diff src/haptic/linux/SDL_syshaptic.c @ 2634:dbd63c419ba5 gsoc2008_force_feedback

Correctness patch my alam.
author Edgar Simo <bobbens@gmail.com>
date Wed, 06 Aug 2008 15:39:08 +0000
parents 3696b9ce8a37
children 318e67011ad9
line wrap: on
line diff
--- a/src/haptic/linux/SDL_syshaptic.c	Wed Aug 06 11:10:44 2008 +0000
+++ b/src/haptic/linux/SDL_syshaptic.c	Wed Aug 06 15:39:08 2008 +0000
@@ -506,7 +506,7 @@
 
       default:
          SDL_SetError("Haptic: Unsupported direction type.");
-         return -1;
+         return (Uint16)-1;
    }
 
    return 0;
@@ -537,7 +537,7 @@
          /* Header */
          dest->type = FF_CONSTANT;
          dest->direction = SDL_SYS_ToDirection(&constant->direction);
-         if (dest->direction < 0) return -1;
+         if (dest->direction == (Uint16)-1) return -1;
 
          /* Replay */
          dest->replay.length = (constant->length == SDL_HAPTIC_INFINITY) ?
@@ -569,7 +569,7 @@
          /* Header */
          dest->type = FF_PERIODIC;
          dest->direction = SDL_SYS_ToDirection(&periodic->direction);
-         if (dest->direction < 0) return -1;
+         if (dest->direction == (Uint16)-1) return -1;
          
          /* Replay */
          dest->replay.length = (periodic->length == SDL_HAPTIC_INFINITY) ? 
@@ -656,7 +656,7 @@
          /* Header */
          dest->type = FF_RAMP;
          dest->direction = SDL_SYS_ToDirection(&ramp->direction);
-         if (dest->direction < 0) return -1;
+         if (dest->direction == (Uint16)-1) return -1;
 
          /* Replay */
          dest->replay.length = (ramp->length == SDL_HAPTIC_INFINITY) ?