src/haptic/SDL_haptic.c
branchgsoc2008_force_feedback
changeset 2514 840e1b6325c0
parent 2513 55fd9103a330
child 2515 030fc4375e63
     1.1 --- a/src/haptic/SDL_haptic.c	Thu Jul 10 11:39:28 2008 +0000
     1.2 +++ b/src/haptic/SDL_haptic.c	Thu Jul 10 16:42:43 2008 +0000
     1.3 @@ -27,7 +27,6 @@
     1.4  
     1.5  Uint8 SDL_numhaptics = 0;
     1.6  SDL_Haptic **SDL_haptics = NULL;
     1.7 -static SDL_Haptic *default_haptic = NULL;
     1.8  
     1.9  
    1.10  /*
    1.11 @@ -44,15 +43,15 @@
    1.12     if (status >= 0) {
    1.13        arraylen = (status + 1) * sizeof(*SDL_haptics);
    1.14        SDL_haptics = (SDL_Haptic **) SDL_malloc(arraylen);
    1.15 -      if (SDL_haptics == NULL) {
    1.16 +      if (SDL_haptics == NULL) { /* Out of memory. */
    1.17           SDL_numhaptics = 0;
    1.18 -      } else {
    1.19 +      }
    1.20 +      else {
    1.21           SDL_memset(SDL_haptics, 0, arraylen);
    1.22           SDL_numhaptics = status;
    1.23        }
    1.24        status = 0;
    1.25     }
    1.26 -   default_haptic = NULL;
    1.27  
    1.28     return status;
    1.29  }
    1.30 @@ -336,13 +335,12 @@
    1.31  void
    1.32  SDL_HapticQuit(void)
    1.33  {
    1.34 -   SDL_numhaptics = 0;
    1.35 -
    1.36     SDL_SYS_HapticQuit();
    1.37     if (SDL_haptics != NULL) {
    1.38        SDL_free(SDL_haptics);
    1.39        SDL_haptics = NULL;
    1.40     }
    1.41 +   SDL_numhaptics = 0;
    1.42  }
    1.43  
    1.44  /*