Simplify flags testing (#7220)

This commit is contained in:
Sylvain Becker 2023-02-03 22:08:42 +01:00 committed by GitHub
parent dcd17f5473
commit cb6b8b0132
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 218 additions and 218 deletions

View file

@ -585,7 +585,7 @@ int SDL_HapticGetEffectStatus(SDL_Haptic *haptic, int effect)
return -1;
}
if ((haptic->supported & SDL_HAPTIC_STATUS) == 0) {
if (!(haptic->supported & SDL_HAPTIC_STATUS)) {
return SDL_SetError("Haptic: Device does not support status queries.");
}
@ -604,7 +604,7 @@ int SDL_HapticSetGain(SDL_Haptic *haptic, int gain)
return -1;
}
if ((haptic->supported & SDL_HAPTIC_GAIN) == 0) {
if (!(haptic->supported & SDL_HAPTIC_GAIN)) {
return SDL_SetError("Haptic: Device does not support setting gain.");
}
@ -646,7 +646,7 @@ int SDL_HapticSetAutocenter(SDL_Haptic *haptic, int autocenter)
return -1;
}
if ((haptic->supported & SDL_HAPTIC_AUTOCENTER) == 0) {
if (!(haptic->supported & SDL_HAPTIC_AUTOCENTER)) {
return SDL_SetError("Haptic: Device does not support setting autocenter.");
}
@ -670,7 +670,7 @@ int SDL_HapticPause(SDL_Haptic *haptic)
return -1;
}
if ((haptic->supported & SDL_HAPTIC_PAUSE) == 0) {
if (!(haptic->supported & SDL_HAPTIC_PAUSE)) {
return SDL_SetError("Haptic: Device does not support setting pausing.");
}
@ -686,7 +686,7 @@ int SDL_HapticUnpause(SDL_Haptic *haptic)
return -1;
}
if ((haptic->supported & SDL_HAPTIC_PAUSE) == 0) {
if (!(haptic->supported & SDL_HAPTIC_PAUSE)) {
return 0; /* Not going to be paused, so we pretend it's unpaused. */
}