src/haptic/SDL_haptic.c
changeset 7037 3fedf1f25b94
parent 6885 700f1b25f77f
child 7131 70a7369c5b32
     1.1 --- a/src/haptic/SDL_haptic.c	Fri Mar 29 21:29:57 2013 -0400
     1.2 +++ b/src/haptic/SDL_haptic.c	Sun Mar 31 12:48:50 2013 -0400
     1.3 @@ -447,8 +447,7 @@
     1.4  
     1.5      /* Check to see if effect is supported */
     1.6      if (SDL_HapticEffectSupported(haptic, effect) == SDL_FALSE) {
     1.7 -        SDL_SetError("Haptic: Effect not supported by haptic device.");
     1.8 -        return -1;
     1.9 +        return SDL_SetError("Haptic: Effect not supported by haptic device.");
    1.10      }
    1.11  
    1.12      /* See if there's a free slot */
    1.13 @@ -467,8 +466,7 @@
    1.14          }
    1.15      }
    1.16  
    1.17 -    SDL_SetError("Haptic: Device has no free space left.");
    1.18 -    return -1;
    1.19 +    return SDL_SetError("Haptic: Device has no free space left.");
    1.20  }
    1.21  
    1.22  /*
    1.23 @@ -497,8 +495,7 @@
    1.24  
    1.25      /* Can't change type dynamically. */
    1.26      if (data->type != haptic->effects[effect].effect.type) {
    1.27 -        SDL_SetError("Haptic: Updating effect type is illegal.");
    1.28 -        return -1;
    1.29 +        return SDL_SetError("Haptic: Updating effect type is illegal.");
    1.30      }
    1.31  
    1.32      /* Updates the effect */
    1.33 @@ -579,8 +576,7 @@
    1.34      }
    1.35  
    1.36      if ((haptic->supported & SDL_HAPTIC_STATUS) == 0) {
    1.37 -        SDL_SetError("Haptic: Device does not support status queries.");
    1.38 -        return -1;
    1.39 +        return SDL_SetError("Haptic: Device does not support status queries.");
    1.40      }
    1.41  
    1.42      return SDL_SYS_HapticGetEffectStatus(haptic, &haptic->effects[effect]);
    1.43 @@ -600,13 +596,11 @@
    1.44      }
    1.45  
    1.46      if ((haptic->supported & SDL_HAPTIC_GAIN) == 0) {
    1.47 -        SDL_SetError("Haptic: Device does not support setting gain.");
    1.48 -        return -1;
    1.49 +        return SDL_SetError("Haptic: Device does not support setting gain.");
    1.50      }
    1.51  
    1.52      if ((gain < 0) || (gain > 100)) {
    1.53 -        SDL_SetError("Haptic: Gain must be between 0 and 100.");
    1.54 -        return -1;
    1.55 +        return SDL_SetError("Haptic: Gain must be between 0 and 100.");
    1.56      }
    1.57  
    1.58      /* We use the envvar to get the maximum gain. */
    1.59 @@ -644,13 +638,11 @@
    1.60      }
    1.61  
    1.62      if ((haptic->supported & SDL_HAPTIC_AUTOCENTER) == 0) {
    1.63 -        SDL_SetError("Haptic: Device does not support setting autocenter.");
    1.64 -        return -1;
    1.65 +        return SDL_SetError("Haptic: Device does not support setting autocenter.");
    1.66      }
    1.67  
    1.68      if ((autocenter < 0) || (autocenter > 100)) {
    1.69 -        SDL_SetError("Haptic: Autocenter must be between 0 and 100.");
    1.70 -        return -1;
    1.71 +        return SDL_SetError("Haptic: Autocenter must be between 0 and 100.");
    1.72      }
    1.73  
    1.74      if (SDL_SYS_HapticSetAutocenter(haptic, autocenter) < 0) {
    1.75 @@ -671,8 +663,7 @@
    1.76      }
    1.77  
    1.78      if ((haptic->supported & SDL_HAPTIC_PAUSE) == 0) {
    1.79 -        SDL_SetError("Haptic: Device does not support setting pausing.");
    1.80 -        return -1;
    1.81 +        return SDL_SetError("Haptic: Device does not support setting pausing.");
    1.82      }
    1.83  
    1.84      return SDL_SYS_HapticPause(haptic);
    1.85 @@ -773,8 +764,7 @@
    1.86      }
    1.87  
    1.88      if (haptic->rumble_id < 0) {
    1.89 -        SDL_SetError("Haptic: Rumble effect not initialized on haptic device");
    1.90 -        return -1;
    1.91 +        return SDL_SetError("Haptic: Rumble effect not initialized on haptic device");
    1.92      }
    1.93  
    1.94      /* Clamp strength. */
    1.95 @@ -805,8 +795,7 @@
    1.96      }
    1.97  
    1.98      if (haptic->rumble_id < 0) {
    1.99 -        SDL_SetError("Haptic: Rumble effect not initialized on haptic device");
   1.100 -        return -1;
   1.101 +        return SDL_SetError("Haptic: Rumble effect not initialized on haptic device");
   1.102      }
   1.103  
   1.104      return SDL_HapticStopEffect(haptic, haptic->rumble_id);