diff src/haptic/SDL_haptic.c @ 2514:840e1b6325c0 gsoc2008_force_feedback

Minor corrections.
author Edgar Simo <bobbens@gmail.com>
date Thu, 10 Jul 2008 16:42:43 +0000
parents 55fd9103a330
children 030fc4375e63
line wrap: on
line diff
--- a/src/haptic/SDL_haptic.c	Thu Jul 10 11:39:28 2008 +0000
+++ b/src/haptic/SDL_haptic.c	Thu Jul 10 16:42:43 2008 +0000
@@ -27,7 +27,6 @@
 
 Uint8 SDL_numhaptics = 0;
 SDL_Haptic **SDL_haptics = NULL;
-static SDL_Haptic *default_haptic = NULL;
 
 
 /*
@@ -44,15 +43,15 @@
    if (status >= 0) {
       arraylen = (status + 1) * sizeof(*SDL_haptics);
       SDL_haptics = (SDL_Haptic **) SDL_malloc(arraylen);
-      if (SDL_haptics == NULL) {
+      if (SDL_haptics == NULL) { /* Out of memory. */
          SDL_numhaptics = 0;
-      } else {
+      }
+      else {
          SDL_memset(SDL_haptics, 0, arraylen);
          SDL_numhaptics = status;
       }
       status = 0;
    }
-   default_haptic = NULL;
 
    return status;
 }
@@ -336,13 +335,12 @@
 void
 SDL_HapticQuit(void)
 {
-   SDL_numhaptics = 0;
-
    SDL_SYS_HapticQuit();
    if (SDL_haptics != NULL) {
       SDL_free(SDL_haptics);
       SDL_haptics = NULL;
    }
+   SDL_numhaptics = 0;
 }
 
 /*