Changed return value of internal function to shorten generic haptic source.
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Sat, 20 Jul 2013 11:01:03 +0200
changeset 7473 c99dc5a423f2
parent 7472 0ec51bd57d56
child 7474 ed6d4d3beba1
Changed return value of internal function to shorten generic haptic source.
src/haptic/dummy/SDL_syshaptic.c
--- a/src/haptic/dummy/SDL_syshaptic.c	Fri Jul 19 22:43:14 2013 -0700
+++ b/src/haptic/dummy/SDL_syshaptic.c	Sat Jul 20 11:01:03 2013 +0200
@@ -29,8 +29,7 @@
 static int
 SDL_SYS_LogicError(void)
 {
-    SDL_SetError("Logic error: No haptic devices available.");
-    return 0;
+    return SDL_SetError("Logic error: No haptic devices available.");
 }
 
 
@@ -52,8 +51,7 @@
 int
 SDL_SYS_HapticOpen(SDL_Haptic * haptic)
 {
-    SDL_SYS_LogicError();
-    return -1;
+    return SDL_SYS_LogicError();
 }
 
 
@@ -74,8 +72,7 @@
 int
 SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick)
 {
-    SDL_SYS_LogicError();
-    return -1;
+    return SDL_SYS_LogicError();
 }
 
 
@@ -104,8 +101,7 @@
 SDL_SYS_HapticNewEffect(SDL_Haptic * haptic,
                         struct haptic_effect *effect, SDL_HapticEffect * base)
 {
-    SDL_SYS_LogicError();
-    return -1;
+    return SDL_SYS_LogicError();
 }
 
 
@@ -114,8 +110,7 @@
                            struct haptic_effect *effect,
                            SDL_HapticEffect * data)
 {
-    SDL_SYS_LogicError();
-    return -1;
+    return SDL_SYS_LogicError();
 }
 
 
@@ -123,16 +118,14 @@
 SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect,
                         Uint32 iterations)
 {
-    SDL_SYS_LogicError();
-    return -1;
+    return SDL_SYS_LogicError();
 }
 
 
 int
 SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect)
 {
-    SDL_SYS_LogicError();
-    return -1;
+    return SDL_SYS_LogicError();
 }
 
 
@@ -148,47 +141,39 @@
 SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic,
                               struct haptic_effect *effect)
 {
-    SDL_SYS_LogicError();
-    return -1;
+    return SDL_SYS_LogicError();
 }
 
 
 int
 SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain)
 {
-    SDL_SYS_LogicError();
-    return -1;
+    return SDL_SYS_LogicError();
 }
 
 
 int
 SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter)
 {
-    SDL_SYS_LogicError();
-    return -1;
+    return SDL_SYS_LogicError();
 }
 
 int
 SDL_SYS_HapticPause(SDL_Haptic * haptic)
 {
-    SDL_SYS_LogicError();
-    return -1;
+    return SDL_SYS_LogicError();
 }
 
 int
 SDL_SYS_HapticUnpause(SDL_Haptic * haptic)
 {
-    SDL_SYS_LogicError();
-    return -1;
+    return SDL_SYS_LogicError();
 }
 
 int
 SDL_SYS_HapticStopAll(SDL_Haptic * haptic)
 {
-    SDL_SYS_LogicError();
-    return -1;
+    return SDL_SYS_LogicError();
 }
 
-
-
 #endif /* SDL_HAPTIC_DUMMY || SDL_HAPTIC_DISABLED */