Use C99 bool internally in SDL

This commit is contained in:
Sam Lantinga
2024-08-22 09:21:26 -07:00
parent 6501e90018
commit 8f546bb3c9
450 changed files with 6046 additions and 6033 deletions

View File

@@ -503,39 +503,39 @@ int SDL_SYS_HapticMouse(void)
/*
* Checks to see if a joystick has haptic features.
*/
SDL_bool SDL_SYS_JoystickIsHaptic(SDL_Joystick *joystick)
bool SDL_SYS_JoystickIsHaptic(SDL_Joystick *joystick)
{
#ifdef SDL_JOYSTICK_LINUX
SDL_AssertJoysticksLocked();
if (joystick->driver != &SDL_LINUX_JoystickDriver) {
return SDL_FALSE;
return false;
}
if (EV_IsHaptic(joystick->hwdata->fd)) {
return SDL_TRUE;
return true;
}
#endif
return SDL_FALSE;
return false;
}
/*
* Checks to see if the haptic device and joystick are in reality the same.
*/
SDL_bool SDL_SYS_JoystickSameHaptic(SDL_Haptic *haptic, SDL_Joystick *joystick)
bool SDL_SYS_JoystickSameHaptic(SDL_Haptic *haptic, SDL_Joystick *joystick)
{
#ifdef SDL_JOYSTICK_LINUX
SDL_AssertJoysticksLocked();
if (joystick->driver != &SDL_LINUX_JoystickDriver) {
return SDL_FALSE;
return false;
}
/* We are assuming Linux is using evdev which should trump the old
* joystick methods. */
if (SDL_strcmp(joystick->hwdata->fname, haptic->hwdata->fname) == 0) {
return SDL_TRUE;
return true;
}
#endif
return SDL_FALSE;
return false;
}
/*