Fixed SDL_HapticQuery() returning -1 as unsigned int if device is not valid.
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Wed, 01 May 2013 11:32:05 +0200
changeset 7131 70a7369c5b32
parent 7130 28df4f1a1712
child 7132 1415923c2eab
Fixed SDL_HapticQuery() returning -1 as unsigned int if device is not valid. The function now returns 0 which is the same as if no effects were supported. This may be confusing in rare situations but will not matter most of the time.
src/haptic/SDL_haptic.c
--- a/src/haptic/SDL_haptic.c	Mon Apr 29 23:54:22 2013 +0200
+++ b/src/haptic/SDL_haptic.c	Wed May 01 11:32:05 2013 +0200
@@ -397,7 +397,7 @@
 SDL_HapticQuery(SDL_Haptic * haptic)
 {
     if (!ValidHaptic(haptic)) {
-        return -1;
+        return 0; /* same as if no effects were supported */
     }
 
     return haptic->supported;