diff --git a/VisualC-GDK/tests/testgdk/src/testgdk.cpp b/VisualC-GDK/tests/testgdk/src/testgdk.cpp index 46301b2ca..b3aa9ec8b 100644 --- a/VisualC-GDK/tests/testgdk/src/testgdk.cpp +++ b/VisualC-GDK/tests/testgdk/src/testgdk.cpp @@ -35,8 +35,8 @@ extern "C" { static SDLTest_CommonState *state; static int num_sprites; static SDL_Texture **sprites; -static SDL_bool cycle_color; -static SDL_bool cycle_alpha; +static bool cycle_color; +static bool cycle_alpha; static int cycle_direction = 1; static int current_alpha = 0; static int current_color = 0; @@ -193,7 +193,7 @@ LoadSprite(const char *file) for (i = 0; i < state->num_windows; ++i) { /* This does the SDL_LoadBMP step repeatedly, but that's OK for test code. */ - sprites[i] = LoadTexture(state->renderers[i], file, SDL_TRUE, &sprite_w, &sprite_h); + sprites[i] = LoadTexture(state->renderers[i], file, true, &sprite_w, &sprite_h); if (!sprites[i]) { return -1; } @@ -371,10 +371,10 @@ main(int argc, char *argv[]) } } } else if (SDL_strcasecmp(argv[i], "--cyclecolor") == 0) { - cycle_color = SDL_TRUE; + cycle_color = true; consumed = 1; } else if (SDL_strcasecmp(argv[i], "--cyclealpha") == 0) { - cycle_alpha = SDL_TRUE; + cycle_alpha = true; consumed = 1; } else if (SDL_isdigit(*argv[i])) { num_sprites = SDL_atoi(argv[i]); diff --git a/build-scripts/SDL_migration.cocci b/build-scripts/SDL_migration.cocci index 41d178c8a..0483a40bb 100644 --- a/build-scripts/SDL_migration.cocci +++ b/build-scripts/SDL_migration.cocci @@ -3687,3 +3687,15 @@ identifier func =~ "^(SDL_AddEventWatch|SDL_AddHintCallback|SDL_AddSurfaceAltern - SDL_GetCPUCount + SDL_GetNumLogicalCPUCores (...) +@@ +@@ +- SDL_bool ++ bool +@@ +@@ +- SDL_TRUE ++ true +@@ +@@ +- SDL_FALSE ++ false diff --git a/docs/README-dynapi.md b/docs/README-dynapi.md index 60a294982..9c137dbfb 100644 --- a/docs/README-dynapi.md +++ b/docs/README-dynapi.md @@ -35,7 +35,7 @@ SDL now has, internally, a table of function pointers. So, this is what SDL_Init now looks like: ```c -SDL_bool SDL_Init(SDL_InitFlags flags) +bool SDL_Init(SDL_InitFlags flags) { return jump_table.SDL_Init(flags); } @@ -49,7 +49,7 @@ SDL_Init() that you've been calling all this time. But at startup, it looks more like this: ```c -SDL_bool SDL_Init_DEFAULT(SDL_InitFlags flags) +bool SDL_Init_DEFAULT(SDL_InitFlags flags) { SDL_InitDynamicAPI(); return jump_table.SDL_Init(flags); diff --git a/docs/README-ios.md b/docs/README-ios.md index cce35b58c..06e2375aa 100644 --- a/docs/README-ios.md +++ b/docs/README-ios.md @@ -139,7 +139,7 @@ void SDL_StartTextInput() void SDL_StopTextInput() -- disables text events and hides the onscreen keyboard. -SDL_bool SDL_TextInputActive() +bool SDL_TextInputActive() -- returns whether or not text events are enabled (and the onscreen keyboard is visible) @@ -225,7 +225,7 @@ Game Center Game Center integration might require that you break up your main loop in order to yield control back to the system. In other words, instead of running an endless main loop, you run each frame in a callback function, using: - SDL_bool SDL_SetiOSAnimationCallback(SDL_Window * window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam); + bool SDL_SetiOSAnimationCallback(SDL_Window * window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam); This will set up the given function to be called back on the animation callback, and then you have to return from main() to let the Cocoa event loop run. diff --git a/docs/README-migration.md b/docs/README-migration.md index 43aa25eaa..7e402ba3f 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -6,7 +6,7 @@ Details on API changes are organized by SDL 2.0 header below. The file with your main() function should include , as that is no longer included in SDL.h. -Functions that previously returned a negative error code now return SDL_bool. +Functions that previously returned a negative error code now return bool. Code that used to look like this: ```c @@ -226,7 +226,7 @@ SDL_FreeWAV has been removed and calls can be replaced with SDL_free. SDL_LoadWAV() is a proper function now and no longer a macro (but offers the same functionality otherwise). -SDL_LoadWAV_IO() and SDL_LoadWAV() return an SDL_bool now, like most of SDL. They no longer return a pointer to an SDL_AudioSpec. +SDL_LoadWAV_IO() and SDL_LoadWAV() return an bool now, like most of SDL. They no longer return a pointer to an SDL_AudioSpec. SDL_AudioCVT interface has been removed, the SDL_AudioStream interface (for audio supplied in pieces) or the new SDL_ConvertAudioSamples() function (for converting a complete audio buffer in one call) can be used instead. @@ -283,13 +283,13 @@ In SDL2, SDL_AUDIODEVICEREMOVED events would fire for open devices with the `whi The following functions have been renamed: * SDL_AudioStreamAvailable() => SDL_GetAudioStreamAvailable() -* SDL_AudioStreamClear() => SDL_ClearAudioStream(), returns SDL_bool -* SDL_AudioStreamFlush() => SDL_FlushAudioStream(), returns SDL_bool +* SDL_AudioStreamClear() => SDL_ClearAudioStream(), returns bool +* SDL_AudioStreamFlush() => SDL_FlushAudioStream(), returns bool * SDL_AudioStreamGet() => SDL_GetAudioStreamData() -* SDL_AudioStreamPut() => SDL_PutAudioStreamData(), returns SDL_bool +* SDL_AudioStreamPut() => SDL_PutAudioStreamData(), returns bool * SDL_FreeAudioStream() => SDL_DestroyAudioStream() -* SDL_LoadWAV_RW() => SDL_LoadWAV_IO(), returns SDL_bool -* SDL_MixAudioFormat() => SDL_MixAudio(), returns SDL_bool +* SDL_LoadWAV_RW() => SDL_LoadWAV_IO(), returns bool +* SDL_MixAudioFormat() => SDL_MixAudio(), returns bool * SDL_NewAudioStream() => SDL_CreateAudioStream() @@ -364,7 +364,7 @@ The following functions have been removed: ## SDL_events.h -SDL_PRESSED and SDL_RELEASED have been removed. For the most part you can replace uses of these with SDL_TRUE and SDL_FALSE respectively. Events which had a field `state` to represent these values have had those fields changed to SDL_bool `down`, e.g. `event.key.state` is now `event.key.down`. +SDL_PRESSED and SDL_RELEASED have been removed. For the most part you can replace uses of these with true and false respectively. Events which had a field `state` to represent these values have had those fields changed to bool `down`, e.g. `event.key.state` is now `event.key.down`. The timestamp member of the SDL_Event structure now represents nanoseconds, and is populated with SDL_GetTicksNS() @@ -417,7 +417,7 @@ SDL_AddEventWatch() now returns SDL_FALSE_ if it fails because it ran out of mem SDL_RegisterEvents() now returns 0 if it couldn't allocate any user events. -SDL_EventFilter functions now return SDL_bool. +SDL_EventFilter functions now return bool. The following symbols have been renamed: * SDL_APP_DIDENTERBACKGROUND => SDL_EVENT_DID_ENTER_BACKGROUND @@ -511,15 +511,15 @@ The gamepad face buttons have been renamed from A/B/X/Y to North/South/East/West #define CONFIRM_BUTTON SDL_GAMEPAD_BUTTON_SOUTH #define CANCEL_BUTTON SDL_GAMEPAD_BUTTON_EAST -SDL_bool flipped_buttons; +bool flipped_buttons; void InitMappedButtons(SDL_Gamepad *gamepad) { if (!GetFlippedButtonSetting(&flipped_buttons)) { if (SDL_GetGamepadButtonLabel(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == SDL_GAMEPAD_BUTTON_LABEL_B) { - flipped_buttons = SDL_TRUE; + flipped_buttons = true; } else { - flipped_buttons = SDL_FALSE; + flipped_buttons = false; } } } @@ -577,7 +577,7 @@ SDL_CONTROLLER_TYPE_VIRTUAL has been removed, so virtual controllers can emulate SDL_CONTROLLER_TYPE_AMAZON_LUNA has been removed, and can be replaced with this code: ```c -SDL_bool SDL_IsJoystickAmazonLunaController(Uint16 vendor_id, Uint16 product_id) +bool SDL_IsJoystickAmazonLunaController(Uint16 vendor_id, Uint16 product_id) { return ((vendor_id == 0x1949 && product_id == 0x0419) || (vendor_id == 0x0171 && product_id == 0x0419)); @@ -586,7 +586,7 @@ SDL_bool SDL_IsJoystickAmazonLunaController(Uint16 vendor_id, Uint16 product_id) SDL_CONTROLLER_TYPE_GOOGLE_STADIA has been removed, and can be replaced with this code: ```c -SDL_bool SDL_IsJoystickGoogleStadiaController(Uint16 vendor_id, Uint16 product_id) +bool SDL_IsJoystickGoogleStadiaController(Uint16 vendor_id, Uint16 product_id) { return (vendor_id == 0x18d1 && product_id == 0x9400); } @@ -594,7 +594,7 @@ SDL_bool SDL_IsJoystickGoogleStadiaController(Uint16 vendor_id, Uint16 product_i SDL_CONTROLLER_TYPE_NVIDIA_SHIELD has been removed, and can be replaced with this code: ```c -SDL_bool SDL_IsJoystickNVIDIASHIELDController(Uint16 vendor_id, Uint16 product_id) +bool SDL_IsJoystickNVIDIASHIELDController(Uint16 vendor_id, Uint16 product_id) { return (vendor_id == 0x0955 && (product_id == 0x7210 || product_id == 0x7214)); } @@ -602,7 +602,7 @@ SDL_bool SDL_IsJoystickNVIDIASHIELDController(Uint16 vendor_id, Uint16 product_i The inputType and outputType fields of SDL_GamepadBinding have been renamed input_type and output_type. -SDL_GetGamepadTouchpadFinger() takes a pointer to SDL_bool for the finger state instead of a pointer to Uint8. +SDL_GetGamepadTouchpadFinger() takes a pointer to bool for the finger state instead of a pointer to Uint8. The following enums have been renamed: * SDL_GameControllerAxis => SDL_GamepadAxis @@ -634,13 +634,13 @@ The following functions have been renamed: * SDL_GameControllerGetPlayerIndex() => SDL_GetGamepadPlayerIndex() * SDL_GameControllerGetProduct() => SDL_GetGamepadProduct() * SDL_GameControllerGetProductVersion() => SDL_GetGamepadProductVersion() -* SDL_GameControllerGetSensorData() => SDL_GetGamepadSensorData(), returns SDL_bool +* SDL_GameControllerGetSensorData() => SDL_GetGamepadSensorData(), returns bool * SDL_GameControllerGetSensorDataRate() => SDL_GetGamepadSensorDataRate() * SDL_GameControllerGetSerial() => SDL_GetGamepadSerial() * SDL_GameControllerGetSteamHandle() => SDL_GetGamepadSteamHandle() * SDL_GameControllerGetStringForAxis() => SDL_GetGamepadStringForAxis() * SDL_GameControllerGetStringForButton() => SDL_GetGamepadStringForButton() -* SDL_GameControllerGetTouchpadFinger() => SDL_GetGamepadTouchpadFinger(), returns SDL_bool +* SDL_GameControllerGetTouchpadFinger() => SDL_GetGamepadTouchpadFinger(), returns bool * SDL_GameControllerGetType() => SDL_GetGamepadType() * SDL_GameControllerGetVendor() => SDL_GetGamepadVendor() * SDL_GameControllerHasAxis() => SDL_GamepadHasAxis() @@ -652,12 +652,12 @@ The following functions have been renamed: * SDL_GameControllerName() => SDL_GetGamepadName() * SDL_GameControllerOpen() => SDL_OpenGamepad() * SDL_GameControllerPath() => SDL_GetGamepadPath() -* SDL_GameControllerRumble() => SDL_RumbleGamepad(), returns SDL_bool -* SDL_GameControllerRumbleTriggers() => SDL_RumbleGamepadTriggers(), returns SDL_bool -* SDL_GameControllerSendEffect() => SDL_SendGamepadEffect(), returns SDL_bool -* SDL_GameControllerSetLED() => SDL_SetGamepadLED(), returns SDL_bool -* SDL_GameControllerSetPlayerIndex() => SDL_SetGamepadPlayerIndex(), returns SDL_bool -* SDL_GameControllerSetSensorEnabled() => SDL_SetGamepadSensorEnabled(), returns SDL_bool +* SDL_GameControllerRumble() => SDL_RumbleGamepad(), returns bool +* SDL_GameControllerRumbleTriggers() => SDL_RumbleGamepadTriggers(), returns bool +* SDL_GameControllerSendEffect() => SDL_SendGamepadEffect(), returns bool +* SDL_GameControllerSetLED() => SDL_SetGamepadLED(), returns bool +* SDL_GameControllerSetPlayerIndex() => SDL_SetGamepadPlayerIndex(), returns bool +* SDL_GameControllerSetSensorEnabled() => SDL_SetGamepadSensorEnabled(), returns bool * SDL_GameControllerUpdate() => SDL_UpdateGamepads() * SDL_IsGameController() => SDL_IsGamepad() @@ -760,12 +760,12 @@ Rather than iterating over haptic devices using device index, there is a new fun } ``` -SDL_GetHapticEffectStatus() now returns SDL_bool instead of an int result. You should call SDL_GetHapticFeatures() to make sure effect status is supported before calling this function. +SDL_GetHapticEffectStatus() now returns bool instead of an int result. You should call SDL_GetHapticFeatures() to make sure effect status is supported before calling this function. The following functions have been renamed: * SDL_HapticClose() => SDL_CloseHaptic() * SDL_HapticDestroyEffect() => SDL_DestroyHapticEffect() -* SDL_HapticGetEffectStatus() => SDL_GetHapticEffectStatus(), returns SDL_bool +* SDL_HapticGetEffectStatus() => SDL_GetHapticEffectStatus(), returns bool * SDL_HapticNewEffect() => SDL_CreateHapticEffect() * SDL_HapticNumAxes() => SDL_GetNumHapticAxes() * SDL_HapticNumEffects() => SDL_GetMaxHapticEffects() @@ -773,18 +773,18 @@ The following functions have been renamed: * SDL_HapticOpen() => SDL_OpenHaptic() * SDL_HapticOpenFromJoystick() => SDL_OpenHapticFromJoystick() * SDL_HapticOpenFromMouse() => SDL_OpenHapticFromMouse() -* SDL_HapticPause() => SDL_PauseHaptic(), returns SDL_bool +* SDL_HapticPause() => SDL_PauseHaptic(), returns bool * SDL_HapticQuery() => SDL_GetHapticFeatures() -* SDL_HapticRumbleInit() => SDL_InitHapticRumble(), returns SDL_bool -* SDL_HapticRumblePlay() => SDL_PlayHapticRumble(), returns SDL_bool -* SDL_HapticRumbleStop() => SDL_StopHapticRumble(), returns SDL_bool -* SDL_HapticRunEffect() => SDL_RunHapticEffect(), returns SDL_bool -* SDL_HapticSetAutocenter() => SDL_SetHapticAutocenter(), returns SDL_bool -* SDL_HapticSetGain() => SDL_SetHapticGain(), returns SDL_bool -* SDL_HapticStopAll() => SDL_StopHapticEffects(), returns SDL_bool -* SDL_HapticStopEffect() => SDL_StopHapticEffect(), returns SDL_bool -* SDL_HapticUnpause() => SDL_ResumeHaptic(), returns SDL_bool -* SDL_HapticUpdateEffect() => SDL_UpdateHapticEffect(), returns SDL_bool +* SDL_HapticRumbleInit() => SDL_InitHapticRumble(), returns bool +* SDL_HapticRumblePlay() => SDL_PlayHapticRumble(), returns bool +* SDL_HapticRumbleStop() => SDL_StopHapticRumble(), returns bool +* SDL_HapticRunEffect() => SDL_RunHapticEffect(), returns bool +* SDL_HapticSetAutocenter() => SDL_SetHapticAutocenter(), returns bool +* SDL_HapticSetGain() => SDL_SetHapticGain(), returns bool +* SDL_HapticStopAll() => SDL_StopHapticEffects(), returns bool +* SDL_HapticStopEffect() => SDL_StopHapticEffect(), returns bool +* SDL_HapticUnpause() => SDL_ResumeHaptic(), returns bool +* SDL_HapticUpdateEffect() => SDL_UpdateHapticEffect(), returns bool * SDL_JoystickIsHaptic() => SDL_IsJoystickHaptic() * SDL_MouseIsHaptic() => SDL_IsMouseHaptic() @@ -843,7 +843,7 @@ The following hints have been removed: * SDL_HINT_VIDEO_X11_XVIDMODE - Xvidmode no longer supported by the X11 backend * SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING - SDL now properly handles the 0x406D1388 Exception if no debugger intercepts it, preventing its propagation. * SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS - Slim Reader/Writer Locks are always used if available -* SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 - replaced with SDL_HINT_WINDOWS_CLOSE_ON_ALT_F4, defaulting to SDL_TRUE +* SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 - replaced with SDL_HINT_WINDOWS_CLOSE_ON_ALT_F4, defaulting to true * SDL_HINT_WINRT_HANDLE_BACK_BUTTON - WinRT support was removed in SDL3. * SDL_HINT_WINRT_PRIVACY_POLICY_LABEL - WinRT support was removed in SDL3. * SDL_HINT_WINRT_PRIVACY_POLICY_URL - WinRT support was removed in SDL3. @@ -937,13 +937,13 @@ SDL_VirtualJoystickDesc version should not be set to SDL_VIRTUAL_JOYSTICK_DESC_V The following functions have been renamed: * SDL_JoystickAttachVirtualEx() => SDL_AttachVirtualJoystick() * SDL_JoystickClose() => SDL_CloseJoystick() -* SDL_JoystickDetachVirtual() => SDL_DetachVirtualJoystick(), returns SDL_bool +* SDL_JoystickDetachVirtual() => SDL_DetachVirtualJoystick(), returns bool * SDL_JoystickFromInstanceID() => SDL_GetJoystickFromID() * SDL_JoystickFromPlayerIndex() => SDL_GetJoystickFromPlayerIndex() * SDL_JoystickGetAttached() => SDL_JoystickConnected() * SDL_JoystickGetAxis() => SDL_GetJoystickAxis() * SDL_JoystickGetAxisInitialState() => SDL_GetJoystickAxisInitialState() -* SDL_JoystickGetBall() => SDL_GetJoystickBall(), returns SDL_bool +* SDL_JoystickGetBall() => SDL_GetJoystickBall(), returns bool * SDL_JoystickGetButton() => SDL_GetJoystickButton() * SDL_JoystickGetFirmwareVersion() => SDL_GetJoystickFirmwareVersion() * SDL_JoystickGetGUID() => SDL_GetJoystickGUID() @@ -964,14 +964,14 @@ The following functions have been renamed: * SDL_JoystickNumHats() => SDL_GetNumJoystickHats() * SDL_JoystickOpen() => SDL_OpenJoystick() * SDL_JoystickPath() => SDL_GetJoystickPath() -* SDL_JoystickRumble() => SDL_RumbleJoystick(), returns SDL_bool -* SDL_JoystickRumbleTriggers() => SDL_RumbleJoystickTriggers(), returns SDL_bool -* SDL_JoystickSendEffect() => SDL_SendJoystickEffect(), returns SDL_bool -* SDL_JoystickSetLED() => SDL_SetJoystickLED(), returns SDL_bool -* SDL_JoystickSetPlayerIndex() => SDL_SetJoystickPlayerIndex(), returns SDL_bool -* SDL_JoystickSetVirtualAxis() => SDL_SetJoystickVirtualAxis(), returns SDL_bool -* SDL_JoystickSetVirtualButton() => SDL_SetJoystickVirtualButton(), returns SDL_bool -* SDL_JoystickSetVirtualHat() => SDL_SetJoystickVirtualHat(), returns SDL_bool +* SDL_JoystickRumble() => SDL_RumbleJoystick(), returns bool +* SDL_JoystickRumbleTriggers() => SDL_RumbleJoystickTriggers(), returns bool +* SDL_JoystickSendEffect() => SDL_SendJoystickEffect(), returns bool +* SDL_JoystickSetLED() => SDL_SetJoystickLED(), returns bool +* SDL_JoystickSetPlayerIndex() => SDL_SetJoystickPlayerIndex(), returns bool +* SDL_JoystickSetVirtualAxis() => SDL_SetJoystickVirtualAxis(), returns bool +* SDL_JoystickSetVirtualButton() => SDL_SetJoystickVirtualButton(), returns bool +* SDL_JoystickSetVirtualHat() => SDL_SetJoystickVirtualHat(), returns bool * SDL_JoystickUpdate() => SDL_UpdateJoysticks() The following symbols have been renamed: @@ -1011,7 +1011,7 @@ The text input state hase been changed to be window-specific. SDL_StartTextInput SDL_GetDefaultKeyFromScancode(), SDL_GetKeyFromScancode(), and SDL_GetScancodeFromKey() take an SDL_Keymod parameter and use that to provide the correct result based on keyboard modifier state. -SDL_GetKeyboardState() returns a pointer to SDL_bool instead of Uint8. +SDL_GetKeyboardState() returns a pointer to bool instead of Uint8. The following functions have been renamed: * SDL_IsScreenKeyboardShown() => SDL_ScreenKeyboardShown() @@ -1186,24 +1186,24 @@ The following symbols have been renamed: SDL_MUTEX_MAXWAIT has been removed; it suggested there was a maximum timeout one could outlive, instead of an infinite wait. Instead, pass a -1 to functions that accepted this symbol. -SDL_MUTEX_TIMEDOUT has been removed, the wait functions return SDL_TRUE if the operation succeeded or SDL_FALSE if they timed out. +SDL_MUTEX_TIMEDOUT has been removed, the wait functions return true if the operation succeeded or false if they timed out. SDL_LockMutex(), SDL_UnlockMutex(), SDL_WaitSemaphore(), SDL_SignalSemaphore(), SDL_WaitCondition(), SDL_SignalCondition(), and SDL_BroadcastCondition() now return void; if the object is valid (including being a NULL pointer, which returns immediately), these functions never fail. If the object is invalid or the caller does something illegal, like unlock another thread's mutex, this is considered undefined behavior. -SDL_TryWaitSemaphore(), SDL_WaitSemaphoreTimeout(), and SDL_WaitConditionTimeout() now return SDL_TRUE if the operation succeeded or SDL_FALSE if they timed out. +SDL_TryWaitSemaphore(), SDL_WaitSemaphoreTimeout(), and SDL_WaitConditionTimeout() now return true if the operation succeeded or false if they timed out. The following functions have been renamed: * SDL_CondBroadcast() => SDL_BroadcastCondition() * SDL_CondSignal() => SDL_SignalCondition() * SDL_CondWait() => SDL_WaitCondition() -* SDL_CondWaitTimeout() => SDL_WaitConditionTimeout(), returns SDL_bool +* SDL_CondWaitTimeout() => SDL_WaitConditionTimeout(), returns bool * SDL_CreateCond() => SDL_CreateCondition() * SDL_DestroyCond() => SDL_DestroyCondition() * SDL_SemPost() => SDL_SignalSemaphore() -* SDL_SemTryWait() => SDL_TryWaitSemaphore(), returns SDL_bool +* SDL_SemTryWait() => SDL_TryWaitSemaphore(), returns bool * SDL_SemValue() => SDL_GetSemaphoreValue() * SDL_SemWait() => SDL_WaitSemaphore() -* SDL_SemWaitTimeout() => SDL_WaitSemaphoreTimeout(), returns SDL_bool +* SDL_SemWaitTimeout() => SDL_WaitSemaphoreTimeout(), returns bool The following symbols have been renamed: * SDL_cond => SDL_Condition @@ -1243,7 +1243,7 @@ The following functions have been renamed: * SDL_AllocPalette() => SDL_CreatePalette() * SDL_FreePalette() => SDL_DestroyPalette() * SDL_MasksToPixelFormatEnum() => SDL_GetPixelFormatForMasks() -* SDL_PixelFormatEnumToMasks() => SDL_GetMasksForPixelFormat(), returns SDL_bool +* SDL_PixelFormatEnumToMasks() => SDL_GetMasksForPixelFormat(), returns bool The following symbols have been renamed: * SDL_PIXELFORMAT_BGR444 => SDL_PIXELFORMAT_XBGR4444 @@ -1343,8 +1343,8 @@ The following functions have been renamed: * SDL_IntersectRectAndLine() => SDL_GetRectAndLineIntersection() * SDL_PointInFRect() => SDL_PointInRectFloat() * SDL_RectEquals() => SDL_RectsEqual() -* SDL_UnionFRect() => SDL_GetRectUnionFloat(), returns SDL_bool -* SDL_UnionRect() => SDL_GetRectUnion(), returns SDL_bool +* SDL_UnionFRect() => SDL_GetRectUnionFloat(), returns bool +* SDL_UnionRect() => SDL_GetRectUnion(), returns bool ## SDL_render.h @@ -1390,42 +1390,42 @@ SDL_Vertex has been changed to use floating point colors, in the range of [0..1] SDL_RenderReadPixels() returns a surface instead of filling in preallocated memory. The following functions have been renamed: -* SDL_GetRendererOutputSize() => SDL_GetCurrentRenderOutputSize(), returns SDL_bool -* SDL_RenderCopy() => SDL_RenderTexture(), returns SDL_bool -* SDL_RenderCopyEx() => SDL_RenderTextureRotated(), returns SDL_bool -* SDL_RenderCopyExF() => SDL_RenderTextureRotated(), returns SDL_bool -* SDL_RenderCopyF() => SDL_RenderTexture(), returns SDL_bool -* SDL_RenderDrawLine() => SDL_RenderLine(), returns SDL_bool -* SDL_RenderDrawLineF() => SDL_RenderLine(), returns SDL_bool -* SDL_RenderDrawLines() => SDL_RenderLines(), returns SDL_bool -* SDL_RenderDrawLinesF() => SDL_RenderLines(), returns SDL_bool -* SDL_RenderDrawPoint() => SDL_RenderPoint(), returns SDL_bool -* SDL_RenderDrawPointF() => SDL_RenderPoint(), returns SDL_bool -* SDL_RenderDrawPoints() => SDL_RenderPoints(), returns SDL_bool -* SDL_RenderDrawPointsF() => SDL_RenderPoints(), returns SDL_bool -* SDL_RenderDrawRect() => SDL_RenderRect(), returns SDL_bool -* SDL_RenderDrawRectF() => SDL_RenderRect(), returns SDL_bool -* SDL_RenderDrawRects() => SDL_RenderRects(), returns SDL_bool -* SDL_RenderDrawRectsF() => SDL_RenderRects(), returns SDL_bool -* SDL_RenderFillRectF() => SDL_RenderFillRect(), returns SDL_bool -* SDL_RenderFillRectsF() => SDL_RenderFillRects(), returns SDL_bool -* SDL_RenderFlush() => SDL_FlushRenderer(), returns SDL_bool -* SDL_RenderGetClipRect() => SDL_GetRenderClipRect(), returns SDL_bool +* SDL_GetRendererOutputSize() => SDL_GetCurrentRenderOutputSize(), returns bool +* SDL_RenderCopy() => SDL_RenderTexture(), returns bool +* SDL_RenderCopyEx() => SDL_RenderTextureRotated(), returns bool +* SDL_RenderCopyExF() => SDL_RenderTextureRotated(), returns bool +* SDL_RenderCopyF() => SDL_RenderTexture(), returns bool +* SDL_RenderDrawLine() => SDL_RenderLine(), returns bool +* SDL_RenderDrawLineF() => SDL_RenderLine(), returns bool +* SDL_RenderDrawLines() => SDL_RenderLines(), returns bool +* SDL_RenderDrawLinesF() => SDL_RenderLines(), returns bool +* SDL_RenderDrawPoint() => SDL_RenderPoint(), returns bool +* SDL_RenderDrawPointF() => SDL_RenderPoint(), returns bool +* SDL_RenderDrawPoints() => SDL_RenderPoints(), returns bool +* SDL_RenderDrawPointsF() => SDL_RenderPoints(), returns bool +* SDL_RenderDrawRect() => SDL_RenderRect(), returns bool +* SDL_RenderDrawRectF() => SDL_RenderRect(), returns bool +* SDL_RenderDrawRects() => SDL_RenderRects(), returns bool +* SDL_RenderDrawRectsF() => SDL_RenderRects(), returns bool +* SDL_RenderFillRectF() => SDL_RenderFillRect(), returns bool +* SDL_RenderFillRectsF() => SDL_RenderFillRects(), returns bool +* SDL_RenderFlush() => SDL_FlushRenderer(), returns bool +* SDL_RenderGetClipRect() => SDL_GetRenderClipRect(), returns bool * SDL_RenderGetIntegerScale() => SDL_GetRenderIntegerScale() -* SDL_RenderGetLogicalSize() => SDL_GetRenderLogicalPresentation(), returns SDL_bool +* SDL_RenderGetLogicalSize() => SDL_GetRenderLogicalPresentation(), returns bool * SDL_RenderGetMetalCommandEncoder() => SDL_GetRenderMetalCommandEncoder() * SDL_RenderGetMetalLayer() => SDL_GetRenderMetalLayer() -* SDL_RenderGetScale() => SDL_GetRenderScale(), returns SDL_bool -* SDL_RenderGetViewport() => SDL_GetRenderViewport(), returns SDL_bool +* SDL_RenderGetScale() => SDL_GetRenderScale(), returns bool +* SDL_RenderGetViewport() => SDL_GetRenderViewport(), returns bool * SDL_RenderGetWindow() => SDL_GetRenderWindow() * SDL_RenderIsClipEnabled() => SDL_RenderClipEnabled() -* SDL_RenderLogicalToWindow() => SDL_RenderCoordinatesToWindow(), returns SDL_bool -* SDL_RenderSetClipRect() => SDL_SetRenderClipRect(), returns SDL_bool -* SDL_RenderSetLogicalSize() => SDL_SetRenderLogicalPresentation(), returns SDL_bool -* SDL_RenderSetScale() => SDL_SetRenderScale(), returns SDL_bool -* SDL_RenderSetVSync() => SDL_SetRenderVSync(), returns SDL_bool -* SDL_RenderSetViewport() => SDL_SetRenderViewport(), returns SDL_bool -* SDL_RenderWindowToLogical() => SDL_RenderCoordinatesFromWindow(), returns SDL_bool +* SDL_RenderLogicalToWindow() => SDL_RenderCoordinatesToWindow(), returns bool +* SDL_RenderSetClipRect() => SDL_SetRenderClipRect(), returns bool +* SDL_RenderSetLogicalSize() => SDL_SetRenderLogicalPresentation(), returns bool +* SDL_RenderSetScale() => SDL_SetRenderScale(), returns bool +* SDL_RenderSetVSync() => SDL_SetRenderVSync(), returns bool +* SDL_RenderSetViewport() => SDL_SetRenderViewport(), returns bool +* SDL_RenderWindowToLogical() => SDL_RenderCoordinatesFromWindow(), returns bool The following functions have been removed: * SDL_GL_BindTexture() - use SDL_GetTextureProperties() to get the OpenGL texture ID and bind the texture directly @@ -1514,7 +1514,7 @@ You can implement this in your own code easily: typedef struct IOStreamStdioFPData { FILE *fp; - SDL_bool autoclose; + bool autoclose; } IOStreamStdioFPData; static Sint64 SDLCALL stdio_seek(void *userdata, Sint64 offset, int whence) @@ -1569,20 +1569,20 @@ static size_t SDLCALL stdio_write(void *userdata, const void *ptr, size_t size, return bytes; } -static SDL_bool SDLCALL stdio_close(void *userdata) +static bool SDLCALL stdio_close(void *userdata) { IOStreamStdioData *rwopsdata = (IOStreamStdioData *) userdata; - SDL_bool status = SDL_TRUE; + bool status = true; if (rwopsdata->autoclose) { if (fclose(rwopsdata->fp) != 0) { SDL_SetError("Couldn't close stream"); - status = SDL_FALSE; + status = false; } } return status; } -SDL_IOStream *SDL_RWFromFP(FILE *fp, SDL_bool autoclose) +SDL_IOStream *SDL_RWFromFP(FILE *fp, bool autoclose) { SDL_IOStreamInterface iface; IOStreamStdioFPData *rwopsdata; @@ -1616,13 +1616,13 @@ The internal `FILE *` is available through a standard SDL_IOStream property, for On Apple platforms, SDL_RWFromFile (now called SDL_IOFromFile) no longer tries to read from inside the app bundle's resource directory, instead now using the specified path unchanged. One can use SDL_GetBasePath() to find the resource directory on these platforms. -The functions SDL_ReadU8(), SDL_ReadU16LE(), SDL_ReadU16BE(), SDL_ReadU32LE(), SDL_ReadU32BE(), SDL_ReadU64LE(), and SDL_ReadU64BE() now return SDL_TRUE if the read succeeded and SDL_FALSE if it didn't, and store the data in a pointer passed in as a parameter. +The functions SDL_ReadU8(), SDL_ReadU16LE(), SDL_ReadU16BE(), SDL_ReadU32LE(), SDL_ReadU32BE(), SDL_ReadU64LE(), and SDL_ReadU64BE() now return true if the read succeeded and false if it didn't, and store the data in a pointer passed in as a parameter. The following functions have been renamed: * SDL_RWFromConstMem() => SDL_IOFromConstMem() * SDL_RWFromFile() => SDL_IOFromFile() * SDL_RWFromMem() => SDL_IOFromMem() -* SDL_RWclose() => SDL_CloseIO(), returns SDL_bool +* SDL_RWclose() => SDL_CloseIO(), returns bool * SDL_RWread() => SDL_ReadIO() * SDL_RWseek() => SDL_SeekIO() * SDL_RWsize() => SDL_GetIOSize() @@ -1704,7 +1704,7 @@ Removed SDL_SensorGetDataWithTimestamp(), if you want timestamps for the sensor The following functions have been renamed: * SDL_SensorClose() => SDL_CloseSensor() * SDL_SensorFromInstanceID() => SDL_GetSensorFromID() -* SDL_SensorGetData() => SDL_GetSensorData(), returns SDL_bool +* SDL_SensorGetData() => SDL_GetSensorData(), returns bool * SDL_SensorGetInstanceID() => SDL_GetSensorID() * SDL_SensorGetName() => SDL_GetSensorName() * SDL_SensorGetNonPortableType() => SDL_GetSensorNonPortableType() @@ -1730,7 +1730,7 @@ This header has been removed and a simplified version of this API has been added The standard C headers like stdio.h and stdlib.h are no longer included, you should include them directly in your project if you use non-SDL C runtime functions. M_PI is no longer defined in SDL_stdinc.h, you can use the new symbols SDL_PI_D (double) and SDL_PI_F (float) instead. -SDL_bool is now defined as bool, and is 1 byte instead of the size of an int. +bool is now defined as bool, and is 1 byte instead of the size of an int. SDL3 attempts to apply consistency to case-insensitive string functions. In SDL2, things like SDL_strcasecmp() would usually only work on English letters, and depending on the user's locale, possibly not even those. In SDL3, consistency is applied: @@ -1753,13 +1753,18 @@ The following macros have been removed: * SDL_TABLESIZE() - use SDL_arraysize() instead The following functions have been renamed: -* SDL_size_add_overflow() => SDL_size_add_check_overflow(), returns SDL_bool -* SDL_size_mul_overflow() => SDL_size_mul_check_overflow(), returns SDL_bool +* SDL_size_add_overflow() => SDL_size_add_check_overflow(), returns bool +* SDL_size_mul_overflow() => SDL_size_mul_check_overflow(), returns bool * SDL_strtokr() => SDL_strtok_r() The following functions have been removed: * SDL_memcpy4() +The following symbols have been renamed: +* SDL_FALSE => false +* SDL_TRUE => true +* SDL_bool => bool + ## SDL_surface.h SDL_Surface has been simplified and internal details are no longer in the public structure. @@ -1833,28 +1838,28 @@ SDL_SoftStretch() now takes a scale parameter. SDL_PixelFormat is used instead of Uint32 for API functions that refer to pixel format by enumerated value. -SDL_SetSurfaceColorKey() takes an SDL_bool to enable and disable colorkey. RLE acceleration isn't controlled by the parameter, you should use SDL_SetSurfaceRLE() to change that separately. +SDL_SetSurfaceColorKey() takes an bool to enable and disable colorkey. RLE acceleration isn't controlled by the parameter, you should use SDL_SetSurfaceRLE() to change that separately. -SDL_SetSurfaceRLE() takes an SDL_bool to enable and disable RLE acceleration. +SDL_SetSurfaceRLE() takes an bool to enable and disable RLE acceleration. The following functions have been renamed: -* SDL_BlitScaled() => SDL_BlitSurfaceScaled(), returns SDL_bool +* SDL_BlitScaled() => SDL_BlitSurfaceScaled(), returns bool * SDL_ConvertSurfaceFormat() => SDL_ConvertSurface() -* SDL_FillRect() => SDL_FillSurfaceRect(), returns SDL_bool -* SDL_FillRects() => SDL_FillSurfaceRects(), returns SDL_bool +* SDL_FillRect() => SDL_FillSurfaceRect(), returns bool +* SDL_FillRects() => SDL_FillSurfaceRects(), returns bool * SDL_FreeSurface() => SDL_DestroySurface() -* SDL_GetClipRect() => SDL_GetSurfaceClipRect(), returns SDL_bool -* SDL_GetColorKey() => SDL_GetSurfaceColorKey(), returns SDL_bool +* SDL_GetClipRect() => SDL_GetSurfaceClipRect(), returns bool +* SDL_GetColorKey() => SDL_GetSurfaceColorKey(), returns bool * SDL_HasColorKey() => SDL_SurfaceHasColorKey() * SDL_HasSurfaceRLE() => SDL_SurfaceHasRLE() * SDL_LoadBMP_RW() => SDL_LoadBMP_IO() -* SDL_LowerBlit() => SDL_BlitSurfaceUnchecked(), returns SDL_bool -* SDL_LowerBlitScaled() => SDL_BlitSurfaceUncheckedScaled(), returns SDL_bool -* SDL_SaveBMP_RW() => SDL_SaveBMP_IO(), returns SDL_bool +* SDL_LowerBlit() => SDL_BlitSurfaceUnchecked(), returns bool +* SDL_LowerBlitScaled() => SDL_BlitSurfaceUncheckedScaled(), returns bool +* SDL_SaveBMP_RW() => SDL_SaveBMP_IO(), returns bool * SDL_SetClipRect() => SDL_SetSurfaceClipRect() -* SDL_SetColorKey() => SDL_SetSurfaceColorKey(), returns SDL_bool -* SDL_UpperBlit() => SDL_BlitSurface(), returns SDL_bool -* SDL_UpperBlitScaled() => SDL_BlitSurfaceScaled(), returns SDL_bool +* SDL_SetColorKey() => SDL_SetSurfaceColorKey(), returns bool +* SDL_UpperBlit() => SDL_BlitSurface(), returns bool +* SDL_UpperBlitScaled() => SDL_BlitSurfaceScaled(), returns bool The following symbols have been removed: * SDL_SWSURFACE @@ -1894,21 +1899,21 @@ The following functions have been renamed: * SDL_AndroidGetExternalStorageState() => SDL_GetAndroidExternalStorageState() * SDL_AndroidGetInternalStoragePath() => SDL_GetAndroidInternalStoragePath() * SDL_AndroidGetJNIEnv() => SDL_GetAndroidJNIEnv() -* SDL_AndroidRequestPermission() => SDL_RequestAndroidPermission(), returns SDL_bool +* SDL_AndroidRequestPermission() => SDL_RequestAndroidPermission(), returns bool * SDL_AndroidRequestPermissionCallback() => SDL_RequestAndroidPermissionCallback() -* SDL_AndroidSendMessage() => SDL_SendAndroidMessage(), returns SDL_bool -* SDL_AndroidShowToast() => SDL_ShowAndroidToast(), returns SDL_bool -* SDL_DXGIGetOutputInfo() => SDL_GetDXGIOutputInfo(), returns SDL_bool +* SDL_AndroidSendMessage() => SDL_SendAndroidMessage(), returns bool +* SDL_AndroidShowToast() => SDL_ShowAndroidToast(), returns bool +* SDL_DXGIGetOutputInfo() => SDL_GetDXGIOutputInfo(), returns bool * SDL_Direct3D9GetAdapterIndex() => SDL_GetDirect3D9AdapterIndex() -* SDL_GDKGetDefaultUser() => SDL_GetGDKDefaultUser(), returns SDL_bool -* SDL_GDKGetTaskQueue() => SDL_GetGDKTaskQueue(), returns SDL_bool -* SDL_LinuxSetThreadPriority() => SDL_SetLinuxThreadPriority(), returns SDL_bool -* SDL_LinuxSetThreadPriorityAndPolicy() => SDL_SetLinuxThreadPriorityAndPolicy(), returns SDL_bool +* SDL_GDKGetDefaultUser() => SDL_GetGDKDefaultUser(), returns bool +* SDL_GDKGetTaskQueue() => SDL_GetGDKTaskQueue(), returns bool +* SDL_LinuxSetThreadPriority() => SDL_SetLinuxThreadPriority(), returns bool +* SDL_LinuxSetThreadPriorityAndPolicy() => SDL_SetLinuxThreadPriorityAndPolicy(), returns bool * SDL_OnApplicationDidBecomeActive() => SDL_OnApplicationDidEnterForeground() * SDL_OnApplicationWillResignActive() => SDL_OnApplicationWillEnterBackground() -* SDL_iOSSetAnimationCallback() => SDL_SetiOSAnimationCallback(), returns SDL_bool +* SDL_iOSSetAnimationCallback() => SDL_SetiOSAnimationCallback(), returns bool * SDL_iOSSetEventPump() => SDL_SetiOSEventPump() -* SDL_iPhoneSetAnimationCallback() => SDL_SetiOSAnimationCallback(), returns SDL_bool +* SDL_iPhoneSetAnimationCallback() => SDL_SetiOSAnimationCallback(), returns bool * SDL_iPhoneSetEventPump() => SDL_SetiOSEventPump() ## SDL_syswm.h @@ -2016,7 +2021,7 @@ SDL_GetTLS() and SDL_SetTLS() take a pointer to a TLS ID, and will automatically The following functions have been renamed: * SDL_TLSCleanup() => SDL_CleanupTLS() * SDL_TLSGet() => SDL_GetTLS() -* SDL_TLSSet() => SDL_SetTLS(), returns SDL_bool +* SDL_TLSSet() => SDL_SetTLS(), returns bool * SDL_ThreadID() => SDL_GetCurrentThreadID() The following functions have been removed: @@ -2169,7 +2174,7 @@ SDL_GL_GetProcAddress() and SDL_EGL_GetProcAddress() now return `SDL_FunctionPoi SDL_GL_DeleteContext() has been renamed to SDL_GL_DestroyContext to match SDL naming conventions (and glX/EGL!). -SDL_GL_GetSwapInterval() takes the interval as an output parameter and returns SDL_TRUE if the function succeeds or SDL_FALSE if there was an error. +SDL_GL_GetSwapInterval() takes the interval as an output parameter and returns true if the function succeeds or false if there was an error. SDL_GL_GetDrawableSize() has been removed. SDL_GetWindowSizeInPixels() can be used in its place. @@ -2180,8 +2185,8 @@ SDL_WindowFlags is used instead of Uint32 for API functions that refer to window SDL_GetWindowOpacity() directly returns the opacity instead of using an out parameter. The following functions have been renamed: -* SDL_GL_DeleteContext() => SDL_GL_DestroyContext(), returns SDL_bool -* SDL_GetClosestDisplayMode() => SDL_GetClosestFullscreenDisplayMode(), returns SDL_bool +* SDL_GL_DeleteContext() => SDL_GL_DestroyContext(), returns bool +* SDL_GetClosestDisplayMode() => SDL_GetClosestFullscreenDisplayMode(), returns bool * SDL_GetDisplayOrientation() => SDL_GetCurrentDisplayOrientation() * SDL_GetPointDisplayIndex() => SDL_GetDisplayForPoint() * SDL_GetRectDisplayIndex() => SDL_GetDisplayForRect() @@ -2189,7 +2194,7 @@ The following functions have been renamed: * SDL_GetWindowDisplayMode() => SDL_GetWindowFullscreenMode() * SDL_HasWindowSurface() => SDL_WindowHasSurface() * SDL_IsScreenSaverEnabled() => SDL_ScreenSaverEnabled() -* SDL_SetWindowDisplayMode() => SDL_SetWindowFullscreenMode(), returns SDL_bool +* SDL_SetWindowDisplayMode() => SDL_SetWindowFullscreenMode(), returns bool The following functions have been removed: * SDL_GetClosestFullscreenDisplayMode() diff --git a/docs/README-wayland.md b/docs/README-wayland.md index ec3a24deb..7b4330a58 100644 --- a/docs/README-wayland.md +++ b/docs/README-wayland.md @@ -61,7 +61,7 @@ having SDL handle input and rendering, it needs to create a custom, roleless sur toplevel window. This is done by using `SDL_CreateWindowWithProperties()` and setting the -`SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN` property to `SDL_TRUE`. Once the window has been +`SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN` property to `true`. Once the window has been successfully created, the `wl_display` and `wl_surface` objects can then be retrieved from the `SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER` and `SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER` properties respectively. @@ -69,10 +69,10 @@ Surfaces don't receive any size change notifications, so if an application chang that the surface size has changed by calling SDL_SetWindowSize() with the new dimensions. Custom surfaces will automatically handle scaling internally if the window was created with the -`SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN` property set to `SDL_TRUE`. In this case, applications should +`SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN` property set to `true`. In this case, applications should not manually attach viewports or change the surface scale value, as SDL will handle this internally. Calls to `SDL_SetWindowSize()` should use the logical size of the window, and `SDL_GetWindowSizeInPixels()` should be used to -query the size of the backbuffer surface in pixels. If this property is not set or is `SDL_FALSE`, applications can +query the size of the backbuffer surface in pixels. If this property is not set or is `false`, applications can attach their own viewports or change the surface scale manually, and the SDL backend will not interfere or change any values internally. In this case, calls to `SDL_SetWindowSize()` should pass the requested surface size in pixels, not the logical window size, as no scaling calculations will be done internally. @@ -101,7 +101,7 @@ SDL receives no notification regarding size changes on external surfaces or topl needs to be resized, SDL must be informed by calling SDL_SetWindowSize() with the new dimensions. If desired, SDL can automatically handle the scaling for the surface by setting the -`SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN` property to `SDL_TRUE`, however, if the surface being imported +`SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN` property to `true`, however, if the surface being imported already has, or will have, a viewport/fractional scale manager attached to it by the application or an external toolkit, a protocol violation will result. Avoid setting this property if importing surfaces from toolkits such as Qt or GTK. @@ -176,7 +176,7 @@ int main(int argc, char *argv[]) */ props = SDL_CreateProperties(); SDL_SetPointerProperty(props, SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER, surface); - SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN, SDL_TRUE); + SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN, true); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, 640); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER, 480); sdlWindow = SDL_CreateWindowWithProperties(props); diff --git a/examples/game/01-snake/snake.c b/examples/game/01-snake/snake.c index 181dd2af5..3015b5df4 100644 --- a/examples/game/01-snake/snake.c +++ b/examples/game/01-snake/snake.c @@ -94,7 +94,7 @@ static int are_cells_full_(SnakeContext *ctx) static void new_food_pos_(SnakeContext *ctx) { - while (SDL_TRUE) { + while (true) { const char x = (char) SDL_rand(SNAKE_GAME_WIDTH); const char y = (char) SDL_rand(SNAKE_GAME_HEIGHT); if (snake_cell_at(ctx, x, y) == SNAKE_CELL_NOTHING) { diff --git a/include/SDL3/SDL_assert.h b/include/SDL3/SDL_assert.h index f5f798e2f..ada270010 100644 --- a/include/SDL3/SDL_assert.h +++ b/include/SDL3/SDL_assert.h @@ -220,7 +220,7 @@ typedef enum SDL_AssertState */ typedef struct SDL_AssertData { - SDL_bool always_ignore; /**< SDL_TRUE if app should always continue when assertion is triggered. */ + bool always_ignore; /**< true if app should always continue when assertion is triggered. */ unsigned int trigger_count; /**< Number of times this assertion has been triggered. */ const char *condition; /**< A string of this assert's test code. */ const char *filename; /**< The source file where this assert lives. */ diff --git a/include/SDL3/SDL_atomic.h b/include/SDL3/SDL_atomic.h index a37383d04..790eb661c 100644 --- a/include/SDL3/SDL_atomic.h +++ b/include/SDL3/SDL_atomic.h @@ -88,7 +88,7 @@ typedef int SDL_SpinLock; * doing. Please be careful using any sort of spinlock!*** * * \param lock a pointer to a lock variable. - * \returns SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already + * \returns true if the lock succeeded, false if the lock is already * held. * * \since This function is available since SDL 3.0.0. @@ -96,7 +96,7 @@ typedef int SDL_SpinLock; * \sa SDL_LockSpinlock * \sa SDL_UnlockSpinlock */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryLockSpinlock(SDL_SpinLock *lock); +extern SDL_DECLSPEC bool SDLCALL SDL_TryLockSpinlock(SDL_SpinLock *lock); /** * Lock a spin lock by setting it to a non-zero value. @@ -337,7 +337,7 @@ typedef struct SDL_AtomicInt { int value; } SDL_AtomicInt; * \param a a pointer to an SDL_AtomicInt variable to be modified. * \param oldval the old value. * \param newval the new value. - * \returns SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise. + * \returns true if the atomic variable was set, false otherwise. * * \threadsafety It is safe to call this function from any thread. * @@ -346,7 +346,7 @@ typedef struct SDL_AtomicInt { int value; } SDL_AtomicInt; * \sa SDL_GetAtomicInt * \sa SDL_SetAtomicInt */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CompareAndSwapAtomicInt(SDL_AtomicInt *a, int oldval, int newval); +extern SDL_DECLSPEC bool SDLCALL SDL_CompareAndSwapAtomicInt(SDL_AtomicInt *a, int oldval, int newval); /** * Set an atomic variable to a value. @@ -431,8 +431,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddAtomicInt(SDL_AtomicInt *a, int v); * ***Note: If you don't know what this macro is for, you shouldn't use it!*** * * \param a a pointer to an SDL_AtomicInt to increment. - * \returns SDL_TRUE if the variable reached zero after decrementing, - * SDL_FALSE otherwise. + * \returns true if the variable reached zero after decrementing, + * false otherwise. * * \since This macro is available since SDL 3.0.0. * @@ -479,7 +479,7 @@ typedef struct SDL_AtomicU32 { Uint32 value; } SDL_AtomicU32; * \param a a pointer to an SDL_AtomicU32 variable to be modified. * \param oldval the old value. * \param newval the new value. - * \returns SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise. + * \returns true if the atomic variable was set, false otherwise. * * \threadsafety It is safe to call this function from any thread. * @@ -488,7 +488,7 @@ typedef struct SDL_AtomicU32 { Uint32 value; } SDL_AtomicU32; * \sa SDL_GetAtomicU32 * \sa SDL_SetAtomicU32 */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CompareAndSwapAtomicU32(SDL_AtomicU32 *a, Uint32 oldval, Uint32 newval); +extern SDL_DECLSPEC bool SDLCALL SDL_CompareAndSwapAtomicU32(SDL_AtomicU32 *a, Uint32 oldval, Uint32 newval); /** * Set an atomic variable to a value. @@ -536,7 +536,7 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetAtomicU32(SDL_AtomicU32 *a); * \param a a pointer to a pointer. * \param oldval the old pointer value. * \param newval the new pointer value. - * \returns SDL_TRUE if the pointer was set, SDL_FALSE otherwise. + * \returns true if the pointer was set, false otherwise. * * \threadsafety It is safe to call this function from any thread. * @@ -546,7 +546,7 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetAtomicU32(SDL_AtomicU32 *a); * \sa SDL_GetAtomicPointer * \sa SDL_SetAtomicPointer */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CompareAndSwapAtomicPointer(void **a, void *oldval, void *newval); +extern SDL_DECLSPEC bool SDLCALL SDL_CompareAndSwapAtomicPointer(void **a, void *oldval, void *newval); /** * Set a pointer to a value atomically. diff --git a/include/SDL3/SDL_audio.h b/include/SDL3/SDL_audio.h index ec000fae9..c6cd3fde0 100644 --- a/include/SDL3/SDL_audio.h +++ b/include/SDL3/SDL_audio.h @@ -532,14 +532,14 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetAudioDeviceName(SDL_AudioDeviceI * \param spec on return, will be filled with device details. * \param sample_frames pointer to store device buffer size, in sample frames. * Can be NULL. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec *spec, int *sample_frames); +extern SDL_DECLSPEC bool SDLCALL SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec *spec, int *sample_frames); /** * Get the current channel map of an audio device. @@ -659,7 +659,7 @@ extern SDL_DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(SDL_AudioDevic * created through SDL_OpenAudioDevice() can be. * * \param dev a device opened by SDL_OpenAudioDevice(). - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -669,7 +669,7 @@ extern SDL_DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(SDL_AudioDevic * \sa SDL_ResumeAudioDevice * \sa SDL_AudioDevicePaused */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev); +extern SDL_DECLSPEC bool SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev); /** * Use this function to unpause audio playback on a specified device. @@ -687,7 +687,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev) * created through SDL_OpenAudioDevice() can be. * * \param dev a device opened by SDL_OpenAudioDevice(). - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -697,7 +697,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev) * \sa SDL_AudioDevicePaused * \sa SDL_PauseAudioDevice */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID dev); +extern SDL_DECLSPEC bool SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID dev); /** * Use this function to query if an audio device is paused. @@ -710,7 +710,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID dev * IDs will report themselves as unpaused here. * * \param dev a device opened by SDL_OpenAudioDevice(). - * \returns SDL_TRUE if device is valid and paused, SDL_FALSE otherwise. + * \returns true if device is valid and paused, false otherwise. * * \threadsafety It is safe to call this function from any thread. * @@ -719,7 +719,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID dev * \sa SDL_PauseAudioDevice * \sa SDL_ResumeAudioDevice */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AudioDevicePaused(SDL_AudioDeviceID dev); +extern SDL_DECLSPEC bool SDLCALL SDL_AudioDevicePaused(SDL_AudioDeviceID dev); /** * Get the gain of an audio device. @@ -753,7 +753,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid * Audio devices default to a gain of 1.0f (no change in output). * * Physical devices may not have their gain changed, only logical devices, and - * this function will always return SDL_FALSE when used on physical devices. + * this function will always return false when used on physical devices. * While it might seem attractive to adjust several logical devices at once in * this way, it would allow an app or library to interfere with another * portion of the program's otherwise-isolated devices. @@ -767,7 +767,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid * * \param devid the audio device on which to change gain. * \param gain the gain. 1.0f is no change, 0.0f is silence. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread, as it holds @@ -777,7 +777,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid * * \sa SDL_GetAudioDeviceGain */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioDeviceGain(SDL_AudioDeviceID devid, float gain); +extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioDeviceGain(SDL_AudioDeviceID devid, float gain); /** * Close a previously-opened audio device. @@ -824,7 +824,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID devid); * \param devid an audio device to bind a stream to. * \param streams an array of audio streams to bind. * \param num_streams number streams listed in the `streams` array. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -835,7 +835,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID devid); * \sa SDL_UnbindAudioStream * \sa SDL_GetAudioStreamDevice */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream **streams, int num_streams); +extern SDL_DECLSPEC bool SDLCALL SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream **streams, int num_streams); /** * Bind a single audio stream to an audio device. @@ -845,7 +845,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BindAudioStreams(SDL_AudioDeviceID devi * * \param devid an audio device to bind a stream to. * \param stream an audio stream to bind to a device. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -856,7 +856,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BindAudioStreams(SDL_AudioDeviceID devi * \sa SDL_UnbindAudioStream * \sa SDL_GetAudioStreamDevice */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_AudioStream *stream); +extern SDL_DECLSPEC bool SDLCALL SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_AudioStream *stream); /** * Unbind a list of audio streams from their audio devices. @@ -953,7 +953,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetAudioStreamProperties(SDL_Au * \param stream the SDL_AudioStream to query. * \param src_spec where to store the input audio format; ignored if NULL. * \param dst_spec where to store the output audio format; ignored if NULL. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread, as it holds @@ -963,7 +963,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetAudioStreamProperties(SDL_Au * * \sa SDL_SetAudioStreamFormat */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetAudioStreamFormat(SDL_AudioStream *stream, SDL_AudioSpec *src_spec, SDL_AudioSpec *dst_spec); +extern SDL_DECLSPEC bool SDLCALL SDL_GetAudioStreamFormat(SDL_AudioStream *stream, SDL_AudioSpec *src_spec, SDL_AudioSpec *dst_spec); /** * Change the input and output formats of an audio stream. @@ -983,7 +983,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetAudioStreamFormat(SDL_AudioStream *s * changed. * \param dst_spec the new format of the audio output; if NULL, it is not * changed. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread, as it holds @@ -994,7 +994,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetAudioStreamFormat(SDL_AudioStream *s * \sa SDL_GetAudioStreamFormat * \sa SDL_SetAudioStreamFrequencyRatio */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamFormat(SDL_AudioStream *stream, const SDL_AudioSpec *src_spec, const SDL_AudioSpec *dst_spec); +extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamFormat(SDL_AudioStream *stream, const SDL_AudioSpec *src_spec, const SDL_AudioSpec *dst_spec); /** * Get the frequency ratio of an audio stream. @@ -1027,7 +1027,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamFrequencyRatio(SDL_AudioStre * \param stream the stream the frequency ratio is being changed. * \param ratio the frequency ratio. 1.0 is normal speed. Must be between 0.01 * and 100. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread, as it holds @@ -1038,7 +1038,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamFrequencyRatio(SDL_AudioStre * \sa SDL_GetAudioStreamFrequencyRatio * \sa SDL_SetAudioStreamFormat */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream *stream, float ratio); +extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream *stream, float ratio); /** * Get the gain of an audio stream. @@ -1074,7 +1074,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamGain(SDL_AudioStream *stream * * \param stream the stream on which the gain is being changed. * \param gain the gain. 1.0f is no change, 0.0f is silence. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread, as it holds @@ -1084,7 +1084,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamGain(SDL_AudioStream *stream * * \sa SDL_GetAudioStreamGain */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamGain(SDL_AudioStream *stream, float gain); +extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamGain(SDL_AudioStream *stream, float gain); /** * Get the current input channel map of an audio stream. @@ -1171,7 +1171,7 @@ extern SDL_DECLSPEC int * SDLCALL SDL_GetAudioStreamOutputChannelMap(SDL_AudioSt * \param stream the SDL_AudioStream to change. * \param chmap the new channel map, NULL to reset to default. * \param count The number of channels in the map. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread, as it holds @@ -1183,7 +1183,7 @@ extern SDL_DECLSPEC int * SDLCALL SDL_GetAudioStreamOutputChannelMap(SDL_AudioSt * * \sa SDL_SetAudioStreamInputChannelMap */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamInputChannelMap(SDL_AudioStream *stream, const int *chmap, int count); +extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamInputChannelMap(SDL_AudioStream *stream, const int *chmap, int count); /** * Set the current output channel map of an audio stream. @@ -1218,7 +1218,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamInputChannelMap(SDL_Audio * \param stream the SDL_AudioStream to change. * \param chmap the new channel map, NULL to reset to default. * \param count The number of channels in the map. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread, as it holds @@ -1230,7 +1230,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamInputChannelMap(SDL_Audio * * \sa SDL_SetAudioStreamInputChannelMap */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamOutputChannelMap(SDL_AudioStream *stream, const int *chmap, int count); +extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamOutputChannelMap(SDL_AudioStream *stream, const int *chmap, int count); /** * Add data to the stream. @@ -1246,7 +1246,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamOutputChannelMap(SDL_Audi * \param stream the stream the audio data is being added to. * \param buf a pointer to the audio data to add. * \param len the number of bytes to write to the stream. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread, but if the @@ -1260,7 +1260,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamOutputChannelMap(SDL_Audi * \sa SDL_GetAudioStreamData * \sa SDL_GetAudioStreamQueued */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PutAudioStreamData(SDL_AudioStream *stream, const void *buf, int len); +extern SDL_DECLSPEC bool SDLCALL SDL_PutAudioStreamData(SDL_AudioStream *stream, const void *buf, int len); /** * Get converted/resampled data from the stream. @@ -1361,7 +1361,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamQueued(SDL_AudioStream *stream * input, so the complete output becomes available. * * \param stream the audio stream to flush. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -1370,7 +1370,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamQueued(SDL_AudioStream *stream * * \sa SDL_PutAudioStreamData */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FlushAudioStream(SDL_AudioStream *stream); +extern SDL_DECLSPEC bool SDLCALL SDL_FlushAudioStream(SDL_AudioStream *stream); /** * Clear any pending data in the stream. @@ -1379,7 +1379,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FlushAudioStream(SDL_AudioStream *strea * stream until more is added. * * \param stream the audio stream to clear. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -1391,7 +1391,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FlushAudioStream(SDL_AudioStream *strea * \sa SDL_GetAudioStreamQueued * \sa SDL_PutAudioStreamData */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearAudioStream(SDL_AudioStream *stream); +extern SDL_DECLSPEC bool SDLCALL SDL_ClearAudioStream(SDL_AudioStream *stream); /** * Use this function to pause audio playback on the audio device associated @@ -1406,7 +1406,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearAudioStream(SDL_AudioStream *strea * loading, etc. * * \param stream the audio stream associated with the audio device to pause. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -1415,7 +1415,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearAudioStream(SDL_AudioStream *strea * * \sa SDL_ResumeAudioStreamDevice */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PauseAudioStreamDevice(SDL_AudioStream *stream); +extern SDL_DECLSPEC bool SDLCALL SDL_PauseAudioStreamDevice(SDL_AudioStream *stream); /** * Use this function to unpause audio playback on the audio device associated @@ -1426,7 +1426,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PauseAudioStreamDevice(SDL_AudioStream * to progress again, and audio can be generated. * * \param stream the audio stream associated with the audio device to resume. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -1435,7 +1435,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PauseAudioStreamDevice(SDL_AudioStream * * \sa SDL_PauseAudioStreamDevice */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResumeAudioStreamDevice(SDL_AudioStream *stream); +extern SDL_DECLSPEC bool SDLCALL SDL_ResumeAudioStreamDevice(SDL_AudioStream *stream); /** * Lock an audio stream for serialized access. @@ -1454,7 +1454,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResumeAudioStreamDevice(SDL_AudioStream * all the same attributes (recursive locks are allowed, etc). * * \param stream the audio stream to lock. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -1463,7 +1463,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResumeAudioStreamDevice(SDL_AudioStream * * \sa SDL_UnlockAudioStream */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockAudioStream(SDL_AudioStream *stream); +extern SDL_DECLSPEC bool SDLCALL SDL_LockAudioStream(SDL_AudioStream *stream); /** @@ -1472,7 +1472,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockAudioStream(SDL_AudioStream *stream * This unlocks an audio stream after a call to SDL_LockAudioStream. * * \param stream the audio stream to unlock. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety You should only call this from the same thread that @@ -1482,7 +1482,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockAudioStream(SDL_AudioStream *stream * * \sa SDL_LockAudioStream */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UnlockAudioStream(SDL_AudioStream *stream); +extern SDL_DECLSPEC bool SDLCALL SDL_UnlockAudioStream(SDL_AudioStream *stream); /** * A callback that fires when data passes through an SDL_AudioStream. @@ -1561,7 +1561,7 @@ typedef void (SDLCALL *SDL_AudioStreamCallback)(void *userdata, SDL_AudioStream * from the stream. * \param userdata an opaque pointer provided to the callback for its own * personal use. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. This only fails if `stream` is NULL. * * \threadsafety It is safe to call this function from any thread. @@ -1570,7 +1570,7 @@ typedef void (SDLCALL *SDL_AudioStreamCallback)(void *userdata, SDL_AudioStream * * \sa SDL_SetAudioStreamPutCallback */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamGetCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata); +extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamGetCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata); /** * Set a callback that runs when data is added to an audio stream. @@ -1610,7 +1610,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamGetCallback(SDL_AudioStre * stream. * \param userdata an opaque pointer provided to the callback for its own * personal use. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. This only fails if `stream` is NULL. * * \threadsafety It is safe to call this function from any thread. @@ -1619,7 +1619,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamGetCallback(SDL_AudioStre * * \sa SDL_SetAudioStreamGetCallback */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamPutCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata); +extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamPutCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata); /** @@ -1788,14 +1788,14 @@ typedef void (SDLCALL *SDL_AudioPostmixCallback)(void *userdata, const SDL_Audio * \param devid the ID of an opened audio device. * \param callback a callback function to be called. Can be NULL. * \param userdata app-controlled pointer passed to callback. Can be NULL. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, SDL_AudioPostmixCallback callback, void *userdata); +extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, SDL_AudioPostmixCallback callback, void *userdata); /** @@ -1850,7 +1850,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioPostmixCallback(SDL_AudioDevice * ``` * * \param src the data source for the WAVE data. - * \param closeio if SDL_TRUE, calls SDL_CloseIO() on `src` before returning, + * \param closeio if true, calls SDL_CloseIO() on `src` before returning, * even in the case of an error. * \param spec a pointer to an SDL_AudioSpec that will be set to the WAVE * data's format details on successful return. @@ -1858,11 +1858,11 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioPostmixCallback(SDL_AudioDevice * function. * \param audio_len a pointer filled with the length of the audio data buffer * in bytes. - * \returns SDL_TRUE on success. `audio_buf` will be filled with a pointer to + * \returns true on success. `audio_buf` will be filled with a pointer to * an allocated buffer containing the audio data, and `audio_len` is * filled with the length of that audio buffer in bytes. * - * This function returns SDL_FALSE if the .WAV file cannot be opened, + * This function returns false if the .WAV file cannot be opened, * uses an unknown data format, or is corrupt; call SDL_GetError() * for more information. * @@ -1876,7 +1876,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioPostmixCallback(SDL_AudioDevice * \sa SDL_free * \sa SDL_LoadWAV */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LoadWAV_IO(SDL_IOStream *src, SDL_bool closeio, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); +extern SDL_DECLSPEC bool SDLCALL SDL_LoadWAV_IO(SDL_IOStream *src, bool closeio, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); /** * Loads a WAV from a file path. @@ -1884,7 +1884,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LoadWAV_IO(SDL_IOStream *src, SDL_bool * This is a convenience function that is effectively the same as: * * ```c - * SDL_LoadWAV_IO(SDL_IOFromFile(path, "rb"), SDL_TRUE, spec, audio_buf, audio_len); + * SDL_LoadWAV_IO(SDL_IOFromFile(path, "rb"), true, spec, audio_buf, audio_len); * ``` * * \param path the file path of the WAV file to open. @@ -1894,11 +1894,11 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LoadWAV_IO(SDL_IOStream *src, SDL_bool * function. * \param audio_len a pointer filled with the length of the audio data buffer * in bytes. - * \returns SDL_TRUE on success. `audio_buf` will be filled with a pointer to + * \returns true on success. `audio_buf` will be filled with a pointer to * an allocated buffer containing the audio data, and `audio_len` is * filled with the length of that audio buffer in bytes. * - * This function returns SDL_FALSE if the .WAV file cannot be opened, + * This function returns false if the .WAV file cannot be opened, * uses an unknown data format, or is corrupt; call SDL_GetError() * for more information. * @@ -1912,7 +1912,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LoadWAV_IO(SDL_IOStream *src, SDL_bool * \sa SDL_free * \sa SDL_LoadWAV_IO */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LoadWAV(const char *path, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); +extern SDL_DECLSPEC bool SDLCALL SDL_LoadWAV(const char *path, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); /** * Mix audio data in a specified format. @@ -1941,14 +1941,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LoadWAV(const char *path, SDL_AudioSpec * \param len the length of the audio buffer in bytes. * \param volume ranges from 0.0 - 1.0, and should be set to 1.0 for full * audio volume. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_MixAudio(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format, Uint32 len, float volume); +extern SDL_DECLSPEC bool SDLCALL SDL_MixAudio(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format, Uint32 len, float volume); /** * Convert some audio data of one format to another format. @@ -1971,14 +1971,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_MixAudio(Uint8 *dst, const Uint8 *src, * which should be freed with SDL_free(). On error, it will be * NULL. * \param dst_len will be filled with the len of dst_data. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ConvertAudioSamples(const SDL_AudioSpec *src_spec, const Uint8 *src_data, int src_len, const SDL_AudioSpec *dst_spec, Uint8 **dst_data, int *dst_len); +extern SDL_DECLSPEC bool SDLCALL SDL_ConvertAudioSamples(const SDL_AudioSpec *src_spec, const Uint8 *src_data, int src_len, const SDL_AudioSpec *dst_spec, Uint8 **dst_data, int *dst_len); /** * Get the human readable name of an audio format. diff --git a/include/SDL3/SDL_bits.h b/include/SDL3/SDL_bits.h index 72be08272..8a0ba37b3 100644 --- a/include/SDL3/SDL_bits.h +++ b/include/SDL3/SDL_bits.h @@ -120,8 +120,8 @@ SDL_FORCE_INLINE int SDL_MostSignificantBitIndex32(Uint32 x) * Determine if a unsigned 32-bit value has exactly one bit set. * * If there are no bits set (`x` is zero), or more than one bit set, this - * returns SDL_FALSE. If any one bit is exclusively set, this returns - * SDL_TRUE. + * returns false. If any one bit is exclusively set, this returns + * true. * * Note that this is a forced-inline function in a header, and not a public * API function available in the SDL library (which is to say, the code is @@ -129,18 +129,18 @@ SDL_FORCE_INLINE int SDL_MostSignificantBitIndex32(Uint32 x) * be able to find this function inside SDL itself). * * \param x the 32-bit value to examine. - * \returns SDL_TRUE if exactly one bit is set in `x`, SDL_FALSE otherwise. + * \returns true if exactly one bit is set in `x`, false otherwise. * * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. */ -SDL_FORCE_INLINE SDL_bool SDL_HasExactlyOneBitSet32(Uint32 x) +SDL_FORCE_INLINE bool SDL_HasExactlyOneBitSet32(Uint32 x) { if (x && !(x & (x - 1))) { - return SDL_TRUE; + return true; } - return SDL_FALSE; + return false; } /* Ends C function definitions when using C++ */ diff --git a/include/SDL3/SDL_camera.h b/include/SDL3/SDL_camera.h index 841bce0a4..43fb1c435 100644 --- a/include/SDL3/SDL_camera.h +++ b/include/SDL3/SDL_camera.h @@ -369,14 +369,14 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetCameraProperties(SDL_Camera * be converting to this format behind the scenes. * * If the system is waiting for the user to approve access to the camera, as - * some platforms require, this will return SDL_FALSE, but this isn't + * some platforms require, this will return false, but this isn't * necessarily a fatal error; you should either wait for an * SDL_EVENT_CAMERA_DEVICE_APPROVED (or SDL_EVENT_CAMERA_DEVICE_DENIED) event, * or poll SDL_IsCameraApproved() occasionally until it returns non-zero. * * \param camera opened camera device. * \param spec the SDL_CameraSpec to be initialized by this function. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -385,7 +385,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetCameraProperties(SDL_Camera * * \sa SDL_OpenCamera */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetCameraFormat(SDL_Camera *camera, SDL_CameraSpec *spec); +extern SDL_DECLSPEC bool SDLCALL SDL_GetCameraFormat(SDL_Camera *camera, SDL_CameraSpec *spec); /** * Acquire a frame. diff --git a/include/SDL3/SDL_clipboard.h b/include/SDL3/SDL_clipboard.h index 4d4ae3220..4979aabbb 100644 --- a/include/SDL3/SDL_clipboard.h +++ b/include/SDL3/SDL_clipboard.h @@ -46,7 +46,7 @@ extern "C" { * Put UTF-8 text into the clipboard. * * \param text the text to store in the clipboard. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -54,7 +54,7 @@ extern "C" { * \sa SDL_GetClipboardText * \sa SDL_HasClipboardText */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetClipboardText(const char *text); +extern SDL_DECLSPEC bool SDLCALL SDL_SetClipboardText(const char *text); /** * Get UTF-8 text from the clipboard. @@ -76,20 +76,20 @@ extern SDL_DECLSPEC char * SDLCALL SDL_GetClipboardText(void); /** * Query whether the clipboard exists and contains a non-empty text string. * - * \returns SDL_TRUE if the clipboard has text, or SDL_FALSE if it does not. + * \returns true if the clipboard has text, or false if it does not. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetClipboardText * \sa SDL_SetClipboardText */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void); +extern SDL_DECLSPEC bool SDLCALL SDL_HasClipboardText(void); /** * Put UTF-8 text into the primary selection. * * \param text the text to store in the primary selection. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -97,7 +97,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void); * \sa SDL_GetPrimarySelectionText * \sa SDL_HasPrimarySelectionText */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetPrimarySelectionText(const char *text); +extern SDL_DECLSPEC bool SDLCALL SDL_SetPrimarySelectionText(const char *text); /** * Get UTF-8 text from the primary selection. @@ -120,7 +120,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_GetPrimarySelectionText(void); * Query whether the primary selection exists and contains a non-empty text * string. * - * \returns SDL_TRUE if the primary selection has text, or SDL_FALSE if it + * \returns true if the primary selection has text, or false if it * does not. * * \since This function is available since SDL 3.0.0. @@ -128,7 +128,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_GetPrimarySelectionText(void); * \sa SDL_GetPrimarySelectionText * \sa SDL_SetPrimarySelectionText */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasPrimarySelectionText(void); +extern SDL_DECLSPEC bool SDLCALL SDL_HasPrimarySelectionText(void); /** * Callback function that will be called when data for the specified mime-type @@ -185,7 +185,7 @@ typedef void (SDLCALL *SDL_ClipboardCleanupCallback)(void *userdata); * \param userdata an opaque pointer that will be forwarded to the callbacks. * \param mime_types a list of mime-types that are being offered. * \param num_mime_types the number of mime-types in the mime_types list. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -194,19 +194,19 @@ typedef void (SDLCALL *SDL_ClipboardCleanupCallback)(void *userdata); * \sa SDL_GetClipboardData * \sa SDL_HasClipboardData */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetClipboardData(SDL_ClipboardDataCallback callback, SDL_ClipboardCleanupCallback cleanup, void *userdata, const char **mime_types, size_t num_mime_types); +extern SDL_DECLSPEC bool SDLCALL SDL_SetClipboardData(SDL_ClipboardDataCallback callback, SDL_ClipboardCleanupCallback cleanup, void *userdata, const char **mime_types, size_t num_mime_types); /** * Clear the clipboard data. * - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetClipboardData */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearClipboardData(void); +extern SDL_DECLSPEC bool SDLCALL SDL_ClearClipboardData(void); /** * Get the data from clipboard for a given mime type. @@ -231,15 +231,15 @@ extern SDL_DECLSPEC void * SDLCALL SDL_GetClipboardData(const char *mime_type, s * Query whether there is data in the clipboard for the provided mime type. * * \param mime_type the mime type to check for data for. - * \returns SDL_TRUE if there exists data in clipboard for the provided mime - * type, SDL_FALSE if it does not. + * \returns true if there exists data in clipboard for the provided mime + * type, false if it does not. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetClipboardData * \sa SDL_GetClipboardData */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasClipboardData(const char *mime_type); +extern SDL_DECLSPEC bool SDLCALL SDL_HasClipboardData(const char *mime_type); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/include/SDL3/SDL_cpuinfo.h b/include/SDL3/SDL_cpuinfo.h index f9921add4..431d0de6c 100644 --- a/include/SDL3/SDL_cpuinfo.h +++ b/include/SDL3/SDL_cpuinfo.h @@ -82,29 +82,29 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetCPUCacheLineSize(void); * This always returns false on CPUs that aren't using PowerPC instruction * sets. * - * \returns SDL_TRUE if the CPU has AltiVec features or SDL_FALSE if not. + * \returns true if the CPU has AltiVec features or false if not. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void); +extern SDL_DECLSPEC bool SDLCALL SDL_HasAltiVec(void); /** * Determine whether the CPU has MMX features. * * This always returns false on CPUs that aren't using Intel instruction sets. * - * \returns SDL_TRUE if the CPU has MMX features or SDL_FALSE if not. + * \returns true if the CPU has MMX features or false if not. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void); +extern SDL_DECLSPEC bool SDLCALL SDL_HasMMX(void); /** * Determine whether the CPU has SSE features. * * This always returns false on CPUs that aren't using Intel instruction sets. * - * \returns SDL_TRUE if the CPU has SSE features or SDL_FALSE if not. + * \returns true if the CPU has SSE features or false if not. * * \since This function is available since SDL 3.0.0. * @@ -113,14 +113,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void); * \sa SDL_HasSSE41 * \sa SDL_HasSSE42 */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void); +extern SDL_DECLSPEC bool SDLCALL SDL_HasSSE(void); /** * Determine whether the CPU has SSE2 features. * * This always returns false on CPUs that aren't using Intel instruction sets. * - * \returns SDL_TRUE if the CPU has SSE2 features or SDL_FALSE if not. + * \returns true if the CPU has SSE2 features or false if not. * * \since This function is available since SDL 3.0.0. * @@ -129,14 +129,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void); * \sa SDL_HasSSE41 * \sa SDL_HasSSE42 */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void); +extern SDL_DECLSPEC bool SDLCALL SDL_HasSSE2(void); /** * Determine whether the CPU has SSE3 features. * * This always returns false on CPUs that aren't using Intel instruction sets. * - * \returns SDL_TRUE if the CPU has SSE3 features or SDL_FALSE if not. + * \returns true if the CPU has SSE3 features or false if not. * * \since This function is available since SDL 3.0.0. * @@ -145,14 +145,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void); * \sa SDL_HasSSE41 * \sa SDL_HasSSE42 */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void); +extern SDL_DECLSPEC bool SDLCALL SDL_HasSSE3(void); /** * Determine whether the CPU has SSE4.1 features. * * This always returns false on CPUs that aren't using Intel instruction sets. * - * \returns SDL_TRUE if the CPU has SSE4.1 features or SDL_FALSE if not. + * \returns true if the CPU has SSE4.1 features or false if not. * * \since This function is available since SDL 3.0.0. * @@ -161,14 +161,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void); * \sa SDL_HasSSE3 * \sa SDL_HasSSE42 */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void); +extern SDL_DECLSPEC bool SDLCALL SDL_HasSSE41(void); /** * Determine whether the CPU has SSE4.2 features. * * This always returns false on CPUs that aren't using Intel instruction sets. * - * \returns SDL_TRUE if the CPU has SSE4.2 features or SDL_FALSE if not. + * \returns true if the CPU has SSE4.2 features or false if not. * * \since This function is available since SDL 3.0.0. * @@ -177,49 +177,49 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void); * \sa SDL_HasSSE3 * \sa SDL_HasSSE41 */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE42(void); +extern SDL_DECLSPEC bool SDLCALL SDL_HasSSE42(void); /** * Determine whether the CPU has AVX features. * * This always returns false on CPUs that aren't using Intel instruction sets. * - * \returns SDL_TRUE if the CPU has AVX features or SDL_FALSE if not. + * \returns true if the CPU has AVX features or false if not. * * \since This function is available since SDL 3.0.0. * * \sa SDL_HasAVX2 * \sa SDL_HasAVX512F */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasAVX(void); +extern SDL_DECLSPEC bool SDLCALL SDL_HasAVX(void); /** * Determine whether the CPU has AVX2 features. * * This always returns false on CPUs that aren't using Intel instruction sets. * - * \returns SDL_TRUE if the CPU has AVX2 features or SDL_FALSE if not. + * \returns true if the CPU has AVX2 features or false if not. * * \since This function is available since SDL 3.0.0. * * \sa SDL_HasAVX * \sa SDL_HasAVX512F */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasAVX2(void); +extern SDL_DECLSPEC bool SDLCALL SDL_HasAVX2(void); /** * Determine whether the CPU has AVX-512F (foundation) features. * * This always returns false on CPUs that aren't using Intel instruction sets. * - * \returns SDL_TRUE if the CPU has AVX-512F features or SDL_FALSE if not. + * \returns true if the CPU has AVX-512F features or false if not. * * \since This function is available since SDL 3.0.0. * * \sa SDL_HasAVX * \sa SDL_HasAVX2 */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasAVX512F(void); +extern SDL_DECLSPEC bool SDLCALL SDL_HasAVX512F(void); /** * Determine whether the CPU has ARM SIMD (ARMv6) features. @@ -228,24 +228,24 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasAVX512F(void); * * This always returns false on CPUs that aren't using ARM instruction sets. * - * \returns SDL_TRUE if the CPU has ARM SIMD features or SDL_FALSE if not. + * \returns true if the CPU has ARM SIMD features or false if not. * * \since This function is available since SDL 3.0.0. * * \sa SDL_HasNEON */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasARMSIMD(void); +extern SDL_DECLSPEC bool SDLCALL SDL_HasARMSIMD(void); /** * Determine whether the CPU has NEON (ARM SIMD) features. * * This always returns false on CPUs that aren't using ARM instruction sets. * - * \returns SDL_TRUE if the CPU has ARM NEON features or SDL_FALSE if not. + * \returns true if the CPU has ARM NEON features or false if not. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void); +extern SDL_DECLSPEC bool SDLCALL SDL_HasNEON(void); /** * Determine whether the CPU has LSX (LOONGARCH SIMD) features. @@ -253,12 +253,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void); * This always returns false on CPUs that aren't using LOONGARCH instruction * sets. * - * \returns SDL_TRUE if the CPU has LOONGARCH LSX features or SDL_FALSE if + * \returns true if the CPU has LOONGARCH LSX features or false if * not. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasLSX(void); +extern SDL_DECLSPEC bool SDLCALL SDL_HasLSX(void); /** * Determine whether the CPU has LASX (LOONGARCH SIMD) features. @@ -266,12 +266,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasLSX(void); * This always returns false on CPUs that aren't using LOONGARCH instruction * sets. * - * \returns SDL_TRUE if the CPU has LOONGARCH LASX features or SDL_FALSE if + * \returns true if the CPU has LOONGARCH LASX features or false if * not. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasLASX(void); +extern SDL_DECLSPEC bool SDLCALL SDL_HasLASX(void); /** * Get the amount of RAM configured in the system. diff --git a/include/SDL3/SDL_dialog.h b/include/SDL3/SDL_dialog.h index 935fd78d5..11343c831 100644 --- a/include/SDL3/SDL_dialog.h +++ b/include/SDL3/SDL_dialog.h @@ -151,7 +151,7 @@ typedef void (SDLCALL *SDL_DialogFileCallback)(void *userdata, const char * cons * \sa SDL_ShowSaveFileDialog * \sa SDL_ShowOpenFolderDialog */ -extern SDL_DECLSPEC void SDLCALL SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const SDL_DialogFileFilter *filters, int nfilters, const char *default_location, SDL_bool allow_many); +extern SDL_DECLSPEC void SDLCALL SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const SDL_DialogFileFilter *filters, int nfilters, const char *default_location, bool allow_many); /** * Displays a dialog that lets the user choose a new or existing file on their @@ -254,7 +254,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_ShowSaveFileDialog(SDL_DialogFileCallback c * \sa SDL_ShowOpenFileDialog * \sa SDL_ShowSaveFileDialog */ -extern SDL_DECLSPEC void SDLCALL SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const char *default_location, SDL_bool allow_many); +extern SDL_DECLSPEC void SDLCALL SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const char *default_location, bool allow_many); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/include/SDL3/SDL_error.h b/include/SDL3/SDL_error.h index 4d7634201..1f5f65d1e 100644 --- a/include/SDL3/SDL_error.h +++ b/include/SDL3/SDL_error.h @@ -44,7 +44,7 @@ extern "C" { * * Calling this function will replace any previous error message that was set. * - * This function always returns SDL_FALSE, since SDL frequently uses SDL_FALSE + * This function always returns false, since SDL frequently uses false * to signify a failing result, leading to this idiom: * * ```c @@ -56,25 +56,25 @@ extern "C" { * \param fmt a printf()-style message format string. * \param ... additional parameters matching % tokens in the `fmt` string, if * any. - * \returns SDL_FALSE. + * \returns false. * * \since This function is available since SDL 3.0.0. * * \sa SDL_ClearError * \sa SDL_GetError */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); +extern SDL_DECLSPEC bool SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); /** * Set an error indicating that memory allocation failed. * * This function does not do any memory allocation. * - * \returns SDL_FALSE. + * \returns false. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_OutOfMemory(void); +extern SDL_DECLSPEC bool SDLCALL SDL_OutOfMemory(void); /** * Retrieve a message about the last error that occurred on the current @@ -114,14 +114,14 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetError(void); /** * Clear any previous error message for this thread. * - * \returns SDL_TRUE. + * \returns true. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetError * \sa SDL_SetError */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearError(void); +extern SDL_DECLSPEC bool SDLCALL SDL_ClearError(void); /** * \name Internal error functions diff --git a/include/SDL3/SDL_events.h b/include/SDL3/SDL_events.h index 252b284ec..34a7664cf 100644 --- a/include/SDL3/SDL_events.h +++ b/include/SDL3/SDL_events.h @@ -327,8 +327,8 @@ typedef struct SDL_KeyboardEvent SDL_Keycode key; /**< SDL virtual key code */ SDL_Keymod mod; /**< current key modifiers */ Uint16 raw; /**< The platform dependent scancode for this event */ - SDL_bool down; /**< SDL_TRUE if the key is pressed */ - SDL_bool repeat; /**< SDL_TRUE if this is a key repeat */ + bool down; /**< true if the key is pressed */ + bool repeat; /**< true if this is a key repeat */ } SDL_KeyboardEvent; /** @@ -365,7 +365,7 @@ typedef struct SDL_TextEditingCandidatesEvent const char * const *candidates; /**< The list of candidates, or NULL if there are no candidates available */ Sint32 num_candidates; /**< The number of strings in `candidates` */ Sint32 selected_candidate; /**< The index of the selected candidate, or -1 if no candidate is selected */ - SDL_bool horizontal; /**< SDL_TRUE if the list is horizontal, SDL_FALSE if it's vertical */ + bool horizontal; /**< true if the list is horizontal, false if it's vertical */ Uint8 padding1; Uint8 padding2; Uint8 padding3; @@ -436,7 +436,7 @@ typedef struct SDL_MouseButtonEvent SDL_WindowID windowID; /**< The window with mouse focus, if any */ SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID */ Uint8 button; /**< The mouse button index */ - SDL_bool down; /**< SDL_TRUE if the button is pressed */ + bool down; /**< true if the button is pressed */ Uint8 clicks; /**< 1 for single-click, 2 for double-click, etc. */ Uint8 padding; float x; /**< X coordinate, relative to window */ @@ -535,7 +535,7 @@ typedef struct SDL_JoyButtonEvent Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_JoystickID which; /**< The joystick instance id */ Uint8 button; /**< The joystick button index */ - SDL_bool down; /**< SDL_TRUE if the button is pressed */ + bool down; /**< true if the button is pressed */ Uint8 padding1; Uint8 padding2; } SDL_JoyButtonEvent; @@ -600,7 +600,7 @@ typedef struct SDL_GamepadButtonEvent Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_JoystickID which; /**< The joystick instance id */ Uint8 button; /**< The gamepad button (SDL_GamepadButton) */ - SDL_bool down; /**< SDL_TRUE if the button is pressed */ + bool down; /**< true if the button is pressed */ Uint8 padding1; Uint8 padding2; } SDL_GamepadButtonEvent; @@ -664,7 +664,7 @@ typedef struct SDL_AudioDeviceEvent Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_AudioDeviceID which; /**< SDL_AudioDeviceID for the device being added or removed or changing */ - SDL_bool recording; /**< SDL_FALSE if a playback device, SDL_TRUE if a recording device. */ + bool recording; /**< false if a playback device, true if a recording device. */ Uint8 padding1; Uint8 padding2; Uint8 padding3; @@ -768,8 +768,8 @@ typedef struct SDL_PenTouchEvent SDL_PenInputFlags pen_state; /**< Complete pen input state at time of event */ float x; /**< X position of pen on tablet */ float y; /**< Y position of pen on tablet */ - SDL_bool eraser; /**< SDL_TRUE if eraser end is used (not all pens support this). */ - SDL_bool down; /**< SDL_TRUE if the pen is touching or SDL_FALSE if the pen is lifted off */ + bool eraser; /**< true if eraser end is used (not all pens support this). */ + bool down; /**< true if the pen is touching or false if the pen is lifted off */ } SDL_PenTouchEvent; /** @@ -791,7 +791,7 @@ typedef struct SDL_PenButtonEvent float x; /**< X position of pen on tablet */ float y; /**< Y position of pen on tablet */ Uint8 button; /**< The pen button index (first button is 1). */ - SDL_bool down; /**< SDL_TRUE if the button is pressed */ + bool down; /**< true if the button is pressed */ } SDL_PenButtonEvent; /** @@ -1052,14 +1052,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event *events, int numevents, * instead. * * \param type the type of event to be queried; see SDL_EventType for details. - * \returns SDL_TRUE if events matching `type` are present, or SDL_FALSE if + * \returns true if events matching `type` are present, or false if * events matching `type` are not present. * * \since This function is available since SDL 3.0.0. * * \sa SDL_HasEvents */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type); +extern SDL_DECLSPEC bool SDLCALL SDL_HasEvent(Uint32 type); /** @@ -1071,14 +1071,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type); * SDL_EventType for details. * \param maxType the high end of event type to be queried, inclusive; see * SDL_EventType for details. - * \returns SDL_TRUE if events with type >= `minType` and <= `maxType` are - * present, or SDL_FALSE if not. + * \returns true if events with type >= `minType` and <= `maxType` are + * present, or false if not. * * \since This function is available since SDL 3.0.0. * * \sa SDL_HasEvents */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType); +extern SDL_DECLSPEC bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType); /** * Clear events of a specific type from the event queue. @@ -1165,7 +1165,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType) * * \param event the SDL_Event structure to be filled with the next event from * the queue, or NULL. - * \returns SDL_TRUE if this got an event or SDL_FALSE if there are none + * \returns true if this got an event or false if there are none * available. * * \since This function is available since SDL 3.0.0. @@ -1174,7 +1174,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType) * \sa SDL_WaitEvent * \sa SDL_WaitEventTimeout */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PollEvent(SDL_Event *event); +extern SDL_DECLSPEC bool SDLCALL SDL_PollEvent(SDL_Event *event); /** * Wait indefinitely for the next available event. @@ -1187,7 +1187,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PollEvent(SDL_Event *event); * * \param event the SDL_Event structure to be filled in with the next event * from the queue, or NULL. - * \returns SDL_TRUE on success or SDL_FALSE if there was an error while + * \returns true on success or false if there was an error while * waiting for events; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -1196,7 +1196,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PollEvent(SDL_Event *event); * \sa SDL_PushEvent * \sa SDL_WaitEventTimeout */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitEvent(SDL_Event *event); +extern SDL_DECLSPEC bool SDLCALL SDL_WaitEvent(SDL_Event *event); /** * Wait until the specified timeout (in milliseconds) for the next available @@ -1215,7 +1215,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitEvent(SDL_Event *event); * from the queue, or NULL. * \param timeoutMS the maximum number of milliseconds to wait for the next * available event. - * \returns SDL_TRUE if this got an event or SDL_FALSE if the timeout elapsed + * \returns true if this got an event or false if the timeout elapsed * without any events available. * * \since This function is available since SDL 3.0.0. @@ -1224,7 +1224,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitEvent(SDL_Event *event); * \sa SDL_PushEvent * \sa SDL_WaitEvent */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitEventTimeout(SDL_Event *event, Sint32 timeoutMS); +extern SDL_DECLSPEC bool SDLCALL SDL_WaitEventTimeout(SDL_Event *event, Sint32 timeoutMS); /** * Add an event to the event queue. @@ -1248,7 +1248,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitEventTimeout(SDL_Event *event, Sint * its own custom event types. * * \param event the SDL_Event to be added to the queue. - * \returns SDL_TRUE on success, SDL_FALSE if the event was filtered or on + * \returns true on success, false if the event was filtered or on * failure; call SDL_GetError() for more information. A common reason * for error is the event queue being full. * @@ -1258,7 +1258,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitEventTimeout(SDL_Event *event, Sint * \sa SDL_PollEvent * \sa SDL_RegisterEvents */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PushEvent(SDL_Event *event); +extern SDL_DECLSPEC bool SDLCALL SDL_PushEvent(SDL_Event *event); /** * A function pointer used for callbacks that watch the event queue. @@ -1266,7 +1266,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PushEvent(SDL_Event *event); * \param userdata what was passed as `userdata` to SDL_SetEventFilter() or * SDL_AddEventWatch, etc. * \param event the event that triggered the callback. - * \returns SDL_TRUE to permit event to be added to the queue, and SDL_FALSE + * \returns true to permit event to be added to the queue, and false * to disallow it. When used with SDL_AddEventWatch, the return value * is ignored. * @@ -1279,14 +1279,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PushEvent(SDL_Event *event); * \sa SDL_SetEventFilter * \sa SDL_AddEventWatch */ -typedef SDL_bool (SDLCALL *SDL_EventFilter)(void *userdata, SDL_Event *event); +typedef bool (SDLCALL *SDL_EventFilter)(void *userdata, SDL_Event *event); /** * Set up a filter to process all events before they change internal state and * are posted to the internal event queue. * - * If the filter function returns SDL_TRUE when called, then the event will be - * added to the internal queue. If it returns SDL_FALSE, then the event will + * If the filter function returns true when called, then the event will be + * added to the internal queue. If it returns false, then the event will * be dropped from the queue, but the internal state will still be updated. * This allows selective filtering of dynamically arriving events. * @@ -1338,13 +1338,13 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter, void * \param filter the current callback function will be stored here. * \param userdata the pointer that is passed to the current event filter will * be stored here. - * \returns SDL_TRUE on success or SDL_FALSE if there is no event filter set. + * \returns true on success or false if there is no event filter set. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetEventFilter */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter *filter, void **userdata); +extern SDL_DECLSPEC bool SDLCALL SDL_GetEventFilter(SDL_EventFilter *filter, void **userdata); /** * Add a callback to be triggered when an event is added to the event queue. @@ -1366,7 +1366,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter *filter, * * \param filter an SDL_EventFilter function to call when an event happens. * \param userdata a pointer that is passed to `filter`. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -1376,7 +1376,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter *filter, * \sa SDL_RemoveEventWatch * \sa SDL_SetEventFilter */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, void *userdata); +extern SDL_DECLSPEC bool SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, void *userdata); /** * Remove an event watch callback added with SDL_AddEventWatch(). @@ -1395,7 +1395,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_RemoveEventWatch(SDL_EventFilter filter, vo /** * Run a specific filter function on the current event queue, removing any - * events for which the filter returns SDL_FALSE. + * events for which the filter returns false. * * See SDL_SetEventFilter() for more information. Unlike SDL_SetEventFilter(), * this function does not change the filter permanently, it only uses the @@ -1421,19 +1421,19 @@ extern SDL_DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter, void * * * \sa SDL_EventEnabled */ -extern SDL_DECLSPEC void SDLCALL SDL_SetEventEnabled(Uint32 type, SDL_bool enabled); +extern SDL_DECLSPEC void SDLCALL SDL_SetEventEnabled(Uint32 type, bool enabled); /** * Query the state of processing events by type. * * \param type the type of event; see SDL_EventType for details. - * \returns SDL_TRUE if the event is being processed, SDL_FALSE otherwise. + * \returns true if the event is being processed, false otherwise. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetEventEnabled */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_EventEnabled(Uint32 type); +extern SDL_DECLSPEC bool SDLCALL SDL_EventEnabled(Uint32 type); /** * Allocate a set of user-defined events, and return the beginning event diff --git a/include/SDL3/SDL_filesystem.h b/include/SDL3/SDL_filesystem.h index 0afe3cb74..cd5941a4b 100644 --- a/include/SDL3/SDL_filesystem.h +++ b/include/SDL3/SDL_filesystem.h @@ -252,12 +252,12 @@ typedef Uint32 SDL_GlobFlags; * Create a directory. * * \param path the path of the directory to create. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CreateDirectory(const char *path); +extern SDL_DECLSPEC bool SDLCALL SDL_CreateDirectory(const char *path); /* Callback for directory enumeration. Return 1 to keep enumerating, 0 to stop enumerating (no error), -1 to stop enumerating and @@ -275,47 +275,47 @@ typedef int (SDLCALL *SDL_EnumerateDirectoryCallback)(void *userdata, const char * \param path the path of the directory to enumerate. * \param callback a function that is called for each entry in the directory. * \param userdata a pointer that is passed to `callback`. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_EnumerateDirectory(const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata); +extern SDL_DECLSPEC bool SDLCALL SDL_EnumerateDirectory(const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata); /** * Remove a file or an empty directory. * * \param path the path of the directory to enumerate. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RemovePath(const char *path); +extern SDL_DECLSPEC bool SDLCALL SDL_RemovePath(const char *path); /** * Rename a file or directory. * * \param oldpath the old path. * \param newpath the new path. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenamePath(const char *oldpath, const char *newpath); +extern SDL_DECLSPEC bool SDLCALL SDL_RenamePath(const char *oldpath, const char *newpath); /** * Copy a file. * * \param oldpath the old path. * \param newpath the new path. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CopyFile(const char *oldpath, const char *newpath); +extern SDL_DECLSPEC bool SDLCALL SDL_CopyFile(const char *oldpath, const char *newpath); /** * Get information about a filesystem path. @@ -323,12 +323,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CopyFile(const char *oldpath, const cha * \param path the path to query. * \param info a pointer filled in with information about the path, or NULL to * check for the existence of a file. - * \returns SDL_TRUE on success or SDL_FALSE if the file doesn't exist, or + * \returns true on success or false if the file doesn't exist, or * another failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetPathInfo(const char *path, SDL_PathInfo *info); +extern SDL_DECLSPEC bool SDLCALL SDL_GetPathInfo(const char *path, SDL_PathInfo *info); /** * Enumerate a directory tree, filtered by pattern, and return a list. diff --git a/include/SDL3/SDL_gamepad.h b/include/SDL3/SDL_gamepad.h index 5ba2f8b5b..77d47095d 100644 --- a/include/SDL3/SDL_gamepad.h +++ b/include/SDL3/SDL_gamepad.h @@ -332,7 +332,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddGamepadMapping(const char *mapping); * constrained environment. * * \param src the data stream for the mappings to be added. - * \param closeio if SDL_TRUE, calls SDL_CloseIO() on `src` before returning, + * \param closeio if true, calls SDL_CloseIO() on `src` before returning, * even in the case of an error. * \returns the number of mappings added or -1 on failure; call SDL_GetError() * for more information. @@ -346,7 +346,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddGamepadMapping(const char *mapping); * \sa SDL_GetGamepadMapping * \sa SDL_GetGamepadMappingForGUID */ -extern SDL_DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromIO(SDL_IOStream *src, SDL_bool closeio); +extern SDL_DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromIO(SDL_IOStream *src, bool closeio); /** * Load a set of gamepad mappings from a file. @@ -381,12 +381,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromFile(const char *file) * * This will generate gamepad events as needed if device mappings change. * - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReloadGamepadMappings(void); +extern SDL_DECLSPEC bool SDLCALL SDL_ReloadGamepadMappings(void); /** * Get the current gamepad mappings. @@ -444,7 +444,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_GetGamepadMapping(SDL_Gamepad *gamepad); * \param instance_id the joystick instance ID. * \param mapping the mapping to use for this device, or NULL to clear the * mapping. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -452,18 +452,18 @@ extern SDL_DECLSPEC char * SDLCALL SDL_GetGamepadMapping(SDL_Gamepad *gamepad); * \sa SDL_AddGamepadMapping * \sa SDL_GetGamepadMapping */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGamepadMapping(SDL_JoystickID instance_id, const char *mapping); +extern SDL_DECLSPEC bool SDLCALL SDL_SetGamepadMapping(SDL_JoystickID instance_id, const char *mapping); /** * Return whether a gamepad is currently connected. * - * \returns SDL_TRUE if a gamepad is connected, SDL_FALSE otherwise. + * \returns true if a gamepad is connected, false otherwise. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetGamepads */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasGamepad(void); +extern SDL_DECLSPEC bool SDLCALL SDL_HasGamepad(void); /** * Get a list of currently connected gamepads. @@ -485,15 +485,15 @@ extern SDL_DECLSPEC SDL_JoystickID * SDLCALL SDL_GetGamepads(int *count); * Check if the given joystick is supported by the gamepad interface. * * \param instance_id the joystick instance ID. - * \returns SDL_TRUE if the given joystick is supported by the gamepad - * interface, SDL_FALSE if it isn't or it's an invalid index. + * \returns true if the given joystick is supported by the gamepad + * interface, false if it isn't or it's an invalid index. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetJoysticks * \sa SDL_OpenGamepad */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsGamepad(SDL_JoystickID instance_id); +extern SDL_DECLSPEC bool SDLCALL SDL_IsGamepad(SDL_JoystickID instance_id); /** * Get the implementation dependent name of a gamepad. @@ -815,14 +815,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetGamepadPlayerIndex(SDL_Gamepad *gamepad); * \param gamepad the gamepad object to adjust. * \param player_index player index to assign to this gamepad, or -1 to clear * the player index and turn off player LEDs. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetGamepadPlayerIndex */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGamepadPlayerIndex(SDL_Gamepad *gamepad, int player_index); +extern SDL_DECLSPEC bool SDLCALL SDL_SetGamepadPlayerIndex(SDL_Gamepad *gamepad, int player_index); /** * Get the USB vendor ID of an opened gamepad, if available. @@ -940,12 +940,12 @@ extern SDL_DECLSPEC SDL_PowerState SDLCALL SDL_GetGamepadPowerInfo(SDL_Gamepad * * * \param gamepad a gamepad identifier previously returned by * SDL_OpenGamepad(). - * \returns SDL_TRUE if the gamepad has been opened and is currently - * connected, or SDL_FALSE if not. + * \returns true if the gamepad has been opened and is currently + * connected, or false if not. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadConnected(SDL_Gamepad *gamepad); +extern SDL_DECLSPEC bool SDLCALL SDL_GamepadConnected(SDL_Gamepad *gamepad); /** * Get the underlying joystick from a gamepad. @@ -980,7 +980,7 @@ extern SDL_DECLSPEC SDL_Joystick * SDLCALL SDL_GetGamepadJoystick(SDL_Gamepad *g * \sa SDL_GamepadEventsEnabled * \sa SDL_UpdateGamepads */ -extern SDL_DECLSPEC void SDLCALL SDL_SetGamepadEventsEnabled(SDL_bool enabled); +extern SDL_DECLSPEC void SDLCALL SDL_SetGamepadEventsEnabled(bool enabled); /** * Query the state of gamepad event processing. @@ -988,14 +988,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetGamepadEventsEnabled(SDL_bool enabled); * If gamepad events are disabled, you must call SDL_UpdateGamepads() yourself * and check the state of the gamepad when you want gamepad information. * - * \returns SDL_TRUE if gamepad events are being processed, SDL_FALSE + * \returns true if gamepad events are being processed, false * otherwise. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetGamepadEventsEnabled */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadEventsEnabled(void); +extern SDL_DECLSPEC bool SDLCALL SDL_GamepadEventsEnabled(void); /** * Get the SDL joystick layer bindings for a gamepad. @@ -1098,14 +1098,14 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadStringForAxis(SDL_Gamepad * * \param gamepad a gamepad. * \param axis an axis enum value (an SDL_GamepadAxis value). - * \returns SDL_TRUE if the gamepad has this axis, SDL_FALSE otherwise. + * \returns true if the gamepad has this axis, false otherwise. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GamepadHasButton * \sa SDL_GetGamepadAxis */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadHasAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis); +extern SDL_DECLSPEC bool SDLCALL SDL_GamepadHasAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis); /** * Get the current state of an axis control on a gamepad. @@ -1171,27 +1171,27 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadStringForButton(SDL_Gamep * * \param gamepad a gamepad. * \param button a button enum value (an SDL_GamepadButton value). - * \returns SDL_TRUE if the gamepad has this button, SDL_FALSE otherwise. + * \returns true if the gamepad has this button, false otherwise. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GamepadHasAxis */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadHasButton(SDL_Gamepad *gamepad, SDL_GamepadButton button); +extern SDL_DECLSPEC bool SDLCALL SDL_GamepadHasButton(SDL_Gamepad *gamepad, SDL_GamepadButton button); /** * Get the current state of a button on a gamepad. * * \param gamepad a gamepad. * \param button a button index (one of the SDL_GamepadButton values). - * \returns SDL_TRUE if the button is pressed, SDL_FALSE otherwise. + * \returns true if the button is pressed, false otherwise. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GamepadHasButton * \sa SDL_GetGamepadAxis */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGamepadButton(SDL_Gamepad *gamepad, SDL_GamepadButton button); +extern SDL_DECLSPEC bool SDLCALL SDL_GetGamepadButton(SDL_Gamepad *gamepad, SDL_GamepadButton button); /** * Get the label of a button on a gamepad. @@ -1252,28 +1252,28 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumGamepadTouchpadFingers(SDL_Gamepad *ga * \param gamepad a gamepad. * \param touchpad a touchpad. * \param finger a finger. - * \param down a pointer filled with SDL_TRUE if the finger is down, SDL_FALSE + * \param down a pointer filled with true if the finger is down, false * otherwise, may be NULL. * \param x a pointer filled with the x position, normalized 0 to 1, with the * origin in the upper left, may be NULL. * \param y a pointer filled with the y position, normalized 0 to 1, with the * origin in the upper left, may be NULL. * \param pressure a pointer filled with pressure value, may be NULL. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetNumGamepadTouchpadFingers */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGamepadTouchpadFinger(SDL_Gamepad *gamepad, int touchpad, int finger, SDL_bool *down, float *x, float *y, float *pressure); +extern SDL_DECLSPEC bool SDLCALL SDL_GetGamepadTouchpadFinger(SDL_Gamepad *gamepad, int touchpad, int finger, bool *down, float *x, float *y, float *pressure); /** * Return whether a gamepad has a particular sensor. * * \param gamepad the gamepad to query. * \param type the type of sensor to query. - * \returns SDL_TRUE if the sensor exists, SDL_FALSE otherwise. + * \returns true if the sensor exists, false otherwise. * * \since This function is available since SDL 3.0.0. * @@ -1281,7 +1281,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGamepadTouchpadFinger(SDL_Gamepad *g * \sa SDL_GetGamepadSensorDataRate * \sa SDL_SetGamepadSensorEnabled */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadHasSensor(SDL_Gamepad *gamepad, SDL_SensorType type); +extern SDL_DECLSPEC bool SDLCALL SDL_GamepadHasSensor(SDL_Gamepad *gamepad, SDL_SensorType type); /** * Set whether data reporting for a gamepad sensor is enabled. @@ -1289,7 +1289,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadHasSensor(SDL_Gamepad *gamepad, * \param gamepad the gamepad to update. * \param type the type of sensor to enable/disable. * \param enabled whether data reporting should be enabled. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1297,20 +1297,20 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadHasSensor(SDL_Gamepad *gamepad, * \sa SDL_GamepadHasSensor * \sa SDL_GamepadSensorEnabled */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type, SDL_bool enabled); +extern SDL_DECLSPEC bool SDLCALL SDL_SetGamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type, bool enabled); /** * Query whether sensor data reporting is enabled for a gamepad. * * \param gamepad the gamepad to query. * \param type the type of sensor to query. - * \returns SDL_TRUE if the sensor is enabled, SDL_FALSE otherwise. + * \returns true if the sensor is enabled, false otherwise. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetGamepadSensorEnabled */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type); +extern SDL_DECLSPEC bool SDLCALL SDL_GamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type); /** * Get the data rate (number of events per second) of a gamepad sensor. @@ -1333,12 +1333,12 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetGamepadSensorDataRate(SDL_Gamepad *game * \param type the type of sensor to query. * \param data a pointer filled with the current sensor state. * \param num_values the number of values to write to data. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGamepadSensorData(SDL_Gamepad *gamepad, SDL_SensorType type, float *data, int num_values); +extern SDL_DECLSPEC bool SDLCALL SDL_GetGamepadSensorData(SDL_Gamepad *gamepad, SDL_SensorType type, float *data, int num_values); /** * Start a rumble effect on a gamepad. @@ -1355,12 +1355,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGamepadSensorData(SDL_Gamepad *gamep * \param high_frequency_rumble the intensity of the high frequency (right) * rumble motor, from 0 to 0xFFFF. * \param duration_ms the duration of the rumble effect, in milliseconds. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); +extern SDL_DECLSPEC bool SDLCALL SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); /** * Start a rumble effect in the gamepad's triggers. @@ -1381,14 +1381,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uin * \param right_rumble the intensity of the right trigger rumble motor, from 0 * to 0xFFFF. * \param duration_ms the duration of the rumble effect, in milliseconds. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_RumbleGamepad */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RumbleGamepadTriggers(SDL_Gamepad *gamepad, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms); +extern SDL_DECLSPEC bool SDLCALL SDL_RumbleGamepadTriggers(SDL_Gamepad *gamepad, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms); /** * Update a gamepad's LED color. @@ -1403,12 +1403,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RumbleGamepadTriggers(SDL_Gamepad *game * \param red the intensity of the red LED. * \param green the intensity of the green LED. * \param blue the intensity of the blue LED. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGamepadLED(SDL_Gamepad *gamepad, Uint8 red, Uint8 green, Uint8 blue); +extern SDL_DECLSPEC bool SDLCALL SDL_SetGamepadLED(SDL_Gamepad *gamepad, Uint8 red, Uint8 green, Uint8 blue); /** * Send a gamepad specific effect packet. @@ -1416,12 +1416,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGamepadLED(SDL_Gamepad *gamepad, Uin * \param gamepad the gamepad to affect. * \param data the data to send to the gamepad. * \param size the size of the data to send to the gamepad. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SendGamepadEffect(SDL_Gamepad *gamepad, const void *data, int size); +extern SDL_DECLSPEC bool SDLCALL SDL_SendGamepadEffect(SDL_Gamepad *gamepad, const void *data, int size); /** * Close a gamepad previously opened with SDL_OpenGamepad(). diff --git a/include/SDL3/SDL_gpu.h b/include/SDL3/SDL_gpu.h index 15af6ea86..53bbe4106 100644 --- a/include/SDL3/SDL_gpu.h +++ b/include/SDL3/SDL_gpu.h @@ -1151,12 +1151,12 @@ typedef struct SDL_GPUSamplerCreateInfo SDL_GPUSamplerAddressMode address_mode_v; /**< The addressing mode for V coordinates outside [0, 1). */ SDL_GPUSamplerAddressMode address_mode_w; /**< The addressing mode for W coordinates outside [0, 1). */ float mip_lod_bias; /**< The bias to be added to mipmap LOD calculation. */ - float max_anisotropy; /**< The anisotropy value clamp used by the sampler. If enable_anisotropy is SDL_FALSE, this is ignored. */ + float max_anisotropy; /**< The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored. */ SDL_GPUCompareOp compare_op; /**< The comparison operator to apply to fetched data before filtering. */ float min_lod; /**< Clamps the minimum of the computed LOD value. */ float max_lod; /**< Clamps the maximum of the computed LOD value. */ - SDL_bool enable_anisotropy; /**< SDL_TRUE to enable anisotropic filtering. */ - SDL_bool enable_compare; /**< SDL_TRUE to enable comparison against a reference value during lookups. */ + bool enable_anisotropy; /**< true to enable anisotropic filtering. */ + bool enable_compare; /**< true to enable comparison against a reference value during lookups. */ Uint8 padding1; Uint8 padding2; @@ -1254,9 +1254,9 @@ typedef struct SDL_GPUColorTargetBlendState SDL_GPUBlendFactor src_alpha_blendfactor; /**< The value to be multiplied by the source alpha. */ SDL_GPUBlendFactor dst_alpha_blendfactor; /**< The value to be multiplied by the destination alpha. */ SDL_GPUBlendOp alpha_blend_op; /**< The blend operation for the alpha component. */ - SDL_GPUColorComponentFlags color_write_mask; /**< A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is SDL_FALSE. */ - SDL_bool enable_blend; /**< Whether blending is enabled for the color target. */ - SDL_bool enable_color_write_mask; /**< Whether the color write mask is enabled. */ + SDL_GPUColorComponentFlags color_write_mask; /**< A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false. */ + bool enable_blend; /**< Whether blending is enabled for the color target. */ + bool enable_color_write_mask; /**< Whether the color write mask is enabled. */ Uint8 padding2; Uint8 padding3; } SDL_GPUColorTargetBlendState; @@ -1367,7 +1367,7 @@ typedef struct SDL_GPURasterizerState float depth_bias_constant_factor; /**< A scalar factor controlling the depth value added to each fragment. */ float depth_bias_clamp; /**< The maximum depth bias of a fragment. */ float depth_bias_slope_factor; /**< A scalar factor applied to a fragment's slope in depth calculations. */ - SDL_bool enable_depth_bias; /**< SDL_TRUE to bias fragment depth values. */ + bool enable_depth_bias; /**< true to bias fragment depth values. */ Uint8 padding1; Uint8 padding2; Uint8 padding3; @@ -1384,8 +1384,8 @@ typedef struct SDL_GPURasterizerState typedef struct SDL_GPUMultisampleState { SDL_GPUSampleCount sample_count; /**< The number of samples to be used in rasterization. */ - Uint32 sample_mask; /**< Determines which samples get updated in the render targets. Treated as 0xFFFFFFFF if enable_mask is SDL_FALSE. */ - SDL_bool enable_mask; /**< Enables sample masking. */ + Uint32 sample_mask; /**< Determines which samples get updated in the render targets. Treated as 0xFFFFFFFF if enable_mask is false. */ + bool enable_mask; /**< Enables sample masking. */ Uint8 padding1; Uint8 padding2; Uint8 padding3; @@ -1406,9 +1406,9 @@ typedef struct SDL_GPUDepthStencilState SDL_GPUStencilOpState front_stencil_state; /**< The stencil op state for front-facing triangles. */ Uint8 compare_mask; /**< Selects the bits of the stencil values participating in the stencil test. */ Uint8 write_mask; /**< Selects the bits of the stencil values updated by the stencil test. */ - SDL_bool enable_depth_test; /**< SDL_TRUE enables the depth test. */ - SDL_bool enable_depth_write; /**< SDL_TRUE enables depth writes. Depth writes are always disabled when enable_depth_test is SDL_FALSE. */ - SDL_bool enable_stencil_test; /**< SDL_TRUE enables the stencil test. */ + bool enable_depth_test; /**< true enables the depth test. */ + bool enable_depth_write; /**< true enables depth writes. Depth writes are always disabled when enable_depth_test is false. */ + bool enable_stencil_test; /**< true enables the stencil test. */ Uint8 padding1; Uint8 padding2; Uint8 padding3; @@ -1440,8 +1440,8 @@ typedef struct SDL_GPUGraphicsPipelineTargetInfo { const SDL_GPUColorTargetDescription *color_target_descriptions; /**< A pointer to an array of color target descriptions. */ Uint32 num_color_targets; /**< The number of color target descriptions in the above array. */ - SDL_GPUTextureFormat depth_stencil_format; /**< The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is SDL_FALSE. */ - SDL_bool has_depth_stencil_target; /**< SDL_TRUE specifies that the pipeline uses a depth-stencil target. */ + SDL_GPUTextureFormat depth_stencil_format; /**< The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. */ + bool has_depth_stencil_target; /**< true specifies that the pipeline uses a depth-stencil target. */ Uint8 padding1; Uint8 padding2; Uint8 padding3; @@ -1540,8 +1540,8 @@ typedef struct SDL_GPUColorTargetInfo SDL_GPUTexture *resolve_texture; /**< The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used. */ Uint32 resolve_mip_level; /**< The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. */ Uint32 resolve_layer; /**< The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. */ - SDL_bool cycle; /**< SDL_TRUE cycles the texture if the texture is bound and load_op is not LOAD */ - SDL_bool cycle_resolve_texture; /**< SDL_TRUE cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used. */ + bool cycle; /**< true cycles the texture if the texture is bound and load_op is not LOAD */ + bool cycle_resolve_texture; /**< true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used. */ Uint8 padding1; Uint8 padding2; } SDL_GPUColorTargetInfo; @@ -1598,7 +1598,7 @@ typedef struct SDL_GPUDepthStencilTargetInfo SDL_GPUStoreOp store_op; /**< What is done with the depth results of the render pass. */ SDL_GPULoadOp stencil_load_op; /**< What is done with the stencil contents at the beginning of the render pass. */ SDL_GPUStoreOp stencil_store_op; /**< What is done with the stencil results of the render pass. */ - SDL_bool cycle; /**< SDL_TRUE cycles the texture if the texture is bound and any load ops are not LOAD */ + bool cycle; /**< true cycles the texture if the texture is bound and any load ops are not LOAD */ Uint8 clear_stencil; /**< The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. */ Uint8 padding1; Uint8 padding2; @@ -1618,7 +1618,7 @@ typedef struct SDL_GPUBlitInfo { SDL_FColor clear_color; /**< The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR. */ SDL_FlipMode flip_mode; /**< The flip mode for the source region. */ SDL_GPUFilter filter; /**< The filter mode used when blitting. */ - SDL_bool cycle; /**< SDL_TRUE cycles the destination texture if it is already bound. */ + bool cycle; /**< true cycles the destination texture if it is already bound. */ Uint8 padding1; Uint8 padding2; Uint8 padding3; @@ -1664,7 +1664,7 @@ typedef struct SDL_GPUTextureSamplerBinding typedef struct SDL_GPUStorageBufferWriteOnlyBinding { SDL_GPUBuffer *buffer; /**< The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE. */ - SDL_bool cycle; /**< SDL_TRUE cycles the buffer if it is already bound. */ + bool cycle; /**< true cycles the buffer if it is already bound. */ Uint8 padding1; Uint8 padding2; Uint8 padding3; @@ -1683,7 +1683,7 @@ typedef struct SDL_GPUStorageTextureWriteOnlyBinding SDL_GPUTexture *texture; /**< The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE. */ Uint32 mip_level; /**< The mip level index to bind. */ Uint32 layer; /**< The layer index to bind. */ - SDL_bool cycle; /**< SDL_TRUE cycles the texture if it is already bound. */ + bool cycle; /**< true cycles the texture if it is already bound. */ Uint8 padding1; Uint8 padding2; Uint8 padding3; @@ -1700,13 +1700,13 @@ typedef struct SDL_GPUStorageTextureWriteOnlyBinding * able to provide. * \param name the preferred GPU driver, or NULL to let SDL pick the optimal * driver. - * \returns SDL_TRUE if supported, SDL_FALSE otherwise. + * \returns true if supported, false otherwise. * * \since This function is available since SDL 3.0.0. * * \sa SDL_CreateGPUDevice */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUSupportsShaderFormats( +extern SDL_DECLSPEC bool SDLCALL SDL_GPUSupportsShaderFormats( SDL_GPUShaderFormat format_flags, const char *name); @@ -1714,13 +1714,13 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUSupportsShaderFormats( * Checks for GPU runtime support. * * \param props the properties to use. - * \returns SDL_TRUE if supported, SDL_FALSE otherwise. + * \returns true if supported, false otherwise. * * \since This function is available since SDL 3.0.0. * * \sa SDL_CreateGPUDeviceWithProperties */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUSupportsProperties( +extern SDL_DECLSPEC bool SDLCALL SDL_GPUSupportsProperties( SDL_PropertiesID props); /** @@ -1742,7 +1742,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUSupportsProperties( */ extern SDL_DECLSPEC SDL_GPUDevice *SDLCALL SDL_CreateGPUDevice( SDL_GPUShaderFormat format_flags, - SDL_bool debug_mode, + bool debug_mode, const char *name); /** @@ -1751,9 +1751,9 @@ extern SDL_DECLSPEC SDL_GPUDevice *SDLCALL SDL_CreateGPUDevice( * These are the supported properties: * * - `SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOL`: enable debug mode properties - * and validations, defaults to SDL_TRUE. + * and validations, defaults to true. * - `SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOL`: enable to prefer energy - * efficiency over maximum GPU performance, defaults to SDL_FALSE. + * efficiency over maximum GPU performance, defaults to false. * - `SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING`: the name of the GPU driver to * use, if a specific one is desired. * @@ -2400,16 +2400,16 @@ extern SDL_DECLSPEC void SDLCALL SDL_PushGPUComputeUniformData( * * All of the functions and structs that involve writing to a resource have a "cycle" bool. * GPUTransferBuffer, GPUBuffer, and GPUTexture all effectively function as ring buffers on internal resources. - * When cycle is SDL_TRUE, if the resource is bound, the cycle rotates to the next unbound internal resource, + * When cycle is true, if the resource is bound, the cycle rotates to the next unbound internal resource, * or if none are available, a new one is created. * This means you don't have to worry about complex state tracking and synchronization as long as cycling is correctly employed. * * For example: you can call MapTransferBuffer, write texture data, UnmapTransferBuffer, and then UploadToTexture. - * The next time you write texture data to the transfer buffer, if you set the cycle param to SDL_TRUE, you don't have + * The next time you write texture data to the transfer buffer, if you set the cycle param to true, you don't have * to worry about overwriting any data that is not yet uploaded. * * Another example: If you are using a texture in a render pass every frame, this can cause a data dependency between frames. - * If you set cycle to SDL_TRUE in the SDL_GPUColorTargetInfo struct, you can prevent this data dependency. + * If you set cycle to true in the SDL_GPUColorTargetInfo struct, you can prevent this data dependency. * * Cycling will never undefine already bound data. * When cycling, all data in the resource is considered to be undefined for subsequent commands until that data is written again. @@ -2966,7 +2966,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_EndGPUComputePass( * * \param device a GPU context. * \param transfer_buffer a transfer buffer. - * \param cycle if SDL_TRUE, cycles the transfer buffer if it is already + * \param cycle if true, cycles the transfer buffer if it is already * bound. * \returns the address of the mapped transfer buffer memory. * @@ -2975,7 +2975,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_EndGPUComputePass( extern SDL_DECLSPEC void *SDLCALL SDL_MapGPUTransferBuffer( SDL_GPUDevice *device, SDL_GPUTransferBuffer *transfer_buffer, - SDL_bool cycle); + bool cycle); /** * Unmaps a previously mapped transfer buffer. @@ -3018,7 +3018,7 @@ extern SDL_DECLSPEC SDL_GPUCopyPass *SDLCALL SDL_BeginGPUCopyPass( * \param copy_pass a copy pass handle. * \param source the source transfer buffer with image layout information. * \param destination the destination texture region. - * \param cycle if SDL_TRUE, cycles the texture if the texture is bound, + * \param cycle if true, cycles the texture if the texture is bound, * otherwise overwrites the data. * * \since This function is available since SDL 3.0.0. @@ -3027,7 +3027,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_UploadToGPUTexture( SDL_GPUCopyPass *copy_pass, const SDL_GPUTextureTransferInfo *source, const SDL_GPUTextureRegion *destination, - SDL_bool cycle); + bool cycle); /* Uploads data from a TransferBuffer to a Buffer. */ @@ -3040,7 +3040,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_UploadToGPUTexture( * \param copy_pass a copy pass handle. * \param source the source transfer buffer with offset. * \param destination the destination buffer with offset and size. - * \param cycle if SDL_TRUE, cycles the buffer if it is already bound, + * \param cycle if true, cycles the buffer if it is already bound, * otherwise overwrites the data. * * \since This function is available since SDL 3.0.0. @@ -3049,7 +3049,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_UploadToGPUBuffer( SDL_GPUCopyPass *copy_pass, const SDL_GPUTransferBufferLocation *source, const SDL_GPUBufferRegion *destination, - SDL_bool cycle); + bool cycle); /** * Performs a texture-to-texture copy. @@ -3063,7 +3063,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_UploadToGPUBuffer( * \param w the width of the region to copy. * \param h the height of the region to copy. * \param d the depth of the region to copy. - * \param cycle if SDL_TRUE, cycles the destination texture if the destination + * \param cycle if true, cycles the destination texture if the destination * texture is bound, otherwise overwrites the data. * * \since This function is available since SDL 3.0.0. @@ -3075,7 +3075,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_CopyGPUTextureToTexture( Uint32 w, Uint32 h, Uint32 d, - SDL_bool cycle); + bool cycle); /* Copies data from a buffer to a buffer. */ @@ -3089,7 +3089,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_CopyGPUTextureToTexture( * \param source the buffer and offset to copy from. * \param destination the buffer and offset to copy to. * \param size the length of the buffer to copy. - * \param cycle if SDL_TRUE, cycles the destination buffer if it is already + * \param cycle if true, cycles the destination buffer if it is already * bound, otherwise overwrites the data. * * \since This function is available since SDL 3.0.0. @@ -3099,7 +3099,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_CopyGPUBufferToBuffer( const SDL_GPUBufferLocation *source, const SDL_GPUBufferLocation *destination, Uint32 size, - SDL_bool cycle); + bool cycle); /** * Copies data from a texture to a transfer buffer on the GPU timeline. @@ -3184,13 +3184,13 @@ extern SDL_DECLSPEC void SDLCALL SDL_BlitGPUTexture( * \param device a GPU context. * \param window an SDL_Window. * \param swapchain_composition the swapchain composition to check. - * \returns SDL_TRUE if supported, SDL_FALSE if unsupported (or on error). + * \returns true if supported, false if unsupported (or on error). * * \since This function is available since SDL 3.0.0. * * \sa SDL_ClaimWindowForGPUDevice */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowSupportsGPUSwapchainComposition( +extern SDL_DECLSPEC bool SDLCALL SDL_WindowSupportsGPUSwapchainComposition( SDL_GPUDevice *device, SDL_Window *window, SDL_GPUSwapchainComposition swapchain_composition); @@ -3203,13 +3203,13 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowSupportsGPUSwapchainComposition( * \param device a GPU context. * \param window an SDL_Window. * \param present_mode the presentation mode to check. - * \returns SDL_TRUE if supported, SDL_FALSE if unsupported (or on error). + * \returns true if supported, false if unsupported (or on error). * * \since This function is available since SDL 3.0.0. * * \sa SDL_ClaimWindowForGPUDevice */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowSupportsGPUPresentMode( +extern SDL_DECLSPEC bool SDLCALL SDL_WindowSupportsGPUPresentMode( SDL_GPUDevice *device, SDL_Window *window, SDL_GPUPresentMode present_mode); @@ -3227,7 +3227,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowSupportsGPUPresentMode( * * \param device a GPU context. * \param window an SDL_Window. - * \returns SDL_TRUE on success, otherwise SDL_FALSE. + * \returns true on success, otherwise false. * * \since This function is available since SDL 3.0.0. * @@ -3236,7 +3236,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowSupportsGPUPresentMode( * \sa SDL_WindowSupportsGPUPresentMode * \sa SDL_WindowSupportsGPUSwapchainComposition */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClaimWindowForGPUDevice( +extern SDL_DECLSPEC bool SDLCALL SDL_ClaimWindowForGPUDevice( SDL_GPUDevice *device, SDL_Window *window); @@ -3269,14 +3269,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_ReleaseWindowFromGPUDevice( * \param window an SDL_Window that has been claimed. * \param swapchain_composition the desired composition of the swapchain. * \param present_mode the desired present mode for the swapchain. - * \returns SDL_TRUE if successful, SDL_FALSE on error. + * \returns true if successful, false on error. * * \since This function is available since SDL 3.0.0. * * \sa SDL_WindowSupportsGPUPresentMode * \sa SDL_WindowSupportsGPUSwapchainComposition */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGPUSwapchainParameters( +extern SDL_DECLSPEC bool SDLCALL SDL_SetGPUSwapchainParameters( SDL_GPUDevice *device, SDL_Window *window, SDL_GPUSwapchainComposition swapchain_composition, @@ -3398,7 +3398,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_WaitForGPUIdle( */ extern SDL_DECLSPEC void SDLCALL SDL_WaitForGPUFences( SDL_GPUDevice *device, - SDL_bool wait_all, + bool wait_all, SDL_GPUFence *const *fences, Uint32 num_fences); @@ -3407,13 +3407,13 @@ extern SDL_DECLSPEC void SDLCALL SDL_WaitForGPUFences( * * \param device a GPU context. * \param fence a fence. - * \returns SDL_TRUE if the fence is signaled, SDL_FALSE if it is not. + * \returns true if the fence is signaled, false if it is not. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SubmitGPUCommandBufferAndAcquireFence */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_QueryGPUFence( +extern SDL_DECLSPEC bool SDLCALL SDL_QueryGPUFence( SDL_GPUDevice *device, SDL_GPUFence *fence); @@ -3458,7 +3458,7 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_GPUTextureFormatTexelBlockSize( * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUTextureSupportsFormat( +extern SDL_DECLSPEC bool SDLCALL SDL_GPUTextureSupportsFormat( SDL_GPUDevice *device, SDL_GPUTextureFormat format, SDL_GPUTextureType type, @@ -3474,7 +3474,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUTextureSupportsFormat( * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUTextureSupportsSampleCount( +extern SDL_DECLSPEC bool SDLCALL SDL_GPUTextureSupportsSampleCount( SDL_GPUDevice *device, SDL_GPUTextureFormat format, SDL_GPUSampleCount sample_count); diff --git a/include/SDL3/SDL_haptic.h b/include/SDL3/SDL_haptic.h index 4cab4217d..167c98612 100644 --- a/include/SDL3/SDL_haptic.h +++ b/include/SDL3/SDL_haptic.h @@ -66,7 +66,7 @@ * Complete example: * * ```c - * SDL_bool test_haptic(SDL_Joystick *joystick) + * bool test_haptic(SDL_Joystick *joystick) * { * SDL_Haptic *haptic; * SDL_HapticEffect effect; @@ -74,12 +74,12 @@ * * // Open the device * haptic = SDL_OpenHapticFromJoystick(joystick); - * if (haptic == NULL) return SDL_FALSE; // Most likely joystick isn't haptic + * if (haptic == NULL) return false; // Most likely joystick isn't haptic * * // See if it can do sine waves * if ((SDL_GetHapticFeatures(haptic) & SDL_HAPTIC_SINE)==0) { * SDL_CloseHaptic(haptic); // No sine effect - * return SDL_FALSE; + * return false; * } * * // Create the effect @@ -106,7 +106,7 @@ * // Close the device * SDL_CloseHaptic(haptic); * - * return SDL_TRUE; // Success + * return true; // Success * } * ``` * @@ -1024,13 +1024,13 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetHapticName(SDL_Haptic *haptic); /** * Query whether or not the current mouse has haptic capabilities. * - * \returns SDL_TRUE if the mouse is haptic or SDL_FALSE if it isn't. + * \returns true if the mouse is haptic or false if it isn't. * * \since This function is available since SDL 3.0.0. * * \sa SDL_OpenHapticFromMouse */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsMouseHaptic(void); +extern SDL_DECLSPEC bool SDLCALL SDL_IsMouseHaptic(void); /** * Try to open a haptic device from the current mouse. @@ -1049,13 +1049,13 @@ extern SDL_DECLSPEC SDL_Haptic * SDLCALL SDL_OpenHapticFromMouse(void); * Query if a joystick has haptic features. * * \param joystick the SDL_Joystick to test for haptic capabilities. - * \returns SDL_TRUE if the joystick is haptic or SDL_FALSE if it isn't. + * \returns true if the joystick is haptic or false if it isn't. * * \since This function is available since SDL 3.0.0. * * \sa SDL_OpenHapticFromJoystick */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsJoystickHaptic(SDL_Joystick *joystick); +extern SDL_DECLSPEC bool SDLCALL SDL_IsJoystickHaptic(SDL_Joystick *joystick); /** * Open a haptic device for use from a joystick device. @@ -1157,14 +1157,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumHapticAxes(SDL_Haptic *haptic); * * \param haptic the SDL_Haptic device to query. * \param effect the desired effect to query. - * \returns SDL_TRUE if the effect is supported or SDL_FALSE if it isn't. + * \returns true if the effect is supported or false if it isn't. * * \since This function is available since SDL 3.0.0. * * \sa SDL_CreateHapticEffect * \sa SDL_GetHapticFeatures */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HapticEffectSupported(SDL_Haptic *haptic, const SDL_HapticEffect *effect); +extern SDL_DECLSPEC bool SDLCALL SDL_HapticEffectSupported(SDL_Haptic *haptic, const SDL_HapticEffect *effect); /** * Create a new haptic effect on a specified device. @@ -1195,7 +1195,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_CreateHapticEffect(SDL_Haptic *haptic, const * \param effect the identifier of the effect to update. * \param data an SDL_HapticEffect structure containing the new effect * properties to use. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1203,7 +1203,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_CreateHapticEffect(SDL_Haptic *haptic, const * \sa SDL_CreateHapticEffect * \sa SDL_RunHapticEffect */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateHapticEffect(SDL_Haptic *haptic, int effect, const SDL_HapticEffect *data); +extern SDL_DECLSPEC bool SDLCALL SDL_UpdateHapticEffect(SDL_Haptic *haptic, int effect, const SDL_HapticEffect *data); /** * Run the haptic effect on its associated haptic device. @@ -1218,7 +1218,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateHapticEffect(SDL_Haptic *haptic, * \param effect the ID of the haptic effect to run. * \param iterations the number of iterations to run the effect; use * `SDL_HAPTIC_INFINITY` to repeat forever. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1227,14 +1227,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateHapticEffect(SDL_Haptic *haptic, * \sa SDL_StopHapticEffect * \sa SDL_StopHapticEffects */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RunHapticEffect(SDL_Haptic *haptic, int effect, Uint32 iterations); +extern SDL_DECLSPEC bool SDLCALL SDL_RunHapticEffect(SDL_Haptic *haptic, int effect, Uint32 iterations); /** * Stop the haptic effect on its associated haptic device. * * \param haptic the SDL_Haptic device to stop the effect on. * \param effect the ID of the haptic effect to stop. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1242,7 +1242,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RunHapticEffect(SDL_Haptic *haptic, int * \sa SDL_RunHapticEffect * \sa SDL_StopHapticEffects */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StopHapticEffect(SDL_Haptic *haptic, int effect); +extern SDL_DECLSPEC bool SDLCALL SDL_StopHapticEffect(SDL_Haptic *haptic, int effect); /** * Destroy a haptic effect on the device. @@ -1266,14 +1266,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyHapticEffect(SDL_Haptic *haptic, int * * \param haptic the SDL_Haptic device to query for the effect status on. * \param effect the ID of the haptic effect to query its status. - * \returns SDL_TRUE if it is playing, SDL_FALSE if it isn't playing or haptic + * \returns true if it is playing, false if it isn't playing or haptic * status isn't supported. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetHapticFeatures */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetHapticEffectStatus(SDL_Haptic *haptic, int effect); +extern SDL_DECLSPEC bool SDLCALL SDL_GetHapticEffectStatus(SDL_Haptic *haptic, int effect); /** * Set the global gain of the specified haptic device. @@ -1288,14 +1288,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetHapticEffectStatus(SDL_Haptic *hapti * \param haptic the SDL_Haptic device to set the gain on. * \param gain value to set the gain to, should be between 0 and 100 (0 - * 100). - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetHapticFeatures */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHapticGain(SDL_Haptic *haptic, int gain); +extern SDL_DECLSPEC bool SDLCALL SDL_SetHapticGain(SDL_Haptic *haptic, int gain); /** * Set the global autocenter of the device. @@ -1307,14 +1307,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHapticGain(SDL_Haptic *haptic, int g * * \param haptic the SDL_Haptic device to set autocentering on. * \param autocenter value to set autocenter to (0-100). - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetHapticFeatures */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHapticAutocenter(SDL_Haptic *haptic, int autocenter); +extern SDL_DECLSPEC bool SDLCALL SDL_SetHapticAutocenter(SDL_Haptic *haptic, int autocenter); /** * Pause a haptic device. @@ -1326,14 +1326,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHapticAutocenter(SDL_Haptic *haptic, * can cause all sorts of weird errors. * * \param haptic the SDL_Haptic device to pause. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_ResumeHaptic */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PauseHaptic(SDL_Haptic *haptic); +extern SDL_DECLSPEC bool SDLCALL SDL_PauseHaptic(SDL_Haptic *haptic); /** * Resume a haptic device. @@ -1341,20 +1341,20 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PauseHaptic(SDL_Haptic *haptic); * Call to unpause after SDL_PauseHaptic(). * * \param haptic the SDL_Haptic device to unpause. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_PauseHaptic */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResumeHaptic(SDL_Haptic *haptic); +extern SDL_DECLSPEC bool SDLCALL SDL_ResumeHaptic(SDL_Haptic *haptic); /** * Stop all the currently playing effects on a haptic device. * * \param haptic the SDL_Haptic device to stop. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1362,25 +1362,25 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResumeHaptic(SDL_Haptic *haptic); * \sa SDL_RunHapticEffect * \sa SDL_StopHapticEffects */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StopHapticEffects(SDL_Haptic *haptic); +extern SDL_DECLSPEC bool SDLCALL SDL_StopHapticEffects(SDL_Haptic *haptic); /** * Check whether rumble is supported on a haptic device. * * \param haptic haptic device to check for rumble support. - * \returns SDL_TRUE if the effect is supported or SDL_FALSE if it isn't. + * \returns true if the effect is supported or false if it isn't. * * \since This function is available since SDL 3.0.0. * * \sa SDL_InitHapticRumble */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HapticRumbleSupported(SDL_Haptic *haptic); +extern SDL_DECLSPEC bool SDLCALL SDL_HapticRumbleSupported(SDL_Haptic *haptic); /** * Initialize a haptic device for simple rumble playback. * * \param haptic the haptic device to initialize for simple rumble playback. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1389,7 +1389,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HapticRumbleSupported(SDL_Haptic *hapti * \sa SDL_StopHapticRumble * \sa SDL_HapticRumbleSupported */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_InitHapticRumble(SDL_Haptic *haptic); +extern SDL_DECLSPEC bool SDLCALL SDL_InitHapticRumble(SDL_Haptic *haptic); /** * Run a simple rumble effect on a haptic device. @@ -1397,7 +1397,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_InitHapticRumble(SDL_Haptic *haptic); * \param haptic the haptic device to play the rumble effect on. * \param strength strength of the rumble to play as a 0-1 float value. * \param length length of the rumble to play in milliseconds. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1405,20 +1405,20 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_InitHapticRumble(SDL_Haptic *haptic); * \sa SDL_InitHapticRumble * \sa SDL_StopHapticRumble */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PlayHapticRumble(SDL_Haptic *haptic, float strength, Uint32 length); +extern SDL_DECLSPEC bool SDLCALL SDL_PlayHapticRumble(SDL_Haptic *haptic, float strength, Uint32 length); /** * Stop the simple rumble on a haptic device. * * \param haptic the haptic device to stop the rumble effect on. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_PlayHapticRumble */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StopHapticRumble(SDL_Haptic *haptic); +extern SDL_DECLSPEC bool SDLCALL SDL_StopHapticRumble(SDL_Haptic *haptic); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/include/SDL3/SDL_hidapi.h b/include/SDL3/SDL_hidapi.h index 66bea9da3..730fdee42 100644 --- a/include/SDL3/SDL_hidapi.h +++ b/include/SDL3/SDL_hidapi.h @@ -537,11 +537,11 @@ extern SDL_DECLSPEC int SDLCALL SDL_hid_get_report_descriptor(SDL_hid_device *de /** * Start or stop a BLE scan on iOS and tvOS to pair Steam Controllers. * - * \param active SDL_TRUE to start the scan, SDL_FALSE to stop the scan. + * \param active true to start the scan, false to stop the scan. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC void SDLCALL SDL_hid_ble_scan(SDL_bool active); +extern SDL_DECLSPEC void SDLCALL SDL_hid_ble_scan(bool active); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h index ab9ce47b5..159a9c11c 100644 --- a/include/SDL3/SDL_hints.h +++ b/include/SDL3/SDL_hints.h @@ -1730,7 +1730,7 @@ extern "C" { * - "0": HIDAPI driver is not used. * - "1": HIDAPI driver is used. * - * This driver doesn't work with the dolphinbar, so the default is SDL_FALSE + * This driver doesn't work with the dolphinbar, so the default is false * for now. * * This hint should be set before enumerating controllers. @@ -4049,7 +4049,7 @@ typedef enum SDL_HintPriority * \param name the hint to set. * \param value the value of the hint variable. * \param priority the SDL_HintPriority level for the hint. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -4060,7 +4060,7 @@ typedef enum SDL_HintPriority * \sa SDL_ResetHint * \sa SDL_SetHint */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriority priority); +extern SDL_DECLSPEC bool SDLCALL SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriority priority); /** * Set a hint with normal priority. @@ -4071,7 +4071,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, c * * \param name the hint to set. * \param value the value of the hint variable. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -4082,7 +4082,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, c * \sa SDL_ResetHint * \sa SDL_SetHintWithPriority */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name, const char *value); +extern SDL_DECLSPEC bool SDLCALL SDL_SetHint(const char *name, const char *value); /** * Reset a hint to the default value. @@ -4092,7 +4092,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name, const char *v * change. * * \param name the hint to set. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -4102,7 +4102,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name, const char *v * \sa SDL_SetHint * \sa SDL_ResetHints */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResetHint(const char *name); +extern SDL_DECLSPEC bool SDLCALL SDL_ResetHint(const char *name); /** * Reset all hints to the default values. @@ -4154,7 +4154,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetHint(const char *name); * \sa SDL_GetHint * \sa SDL_SetHint */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetHintBoolean(const char *name, SDL_bool default_value); +extern SDL_DECLSPEC bool SDLCALL SDL_GetHintBoolean(const char *name, bool default_value); /** * A callback used to send notifications of hint value changes. @@ -4187,7 +4187,7 @@ typedef void(SDLCALL *SDL_HintCallback)(void *userdata, const char *name, const * \param callback An SDL_HintCallback function that will be called when the * hint value changes. * \param userdata a pointer to pass to the callback function. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -4196,7 +4196,7 @@ typedef void(SDLCALL *SDL_HintCallback)(void *userdata, const char *name, const * * \sa SDL_RemoveHintCallback */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata); +extern SDL_DECLSPEC bool SDLCALL SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata); /** * Remove a function watching a particular hint. diff --git a/include/SDL3/SDL_init.h b/include/SDL3/SDL_init.h index 0b3e44c32..8561e2002 100644 --- a/include/SDL3/SDL_init.h +++ b/include/SDL3/SDL_init.h @@ -141,7 +141,7 @@ typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate); * SDL_SetAppMetadataProperty(). * * \param flags subsystem initialization flags. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -153,7 +153,7 @@ typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate); * \sa SDL_SetMainReady * \sa SDL_WasInit */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_Init(SDL_InitFlags flags); +extern SDL_DECLSPEC bool SDLCALL SDL_Init(SDL_InitFlags flags); /** * Compatibility function to initialize the SDL library. @@ -161,7 +161,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_Init(SDL_InitFlags flags); * This function and SDL_Init() are interchangeable. * * \param flags any of the flags used by SDL_Init(); see SDL_Init for details. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -170,7 +170,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_Init(SDL_InitFlags flags); * \sa SDL_Quit * \sa SDL_QuitSubSystem */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_InitSubSystem(SDL_InitFlags flags); +extern SDL_DECLSPEC bool SDLCALL SDL_InitSubSystem(SDL_InitFlags flags); /** * Shut down specific SDL subsystems. @@ -246,7 +246,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_Quit(void); * hash, or whatever makes sense). * \param appidentifier A unique string in reverse-domain format that * identifies this app ("com.example.mygame2"). - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -255,7 +255,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_Quit(void); * * \sa SDL_SetAppMetadataProperty */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAppMetadata(const char *appname, const char *appversion, const char *appidentifier); +extern SDL_DECLSPEC bool SDLCALL SDL_SetAppMetadata(const char *appname, const char *appversion, const char *appidentifier); /** * Specify metadata about your app through a set of properties. @@ -308,7 +308,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAppMetadata(const char *appname, con * * \param name the name of the metadata property to set. * \param value the value of the property, or NULL to remove that property. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -318,7 +318,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAppMetadata(const char *appname, con * \sa SDL_GetAppMetadataProperty * \sa SDL_SetAppMetadata */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAppMetadataProperty(const char *name, const char *value); +extern SDL_DECLSPEC bool SDLCALL SDL_SetAppMetadataProperty(const char *name, const char *value); #define SDL_PROP_APP_METADATA_NAME_STRING "SDL.app.metadata.name" #define SDL_PROP_APP_METADATA_VERSION_STRING "SDL.app.metadata.version" diff --git a/include/SDL3/SDL_iostream.h b/include/SDL3/SDL_iostream.h index f026cca31..5619ff6af 100644 --- a/include/SDL3/SDL_iostream.h +++ b/include/SDL3/SDL_iostream.h @@ -140,9 +140,9 @@ typedef struct SDL_IOStreamInterface * SDL_IOStatus enum. You do not have to explicitly set this on * a successful flush. * - * \return SDL_TRUE if successful or SDL_FALSE on write error when flushing data. + * \return true if successful or false on write error when flushing data. */ - SDL_bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status); + bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status); /** * Close and free any allocated resources. @@ -150,9 +150,9 @@ typedef struct SDL_IOStreamInterface * The SDL_IOStream is still destroyed even if this fails, so clean up anything * even if flushing to disk returns an error. * - * \return SDL_TRUE if successful or SDL_FALSE on write error when flushing data. + * \return true if successful or false on write error when flushing data. */ - SDL_bool (SDLCALL *close)(void *userdata); + bool (SDLCALL *close)(void *userdata); } SDL_IOStreamInterface; @@ -403,21 +403,21 @@ extern SDL_DECLSPEC SDL_IOStream * SDLCALL SDL_OpenIO(const SDL_IOStreamInterfac * * SDL_CloseIO() closes and cleans up the SDL_IOStream stream. It releases any * resources used by the stream and frees the SDL_IOStream itself. This - * returns SDL_TRUE on success, or SDL_FALSE if the stream failed to flush to + * returns true on success, or false if the stream failed to flush to * its output (e.g. to disk). * * Note that if this fails to flush the stream to disk, this function reports * an error, but the SDL_IOStream is still invalid once this function returns. * * \param context SDL_IOStream structure to close. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_OpenIO */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CloseIO(SDL_IOStream *context); +extern SDL_DECLSPEC bool SDLCALL SDL_CloseIO(SDL_IOStream *context); /** * Get the properties associated with an SDL_IOStream. @@ -605,7 +605,7 @@ extern SDL_DECLSPEC size_t SDLCALL SDL_IOvprintf(SDL_IOStream *context, SDL_PRIN * guarantees that any pending data is sent. * * \param context SDL_IOStream structure to flush. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -613,7 +613,7 @@ extern SDL_DECLSPEC size_t SDLCALL SDL_IOvprintf(SDL_IOStream *context, SDL_PRIN * \sa SDL_OpenIO * \sa SDL_WriteIO */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FlushIO(SDL_IOStream *context); +extern SDL_DECLSPEC bool SDLCALL SDL_FlushIO(SDL_IOStream *context); /** * Load all the data from an SDL data stream. @@ -627,7 +627,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FlushIO(SDL_IOStream *context); * \param src the SDL_IOStream to read all available data from. * \param datasize a pointer filled in with the number of bytes read, may be * NULL. - * \param closeio if SDL_TRUE, calls SDL_CloseIO() on `src` before returning, + * \param closeio if true, calls SDL_CloseIO() on `src` before returning, * even in the case of an error. * \returns the data or NULL on failure; call SDL_GetError() for more * information. @@ -636,7 +636,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FlushIO(SDL_IOStream *context); * * \sa SDL_LoadFile */ -extern SDL_DECLSPEC void * SDLCALL SDL_LoadFile_IO(SDL_IOStream *src, size_t *datasize, SDL_bool closeio); +extern SDL_DECLSPEC void * SDLCALL SDL_LoadFile_IO(SDL_IOStream *src, size_t *datasize, bool closeio); /** * Load all the data from a file path. @@ -670,24 +670,24 @@ extern SDL_DECLSPEC void * SDLCALL SDL_LoadFile(const char *file, size_t *datasi * * \param src the SDL_IOStream to read from. * \param value a pointer filled in with the data read. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU8(SDL_IOStream *src, Uint8 *value); +extern SDL_DECLSPEC bool SDLCALL SDL_ReadU8(SDL_IOStream *src, Uint8 *value); /** * Use this function to read a signed byte from an SDL_IOStream. * * \param src the SDL_IOStream to read from. * \param value a pointer filled in with the data read. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS8(SDL_IOStream *src, Sint8 *value); +extern SDL_DECLSPEC bool SDLCALL SDL_ReadS8(SDL_IOStream *src, Sint8 *value); /** * Use this function to read 16 bits of little-endian data from an @@ -698,12 +698,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS8(SDL_IOStream *src, Sint8 *value) * * \param src the stream from which to read data. * \param value a pointer filled in with the data read. - * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call + * \returns true on successful write or false on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU16LE(SDL_IOStream *src, Uint16 *value); +extern SDL_DECLSPEC bool SDLCALL SDL_ReadU16LE(SDL_IOStream *src, Uint16 *value); /** * Use this function to read 16 bits of little-endian data from an @@ -714,12 +714,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU16LE(SDL_IOStream *src, Uint16 *va * * \param src the stream from which to read data. * \param value a pointer filled in with the data read. - * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call + * \returns true on successful write or false on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS16LE(SDL_IOStream *src, Sint16 *value); +extern SDL_DECLSPEC bool SDLCALL SDL_ReadS16LE(SDL_IOStream *src, Sint16 *value); /** * Use this function to read 16 bits of big-endian data from an SDL_IOStream @@ -730,12 +730,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS16LE(SDL_IOStream *src, Sint16 *va * * \param src the stream from which to read data. * \param value a pointer filled in with the data read. - * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call + * \returns true on successful write or false on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU16BE(SDL_IOStream *src, Uint16 *value); +extern SDL_DECLSPEC bool SDLCALL SDL_ReadU16BE(SDL_IOStream *src, Uint16 *value); /** * Use this function to read 16 bits of big-endian data from an SDL_IOStream @@ -746,12 +746,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU16BE(SDL_IOStream *src, Uint16 *va * * \param src the stream from which to read data. * \param value a pointer filled in with the data read. - * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call + * \returns true on successful write or false on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS16BE(SDL_IOStream *src, Sint16 *value); +extern SDL_DECLSPEC bool SDLCALL SDL_ReadS16BE(SDL_IOStream *src, Sint16 *value); /** * Use this function to read 32 bits of little-endian data from an @@ -762,12 +762,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS16BE(SDL_IOStream *src, Sint16 *va * * \param src the stream from which to read data. * \param value a pointer filled in with the data read. - * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call + * \returns true on successful write or false on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU32LE(SDL_IOStream *src, Uint32 *value); +extern SDL_DECLSPEC bool SDLCALL SDL_ReadU32LE(SDL_IOStream *src, Uint32 *value); /** * Use this function to read 32 bits of little-endian data from an @@ -778,12 +778,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU32LE(SDL_IOStream *src, Uint32 *va * * \param src the stream from which to read data. * \param value a pointer filled in with the data read. - * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call + * \returns true on successful write or false on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS32LE(SDL_IOStream *src, Sint32 *value); +extern SDL_DECLSPEC bool SDLCALL SDL_ReadS32LE(SDL_IOStream *src, Sint32 *value); /** * Use this function to read 32 bits of big-endian data from an SDL_IOStream @@ -794,12 +794,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS32LE(SDL_IOStream *src, Sint32 *va * * \param src the stream from which to read data. * \param value a pointer filled in with the data read. - * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call + * \returns true on successful write or false on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU32BE(SDL_IOStream *src, Uint32 *value); +extern SDL_DECLSPEC bool SDLCALL SDL_ReadU32BE(SDL_IOStream *src, Uint32 *value); /** * Use this function to read 32 bits of big-endian data from an SDL_IOStream @@ -810,12 +810,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU32BE(SDL_IOStream *src, Uint32 *va * * \param src the stream from which to read data. * \param value a pointer filled in with the data read. - * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call + * \returns true on successful write or false on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS32BE(SDL_IOStream *src, Sint32 *value); +extern SDL_DECLSPEC bool SDLCALL SDL_ReadS32BE(SDL_IOStream *src, Sint32 *value); /** * Use this function to read 64 bits of little-endian data from an @@ -826,12 +826,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS32BE(SDL_IOStream *src, Sint32 *va * * \param src the stream from which to read data. * \param value a pointer filled in with the data read. - * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call + * \returns true on successful write or false on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU64LE(SDL_IOStream *src, Uint64 *value); +extern SDL_DECLSPEC bool SDLCALL SDL_ReadU64LE(SDL_IOStream *src, Uint64 *value); /** * Use this function to read 64 bits of little-endian data from an @@ -842,12 +842,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU64LE(SDL_IOStream *src, Uint64 *va * * \param src the stream from which to read data. * \param value a pointer filled in with the data read. - * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call + * \returns true on successful write or false on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS64LE(SDL_IOStream *src, Sint64 *value); +extern SDL_DECLSPEC bool SDLCALL SDL_ReadS64LE(SDL_IOStream *src, Sint64 *value); /** * Use this function to read 64 bits of big-endian data from an SDL_IOStream @@ -858,12 +858,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS64LE(SDL_IOStream *src, Sint64 *va * * \param src the stream from which to read data. * \param value a pointer filled in with the data read. - * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call + * \returns true on successful write or false on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU64BE(SDL_IOStream *src, Uint64 *value); +extern SDL_DECLSPEC bool SDLCALL SDL_ReadU64BE(SDL_IOStream *src, Uint64 *value); /** * Use this function to read 64 bits of big-endian data from an SDL_IOStream @@ -874,12 +874,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU64BE(SDL_IOStream *src, Uint64 *va * * \param src the stream from which to read data. * \param value a pointer filled in with the data read. - * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call + * \returns true on successful write or false on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS64BE(SDL_IOStream *src, Sint64 *value); +extern SDL_DECLSPEC bool SDLCALL SDL_ReadS64BE(SDL_IOStream *src, Sint64 *value); /* @} *//* Read endian functions */ /** @@ -894,24 +894,24 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS64BE(SDL_IOStream *src, Sint64 *va * * \param dst the SDL_IOStream to write to. * \param value the byte value to write. - * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call + * \returns true on successful write or false on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU8(SDL_IOStream *dst, Uint8 value); +extern SDL_DECLSPEC bool SDLCALL SDL_WriteU8(SDL_IOStream *dst, Uint8 value); /** * Use this function to write a signed byte to an SDL_IOStream. * * \param dst the SDL_IOStream to write to. * \param value the byte value to write. - * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call + * \returns true on successful write or false on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS8(SDL_IOStream *dst, Sint8 value); +extern SDL_DECLSPEC bool SDLCALL SDL_WriteS8(SDL_IOStream *dst, Sint8 value); /** * Use this function to write 16 bits in native format to an SDL_IOStream as @@ -923,12 +923,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS8(SDL_IOStream *dst, Sint8 value) * * \param dst the stream to which data will be written. * \param value the data to be written, in native format. - * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call + * \returns true on successful write or false on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU16LE(SDL_IOStream *dst, Uint16 value); +extern SDL_DECLSPEC bool SDLCALL SDL_WriteU16LE(SDL_IOStream *dst, Uint16 value); /** * Use this function to write 16 bits in native format to an SDL_IOStream as @@ -940,12 +940,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU16LE(SDL_IOStream *dst, Uint16 va * * \param dst the stream to which data will be written. * \param value the data to be written, in native format. - * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call + * \returns true on successful write or false on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS16LE(SDL_IOStream *dst, Sint16 value); +extern SDL_DECLSPEC bool SDLCALL SDL_WriteS16LE(SDL_IOStream *dst, Sint16 value); /** * Use this function to write 16 bits in native format to an SDL_IOStream as @@ -956,12 +956,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS16LE(SDL_IOStream *dst, Sint16 va * * \param dst the stream to which data will be written. * \param value the data to be written, in native format. - * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call + * \returns true on successful write or false on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU16BE(SDL_IOStream *dst, Uint16 value); +extern SDL_DECLSPEC bool SDLCALL SDL_WriteU16BE(SDL_IOStream *dst, Uint16 value); /** * Use this function to write 16 bits in native format to an SDL_IOStream as @@ -972,12 +972,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU16BE(SDL_IOStream *dst, Uint16 va * * \param dst the stream to which data will be written. * \param value the data to be written, in native format. - * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call + * \returns true on successful write or false on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS16BE(SDL_IOStream *dst, Sint16 value); +extern SDL_DECLSPEC bool SDLCALL SDL_WriteS16BE(SDL_IOStream *dst, Sint16 value); /** * Use this function to write 32 bits in native format to an SDL_IOStream as @@ -989,12 +989,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS16BE(SDL_IOStream *dst, Sint16 va * * \param dst the stream to which data will be written. * \param value the data to be written, in native format. - * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call + * \returns true on successful write or false on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU32LE(SDL_IOStream *dst, Uint32 value); +extern SDL_DECLSPEC bool SDLCALL SDL_WriteU32LE(SDL_IOStream *dst, Uint32 value); /** * Use this function to write 32 bits in native format to an SDL_IOStream as @@ -1006,12 +1006,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU32LE(SDL_IOStream *dst, Uint32 va * * \param dst the stream to which data will be written. * \param value the data to be written, in native format. - * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call + * \returns true on successful write or false on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS32LE(SDL_IOStream *dst, Sint32 value); +extern SDL_DECLSPEC bool SDLCALL SDL_WriteS32LE(SDL_IOStream *dst, Sint32 value); /** * Use this function to write 32 bits in native format to an SDL_IOStream as @@ -1022,12 +1022,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS32LE(SDL_IOStream *dst, Sint32 va * * \param dst the stream to which data will be written. * \param value the data to be written, in native format. - * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call + * \returns true on successful write or false on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU32BE(SDL_IOStream *dst, Uint32 value); +extern SDL_DECLSPEC bool SDLCALL SDL_WriteU32BE(SDL_IOStream *dst, Uint32 value); /** * Use this function to write 32 bits in native format to an SDL_IOStream as @@ -1038,12 +1038,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU32BE(SDL_IOStream *dst, Uint32 va * * \param dst the stream to which data will be written. * \param value the data to be written, in native format. - * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call + * \returns true on successful write or false on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS32BE(SDL_IOStream *dst, Sint32 value); +extern SDL_DECLSPEC bool SDLCALL SDL_WriteS32BE(SDL_IOStream *dst, Sint32 value); /** * Use this function to write 64 bits in native format to an SDL_IOStream as @@ -1055,12 +1055,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS32BE(SDL_IOStream *dst, Sint32 va * * \param dst the stream to which data will be written. * \param value the data to be written, in native format. - * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call + * \returns true on successful write or false on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU64LE(SDL_IOStream *dst, Uint64 value); +extern SDL_DECLSPEC bool SDLCALL SDL_WriteU64LE(SDL_IOStream *dst, Uint64 value); /** * Use this function to write 64 bits in native format to an SDL_IOStream as @@ -1072,12 +1072,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU64LE(SDL_IOStream *dst, Uint64 va * * \param dst the stream to which data will be written. * \param value the data to be written, in native format. - * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call + * \returns true on successful write or false on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS64LE(SDL_IOStream *dst, Sint64 value); +extern SDL_DECLSPEC bool SDLCALL SDL_WriteS64LE(SDL_IOStream *dst, Sint64 value); /** * Use this function to write 64 bits in native format to an SDL_IOStream as @@ -1088,12 +1088,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS64LE(SDL_IOStream *dst, Sint64 va * * \param dst the stream to which data will be written. * \param value the data to be written, in native format. - * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call + * \returns true on successful write or false on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU64BE(SDL_IOStream *dst, Uint64 value); +extern SDL_DECLSPEC bool SDLCALL SDL_WriteU64BE(SDL_IOStream *dst, Uint64 value); /** * Use this function to write 64 bits in native format to an SDL_IOStream as @@ -1104,12 +1104,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU64BE(SDL_IOStream *dst, Uint64 va * * \param dst the stream to which data will be written. * \param value the data to be written, in native format. - * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call + * \returns true on successful write or false on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS64BE(SDL_IOStream *dst, Sint64 value); +extern SDL_DECLSPEC bool SDLCALL SDL_WriteS64BE(SDL_IOStream *dst, Sint64 value); /* @} *//* Write endian functions */ diff --git a/include/SDL3/SDL_joystick.h b/include/SDL3/SDL_joystick.h index 7c043090d..7d248b306 100644 --- a/include/SDL3/SDL_joystick.h +++ b/include/SDL3/SDL_joystick.h @@ -190,13 +190,13 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockJoysticks(void) SDL_RELEASE(SDL_joyst /** * Return whether a joystick is currently connected. * - * \returns SDL_TRUE if a joystick is connected, SDL_FALSE otherwise. + * \returns true if a joystick is connected, false otherwise. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetJoysticks */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasJoystick(void); +extern SDL_DECLSPEC bool SDLCALL SDL_HasJoystick(void); /** * Get a list of currently connected joysticks. @@ -450,11 +450,11 @@ typedef struct SDL_VirtualJoystickDesc void *userdata; /**< User data pointer passed to callbacks */ void (SDLCALL *Update)(void *userdata); /**< Called when the joystick state should be updated */ void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index); /**< Called when the player index is set */ - SDL_bool (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble); /**< Implements SDL_RumbleJoystick() */ - SDL_bool (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble); /**< Implements SDL_RumbleJoystickTriggers() */ - SDL_bool (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue); /**< Implements SDL_SetJoystickLED() */ - SDL_bool (SDLCALL *SendEffect)(void *userdata, const void *data, int size); /**< Implements SDL_SendJoystickEffect() */ - SDL_bool (SDLCALL *SetSensorsEnabled)(void *userdata, SDL_bool enabled); /**< Implements SDL_SetGamepadSensorEnabled() */ + bool (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble); /**< Implements SDL_RumbleJoystick() */ + bool (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble); /**< Implements SDL_RumbleJoystickTriggers() */ + bool (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue); /**< Implements SDL_SetJoystickLED() */ + bool (SDLCALL *SendEffect)(void *userdata, const void *data, int size); /**< Implements SDL_SendJoystickEffect() */ + bool (SDLCALL *SetSensorsEnabled)(void *userdata, bool enabled); /**< Implements SDL_SetGamepadSensorEnabled() */ void (SDLCALL *Cleanup)(void *userdata); /**< Cleans up the userdata when the joystick is detached */ } SDL_VirtualJoystickDesc; @@ -486,24 +486,24 @@ extern SDL_DECLSPEC SDL_JoystickID SDLCALL SDL_AttachVirtualJoystick(const SDL_V * * \param instance_id the joystick instance ID, previously returned from * SDL_AttachVirtualJoystick(). - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_AttachVirtualJoystick */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_DetachVirtualJoystick(SDL_JoystickID instance_id); +extern SDL_DECLSPEC bool SDLCALL SDL_DetachVirtualJoystick(SDL_JoystickID instance_id); /** * Query whether or not a joystick is virtual. * * \param instance_id the joystick instance ID. - * \returns SDL_TRUE if the joystick is virtual, SDL_FALSE otherwise. + * \returns true if the joystick is virtual, false otherwise. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsJoystickVirtual(SDL_JoystickID instance_id); +extern SDL_DECLSPEC bool SDLCALL SDL_IsJoystickVirtual(SDL_JoystickID instance_id); /** * Set the state of an axis on an opened virtual joystick. @@ -521,12 +521,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsJoystickVirtual(SDL_JoystickID instan * \param joystick the virtual joystick on which to set state. * \param axis the index of the axis on the virtual joystick to update. * \param value the new value for the specified axis. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value); +extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value); /** * Generate ball motion on an opened virtual joystick. @@ -541,12 +541,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualAxis(SDL_Joystick *jo * \param ball the index of the ball on the virtual joystick to update. * \param xrel the relative motion on the X axis. * \param yrel the relative motion on the Y axis. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualBall(SDL_Joystick *joystick, int ball, Sint16 xrel, Sint16 yrel); +extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualBall(SDL_Joystick *joystick, int ball, Sint16 xrel, Sint16 yrel); /** * Set the state of a button on an opened virtual joystick. @@ -559,13 +559,13 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualBall(SDL_Joystick *jo * * \param joystick the virtual joystick on which to set state. * \param button the index of the button on the virtual joystick to update. - * \param down SDL_TRUE if the button is pressed, SDL_FALSE otherwise. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \param down true if the button is pressed, false otherwise. + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualButton(SDL_Joystick *joystick, int button, SDL_bool down); +extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualButton(SDL_Joystick *joystick, int button, bool down); /** * Set the state of a hat on an opened virtual joystick. @@ -579,12 +579,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualButton(SDL_Joystick * * \param joystick the virtual joystick on which to set state. * \param hat the index of the hat on the virtual joystick to update. * \param value the new value for the specified hat. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value); +extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value); /** * Set touchpad finger state on an opened virtual joystick. @@ -599,19 +599,19 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualHat(SDL_Joystick *joy * \param touchpad the index of the touchpad on the virtual joystick to * update. * \param finger the index of the finger on the touchpad to set. - * \param down SDL_TRUE if the finger is pressed, SDL_FALSE if the finger is + * \param down true if the finger is pressed, false if the finger is * released. * \param x the x coordinate of the finger on the touchpad, normalized 0 to 1, * with the origin in the upper left. * \param y the y coordinate of the finger on the touchpad, normalized 0 to 1, * with the origin in the upper left. * \param pressure the pressure of the finger. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualTouchpad(SDL_Joystick *joystick, int touchpad, int finger, SDL_bool down, float x, float y, float pressure); +extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualTouchpad(SDL_Joystick *joystick, int touchpad, int finger, bool down, float x, float y, float pressure); /** * Send a sensor update for an opened virtual joystick. @@ -628,12 +628,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualTouchpad(SDL_Joystick * the sensor reading. * \param data the data associated with the sensor reading. * \param num_values the number of values pointed to by `data`. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SendJoystickVirtualSensorData(SDL_Joystick *joystick, SDL_SensorType type, Uint64 sensor_timestamp, const float *data, int num_values); +extern SDL_DECLSPEC bool SDLCALL SDL_SendJoystickVirtualSensorData(SDL_Joystick *joystick, SDL_SensorType type, Uint64 sensor_timestamp, const float *data, int num_values); /** * Get the properties associated with a joystick. @@ -712,14 +712,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetJoystickPlayerIndex(SDL_Joystick *joystic * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick(). * \param player_index player index to assign to this joystick, or -1 to clear * the player index and turn off player LEDs. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetJoystickPlayerIndex */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickPlayerIndex(SDL_Joystick *joystick, int player_index); +extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickPlayerIndex(SDL_Joystick *joystick, int player_index); /** * Get the implementation-dependent GUID for the joystick. @@ -841,12 +841,12 @@ extern SDL_DECLSPEC void SDLCALL SDL_GetJoystickGUIDInfo(SDL_GUID guid, Uint16 * * Get the status of a specified joystick. * * \param joystick the joystick to query. - * \returns SDL_TRUE if the joystick has been opened, SDL_FALSE if it has not; + * \returns true if the joystick has been opened, false if it has not; * call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_JoystickConnected(SDL_Joystick *joystick); +extern SDL_DECLSPEC bool SDLCALL SDL_JoystickConnected(SDL_Joystick *joystick); /** * Get the instance ID of an opened joystick. @@ -946,7 +946,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumJoystickButtons(SDL_Joystick *joystick * \sa SDL_JoystickEventsEnabled * \sa SDL_UpdateJoysticks */ -extern SDL_DECLSPEC void SDLCALL SDL_SetJoystickEventsEnabled(SDL_bool enabled); +extern SDL_DECLSPEC void SDLCALL SDL_SetJoystickEventsEnabled(bool enabled); /** * Query the state of joystick event processing. @@ -955,14 +955,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetJoystickEventsEnabled(SDL_bool enabled); * yourself and check the state of the joystick when you want joystick * information. * - * \returns SDL_TRUE if joystick events are being processed, SDL_FALSE + * \returns true if joystick events are being processed, false * otherwise. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetJoystickEventsEnabled */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_JoystickEventsEnabled(void); +extern SDL_DECLSPEC bool SDLCALL SDL_JoystickEventsEnabled(void); /** * Update the current state of the open joysticks. @@ -1008,11 +1008,11 @@ extern SDL_DECLSPEC Sint16 SDLCALL SDL_GetJoystickAxis(SDL_Joystick *joystick, i * \param joystick an SDL_Joystick structure containing joystick information. * \param axis the axis to query; the axis indices start at index 0. * \param state upon return, the initial value is supplied here. - * \returns SDL_TRUE if this axis has any initial value, or SDL_FALSE if not. + * \returns true if this axis has any initial value, or false if not. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetJoystickAxisInitialState(SDL_Joystick *joystick, int axis, Sint16 *state); +extern SDL_DECLSPEC bool SDLCALL SDL_GetJoystickAxisInitialState(SDL_Joystick *joystick, int axis, Sint16 *state); /** * Get the ball axis change since the last poll. @@ -1026,14 +1026,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetJoystickAxisInitialState(SDL_Joystic * \param ball the ball index to query; ball indices start at index 0. * \param dx stores the difference in the x axis position since the last poll. * \param dy stores the difference in the y axis position since the last poll. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetNumJoystickBalls */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetJoystickBall(SDL_Joystick *joystick, int ball, int *dx, int *dy); +extern SDL_DECLSPEC bool SDLCALL SDL_GetJoystickBall(SDL_Joystick *joystick, int ball, int *dx, int *dy); /** * Get the current state of a POV hat on a joystick. @@ -1066,13 +1066,13 @@ extern SDL_DECLSPEC Uint8 SDLCALL SDL_GetJoystickHat(SDL_Joystick *joystick, int * \param joystick an SDL_Joystick structure containing joystick information. * \param button the button index to get the state from; indices start at * index 0. - * \returns SDL_TRUE if the button is pressed, SDL_FALSE otherwise. + * \returns true if the button is pressed, false otherwise. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetNumJoystickButtons */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetJoystickButton(SDL_Joystick *joystick, int button); +extern SDL_DECLSPEC bool SDLCALL SDL_GetJoystickButton(SDL_Joystick *joystick, int button); /** * Start a rumble effect. @@ -1089,11 +1089,11 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetJoystickButton(SDL_Joystick *joystic * \param high_frequency_rumble the intensity of the high frequency (right) * rumble motor, from 0 to 0xFFFF. * \param duration_ms the duration of the rumble effect, in milliseconds. - * \returns SDL_TRUE, or SDL_FALSE if rumble isn't supported on this joystick. + * \returns true, or false if rumble isn't supported on this joystick. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RumbleJoystick(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); +extern SDL_DECLSPEC bool SDLCALL SDL_RumbleJoystick(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); /** * Start a rumble effect in the joystick's triggers. @@ -1115,14 +1115,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RumbleJoystick(SDL_Joystick *joystick, * \param right_rumble the intensity of the right trigger rumble motor, from 0 * to 0xFFFF. * \param duration_ms the duration of the rumble effect, in milliseconds. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_RumbleJoystick */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RumbleJoystickTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms); +extern SDL_DECLSPEC bool SDLCALL SDL_RumbleJoystickTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms); /** * Update a joystick's LED color. @@ -1137,12 +1137,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RumbleJoystickTriggers(SDL_Joystick *jo * \param red the intensity of the red LED. * \param green the intensity of the green LED. * \param blue the intensity of the blue LED. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue); +extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue); /** * Send a joystick specific effect packet. @@ -1150,12 +1150,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickLED(SDL_Joystick *joystick, * \param joystick the joystick to affect. * \param data the data to send to the joystick. * \param size the size of the data to send to the joystick. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SendJoystickEffect(SDL_Joystick *joystick, const void *data, int size); +extern SDL_DECLSPEC bool SDLCALL SDL_SendJoystickEffect(SDL_Joystick *joystick, const void *data, int size); /** * Close a joystick previously opened with SDL_OpenJoystick(). diff --git a/include/SDL3/SDL_keyboard.h b/include/SDL3/SDL_keyboard.h index 0cd3d8e1f..b9c32aa5b 100644 --- a/include/SDL3/SDL_keyboard.h +++ b/include/SDL3/SDL_keyboard.h @@ -59,13 +59,13 @@ typedef Uint32 SDL_KeyboardID; /** * Return whether a keyboard is currently connected. * - * \returns SDL_TRUE if a keyboard is connected, SDL_FALSE otherwise. + * \returns true if a keyboard is connected, false otherwise. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetKeyboards */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasKeyboard(void); +extern SDL_DECLSPEC bool SDLCALL SDL_HasKeyboard(void); /** * Get a list of currently connected keyboards. @@ -119,8 +119,8 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void); * valid for the whole lifetime of the application and should not be freed by * the caller. * - * A array element with a value of SDL_TRUE means that the key is pressed and - * a value of SDL_FALSE means that it is not. Indexes into this array are + * A array element with a value of true means that the key is pressed and + * a value of false means that it is not. Indexes into this array are * obtained by using SDL_Scancode values. * * Use SDL_PumpEvents() to update the state array. @@ -141,7 +141,7 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void); * \sa SDL_PumpEvents * \sa SDL_ResetKeyboard */ -extern SDL_DECLSPEC const SDL_bool * SDLCALL SDL_GetKeyboardState(int *numkeys); +extern SDL_DECLSPEC const bool * SDLCALL SDL_GetKeyboardState(int *numkeys); /** * Clear the state of the keyboard. @@ -192,13 +192,13 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate); * * If you want to get the keycode as it would be delivered in key events, * including options specified in SDL_HINT_KEYCODE_OPTIONS, then you should - * pass `key_event` as SDL_TRUE. Otherwise this function simply translates the + * pass `key_event` as true. Otherwise this function simply translates the * scancode based on the given modifier state. * * \param scancode the desired SDL_Scancode to query. * \param modstate the modifier state to use when translating the scancode to * a keycode. - * \param key_event SDL_TRUE if the keycode will be used in key events. + * \param key_event true if the keycode will be used in key events. * \returns the SDL_Keycode that corresponds to the given SDL_Scancode. * * \since This function is available since SDL 3.0.0. @@ -206,7 +206,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate); * \sa SDL_GetKeyName * \sa SDL_GetScancodeFromKey */ -extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate, SDL_bool key_event); +extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate, bool key_event); /** * Get the scancode corresponding to the given key code according to the @@ -234,14 +234,14 @@ extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key, * \param name the name to use for the scancode, encoded as UTF-8. The string * is not copied, so the pointer given to this function must stay * valid while SDL is being used. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetScancodeName */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetScancodeName(SDL_Scancode scancode, const char *name); +extern SDL_DECLSPEC bool SDLCALL SDL_SetScancodeName(SDL_Scancode scancode, const char *name); /** * Get a human-readable name for a scancode. @@ -325,7 +325,7 @@ extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name); * On some platforms using this function shows the screen keyboard. * * \param window the window to enable text input. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -335,7 +335,7 @@ extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name); * \sa SDL_StopTextInput * \sa SDL_TextInputActive */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StartTextInput(SDL_Window *window); +extern SDL_DECLSPEC bool SDLCALL SDL_StartTextInput(SDL_Window *window); /** * Text input type. @@ -403,10 +403,10 @@ typedef enum SDL_Capitalization * SDL_TEXTINPUT_TYPE_TEXT_NAME, and SDL_CAPITALIZE_NONE for e-mail * addresses, usernames, and passwords. * - `SDL_PROP_TEXTINPUT_AUTOCORRECT_BOOLEAN` - true to enable auto completion - * and auto correction, defaults to SDL_TRUE. + * and auto correction, defaults to true. * - `SDL_PROP_TEXTINPUT_MULTILINE_BOOLEAN` - true if multiple lines of text - * are allowed. This defaults to SDL_TRUE if SDL_HINT_RETURN_KEY_HIDES_IME - * is "0" or is not set, and defaults to SDL_FALSE if + * are allowed. This defaults to true if SDL_HINT_RETURN_KEY_HIDES_IME + * is "0" or is not set, and defaults to false if * SDL_HINT_RETURN_KEY_HIDES_IME is "1". * * On Android you can directly specify the input type: @@ -417,7 +417,7 @@ typedef enum SDL_Capitalization * * \param window the window to enable text input. * \param props the properties to use. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -427,7 +427,7 @@ typedef enum SDL_Capitalization * \sa SDL_StopTextInput * \sa SDL_TextInputActive */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StartTextInputWithProperties(SDL_Window *window, SDL_PropertiesID props); +extern SDL_DECLSPEC bool SDLCALL SDL_StartTextInputWithProperties(SDL_Window *window, SDL_PropertiesID props); #define SDL_PROP_TEXTINPUT_TYPE_NUMBER "SDL.textinput.type" #define SDL_PROP_TEXTINPUT_CAPITALIZATION_NUMBER "SDL.textinput.capitalization" @@ -439,13 +439,13 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StartTextInputWithProperties(SDL_Window * Check whether or not Unicode text input events are enabled for a window. * * \param window the window to check. - * \returns SDL_TRUE if text input events are enabled else SDL_FALSE. + * \returns true if text input events are enabled else false. * * \since This function is available since SDL 3.0.0. * * \sa SDL_StartTextInput */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TextInputActive(SDL_Window *window); +extern SDL_DECLSPEC bool SDLCALL SDL_TextInputActive(SDL_Window *window); /** * Stop receiving any text input events in a window. @@ -454,20 +454,20 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TextInputActive(SDL_Window *window); * it. * * \param window the window to disable text input. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_StartTextInput */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StopTextInput(SDL_Window *window); +extern SDL_DECLSPEC bool SDLCALL SDL_StopTextInput(SDL_Window *window); /** * Dismiss the composition window/IME without disabling the subsystem. * * \param window the window to affect. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -475,7 +475,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StopTextInput(SDL_Window *window); * \sa SDL_StartTextInput * \sa SDL_StopTextInput */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearComposition(SDL_Window *window); +extern SDL_DECLSPEC bool SDLCALL SDL_ClearComposition(SDL_Window *window); /** * Set the area used to type Unicode text input. @@ -488,7 +488,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearComposition(SDL_Window *window); * coordinates, or NULL to clear it. * \param cursor the offset of the current cursor location relative to * `rect->x`, in window coordinates. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -496,7 +496,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearComposition(SDL_Window *window); * \sa SDL_GetTextInputArea * \sa SDL_StartTextInput */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextInputArea(SDL_Window *window, const SDL_Rect *rect, int cursor); +extern SDL_DECLSPEC bool SDLCALL SDL_SetTextInputArea(SDL_Window *window, const SDL_Rect *rect, int cursor); /** * Get the area used to type Unicode text input. @@ -508,39 +508,39 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextInputArea(SDL_Window *window, co * may be NULL. * \param cursor a pointer to the offset of the current cursor location * relative to `rect->x`, may be NULL. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetTextInputArea */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextInputArea(SDL_Window *window, SDL_Rect *rect, int *cursor); +extern SDL_DECLSPEC bool SDLCALL SDL_GetTextInputArea(SDL_Window *window, SDL_Rect *rect, int *cursor); /** * Check whether the platform has screen keyboard support. * - * \returns SDL_TRUE if the platform has some screen keyboard support or - * SDL_FALSE if not. + * \returns true if the platform has some screen keyboard support or + * false if not. * * \since This function is available since SDL 3.0.0. * * \sa SDL_StartTextInput * \sa SDL_ScreenKeyboardShown */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport(void); +extern SDL_DECLSPEC bool SDLCALL SDL_HasScreenKeyboardSupport(void); /** * Check whether the screen keyboard is shown for given window. * * \param window the window for which screen keyboard should be queried. - * \returns SDL_TRUE if screen keyboard is shown or SDL_FALSE if not. + * \returns true if screen keyboard is shown or false if not. * * \since This function is available since SDL 3.0.0. * * \sa SDL_HasScreenKeyboardSupport */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ScreenKeyboardShown(SDL_Window *window); +extern SDL_DECLSPEC bool SDLCALL SDL_ScreenKeyboardShown(SDL_Window *window); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/include/SDL3/SDL_log.h b/include/SDL3/SDL_log.h index f2891c8bd..9bab20dd2 100644 --- a/include/SDL3/SDL_log.h +++ b/include/SDL3/SDL_log.h @@ -200,7 +200,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_ResetLogPriorities(void); * \param priority the SDL_LogPriority to modify. * \param prefix the prefix to use for that log priority, or NULL to use no * prefix. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -210,7 +210,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_ResetLogPriorities(void); * \sa SDL_SetLogPriorities * \sa SDL_SetLogPriority */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetLogPriorityPrefix(SDL_LogPriority priority, const char *prefix); +extern SDL_DECLSPEC bool SDLCALL SDL_SetLogPriorityPrefix(SDL_LogPriority priority, const char *prefix); /** * Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO. diff --git a/include/SDL3/SDL_main.h b/include/SDL3/SDL_main.h index 82e60510c..d9a497c05 100644 --- a/include/SDL3/SDL_main.h +++ b/include/SDL3/SDL_main.h @@ -524,12 +524,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_EnterAppMainCallbacks(int argc, char *argv[] * what is specified here. * \param hInst the HINSTANCE to use in WNDCLASSEX::hInstance. If zero, SDL * will use `GetModuleHandle(NULL)` instead. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst); +extern SDL_DECLSPEC bool SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst); /** * Deregister the win32 window class from an SDL_RegisterApp call. diff --git a/include/SDL3/SDL_messagebox.h b/include/SDL3/SDL_messagebox.h index bae603cd8..34aedab8a 100644 --- a/include/SDL3/SDL_messagebox.h +++ b/include/SDL3/SDL_messagebox.h @@ -154,14 +154,14 @@ typedef struct SDL_MessageBoxData * other options. * \param buttonid the pointer to which user id of hit button should be * copied. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_ShowSimpleMessageBox */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); +extern SDL_DECLSPEC bool SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); /** * Display a simple modal message box. @@ -196,14 +196,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData * \param title uTF-8 title text. * \param message uTF-8 message text. * \param window the parent window, or NULL for no parent. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_ShowMessageBox */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowSimpleMessageBox(SDL_MessageBoxFlags flags, const char *title, const char *message, SDL_Window *window); +extern SDL_DECLSPEC bool SDLCALL SDL_ShowSimpleMessageBox(SDL_MessageBoxFlags flags, const char *title, const char *message, SDL_Window *window); /* Ends C function definitions when using C++ */ diff --git a/include/SDL3/SDL_misc.h b/include/SDL3/SDL_misc.h index 23317e014..c2ff96abb 100644 --- a/include/SDL3/SDL_misc.h +++ b/include/SDL3/SDL_misc.h @@ -62,12 +62,12 @@ extern "C" { * * \param url a valid URL/URI to open. Use `file:///full/path/to/file` for * local files, if supported. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_OpenURL(const char *url); +extern SDL_DECLSPEC bool SDLCALL SDL_OpenURL(const char *url); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/include/SDL3/SDL_mouse.h b/include/SDL3/SDL_mouse.h index 4d870b652..95e6a882a 100644 --- a/include/SDL3/SDL_mouse.h +++ b/include/SDL3/SDL_mouse.h @@ -137,13 +137,13 @@ typedef Uint32 SDL_MouseButtonFlags; /** * Return whether a mouse is currently connected. * - * \returns SDL_TRUE if a mouse is connected, SDL_FALSE otherwise. + * \returns true if a mouse is connected, false otherwise. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetMice */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasMouse(void); +extern SDL_DECLSPEC bool SDLCALL SDL_HasMouse(void); /** * Get a list of currently connected mice. @@ -296,14 +296,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window, * * \param x the x coordinate. * \param y the y coordinate. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_WarpMouseInWindow */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WarpMouseGlobal(float x, float y); +extern SDL_DECLSPEC bool SDLCALL SDL_WarpMouseGlobal(float x, float y); /** * Set relative mouse mode for a window. @@ -316,28 +316,28 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WarpMouseGlobal(float x, float y); * This function will flush any pending mouse motion for this window. * * \param window the window to change. - * \param enabled SDL_TRUE to enable relative mode, SDL_FALSE to disable. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \param enabled true to enable relative mode, false to disable. + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetWindowRelativeMouseMode */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowRelativeMouseMode(SDL_Window *window, SDL_bool enabled); +extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowRelativeMouseMode(SDL_Window *window, bool enabled); /** * Query whether relative mouse mode is enabled for a window. * * \param window the window to query. - * \returns SDL_TRUE if relative mode is enabled for a window or SDL_FALSE + * \returns true if relative mode is enabled for a window or false * otherwise. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetWindowRelativeMouseMode */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowRelativeMouseMode(SDL_Window *window); +extern SDL_DECLSPEC bool SDLCALL SDL_GetWindowRelativeMouseMode(SDL_Window *window); /** * Capture the mouse and to track input outside an SDL window. @@ -375,15 +375,15 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowRelativeMouseMode(SDL_Window * * app, you can disable auto capture by setting the * `SDL_HINT_MOUSE_AUTO_CAPTURE` hint to zero. * - * \param enabled SDL_TRUE to enable capturing, SDL_FALSE to disable. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \param enabled true to enable capturing, false to disable. + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetGlobalMouseState */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CaptureMouse(SDL_bool enabled); +extern SDL_DECLSPEC bool SDLCALL SDL_CaptureMouse(bool enabled); /** * Create a cursor using the specified bitmap data and mask (in MSB format). @@ -484,14 +484,14 @@ extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor * this is desired for any reason. * * \param cursor a cursor to make active. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetCursor */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetCursor(SDL_Cursor *cursor); +extern SDL_DECLSPEC bool SDLCALL SDL_SetCursor(SDL_Cursor *cursor); /** * Get the active cursor. @@ -539,7 +539,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyCursor(SDL_Cursor *cursor); /** * Show the cursor. * - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -547,12 +547,12 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyCursor(SDL_Cursor *cursor); * \sa SDL_CursorVisible * \sa SDL_HideCursor */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowCursor(void); +extern SDL_DECLSPEC bool SDLCALL SDL_ShowCursor(void); /** * Hide the cursor. * - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -560,12 +560,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowCursor(void); * \sa SDL_CursorVisible * \sa SDL_ShowCursor */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HideCursor(void); +extern SDL_DECLSPEC bool SDLCALL SDL_HideCursor(void); /** * Return whether the cursor is currently being shown. * - * \returns `SDL_TRUE` if the cursor is being shown, or `SDL_FALSE` if the + * \returns `true` if the cursor is being shown, or `false` if the * cursor is hidden. * * \since This function is available since SDL 3.0.0. @@ -573,7 +573,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HideCursor(void); * \sa SDL_HideCursor * \sa SDL_ShowCursor */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CursorVisible(void); +extern SDL_DECLSPEC bool SDLCALL SDL_CursorVisible(void); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/include/SDL3/SDL_mutex.h b/include/SDL3/SDL_mutex.h index 3a7ce5655..686f328a6 100644 --- a/include/SDL3/SDL_mutex.h +++ b/include/SDL3/SDL_mutex.h @@ -184,22 +184,22 @@ extern SDL_DECLSPEC void SDLCALL SDL_LockMutex(SDL_Mutex *mutex) SDL_ACQUIRE(mut * Try to lock a mutex without blocking. * * This works just like SDL_LockMutex(), but if the mutex is not available, - * this function returns SDL_FALSE immediately. + * this function returns false immediately. * * This technique is useful if you need exclusive access to a resource but * don't want to wait for it, and will return to it to try again later. * - * This function returns SDL_TRUE if passed a NULL mutex. + * This function returns true if passed a NULL mutex. * * \param mutex the mutex to try to lock. - * \returns SDL_TRUE on success, SDL_FALSE if the mutex would block. + * \returns true on success, false if the mutex would block. * * \since This function is available since SDL 3.0.0. * * \sa SDL_LockMutex * \sa SDL_UnlockMutex */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryLockMutex(SDL_Mutex *mutex) SDL_TRY_ACQUIRE(0, mutex); +extern SDL_DECLSPEC bool SDLCALL SDL_TryLockMutex(SDL_Mutex *mutex) SDL_TRY_ACQUIRE(0, mutex); /** * Unlock the mutex. @@ -379,7 +379,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_LockRWLockForWriting(SDL_RWLock *rwlock) SD * Try to lock a read/write lock _for reading_ without blocking. * * This works just like SDL_LockRWLockForReading(), but if the rwlock is not - * available, then this function returns SDL_FALSE immediately. + * available, then this function returns false immediately. * * This technique is useful if you need access to a resource but don't want to * wait for it, and will return to it to try again later. @@ -387,10 +387,10 @@ extern SDL_DECLSPEC void SDLCALL SDL_LockRWLockForWriting(SDL_RWLock *rwlock) SD * Trying to lock for read-only access can succeed if other threads are * holding read-only locks, as this won't prevent access. * - * This function returns SDL_TRUE if passed a NULL rwlock. + * This function returns true if passed a NULL rwlock. * * \param rwlock the rwlock to try to lock. - * \returns SDL_TRUE on success, SDL_FALSE if the lock would block. + * \returns true on success, false if the lock would block. * * \since This function is available since SDL 3.0.0. * @@ -398,13 +398,13 @@ extern SDL_DECLSPEC void SDLCALL SDL_LockRWLockForWriting(SDL_RWLock *rwlock) SD * \sa SDL_TryLockRWLockForWriting * \sa SDL_UnlockRWLock */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryLockRWLockForReading(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE_SHARED(0, rwlock); +extern SDL_DECLSPEC bool SDLCALL SDL_TryLockRWLockForReading(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE_SHARED(0, rwlock); /** * Try to lock a read/write lock _for writing_ without blocking. * * This works just like SDL_LockRWLockForWriting(), but if the rwlock is not - * available, then this function returns SDL_FALSE immediately. + * available, then this function returns false immediately. * * This technique is useful if you need exclusive access to a resource but * don't want to wait for it, and will return to it to try again later. @@ -417,10 +417,10 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryLockRWLockForReading(SDL_RWLock *rwl * read-only lock. Doing so results in undefined behavior. Unlock the * read-only lock before requesting a write lock. * - * This function returns SDL_TRUE if passed a NULL rwlock. + * This function returns true if passed a NULL rwlock. * * \param rwlock the rwlock to try to lock. - * \returns SDL_TRUE on success, SDL_FALSE if the lock would block. + * \returns true on success, false if the lock would block. * * \since This function is available since SDL 3.0.0. * @@ -428,7 +428,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryLockRWLockForReading(SDL_RWLock *rwl * \sa SDL_TryLockRWLockForReading * \sa SDL_UnlockRWLock */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE(0, rwlock); +extern SDL_DECLSPEC bool SDLCALL SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE(0, rwlock); /** * Unlock the read/write lock. @@ -560,10 +560,10 @@ extern SDL_DECLSPEC void SDLCALL SDL_WaitSemaphore(SDL_Semaphore *sem); * This function checks to see if the semaphore pointed to by `sem` has a * positive value and atomically decrements the semaphore value if it does. If * the semaphore doesn't have a positive value, the function immediately - * returns SDL_FALSE. + * returns false. * * \param sem the semaphore to wait on. - * \returns SDL_TRUE if the wait succeeds, SDL_FALSE if the wait would block. + * \returns true if the wait succeeds, false if the wait would block. * * \since This function is available since SDL 3.0.0. * @@ -571,7 +571,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_WaitSemaphore(SDL_Semaphore *sem); * \sa SDL_WaitSemaphore * \sa SDL_WaitSemaphoreTimeout */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryWaitSemaphore(SDL_Semaphore *sem); +extern SDL_DECLSPEC bool SDLCALL SDL_TryWaitSemaphore(SDL_Semaphore *sem); /** * Wait until a semaphore has a positive value and then decrements it. @@ -583,7 +583,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryWaitSemaphore(SDL_Semaphore *sem); * \param sem the semaphore to wait on. * \param timeoutMS the length of the timeout, in milliseconds, or -1 to wait * indefinitely. - * \returns SDL_TRUE if the wait succeeds or SDL_FALSE if the wait times out. + * \returns true if the wait succeeds or false if the wait times out. * * \since This function is available since SDL 3.0.0. * @@ -591,7 +591,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryWaitSemaphore(SDL_Semaphore *sem); * \sa SDL_TryWaitSemaphore * \sa SDL_WaitSemaphore */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitSemaphoreTimeout(SDL_Semaphore *sem, Sint32 timeoutMS); +extern SDL_DECLSPEC bool SDLCALL SDL_WaitSemaphoreTimeout(SDL_Semaphore *sem, Sint32 timeoutMS); /** * Atomically increment a semaphore's value and wake waiting threads. @@ -741,7 +741,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_WaitCondition(SDL_Condition *cond, SDL_Mute * \param mutex the mutex used to coordinate thread access. * \param timeoutMS the maximum time to wait, in milliseconds, or -1 to wait * indefinitely. - * \returns SDL_TRUE if the condition variable is signaled, SDL_FALSE if the + * \returns true if the condition variable is signaled, false if the * condition is not signaled in the allotted time. * * \threadsafety It is safe to call this function from any thread. @@ -752,7 +752,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_WaitCondition(SDL_Condition *cond, SDL_Mute * \sa SDL_SignalCondition * \sa SDL_WaitCondition */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitConditionTimeout(SDL_Condition *cond, +extern SDL_DECLSPEC bool SDLCALL SDL_WaitConditionTimeout(SDL_Condition *cond, SDL_Mutex *mutex, Sint32 timeoutMS); /* @} *//* Condition variable functions */ diff --git a/include/SDL3/SDL_oldnames.h b/include/SDL3/SDL_oldnames.h index 3af24cc3e..82b4915a4 100644 --- a/include/SDL3/SDL_oldnames.h +++ b/include/SDL3/SDL_oldnames.h @@ -590,7 +590,10 @@ #define SDL_SensorUpdate SDL_UpdateSensors /* ##SDL_stdinc.h */ +#define SDL_FALSE false #define SDL_TABLESIZE SDL_arraysize +#define SDL_TRUE true +#define SDL_bool bool #define SDL_size_add_overflow SDL_size_add_check_overflow #define SDL_size_mul_overflow SDL_size_mul_check_overflow #define SDL_strtokr SDL_strtok_r @@ -1224,7 +1227,10 @@ #define SDL_SensorUpdate SDL_SensorUpdate_renamed_SDL_UpdateSensors /* ##SDL_stdinc.h */ +#define SDL_FALSE SDL_FALSE_renamed_false #define SDL_TABLESIZE SDL_TABLESIZE_renamed_SDL_arraysize +#define SDL_TRUE SDL_TRUE_renamed_true +#define SDL_bool SDL_bool_renamed_bool #define SDL_size_add_overflow SDL_size_add_overflow_renamed_SDL_size_add_check_overflow #define SDL_size_mul_overflow SDL_size_mul_overflow_renamed_SDL_size_mul_check_overflow #define SDL_strtokr SDL_strtokr_renamed_SDL_strtok_r diff --git a/include/SDL3/SDL_pixels.h b/include/SDL3/SDL_pixels.h index 95b432283..c916f9e09 100644 --- a/include/SDL3/SDL_pixels.h +++ b/include/SDL3/SDL_pixels.h @@ -780,7 +780,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetPixelFormatName(SDL_PixelFormat * \param Gmask a pointer filled in with the green mask for the format. * \param Bmask a pointer filled in with the blue mask for the format. * \param Amask a pointer filled in with the alpha mask for the format. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -789,7 +789,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetPixelFormatName(SDL_PixelFormat * * \sa SDL_GetPixelFormatForMasks */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetMasksForPixelFormat(SDL_PixelFormat format, int *bpp, Uint32 *Rmask, Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask); +extern SDL_DECLSPEC bool SDLCALL SDL_GetMasksForPixelFormat(SDL_PixelFormat format, int *bpp, Uint32 *Rmask, Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask); /** * Convert a bpp value and RGBA masks to an enumerated pixel format. @@ -857,7 +857,7 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_CreatePalette(int ncolors); * \param colors an array of SDL_Color structures to copy into the palette. * \param firstcolor the index of the first palette entry to modify. * \param ncolors the number of entries to modify. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread, as long as @@ -865,7 +865,7 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_CreatePalette(int ncolors); * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetPaletteColors(SDL_Palette *palette, const SDL_Color *colors, int firstcolor, int ncolors); +extern SDL_DECLSPEC bool SDLCALL SDL_SetPaletteColors(SDL_Palette *palette, const SDL_Color *colors, int firstcolor, int ncolors); /** * Free a palette created with SDL_CreatePalette(). diff --git a/include/SDL3/SDL_process.h b/include/SDL3/SDL_process.h index d1f5871fd..0c2608a2f 100644 --- a/include/SDL3/SDL_process.h +++ b/include/SDL3/SDL_process.h @@ -67,7 +67,7 @@ typedef struct SDL_Process SDL_Process; * const char *args[] = { "myprogram", "argument", NULL }; * ``` * - * Setting pipe_stdio to SDL_TRUE is equivalent to setting + * Setting pipe_stdio to true is equivalent to setting * `SDL_PROP_PROCESS_CREATE_STDIN_NUMBER` and * `SDL_PROP_PROCESS_CREATE_STDOUT_NUMBER` to `SDL_PROCESS_STDIO_APP`, and * will allow the use of SDL_ReadProcess() or SDL_GetProcessInput() and @@ -76,8 +76,8 @@ typedef struct SDL_Process SDL_Process; * See SDL_CreateProcessWithProperties() for more details. * * \param args the path and arguments for the new process. - * \param pipe_stdio SDL_TRUE to create pipes to the process's standard input - * and from the process's standard output, SDL_FALSE for the + * \param pipe_stdio true to create pipes to the process's standard input + * and from the process's standard output, false for the * process to have no input and inherit the application's * standard output. * \returns the newly created and running process, or NULL if the process @@ -96,7 +96,7 @@ typedef struct SDL_Process SDL_Process; * \sa SDL_WaitProcess * \sa SDL_DestroyProcess */ -extern SDL_DECLSPEC SDL_Process *SDLCALL SDL_CreateProcess(const char * const *args, SDL_bool pipe_stdio); +extern SDL_DECLSPEC SDL_Process *SDLCALL SDL_CreateProcess(const char * const *args, bool pipe_stdio); /** * Description of where standard I/O should be directed when creating a @@ -286,7 +286,7 @@ extern SDL_DECLSPEC void * SDLCALL SDL_ReadProcess(SDL_Process *process, size_t * Get the SDL_IOStream associated with process standard input. * * The process must have been created with SDL_CreateProcess() and pipe_stdio - * set to SDL_TRUE, or with SDL_CreateProcessWithProperties() and + * set to true, or with SDL_CreateProcessWithProperties() and * `SDL_PROP_PROCESS_CREATE_STDIN_NUMBER` set to `SDL_PROCESS_STDIO_APP`. * * Writing to this stream can return less data than expected if the process @@ -312,7 +312,7 @@ extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_GetProcessInput(SDL_Process *proce * Get the SDL_IOStream associated with process standard output. * * The process must have been created with SDL_CreateProcess() and pipe_stdio - * set to SDL_TRUE, or with SDL_CreateProcessWithProperties() and + * set to true, or with SDL_CreateProcessWithProperties() and * `SDL_PROP_PROCESS_CREATE_STDOUT_NUMBER` set to `SDL_PROCESS_STDIO_APP`. * * Reading from this stream can return 0 with SDL_GetIOStatus() returning @@ -336,12 +336,12 @@ extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_GetProcessOutput(SDL_Process *proc * Stop a process. * * \param process The process to stop. - * \param force SDL_TRUE to terminate the process immediately, SDL_FALSE to + * \param force true to terminate the process immediately, false to * try to stop the process gracefully. In general you should try * to stop the process gracefully first as terminating a process * may leave it with half-written data or in some other unstable * state. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety This function is not thread safe. @@ -353,7 +353,7 @@ extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_GetProcessOutput(SDL_Process *proc * \sa SDL_WaitProcess * \sa SDL_DestroyProcess */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_KillProcess(SDL_Process *process, SDL_bool force); +extern SDL_DECLSPEC bool SDLCALL SDL_KillProcess(SDL_Process *process, bool force); /** * Wait for a process to finish. @@ -369,7 +369,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_KillProcess(SDL_Process *process, SDL_b * on the process' status. * \param exitcode a pointer filled in with the process exit code if the * process has exited, may be NULL. - * \returns SDL_TRUE if the process exited, SDL_FALSE otherwise. + * \returns true if the process exited, false otherwise. * * \threadsafety This function is not thread safe. * @@ -380,7 +380,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_KillProcess(SDL_Process *process, SDL_b * \sa SDL_KillProcess * \sa SDL_DestroyProcess */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitProcess(SDL_Process *process, SDL_bool block, int *exitcode); +extern SDL_DECLSPEC bool SDLCALL SDL_WaitProcess(SDL_Process *process, bool block, int *exitcode); /** * Destroy a previously created process object. diff --git a/include/SDL3/SDL_properties.h b/include/SDL3/SDL_properties.h index c3a2c82ab..dd571a960 100644 --- a/include/SDL3/SDL_properties.h +++ b/include/SDL3/SDL_properties.h @@ -116,14 +116,14 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_CreateProperties(void); * * \param src the properties to copy. * \param dst the destination properties. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst); +extern SDL_DECLSPEC bool SDLCALL SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst); /** * Lock a group of properties. @@ -138,7 +138,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CopyProperties(SDL_PropertiesID src, SD * thread. * * \param props the properties to lock. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -147,7 +147,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CopyProperties(SDL_PropertiesID src, SD * * \sa SDL_UnlockProperties */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockProperties(SDL_PropertiesID props); +extern SDL_DECLSPEC bool SDLCALL SDL_LockProperties(SDL_PropertiesID props); /** * Unlock a group of properties. @@ -204,7 +204,7 @@ typedef void (SDLCALL *SDL_CleanupPropertyCallback)(void *userdata, void *value) * \param cleanup the function to call when this property is deleted, or NULL * if no cleanup is necessary. * \param userdata a pointer that is passed to the cleanup function. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -215,7 +215,7 @@ typedef void (SDLCALL *SDL_CleanupPropertyCallback)(void *userdata, void *value) * \sa SDL_SetPointerProperty * \sa SDL_CleanupPropertyCallback */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, SDL_CleanupPropertyCallback cleanup, void *userdata); +extern SDL_DECLSPEC bool SDLCALL SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, SDL_CleanupPropertyCallback cleanup, void *userdata); /** * Set a pointer property in a group of properties. @@ -223,7 +223,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetPointerPropertyWithCleanup(SDL_Prope * \param props the properties to modify. * \param name the name of the property to modify. * \param value the new value of the property, or NULL to delete the property. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -238,7 +238,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetPointerPropertyWithCleanup(SDL_Prope * \sa SDL_SetPointerPropertyWithCleanup * \sa SDL_SetStringProperty */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetPointerProperty(SDL_PropertiesID props, const char *name, void *value); +extern SDL_DECLSPEC bool SDLCALL SDL_SetPointerProperty(SDL_PropertiesID props, const char *name, void *value); /** * Set a string property in a group of properties. @@ -249,7 +249,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetPointerProperty(SDL_PropertiesID pro * \param props the properties to modify. * \param name the name of the property to modify. * \param value the new value of the property, or NULL to delete the property. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -258,7 +258,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetPointerProperty(SDL_PropertiesID pro * * \sa SDL_GetStringProperty */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetStringProperty(SDL_PropertiesID props, const char *name, const char *value); +extern SDL_DECLSPEC bool SDLCALL SDL_SetStringProperty(SDL_PropertiesID props, const char *name, const char *value); /** * Set an integer property in a group of properties. @@ -266,7 +266,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetStringProperty(SDL_PropertiesID prop * \param props the properties to modify. * \param name the name of the property to modify. * \param value the new value of the property. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -275,7 +275,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetStringProperty(SDL_PropertiesID prop * * \sa SDL_GetNumberProperty */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetNumberProperty(SDL_PropertiesID props, const char *name, Sint64 value); +extern SDL_DECLSPEC bool SDLCALL SDL_SetNumberProperty(SDL_PropertiesID props, const char *name, Sint64 value); /** * Set a floating point property in a group of properties. @@ -283,7 +283,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetNumberProperty(SDL_PropertiesID prop * \param props the properties to modify. * \param name the name of the property to modify. * \param value the new value of the property. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -292,7 +292,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetNumberProperty(SDL_PropertiesID prop * * \sa SDL_GetFloatProperty */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetFloatProperty(SDL_PropertiesID props, const char *name, float value); +extern SDL_DECLSPEC bool SDLCALL SDL_SetFloatProperty(SDL_PropertiesID props, const char *name, float value); /** * Set a boolean property in a group of properties. @@ -300,7 +300,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetFloatProperty(SDL_PropertiesID props * \param props the properties to modify. * \param name the name of the property to modify. * \param value the new value of the property. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -309,14 +309,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetFloatProperty(SDL_PropertiesID props * * \sa SDL_GetBooleanProperty */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bool value); +extern SDL_DECLSPEC bool SDLCALL SDL_SetBooleanProperty(SDL_PropertiesID props, const char *name, bool value); /** * Return whether a property exists in a group of properties. * * \param props the properties to query. * \param name the name of the property to query. - * \returns SDL_TRUE if the property exists, or SDL_FALSE if it doesn't. + * \returns true if the property exists, or false if it doesn't. * * \threadsafety It is safe to call this function from any thread. * @@ -324,7 +324,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetBooleanProperty(SDL_PropertiesID pro * * \sa SDL_GetPropertyType */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasProperty(SDL_PropertiesID props, const char *name); +extern SDL_DECLSPEC bool SDLCALL SDL_HasProperty(SDL_PropertiesID props, const char *name); /** * Get the type of a property in a group of properties. @@ -463,21 +463,21 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetFloatProperty(SDL_PropertiesID props, c * \sa SDL_HasProperty * \sa SDL_SetBooleanProperty */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bool default_value); +extern SDL_DECLSPEC bool SDLCALL SDL_GetBooleanProperty(SDL_PropertiesID props, const char *name, bool default_value); /** * Clear a property from a group of properties. * * \param props the properties to modify. * \param name the name of the property to clear. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearProperty(SDL_PropertiesID props, const char *name); +extern SDL_DECLSPEC bool SDLCALL SDL_ClearProperty(SDL_PropertiesID props, const char *name); /** * A callback used to enumerate all the properties in a group of properties. @@ -507,14 +507,14 @@ typedef void (SDLCALL *SDL_EnumeratePropertiesCallback)(void *userdata, SDL_Prop * \param props the properties to query. * \param callback the function to call for each property. * \param userdata a pointer that is passed to `callback`. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_EnumerateProperties(SDL_PropertiesID props, SDL_EnumeratePropertiesCallback callback, void *userdata); +extern SDL_DECLSPEC bool SDLCALL SDL_EnumerateProperties(SDL_PropertiesID props, SDL_EnumeratePropertiesCallback callback, void *userdata); /** * Destroy a group of properties. diff --git a/include/SDL3/SDL_rect.h b/include/SDL3/SDL_rect.h index ea97df9c5..2a2e96e42 100644 --- a/include/SDL3/SDL_rect.h +++ b/include/SDL3/SDL_rect.h @@ -146,16 +146,16 @@ SDL_FORCE_INLINE void SDL_RectToFRect(const SDL_Rect *rect, SDL_FRect *frect) * * \param p the point to test. * \param r the rectangle to test. - * \returns SDL_TRUE if `p` is contained by `r`, SDL_FALSE otherwise. + * \returns true if `p` is contained by `r`, false otherwise. * * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. */ -SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r) +SDL_FORCE_INLINE bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r) { return ( p && r && (p->x >= r->x) && (p->x < (r->x + r->w)) && - (p->y >= r->y) && (p->y < (r->y + r->h)) ) ? SDL_TRUE : SDL_FALSE; + (p->y >= r->y) && (p->y < (r->y + r->h)) ) ? true : false; } /** @@ -170,15 +170,15 @@ SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r) * be able to find this function inside SDL itself). * * \param r the rectangle to test. - * \returns SDL_TRUE if the rectangle is "empty", SDL_FALSE otherwise. + * \returns true if the rectangle is "empty", false otherwise. * * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. */ -SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r) +SDL_FORCE_INLINE bool SDL_RectEmpty(const SDL_Rect *r) { - return ((!r) || (r->w <= 0) || (r->h <= 0)) ? SDL_TRUE : SDL_FALSE; + return ((!r) || (r->w <= 0) || (r->h <= 0)) ? true : false; } /** @@ -194,26 +194,26 @@ SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r) * * \param a the first rectangle to test. * \param b the second rectangle to test. - * \returns SDL_TRUE if the rectangles are equal, SDL_FALSE otherwise. + * \returns true if the rectangles are equal, false otherwise. * * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. */ -SDL_FORCE_INLINE SDL_bool SDL_RectsEqual(const SDL_Rect *a, const SDL_Rect *b) +SDL_FORCE_INLINE bool SDL_RectsEqual(const SDL_Rect *a, const SDL_Rect *b) { return (a && b && (a->x == b->x) && (a->y == b->y) && - (a->w == b->w) && (a->h == b->h)) ? SDL_TRUE : SDL_FALSE; + (a->w == b->w) && (a->h == b->h)) ? true : false; } /** * Determine whether two rectangles intersect. * - * If either pointer is NULL the function will return SDL_FALSE. + * If either pointer is NULL the function will return false. * * \param A an SDL_Rect structure representing the first rectangle. * \param B an SDL_Rect structure representing the second rectangle. - * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise. + * \returns true if there is an intersection, false otherwise. * * \threadsafety It is safe to call this function from any thread. * @@ -221,24 +221,24 @@ SDL_FORCE_INLINE SDL_bool SDL_RectsEqual(const SDL_Rect *a, const SDL_Rect *b) * * \sa SDL_GetRectIntersection */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasRectIntersection(const SDL_Rect *A, const SDL_Rect *B); +extern SDL_DECLSPEC bool SDLCALL SDL_HasRectIntersection(const SDL_Rect *A, const SDL_Rect *B); /** * Calculate the intersection of two rectangles. * - * If `result` is NULL then this function will return SDL_FALSE. + * If `result` is NULL then this function will return false. * * \param A an SDL_Rect structure representing the first rectangle. * \param B an SDL_Rect structure representing the second rectangle. * \param result an SDL_Rect structure filled in with the intersection of * rectangles `A` and `B`. - * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise. + * \returns true if there is an intersection, false otherwise. * * \since This function is available since SDL 3.0.0. * * \sa SDL_HasRectIntersection */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectIntersection(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result); +extern SDL_DECLSPEC bool SDLCALL SDL_GetRectIntersection(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result); /** * Calculate the union of two rectangles. @@ -247,12 +247,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectIntersection(const SDL_Rect *A, * \param B an SDL_Rect structure representing the second rectangle. * \param result an SDL_Rect structure filled in with the union of rectangles * `A` and `B`. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectUnion(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result); +extern SDL_DECLSPEC bool SDLCALL SDL_GetRectUnion(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result); /** * Calculate a minimal rectangle enclosing a set of points. @@ -266,12 +266,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectUnion(const SDL_Rect *A, const S * \param clip an SDL_Rect used for clipping or NULL to enclose all points. * \param result an SDL_Rect structure filled in with the minimal enclosing * rectangle. - * \returns SDL_TRUE if any points were enclosed or SDL_FALSE if all the + * \returns true if any points were enclosed or false if all the * points were outside of the clipping rectangle. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectEnclosingPoints(const SDL_Point *points, int count, const SDL_Rect *clip, SDL_Rect *result); +extern SDL_DECLSPEC bool SDLCALL SDL_GetRectEnclosingPoints(const SDL_Point *points, int count, const SDL_Rect *clip, SDL_Rect *result); /** * Calculate the intersection of a rectangle and line segment. @@ -287,11 +287,11 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectEnclosingPoints(const SDL_Point * \param Y1 a pointer to the starting Y-coordinate of the line. * \param X2 a pointer to the ending X-coordinate of the line. * \param Y2 a pointer to the ending Y-coordinate of the line. - * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise. + * \returns true if there is an intersection, false otherwise. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectAndLineIntersection(const SDL_Rect *rect, int *X1, int *Y1, int *X2, int *Y2); +extern SDL_DECLSPEC bool SDLCALL SDL_GetRectAndLineIntersection(const SDL_Rect *rect, int *X1, int *Y1, int *X2, int *Y2); /* SDL_FRect versions... */ @@ -311,16 +311,16 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectAndLineIntersection(const SDL_Re * * \param p the point to test. * \param r the rectangle to test. - * \returns SDL_TRUE if `p` is contained by `r`, SDL_FALSE otherwise. + * \returns true if `p` is contained by `r`, false otherwise. * * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. */ -SDL_FORCE_INLINE SDL_bool SDL_PointInRectFloat(const SDL_FPoint *p, const SDL_FRect *r) +SDL_FORCE_INLINE bool SDL_PointInRectFloat(const SDL_FPoint *p, const SDL_FRect *r) { return ( p && r && (p->x >= r->x) && (p->x <= (r->x + r->w)) && - (p->y >= r->y) && (p->y <= (r->y + r->h)) ) ? SDL_TRUE : SDL_FALSE; + (p->y >= r->y) && (p->y <= (r->y + r->h)) ) ? true : false; } /** @@ -335,15 +335,15 @@ SDL_FORCE_INLINE SDL_bool SDL_PointInRectFloat(const SDL_FPoint *p, const SDL_FR * be able to find this function inside SDL itself). * * \param r the rectangle to test. - * \returns SDL_TRUE if the rectangle is "empty", SDL_FALSE otherwise. + * \returns true if the rectangle is "empty", false otherwise. * * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. */ -SDL_FORCE_INLINE SDL_bool SDL_RectEmptyFloat(const SDL_FRect *r) +SDL_FORCE_INLINE bool SDL_RectEmptyFloat(const SDL_FRect *r) { - return ((!r) || (r->w < 0.0f) || (r->h < 0.0f)) ? SDL_TRUE : SDL_FALSE; + return ((!r) || (r->w < 0.0f) || (r->h < 0.0f)) ? true : false; } /** @@ -363,7 +363,7 @@ SDL_FORCE_INLINE SDL_bool SDL_RectEmptyFloat(const SDL_FRect *r) * \param a the first rectangle to test. * \param b the second rectangle to test. * \param epsilon the epsilon value for comparison. - * \returns SDL_TRUE if the rectangles are equal, SDL_FALSE otherwise. + * \returns true if the rectangles are equal, false otherwise. * * \threadsafety It is safe to call this function from any thread. * @@ -371,14 +371,14 @@ SDL_FORCE_INLINE SDL_bool SDL_RectEmptyFloat(const SDL_FRect *r) * * \sa SDL_RectsEqualFloat */ -SDL_FORCE_INLINE SDL_bool SDL_RectsEqualEpsilon(const SDL_FRect *a, const SDL_FRect *b, const float epsilon) +SDL_FORCE_INLINE bool SDL_RectsEqualEpsilon(const SDL_FRect *a, const SDL_FRect *b, const float epsilon) { return (a && b && ((a == b) || ((SDL_fabsf(a->x - b->x) <= epsilon) && (SDL_fabsf(a->y - b->y) <= epsilon) && (SDL_fabsf(a->w - b->w) <= epsilon) && (SDL_fabsf(a->h - b->h) <= epsilon)))) - ? SDL_TRUE : SDL_FALSE; + ? true : false; } /** @@ -398,7 +398,7 @@ SDL_FORCE_INLINE SDL_bool SDL_RectsEqualEpsilon(const SDL_FRect *a, const SDL_FR * * \param a the first rectangle to test. * \param b the second rectangle to test. - * \returns SDL_TRUE if the rectangles are equal, SDL_FALSE otherwise. + * \returns true if the rectangles are equal, false otherwise. * * \threadsafety It is safe to call this function from any thread. * @@ -406,7 +406,7 @@ SDL_FORCE_INLINE SDL_bool SDL_RectsEqualEpsilon(const SDL_FRect *a, const SDL_FR * * \sa SDL_RectsEqualEpsilon */ -SDL_FORCE_INLINE SDL_bool SDL_RectsEqualFloat(const SDL_FRect *a, const SDL_FRect *b) +SDL_FORCE_INLINE bool SDL_RectsEqualFloat(const SDL_FRect *a, const SDL_FRect *b) { return SDL_RectsEqualEpsilon(a, b, SDL_FLT_EPSILON); } @@ -414,34 +414,34 @@ SDL_FORCE_INLINE SDL_bool SDL_RectsEqualFloat(const SDL_FRect *a, const SDL_FRec /** * Determine whether two rectangles intersect with float precision. * - * If either pointer is NULL the function will return SDL_FALSE. + * If either pointer is NULL the function will return false. * * \param A an SDL_FRect structure representing the first rectangle. * \param B an SDL_FRect structure representing the second rectangle. - * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise. + * \returns true if there is an intersection, false otherwise. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetRectIntersection */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasRectIntersectionFloat(const SDL_FRect *A, const SDL_FRect *B); +extern SDL_DECLSPEC bool SDLCALL SDL_HasRectIntersectionFloat(const SDL_FRect *A, const SDL_FRect *B); /** * Calculate the intersection of two rectangles with float precision. * - * If `result` is NULL then this function will return SDL_FALSE. + * If `result` is NULL then this function will return false. * * \param A an SDL_FRect structure representing the first rectangle. * \param B an SDL_FRect structure representing the second rectangle. * \param result an SDL_FRect structure filled in with the intersection of * rectangles `A` and `B`. - * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise. + * \returns true if there is an intersection, false otherwise. * * \since This function is available since SDL 3.0.0. * * \sa SDL_HasRectIntersectionFloat */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectIntersectionFloat(const SDL_FRect *A, const SDL_FRect *B, SDL_FRect *result); +extern SDL_DECLSPEC bool SDLCALL SDL_GetRectIntersectionFloat(const SDL_FRect *A, const SDL_FRect *B, SDL_FRect *result); /** * Calculate the union of two rectangles with float precision. @@ -450,12 +450,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectIntersectionFloat(const SDL_FRec * \param B an SDL_FRect structure representing the second rectangle. * \param result an SDL_FRect structure filled in with the union of rectangles * `A` and `B`. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectUnionFloat(const SDL_FRect *A, const SDL_FRect *B, SDL_FRect *result); +extern SDL_DECLSPEC bool SDLCALL SDL_GetRectUnionFloat(const SDL_FRect *A, const SDL_FRect *B, SDL_FRect *result); /** * Calculate a minimal rectangle enclosing a set of points with float @@ -470,12 +470,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectUnionFloat(const SDL_FRect *A, c * \param clip an SDL_FRect used for clipping or NULL to enclose all points. * \param result an SDL_FRect structure filled in with the minimal enclosing * rectangle. - * \returns SDL_TRUE if any points were enclosed or SDL_FALSE if all the + * \returns true if any points were enclosed or false if all the * points were outside of the clipping rectangle. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectEnclosingPointsFloat(const SDL_FPoint *points, int count, const SDL_FRect *clip, SDL_FRect *result); +extern SDL_DECLSPEC bool SDLCALL SDL_GetRectEnclosingPointsFloat(const SDL_FPoint *points, int count, const SDL_FRect *clip, SDL_FRect *result); /** * Calculate the intersection of a rectangle and line segment with float @@ -492,11 +492,11 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectEnclosingPointsFloat(const SDL_F * \param Y1 a pointer to the starting Y-coordinate of the line. * \param X2 a pointer to the ending X-coordinate of the line. * \param Y2 a pointer to the ending Y-coordinate of the line. - * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise. + * \returns true if there is an intersection, false otherwise. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectAndLineIntersectionFloat(const SDL_FRect *rect, float *X1, float *Y1, float *X2, float *Y2); +extern SDL_DECLSPEC bool SDLCALL SDL_GetRectAndLineIntersectionFloat(const SDL_FRect *rect, float *X1, float *Y1, float *X2, float *Y2); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/include/SDL3/SDL_render.h b/include/SDL3/SDL_render.h index 7ff5a9da5..ced6c4d10 100644 --- a/include/SDL3/SDL_render.h +++ b/include/SDL3/SDL_render.h @@ -177,7 +177,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetRenderDriver(int index); * SDL_CreateWindow()). * \param window a pointer filled with the window, or NULL on error. * \param renderer a pointer filled with the renderer, or NULL on error. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -185,7 +185,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetRenderDriver(int index); * \sa SDL_CreateRenderer * \sa SDL_CreateWindow */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CreateWindowAndRenderer(const char *title, int width, int height, SDL_WindowFlags window_flags, SDL_Window **window, SDL_Renderer **renderer); +extern SDL_DECLSPEC bool SDLCALL SDL_CreateWindowAndRenderer(const char *title, int width, int height, SDL_WindowFlags window_flags, SDL_Window **window, SDL_Renderer **renderer); /** * Create a 2D rendering context for a window. @@ -447,14 +447,14 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetRendererProperties(SDL_Rende * \param renderer the rendering context. * \param w a pointer filled in with the width in pixels. * \param h a pointer filled in with the height in pixels. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetCurrentRenderOutputSize */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderOutputSize(SDL_Renderer *renderer, int *w, int *h); +extern SDL_DECLSPEC bool SDLCALL SDL_GetRenderOutputSize(SDL_Renderer *renderer, int *w, int *h); /** * Get the current output size in pixels of a rendering context. @@ -467,14 +467,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderOutputSize(SDL_Renderer *rende * \param renderer the rendering context. * \param w a pointer filled in with the current width. * \param h a pointer filled in with the current height. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetRenderOutputSize */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetCurrentRenderOutputSize(SDL_Renderer *renderer, int *w, int *h); +extern SDL_DECLSPEC bool SDLCALL SDL_GetCurrentRenderOutputSize(SDL_Renderer *renderer, int *w, int *h); /** * Create a texture for a rendering context. @@ -806,12 +806,12 @@ extern SDL_DECLSPEC SDL_Renderer * SDLCALL SDL_GetRendererFromTexture(SDL_Textur * argument can be NULL if you don't need this information. * \param h a pointer filled in with the height of the texture in pixels. This * argument can be NULL if you don't need this information. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureSize(SDL_Texture *texture, float *w, float *h); +extern SDL_DECLSPEC bool SDLCALL SDL_GetTextureSize(SDL_Texture *texture, float *w, float *h); /** * Set an additional color value multiplied into render copy operations. @@ -823,13 +823,13 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureSize(SDL_Texture *texture, fl * `srcC = srcC * (color / 255)` * * Color modulation is not always supported by the renderer; it will return - * SDL_FALSE if color modulation is not supported. + * false if color modulation is not supported. * * \param texture the texture to update. * \param r the red color value multiplied into copy operations. * \param g the green color value multiplied into copy operations. * \param b the blue color value multiplied into copy operations. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -838,7 +838,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureSize(SDL_Texture *texture, fl * \sa SDL_SetTextureAlphaMod * \sa SDL_SetTextureColorModFloat */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b); +extern SDL_DECLSPEC bool SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b); /** @@ -851,13 +851,13 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture * `srcC = srcC * color` * * Color modulation is not always supported by the renderer; it will return - * SDL_FALSE if color modulation is not supported. + * false if color modulation is not supported. * * \param texture the texture to update. * \param r the red color value multiplied into copy operations. * \param g the green color value multiplied into copy operations. * \param b the blue color value multiplied into copy operations. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -866,7 +866,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture * \sa SDL_SetTextureAlphaModFloat * \sa SDL_SetTextureColorMod */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureColorModFloat(SDL_Texture *texture, float r, float g, float b); +extern SDL_DECLSPEC bool SDLCALL SDL_SetTextureColorModFloat(SDL_Texture *texture, float r, float g, float b); /** @@ -876,7 +876,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureColorModFloat(SDL_Texture *te * \param r a pointer filled in with the current red color value. * \param g a pointer filled in with the current green color value. * \param b a pointer filled in with the current blue color value. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -885,7 +885,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureColorModFloat(SDL_Texture *te * \sa SDL_GetTextureColorModFloat * \sa SDL_SetTextureColorMod */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 *b); +extern SDL_DECLSPEC bool SDLCALL SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 *b); /** * Get the additional color value multiplied into render copy operations. @@ -894,7 +894,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureColorMod(SDL_Texture *texture * \param r a pointer filled in with the current red color value. * \param g a pointer filled in with the current green color value. * \param b a pointer filled in with the current blue color value. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -903,7 +903,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureColorMod(SDL_Texture *texture * \sa SDL_GetTextureColorMod * \sa SDL_SetTextureColorModFloat */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureColorModFloat(SDL_Texture *texture, float *r, float *g, float *b); +extern SDL_DECLSPEC bool SDLCALL SDL_GetTextureColorModFloat(SDL_Texture *texture, float *r, float *g, float *b); /** * Set an additional alpha value multiplied into render copy operations. @@ -914,11 +914,11 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureColorModFloat(SDL_Texture *te * `srcA = srcA * (alpha / 255)` * * Alpha modulation is not always supported by the renderer; it will return - * SDL_FALSE if alpha modulation is not supported. + * false if alpha modulation is not supported. * * \param texture the texture to update. * \param alpha the source alpha value multiplied into copy operations. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -927,7 +927,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureColorModFloat(SDL_Texture *te * \sa SDL_SetTextureAlphaModFloat * \sa SDL_SetTextureColorMod */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha); +extern SDL_DECLSPEC bool SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha); /** * Set an additional alpha value multiplied into render copy operations. @@ -938,11 +938,11 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture * `srcA = srcA * alpha` * * Alpha modulation is not always supported by the renderer; it will return - * SDL_FALSE if alpha modulation is not supported. + * false if alpha modulation is not supported. * * \param texture the texture to update. * \param alpha the source alpha value multiplied into copy operations. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -951,14 +951,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture * \sa SDL_SetTextureAlphaMod * \sa SDL_SetTextureColorModFloat */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureAlphaModFloat(SDL_Texture *texture, float alpha); +extern SDL_DECLSPEC bool SDLCALL SDL_SetTextureAlphaModFloat(SDL_Texture *texture, float alpha); /** * Get the additional alpha value multiplied into render copy operations. * * \param texture the texture to query. * \param alpha a pointer filled in with the current alpha value. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -967,14 +967,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureAlphaModFloat(SDL_Texture *te * \sa SDL_GetTextureColorMod * \sa SDL_SetTextureAlphaMod */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *alpha); +extern SDL_DECLSPEC bool SDLCALL SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *alpha); /** * Get the additional alpha value multiplied into render copy operations. * * \param texture the texture to query. * \param alpha a pointer filled in with the current alpha value. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -983,38 +983,38 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureAlphaMod(SDL_Texture *texture * \sa SDL_GetTextureColorModFloat * \sa SDL_SetTextureAlphaModFloat */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureAlphaModFloat(SDL_Texture *texture, float *alpha); +extern SDL_DECLSPEC bool SDLCALL SDL_GetTextureAlphaModFloat(SDL_Texture *texture, float *alpha); /** * Set the blend mode for a texture, used by SDL_RenderTexture(). * * If the blend mode is not supported, the closest supported mode is chosen - * and this function returns SDL_FALSE. + * and this function returns false. * * \param texture the texture to update. * \param blendMode the SDL_BlendMode to use for texture blending. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetTextureBlendMode */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode); +extern SDL_DECLSPEC bool SDLCALL SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode); /** * Get the blend mode used for texture copy operations. * * \param texture the texture to query. * \param blendMode a pointer filled in with the current SDL_BlendMode. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetTextureBlendMode */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode); +extern SDL_DECLSPEC bool SDLCALL SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode); /** * Set the scale mode used for texture scale operations. @@ -1025,28 +1025,28 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureBlendMode(SDL_Texture *textur * * \param texture the texture to update. * \param scaleMode the SDL_ScaleMode to use for texture scaling. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetTextureScaleMode */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode); +extern SDL_DECLSPEC bool SDLCALL SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode); /** * Get the scale mode used for texture scale operations. * * \param texture the texture to query. * \param scaleMode a pointer filled in with the current scale mode. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetTextureScaleMode */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode *scaleMode); +extern SDL_DECLSPEC bool SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode *scaleMode); /** * Update the given texture rectangle with new pixel data. @@ -1068,7 +1068,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureScaleMode(SDL_Texture *textur * \param pixels the raw pixel data in the format of the texture. * \param pitch the number of bytes in a row of pixel data, including padding * between lines. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1078,7 +1078,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureScaleMode(SDL_Texture *textur * \sa SDL_UpdateNVTexture * \sa SDL_UpdateYUVTexture */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateTexture(SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch); +extern SDL_DECLSPEC bool SDLCALL SDL_UpdateTexture(SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch); /** * Update a rectangle within a planar YV12 or IYUV texture with new pixel @@ -1100,7 +1100,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateTexture(SDL_Texture *texture, con * \param Vplane the raw pixel data for the V plane. * \param Vpitch the number of bytes between rows of pixel data for the V * plane. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1108,7 +1108,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateTexture(SDL_Texture *texture, con * \sa SDL_UpdateNVTexture * \sa SDL_UpdateTexture */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateYUVTexture(SDL_Texture *texture, +extern SDL_DECLSPEC bool SDLCALL SDL_UpdateYUVTexture(SDL_Texture *texture, const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *Uplane, int Upitch, @@ -1130,7 +1130,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateYUVTexture(SDL_Texture *texture, * \param UVplane the raw pixel data for the UV plane. * \param UVpitch the number of bytes between rows of pixel data for the UV * plane. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1138,7 +1138,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateYUVTexture(SDL_Texture *texture, * \sa SDL_UpdateTexture * \sa SDL_UpdateYUVTexture */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateNVTexture(SDL_Texture *texture, +extern SDL_DECLSPEC bool SDLCALL SDL_UpdateNVTexture(SDL_Texture *texture, const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *UVplane, int UVpitch); @@ -1162,7 +1162,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateNVTexture(SDL_Texture *texture, * appropriately offset by the locked area. * \param pitch this is filled in with the pitch of the locked pixels; the * pitch is the length of one row in bytes. - * \returns SDL_TRUE on success or SDL_FALSE if the texture is not valid or + * \returns true on success or false if the texture is not valid or * was not created with `SDL_TEXTUREACCESS_STREAMING`; call * SDL_GetError() for more information. * @@ -1171,7 +1171,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateNVTexture(SDL_Texture *texture, * \sa SDL_LockTextureToSurface * \sa SDL_UnlockTexture */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockTexture(SDL_Texture *texture, +extern SDL_DECLSPEC bool SDLCALL SDL_LockTexture(SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch); @@ -1199,7 +1199,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockTexture(SDL_Texture *texture, * NULL, the entire texture will be locked. * \param surface this is filled in with an SDL surface representing the * locked area. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1207,7 +1207,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockTexture(SDL_Texture *texture, * \sa SDL_LockTexture * \sa SDL_UnlockTexture */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockTextureToSurface(SDL_Texture *texture, const SDL_Rect *rect, SDL_Surface **surface); +extern SDL_DECLSPEC bool SDLCALL SDL_LockTextureToSurface(SDL_Texture *texture, const SDL_Rect *rect, SDL_Surface **surface); /** * Unlock a texture, uploading the changes to video memory, if needed. @@ -1239,14 +1239,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture *texture); * \param texture the targeted texture, which must be created with the * `SDL_TEXTUREACCESS_TARGET` flag, or NULL to render to the * window instead of a texture. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetRenderTarget */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture); +extern SDL_DECLSPEC bool SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture); /** * Get the current render target. @@ -1282,7 +1282,7 @@ extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *rend * \param h the height of the logical resolution. * \param mode the presentation mode used. * \param scale_mode the scale mode used. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1291,7 +1291,7 @@ extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *rend * \sa SDL_GetRenderLogicalPresentation * \sa SDL_GetRenderLogicalPresentationRect */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderLogicalPresentation(SDL_Renderer *renderer, int w, int h, SDL_RendererLogicalPresentation mode, SDL_ScaleMode scale_mode); +extern SDL_DECLSPEC bool SDLCALL SDL_SetRenderLogicalPresentation(SDL_Renderer *renderer, int w, int h, SDL_RendererLogicalPresentation mode, SDL_ScaleMode scale_mode); /** * Get device independent resolution and presentation mode for rendering. @@ -1304,14 +1304,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderLogicalPresentation(SDL_Render * \param h an int to be filled with the height. * \param mode a pointer filled in with the presentation mode. * \param scale_mode a pointer filled in with the scale mode. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetRenderLogicalPresentation */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderLogicalPresentation(SDL_Renderer *renderer, int *w, int *h, SDL_RendererLogicalPresentation *mode, SDL_ScaleMode *scale_mode); +extern SDL_DECLSPEC bool SDLCALL SDL_GetRenderLogicalPresentation(SDL_Renderer *renderer, int *w, int *h, SDL_RendererLogicalPresentation *mode, SDL_ScaleMode *scale_mode); /** * Get the final presentation rectangle for rendering. @@ -1324,14 +1324,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderLogicalPresentation(SDL_Render * \param renderer the rendering context. * \param rect a pointer filled in with the final presentation rectangle, may * be NULL. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetRenderLogicalPresentation */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderLogicalPresentationRect(SDL_Renderer *renderer, SDL_FRect *rect); +extern SDL_DECLSPEC bool SDLCALL SDL_GetRenderLogicalPresentationRect(SDL_Renderer *renderer, SDL_FRect *rect); /** * Get a point in render coordinates when given a point in window coordinates. @@ -1341,7 +1341,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderLogicalPresentationRect(SDL_Re * \param window_y the y coordinate in window coordinates. * \param x a pointer filled with the x coordinate in render coordinates. * \param y a pointer filled with the y coordinate in render coordinates. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1349,7 +1349,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderLogicalPresentationRect(SDL_Re * \sa SDL_SetRenderLogicalPresentation * \sa SDL_SetRenderScale */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderCoordinatesFromWindow(SDL_Renderer *renderer, float window_x, float window_y, float *x, float *y); +extern SDL_DECLSPEC bool SDLCALL SDL_RenderCoordinatesFromWindow(SDL_Renderer *renderer, float window_x, float window_y, float *x, float *y); /** * Get a point in window coordinates when given a point in render coordinates. @@ -1361,7 +1361,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderCoordinatesFromWindow(SDL_Rendere * coordinates. * \param window_y a pointer filled with the y coordinate in window * coordinates. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1369,7 +1369,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderCoordinatesFromWindow(SDL_Rendere * \sa SDL_SetRenderLogicalPresentation * \sa SDL_SetRenderScale */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderCoordinatesToWindow(SDL_Renderer *renderer, float x, float y, float *window_x, float *window_y); +extern SDL_DECLSPEC bool SDLCALL SDL_RenderCoordinatesToWindow(SDL_Renderer *renderer, float x, float y, float *window_x, float *window_y); /** * Convert the coordinates in an event to render coordinates. @@ -1381,14 +1381,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderCoordinatesToWindow(SDL_Renderer * * \param renderer the rendering context. * \param event the event to modify. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_RenderCoordinatesFromWindow */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ConvertEventToRenderCoordinates(SDL_Renderer *renderer, SDL_Event *event); +extern SDL_DECLSPEC bool SDLCALL SDL_ConvertEventToRenderCoordinates(SDL_Renderer *renderer, SDL_Event *event); /** * Set the drawing area for rendering on the current target. @@ -1396,7 +1396,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ConvertEventToRenderCoordinates(SDL_Ren * \param renderer the rendering context. * \param rect the SDL_Rect structure representing the drawing area, or NULL * to set the viewport to the entire target. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1404,14 +1404,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ConvertEventToRenderCoordinates(SDL_Ren * \sa SDL_GetRenderViewport * \sa SDL_RenderViewportSet */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderViewport(SDL_Renderer *renderer, const SDL_Rect *rect); +extern SDL_DECLSPEC bool SDLCALL SDL_SetRenderViewport(SDL_Renderer *renderer, const SDL_Rect *rect); /** * Get the drawing area for the current target. * * \param renderer the rendering context. * \param rect an SDL_Rect structure filled in with the current drawing area. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1419,7 +1419,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderViewport(SDL_Renderer *rendere * \sa SDL_RenderViewportSet * \sa SDL_SetRenderViewport */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderViewport(SDL_Renderer *renderer, SDL_Rect *rect); +extern SDL_DECLSPEC bool SDLCALL SDL_GetRenderViewport(SDL_Renderer *renderer, SDL_Rect *rect); /** * Return whether an explicit rectangle was set as the viewport. @@ -1429,15 +1429,15 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderViewport(SDL_Renderer *rendere * viewport is always reset when changing rendering targets. * * \param renderer the rendering context. - * \returns SDL_TRUE if the viewport was set to a specific rectangle, or - * SDL_FALSE if it was set to NULL (the entire target). + * \returns true if the viewport was set to a specific rectangle, or + * false if it was set to NULL (the entire target). * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetRenderViewport * \sa SDL_SetRenderViewport */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderViewportSet(SDL_Renderer *renderer); +extern SDL_DECLSPEC bool SDLCALL SDL_RenderViewportSet(SDL_Renderer *renderer); /** * Get the safe area for rendering within the current viewport. @@ -1452,12 +1452,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderViewportSet(SDL_Renderer *rendere * \param renderer the rendering context. * \param rect a pointer filled in with the area that is safe for interactive * content. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderSafeArea(SDL_Renderer *renderer, SDL_Rect *rect); +extern SDL_DECLSPEC bool SDLCALL SDL_GetRenderSafeArea(SDL_Renderer *renderer, SDL_Rect *rect); /** * Set the clip rectangle for rendering on the specified target. @@ -1465,7 +1465,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderSafeArea(SDL_Renderer *rendere * \param renderer the rendering context. * \param rect an SDL_Rect structure representing the clip area, relative to * the viewport, or NULL to disable clipping. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1473,7 +1473,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderSafeArea(SDL_Renderer *rendere * \sa SDL_GetRenderClipRect * \sa SDL_RenderClipEnabled */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderClipRect(SDL_Renderer *renderer, const SDL_Rect *rect); +extern SDL_DECLSPEC bool SDLCALL SDL_SetRenderClipRect(SDL_Renderer *renderer, const SDL_Rect *rect); /** * Get the clip rectangle for the current target. @@ -1481,7 +1481,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderClipRect(SDL_Renderer *rendere * \param renderer the rendering context. * \param rect an SDL_Rect structure filled in with the current clipping area * or an empty rectangle if clipping is disabled. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1489,13 +1489,13 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderClipRect(SDL_Renderer *rendere * \sa SDL_RenderClipEnabled * \sa SDL_SetRenderClipRect */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderClipRect(SDL_Renderer *renderer, SDL_Rect *rect); +extern SDL_DECLSPEC bool SDLCALL SDL_GetRenderClipRect(SDL_Renderer *renderer, SDL_Rect *rect); /** * Get whether clipping is enabled on the given renderer. * * \param renderer the rendering context. - * \returns SDL_TRUE if clipping is enabled or SDL_FALSE if not; call + * \returns true if clipping is enabled or false if not; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -1503,7 +1503,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderClipRect(SDL_Renderer *rendere * \sa SDL_GetRenderClipRect * \sa SDL_SetRenderClipRect */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderClipEnabled(SDL_Renderer *renderer); +extern SDL_DECLSPEC bool SDLCALL SDL_RenderClipEnabled(SDL_Renderer *renderer); /** * Set the drawing scale for rendering on the current target. @@ -1519,14 +1519,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderClipEnabled(SDL_Renderer *rendere * \param renderer the rendering context. * \param scaleX the horizontal scaling factor. * \param scaleY the vertical scaling factor. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetRenderScale */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderScale(SDL_Renderer *renderer, float scaleX, float scaleY); +extern SDL_DECLSPEC bool SDLCALL SDL_SetRenderScale(SDL_Renderer *renderer, float scaleX, float scaleY); /** * Get the drawing scale for the current target. @@ -1534,14 +1534,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderScale(SDL_Renderer *renderer, * \param renderer the rendering context. * \param scaleX a pointer filled in with the horizontal scaling factor. * \param scaleY a pointer filled in with the vertical scaling factor. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetRenderScale */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderScale(SDL_Renderer *renderer, float *scaleX, float *scaleY); +extern SDL_DECLSPEC bool SDLCALL SDL_GetRenderScale(SDL_Renderer *renderer, float *scaleX, float *scaleY); /** * Set the color used for drawing operations. @@ -1556,7 +1556,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderScale(SDL_Renderer *renderer, * \param a the alpha value used to draw on the rendering target; usually * `SDL_ALPHA_OPAQUE` (255). Use SDL_SetRenderDrawBlendMode to * specify how the alpha channel is used. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1564,7 +1564,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderScale(SDL_Renderer *renderer, * \sa SDL_GetRenderDrawColor * \sa SDL_SetRenderDrawColorFloat */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderDrawColor(SDL_Renderer *renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a); +extern SDL_DECLSPEC bool SDLCALL SDL_SetRenderDrawColor(SDL_Renderer *renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /** * Set the color used for drawing operations (Rect, Line and Clear). @@ -1579,7 +1579,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderDrawColor(SDL_Renderer *render * \param a the alpha value used to draw on the rendering target. Use * SDL_SetRenderDrawBlendMode to specify how the alpha channel is * used. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1587,7 +1587,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderDrawColor(SDL_Renderer *render * \sa SDL_GetRenderDrawColorFloat * \sa SDL_SetRenderDrawColor */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderDrawColorFloat(SDL_Renderer *renderer, float r, float g, float b, float a); +extern SDL_DECLSPEC bool SDLCALL SDL_SetRenderDrawColorFloat(SDL_Renderer *renderer, float r, float g, float b, float a); /** * Get the color used for drawing operations (Rect, Line and Clear). @@ -1601,7 +1601,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderDrawColorFloat(SDL_Renderer *r * rendering target. * \param a a pointer filled in with the alpha value used to draw on the * rendering target; usually `SDL_ALPHA_OPAQUE` (255). - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1609,7 +1609,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderDrawColorFloat(SDL_Renderer *r * \sa SDL_GetRenderDrawColorFloat * \sa SDL_SetRenderDrawColor */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); +extern SDL_DECLSPEC bool SDLCALL SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); /** * Get the color used for drawing operations (Rect, Line and Clear). @@ -1623,7 +1623,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderDrawColor(SDL_Renderer *render * rendering target. * \param a a pointer filled in with the alpha value used to draw on the * rendering target. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1631,7 +1631,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderDrawColor(SDL_Renderer *render * \sa SDL_SetRenderDrawColorFloat * \sa SDL_GetRenderDrawColor */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderDrawColorFloat(SDL_Renderer *renderer, float *r, float *g, float *b, float *a); +extern SDL_DECLSPEC bool SDLCALL SDL_GetRenderDrawColorFloat(SDL_Renderer *renderer, float *r, float *g, float *b, float *a); /** * Set the color scale used for render operations. @@ -1646,28 +1646,28 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderDrawColorFloat(SDL_Renderer *r * * \param renderer the rendering context. * \param scale the color scale value. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetRenderColorScale */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderColorScale(SDL_Renderer *renderer, float scale); +extern SDL_DECLSPEC bool SDLCALL SDL_SetRenderColorScale(SDL_Renderer *renderer, float scale); /** * Get the color scale used for render operations. * * \param renderer the rendering context. * \param scale a pointer filled in with the current color scale value. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetRenderColorScale */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderColorScale(SDL_Renderer *renderer, float *scale); +extern SDL_DECLSPEC bool SDLCALL SDL_GetRenderColorScale(SDL_Renderer *renderer, float *scale); /** * Set the blend mode used for drawing operations (Fill and Line). @@ -1676,28 +1676,28 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderColorScale(SDL_Renderer *rende * * \param renderer the rendering context. * \param blendMode the SDL_BlendMode to use for blending. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetRenderDrawBlendMode */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode); +extern SDL_DECLSPEC bool SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode); /** * Get the blend mode used for drawing operations. * * \param renderer the rendering context. * \param blendMode a pointer filled in with the current SDL_BlendMode. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetRenderDrawBlendMode */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode); +extern SDL_DECLSPEC bool SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode); /** * Clear the current rendering target with the drawing color. @@ -1708,14 +1708,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer *re * SDL_SetRenderDrawColor() when needed. * * \param renderer the rendering context. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetRenderDrawColor */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderClear(SDL_Renderer *renderer); +extern SDL_DECLSPEC bool SDLCALL SDL_RenderClear(SDL_Renderer *renderer); /** * Draw a point on the current rendering target at subpixel precision. @@ -1723,14 +1723,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderClear(SDL_Renderer *renderer); * \param renderer the renderer which should draw a point. * \param x the x coordinate of the point. * \param y the y coordinate of the point. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_RenderPoints */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderPoint(SDL_Renderer *renderer, float x, float y); +extern SDL_DECLSPEC bool SDLCALL SDL_RenderPoint(SDL_Renderer *renderer, float x, float y); /** * Draw multiple points on the current rendering target at subpixel precision. @@ -1738,14 +1738,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderPoint(SDL_Renderer *renderer, flo * \param renderer the renderer which should draw multiple points. * \param points the points to draw. * \param count the number of points to draw. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_RenderPoint */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int count); +extern SDL_DECLSPEC bool SDLCALL SDL_RenderPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int count); /** * Draw a line on the current rendering target at subpixel precision. @@ -1755,14 +1755,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderPoints(SDL_Renderer *renderer, co * \param y1 the y coordinate of the start point. * \param x2 the x coordinate of the end point. * \param y2 the y coordinate of the end point. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_RenderLines */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderLine(SDL_Renderer *renderer, float x1, float y1, float x2, float y2); +extern SDL_DECLSPEC bool SDLCALL SDL_RenderLine(SDL_Renderer *renderer, float x1, float y1, float x2, float y2); /** * Draw a series of connected lines on the current rendering target at @@ -1771,14 +1771,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderLine(SDL_Renderer *renderer, floa * \param renderer the renderer which should draw multiple lines. * \param points the points along the lines. * \param count the number of points, drawing count-1 lines. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_RenderLine */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count); +extern SDL_DECLSPEC bool SDLCALL SDL_RenderLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count); /** * Draw a rectangle on the current rendering target at subpixel precision. @@ -1786,14 +1786,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderLines(SDL_Renderer *renderer, con * \param renderer the renderer which should draw a rectangle. * \param rect a pointer to the destination rectangle, or NULL to outline the * entire rendering target. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_RenderRects */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderRect(SDL_Renderer *renderer, const SDL_FRect *rect); +extern SDL_DECLSPEC bool SDLCALL SDL_RenderRect(SDL_Renderer *renderer, const SDL_FRect *rect); /** * Draw some number of rectangles on the current rendering target at subpixel @@ -1802,14 +1802,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderRect(SDL_Renderer *renderer, cons * \param renderer the renderer which should draw multiple rectangles. * \param rects a pointer to an array of destination rectangles. * \param count the number of rectangles. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_RenderRect */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count); +extern SDL_DECLSPEC bool SDLCALL SDL_RenderRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count); /** * Fill a rectangle on the current rendering target with the drawing color at @@ -1818,14 +1818,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderRects(SDL_Renderer *renderer, con * \param renderer the renderer which should fill a rectangle. * \param rect a pointer to the destination rectangle, or NULL for the entire * rendering target. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_RenderFillRects */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderFillRect(SDL_Renderer *renderer, const SDL_FRect *rect); +extern SDL_DECLSPEC bool SDLCALL SDL_RenderFillRect(SDL_Renderer *renderer, const SDL_FRect *rect); /** * Fill some number of rectangles on the current rendering target with the @@ -1834,14 +1834,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderFillRect(SDL_Renderer *renderer, * \param renderer the renderer which should fill multiple rectangles. * \param rects a pointer to an array of destination rectangles. * \param count the number of rectangles. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_RenderFillRect */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count); +extern SDL_DECLSPEC bool SDLCALL SDL_RenderFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count); /** * Copy a portion of the texture to the current rendering target at subpixel @@ -1853,7 +1853,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderFillRects(SDL_Renderer *renderer, * texture. * \param dstrect a pointer to the destination rectangle, or NULL for the * entire rendering target. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1861,7 +1861,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderFillRects(SDL_Renderer *renderer, * \sa SDL_RenderTextureRotated * \sa SDL_RenderTextureTiled */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FRect *dstrect); +extern SDL_DECLSPEC bool SDLCALL SDL_RenderTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FRect *dstrect); /** * Copy a portion of the source texture to the current rendering target, with @@ -1880,14 +1880,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderTexture(SDL_Renderer *renderer, S * around dstrect.w/2, dstrect.h/2). * \param flip an SDL_FlipMode value stating which flipping actions should be * performed on the texture. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_RenderTexture */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderTextureRotated(SDL_Renderer *renderer, SDL_Texture *texture, +extern SDL_DECLSPEC bool SDLCALL SDL_RenderTextureRotated(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FRect *dstrect, const double angle, const SDL_FPoint *center, const SDL_FlipMode flip); @@ -1908,14 +1908,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderTextureRotated(SDL_Renderer *rend * 64x64 tiles. * \param dstrect a pointer to the destination rectangle, or NULL for the * entire rendering target. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_RenderTexture */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderTextureTiled(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float scale, const SDL_FRect *dstrect); +extern SDL_DECLSPEC bool SDLCALL SDL_RenderTextureTiled(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float scale, const SDL_FRect *dstrect); /** * Perform a scaled copy using the 9-grid algorithm to the current rendering @@ -1940,14 +1940,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderTextureTiled(SDL_Renderer *render * corner of `dstrect`, or 0.0f for an unscaled copy. * \param dstrect a pointer to the destination rectangle, or NULL for the * entire rendering target. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_RenderTexture */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderTexture9Grid(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float left_width, float right_width, float top_height, float bottom_height, float scale, const SDL_FRect *dstrect); +extern SDL_DECLSPEC bool SDLCALL SDL_RenderTexture9Grid(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float left_width, float right_width, float top_height, float bottom_height, float scale, const SDL_FRect *dstrect); /** * Render a list of triangles, optionally using a texture and indices into the @@ -1962,14 +1962,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderTexture9Grid(SDL_Renderer *render * array, if NULL all vertices will be rendered in sequential * order. * \param num_indices number of indices. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_RenderGeometryRaw */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer, +extern SDL_DECLSPEC bool SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Vertex *vertices, int num_vertices, const int *indices, int num_indices); @@ -1992,14 +1992,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer, * if NULL all vertices will be rendered in sequential order. * \param num_indices number of indices. * \param size_indices index size: 1 (byte), 2 (short), 4 (int). - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_RenderGeometry */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderGeometryRaw(SDL_Renderer *renderer, +extern SDL_DECLSPEC bool SDLCALL SDL_RenderGeometryRaw(SDL_Renderer *renderer, SDL_Texture *texture, const float *xy, int xy_stride, const SDL_FColor *color, int color_stride, @@ -2052,7 +2052,7 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_RenderReadPixels(SDL_Renderer *ren * do not have a concept of backbuffers. * * \param renderer the rendering context. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety You may only call this function on the main thread. @@ -2072,7 +2072,7 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_RenderReadPixels(SDL_Renderer *ren * \sa SDL_SetRenderDrawBlendMode * \sa SDL_SetRenderDrawColor */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderPresent(SDL_Renderer *renderer); +extern SDL_DECLSPEC bool SDLCALL SDL_RenderPresent(SDL_Renderer *renderer); /** * Destroy the specified texture. @@ -2127,12 +2127,12 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer *renderer); * be prepared to make changes if specific state needs to be protected. * * \param renderer the rendering context. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FlushRenderer(SDL_Renderer *renderer); +extern SDL_DECLSPEC bool SDLCALL SDL_FlushRenderer(SDL_Renderer *renderer); /** * Get the CAMetalLayer associated with the given Metal renderer. @@ -2192,7 +2192,7 @@ extern SDL_DECLSPEC void * SDLCALL SDL_GetRenderMetalCommandEncoder(SDL_Renderer * \param signal_semaphore a VkSempahore that SDL will signal when rendering * for the current frame is complete, or 0 if not * needed. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is **NOT** safe to call this function from two threads at @@ -2200,7 +2200,7 @@ extern SDL_DECLSPEC void * SDLCALL SDL_GetRenderMetalCommandEncoder(SDL_Renderer * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AddVulkanRenderSemaphores(SDL_Renderer *renderer, Uint32 wait_stage_mask, Sint64 wait_semaphore, Sint64 signal_semaphore); +extern SDL_DECLSPEC bool SDLCALL SDL_AddVulkanRenderSemaphores(SDL_Renderer *renderer, Uint32 wait_stage_mask, Sint64 wait_semaphore, Sint64 signal_semaphore); /** * Toggle VSync of the given renderer. @@ -2216,14 +2216,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AddVulkanRenderSemaphores(SDL_Renderer * * \param renderer the renderer to toggle. * \param vsync the vertical refresh sync interval. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetRenderVSync */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderVSync(SDL_Renderer *renderer, int vsync); +extern SDL_DECLSPEC bool SDLCALL SDL_SetRenderVSync(SDL_Renderer *renderer, int vsync); #define SDL_RENDERER_VSYNC_DISABLED 0 #define SDL_RENDERER_VSYNC_ADAPTIVE (-1) @@ -2234,14 +2234,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderVSync(SDL_Renderer *renderer, * \param renderer the renderer to toggle. * \param vsync an int filled with the current vertical refresh sync interval. * See SDL_SetRenderVSync() for the meaning of the value. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetRenderVSync */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderVSync(SDL_Renderer *renderer, int *vsync); +extern SDL_DECLSPEC bool SDLCALL SDL_GetRenderVSync(SDL_Renderer *renderer, int *vsync); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/include/SDL3/SDL_sensor.h b/include/SDL3/SDL_sensor.h index a0dfb8d88..7287b2252 100644 --- a/include/SDL3/SDL_sensor.h +++ b/include/SDL3/SDL_sensor.h @@ -272,12 +272,12 @@ extern SDL_DECLSPEC SDL_SensorID SDLCALL SDL_GetSensorID(SDL_Sensor *sensor); * \param sensor the SDL_Sensor object to query. * \param data a pointer filled with the current sensor state. * \param num_values the number of values to write to data. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetSensorData(SDL_Sensor *sensor, float *data, int num_values); +extern SDL_DECLSPEC bool SDLCALL SDL_GetSensorData(SDL_Sensor *sensor, float *data, int num_values); /** * Close a sensor previously opened with SDL_OpenSensor(). diff --git a/include/SDL3/SDL_stdinc.h b/include/SDL3/SDL_stdinc.h index 0f98b35d1..d8f855683 100644 --- a/include/SDL3/SDL_stdinc.h +++ b/include/SDL3/SDL_stdinc.h @@ -272,34 +272,6 @@ void *alloca(size_t); */ /* @{ */ -/** - * A boolean false. - * - * \since This macro is available since SDL 3.0.0. - * - * \sa SDL_bool - */ -#define SDL_FALSE false - -/** - * A boolean true. - * - * \since This macro is available since SDL 3.0.0. - * - * \sa SDL_bool - */ -#define SDL_TRUE true - -/** - * A boolean type: true or false. - * - * \since This datatype is available since SDL 3.0.0. - * - * \sa SDL_TRUE - * \sa SDL_FALSE - */ -typedef bool SDL_bool; - /** * A signed 8-bit integer type. * @@ -570,7 +542,7 @@ typedef Sint64 SDL_Time; /** \cond */ #ifndef DOXYGEN_SHOULD_IGNORE_THIS -SDL_COMPILE_TIME_ASSERT(bool_size, sizeof(SDL_bool) == 1); +SDL_COMPILE_TIME_ASSERT(bool_size, sizeof(bool) == 1); SDL_COMPILE_TIME_ASSERT(uint8_size, sizeof(Uint8) == 1); SDL_COMPILE_TIME_ASSERT(sint8_size, sizeof(Sint8) == 1); SDL_COMPILE_TIME_ASSERT(uint16_size, sizeof(Uint16) == 2); @@ -908,7 +880,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_ * \param calloc_func custom calloc function. * \param realloc_func custom realloc function. * \param free_func custom free function. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread, but one @@ -920,7 +892,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_ * \sa SDL_GetMemoryFunctions * \sa SDL_GetOriginalMemoryFunctions */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_func, +extern SDL_DECLSPEC bool SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_func, SDL_calloc_func calloc_func, SDL_realloc_func realloc_func, SDL_free_func free_func); @@ -1019,12 +991,12 @@ extern SDL_DECLSPEC SDL_Environment * SDLCALL SDL_GetEnvironment(void); /** * Create a set of environment variables * - * \param populated SDL_TRUE to initialize it from the C runtime environment, - * SDL_FALSE to create an empty environment. + * \param populated true to initialize it from the C runtime environment, + * false to create an empty environment. * \returns a pointer to the new environment or NULL on failure; call * SDL_GetError() for more information. * - * \threadsafety If `populated` is SDL_FALSE, it is safe to call this function + * \threadsafety If `populated` is false, it is safe to call this function * from any thread, otherwise it is safe if no other threads are * calling setenv() or unsetenv() * @@ -1036,7 +1008,7 @@ extern SDL_DECLSPEC SDL_Environment * SDLCALL SDL_GetEnvironment(void); * \sa SDL_UnsetEnvironmentVariable * \sa SDL_DestroyEnvironment */ -extern SDL_DECLSPEC SDL_Environment * SDLCALL SDL_CreateEnvironment(SDL_bool populated); +extern SDL_DECLSPEC SDL_Environment * SDLCALL SDL_CreateEnvironment(bool populated); /** * Get the value of a variable in the environment. @@ -1085,10 +1057,10 @@ extern SDL_DECLSPEC char ** SDLCALL SDL_GetEnvironmentVariables(SDL_Environment * \param env the environment to modify. * \param name the name of the variable to set. * \param value the value of the variable to set. - * \param overwrite SDL_TRUE to overwrite the variable if it exists, SDL_FALSE + * \param overwrite true to overwrite the variable if it exists, false * to return success without setting the variable if it * already exists. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -1101,14 +1073,14 @@ extern SDL_DECLSPEC char ** SDLCALL SDL_GetEnvironmentVariables(SDL_Environment * \sa SDL_GetEnvironmentVariables * \sa SDL_UnsetEnvironmentVariable */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetEnvironmentVariable(SDL_Environment *env, const char *name, const char *value, SDL_bool overwrite); +extern SDL_DECLSPEC bool SDLCALL SDL_SetEnvironmentVariable(SDL_Environment *env, const char *name, const char *value, bool overwrite); /** * Clear a variable from the environment. * * \param env the environment to modify. * \param name the name of the variable to unset. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -1122,7 +1094,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetEnvironmentVariable(SDL_Environment * \sa SDL_SetEnvironmentVariable * \sa SDL_UnsetEnvironmentVariable */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UnsetEnvironmentVariable(SDL_Environment *env, const char *name); +extern SDL_DECLSPEC bool SDLCALL SDL_UnsetEnvironmentVariable(SDL_Environment *env, const char *name); /** * Destroy a set of environment variables. @@ -4033,28 +4005,28 @@ size_t wcslcat(wchar_t *dst, const wchar_t *src, size_t size); /** * Multiply two integers, checking for overflow. * - * If `a * b` would overflow, return SDL_FALSE. + * If `a * b` would overflow, return false. * - * Otherwise store `a * b` via ret and return SDL_TRUE. + * Otherwise store `a * b` via ret and return true. * * \param a the multiplicand. * \param b the multiplier. * \param ret on non-overflow output, stores the multiplication result. May * not be NULL. - * \returns SDL_FALSE on overflow, SDL_TRUE if result is multiplied without + * \returns false on overflow, true if result is multiplied without * overflow. * * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. */ -SDL_FORCE_INLINE SDL_bool SDL_size_mul_check_overflow(size_t a, size_t b, size_t *ret) +SDL_FORCE_INLINE bool SDL_size_mul_check_overflow(size_t a, size_t b, size_t *ret) { if (a != 0 && b > SDL_SIZE_MAX / a) { - return SDL_FALSE; + return false; } *ret = a * b; - return SDL_TRUE; + return true; } #ifndef SDL_WIKI_DOCUMENTATION_SECTION @@ -4062,7 +4034,7 @@ SDL_FORCE_INLINE SDL_bool SDL_size_mul_check_overflow(size_t a, size_t b, size_t /* This needs to be wrapped in an inline rather than being a direct #define, * because __builtin_mul_overflow() is type-generic, but we want to be * consistent about interpreting a and b as size_t. */ -SDL_FORCE_INLINE SDL_bool SDL_size_mul_check_overflow_builtin(size_t a, size_t b, size_t *ret) +SDL_FORCE_INLINE bool SDL_size_mul_check_overflow_builtin(size_t a, size_t b, size_t *ret) { return (__builtin_mul_overflow(a, b, ret) == 0); } @@ -4081,27 +4053,27 @@ SDL_FORCE_INLINE SDL_bool SDL_size_mul_check_overflow_builtin(size_t a, size_t b * \param b the second addend. * \param ret on non-overflow output, stores the addition result. May not be * NULL. - * \returns SDL_FALSE on overflow, SDL_TRUE if result is added without + * \returns false on overflow, true if result is added without * overflow. * * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. */ -SDL_FORCE_INLINE SDL_bool SDL_size_add_check_overflow(size_t a, size_t b, size_t *ret) +SDL_FORCE_INLINE bool SDL_size_add_check_overflow(size_t a, size_t b, size_t *ret) { if (b > SDL_SIZE_MAX - a) { - return SDL_FALSE; + return false; } *ret = a + b; - return SDL_TRUE; + return true; } #ifndef SDL_WIKI_DOCUMENTATION_SECTION #if SDL_HAS_BUILTIN(__builtin_add_overflow) /* This needs to be wrapped in an inline rather than being a direct #define, * the same as the call to __builtin_mul_overflow() above. */ -SDL_FORCE_INLINE SDL_bool SDL_size_add_check_overflow_builtin(size_t a, size_t b, size_t *ret) +SDL_FORCE_INLINE bool SDL_size_add_check_overflow_builtin(size_t a, size_t b, size_t *ret) { return (__builtin_add_overflow(a, b, ret) == 0); } diff --git a/include/SDL3/SDL_storage.h b/include/SDL3/SDL_storage.h index 2b2259a89..93a4b4854 100644 --- a/include/SDL3/SDL_storage.h +++ b/include/SDL3/SDL_storage.h @@ -64,34 +64,34 @@ typedef struct SDL_StorageInterface Uint32 version; /* Called when the storage is closed */ - SDL_bool (SDLCALL *close)(void *userdata); + bool (SDLCALL *close)(void *userdata); /* Optional, returns whether the storage is currently ready for access */ - SDL_bool (SDLCALL *ready)(void *userdata); + bool (SDLCALL *ready)(void *userdata); /* Enumerate a directory, optional for write-only storage */ - SDL_bool (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata); + bool (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata); /* Get path information, optional for write-only storage */ - SDL_bool (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info); + bool (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info); /* Read a file from storage, optional for write-only storage */ - SDL_bool (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length); + bool (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length); /* Write a file to storage, optional for read-only storage */ - SDL_bool (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length); + bool (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length); /* Create a directory, optional for read-only storage */ - SDL_bool (SDLCALL *mkdir)(void *userdata, const char *path); + bool (SDLCALL *mkdir)(void *userdata, const char *path); /* Remove a file or empty directory, optional for read-only storage */ - SDL_bool (SDLCALL *remove)(void *userdata, const char *path); + bool (SDLCALL *remove)(void *userdata, const char *path); /* Rename a path, optional for read-only storage */ - SDL_bool (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath); + bool (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath); /* Copy a file, optional for read-only storage */ - SDL_bool (SDLCALL *copy)(void *userdata, const char *oldpath, const char *newpath); + bool (SDLCALL *copy)(void *userdata, const char *oldpath, const char *newpath); /* Get the space remaining, optional for read-only storage */ Uint64 (SDLCALL *space_remaining)(void *userdata); @@ -218,7 +218,7 @@ extern SDL_DECLSPEC SDL_Storage * SDLCALL SDL_OpenStorage(const SDL_StorageInter * Closes and frees a storage container. * * \param storage a storage container to close. - * \returns SDL_TRUE if the container was freed with no errors, SDL_FALSE + * \returns true if the container was freed with no errors, false * otherwise; call SDL_GetError() for more information. Even if the * function returns an error, the container data will be freed; the * error is only for informational purposes. @@ -230,21 +230,21 @@ extern SDL_DECLSPEC SDL_Storage * SDLCALL SDL_OpenStorage(const SDL_StorageInter * \sa SDL_OpenTitleStorage * \sa SDL_OpenUserStorage */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CloseStorage(SDL_Storage *storage); +extern SDL_DECLSPEC bool SDLCALL SDL_CloseStorage(SDL_Storage *storage); /** * Checks if the storage container is ready to use. * * This function should be called in regular intervals until it returns - * SDL_TRUE - however, it is not recommended to spinwait on this call, as the + * true - however, it is not recommended to spinwait on this call, as the * backend may depend on a synchronous message loop. * * \param storage a storage container to query. - * \returns SDL_TRUE if the container is ready, SDL_FALSE otherwise. + * \returns true if the container is ready, false otherwise. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StorageReady(SDL_Storage *storage); +extern SDL_DECLSPEC bool SDLCALL SDL_StorageReady(SDL_Storage *storage); /** * Query the size of a file within a storage container. @@ -252,7 +252,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StorageReady(SDL_Storage *storage); * \param storage a storage container to query. * \param path the relative path of the file to query. * \param length a pointer to be filled with the file's length. - * \returns SDL_TRUE if the file could be queried or SDL_FALSE on failure; + * \returns true if the file could be queried or false on failure; * call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -260,7 +260,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StorageReady(SDL_Storage *storage); * \sa SDL_ReadStorageFile * \sa SDL_StorageReady */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetStorageFileSize(SDL_Storage *storage, const char *path, Uint64 *length); +extern SDL_DECLSPEC bool SDLCALL SDL_GetStorageFileSize(SDL_Storage *storage, const char *path, Uint64 *length); /** * Synchronously read a file from a storage container into a client-provided @@ -270,7 +270,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetStorageFileSize(SDL_Storage *storage * \param path the relative path of the file to read. * \param destination a client-provided buffer to read the file into. * \param length the length of the destination buffer. - * \returns SDL_TRUE if the file was read or SDL_FALSE on failure; call + * \returns true if the file was read or false on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -279,7 +279,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetStorageFileSize(SDL_Storage *storage * \sa SDL_StorageReady * \sa SDL_WriteStorageFile */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadStorageFile(SDL_Storage *storage, const char *path, void *destination, Uint64 length); +extern SDL_DECLSPEC bool SDLCALL SDL_ReadStorageFile(SDL_Storage *storage, const char *path, void *destination, Uint64 length); /** * Synchronously write a file from client memory into a storage container. @@ -288,7 +288,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadStorageFile(SDL_Storage *storage, c * \param path the relative path of the file to write. * \param source a client-provided buffer to write from. * \param length the length of the source buffer. - * \returns SDL_TRUE if the file was written or SDL_FALSE on failure; call + * \returns true if the file was written or false on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -297,21 +297,21 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadStorageFile(SDL_Storage *storage, c * \sa SDL_ReadStorageFile * \sa SDL_StorageReady */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteStorageFile(SDL_Storage *storage, const char *path, const void *source, Uint64 length); +extern SDL_DECLSPEC bool SDLCALL SDL_WriteStorageFile(SDL_Storage *storage, const char *path, const void *source, Uint64 length); /** * Create a directory in a writable storage container. * * \param storage a storage container. * \param path the path of the directory to create. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_StorageReady */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CreateStorageDirectory(SDL_Storage *storage, const char *path); +extern SDL_DECLSPEC bool SDLCALL SDL_CreateStorageDirectory(SDL_Storage *storage, const char *path); /** * Enumerate a directory in a storage container through a callback function. @@ -324,28 +324,28 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CreateStorageDirectory(SDL_Storage *sto * \param path the path of the directory to enumerate. * \param callback a function that is called for each entry in the directory. * \param userdata a pointer that is passed to `callback`. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_StorageReady */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_EnumerateStorageDirectory(SDL_Storage *storage, const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata); +extern SDL_DECLSPEC bool SDLCALL SDL_EnumerateStorageDirectory(SDL_Storage *storage, const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata); /** * Remove a file or an empty directory in a writable storage container. * * \param storage a storage container. * \param path the path of the directory to enumerate. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_StorageReady */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RemoveStoragePath(SDL_Storage *storage, const char *path); +extern SDL_DECLSPEC bool SDLCALL SDL_RemoveStoragePath(SDL_Storage *storage, const char *path); /** * Rename a file or directory in a writable storage container. @@ -353,14 +353,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RemoveStoragePath(SDL_Storage *storage, * \param storage a storage container. * \param oldpath the old path. * \param newpath the new path. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_StorageReady */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenameStoragePath(SDL_Storage *storage, const char *oldpath, const char *newpath); +extern SDL_DECLSPEC bool SDLCALL SDL_RenameStoragePath(SDL_Storage *storage, const char *oldpath, const char *newpath); /** * Copy a file in a writable storage container. @@ -368,14 +368,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenameStoragePath(SDL_Storage *storage, * \param storage a storage container. * \param oldpath the old path. * \param newpath the new path. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_StorageReady */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CopyStorageFile(SDL_Storage *storage, const char *oldpath, const char *newpath); +extern SDL_DECLSPEC bool SDLCALL SDL_CopyStorageFile(SDL_Storage *storage, const char *oldpath, const char *newpath); /** * Get information about a filesystem path in a storage container. @@ -384,14 +384,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CopyStorageFile(SDL_Storage *storage, c * \param path the path to query. * \param info a pointer filled in with information about the path, or NULL to * check for the existence of a file. - * \returns SDL_TRUE on success or SDL_FALSE if the file doesn't exist, or + * \returns true on success or false if the file doesn't exist, or * another failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_StorageReady */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetStoragePathInfo(SDL_Storage *storage, const char *path, SDL_PathInfo *info); +extern SDL_DECLSPEC bool SDLCALL SDL_GetStoragePathInfo(SDL_Storage *storage, const char *path, SDL_PathInfo *info); /** * Queries the remaining space in a storage container. diff --git a/include/SDL3/SDL_surface.h b/include/SDL3/SDL_surface.h index 33a27ed3e..fb62aa121 100644 --- a/include/SDL3/SDL_surface.h +++ b/include/SDL3/SDL_surface.h @@ -223,14 +223,14 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSurfaceProperties(SDL_Surfac * \param surface the SDL_Surface structure to update. * \param colorspace an SDL_ColorSpace value describing the surface * colorspace. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetSurfaceColorspace */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceColorspace(SDL_Surface *surface, SDL_Colorspace colorspace); +extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceColorspace(SDL_Surface *surface, SDL_Colorspace colorspace); /** * Get the colorspace used by a surface. @@ -284,7 +284,7 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_CreateSurfacePalette(SDL_Surface * * * \param surface the SDL_Surface structure to update. * \param palette the SDL_Palette structure to use. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -292,7 +292,7 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_CreateSurfacePalette(SDL_Surface * * \sa SDL_CreatePalette * \sa SDL_GetSurfacePalette */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfacePalette(SDL_Surface *surface, SDL_Palette *palette); +extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfacePalette(SDL_Surface *surface, SDL_Palette *palette); /** * Get the palette used by a surface. @@ -321,7 +321,7 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_GetSurfacePalette(SDL_Surface *sur * \param surface the SDL_Surface structure to update. * \param image a pointer to an alternate SDL_Surface to associate with this * surface. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -330,13 +330,13 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_GetSurfacePalette(SDL_Surface *sur * \sa SDL_GetSurfaceImages * \sa SDL_SurfaceHasAlternateImages */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AddSurfaceAlternateImage(SDL_Surface *surface, SDL_Surface *image); +extern SDL_DECLSPEC bool SDLCALL SDL_AddSurfaceAlternateImage(SDL_Surface *surface, SDL_Surface *image); /** * Return whether a surface has alternate versions available. * * \param surface the SDL_Surface structure to query. - * \returns SDL_TRUE if alternate versions are available or SDL_TRUE + * \returns true if alternate versions are available or true * otherwise. * * \since This function is available since SDL 3.0.0. @@ -345,7 +345,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AddSurfaceAlternateImage(SDL_Surface *s * \sa SDL_RemoveSurfaceAlternateImages * \sa SDL_GetSurfaceImages */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasAlternateImages(SDL_Surface *surface); +extern SDL_DECLSPEC bool SDLCALL SDL_SurfaceHasAlternateImages(SDL_Surface *surface); /** * Get an array including all versions of a surface. @@ -401,7 +401,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_RemoveSurfaceAlternateImages(SDL_Surface *s * format of the surface will not change. * * \param surface the SDL_Surface structure to be locked. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -409,7 +409,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_RemoveSurfaceAlternateImages(SDL_Surface *s * \sa SDL_MUSTLOCK * \sa SDL_UnlockSurface */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockSurface(SDL_Surface *surface); +extern SDL_DECLSPEC bool SDLCALL SDL_LockSurface(SDL_Surface *surface); /** * Release a surface after directly accessing the pixels. @@ -429,7 +429,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface); * will result in a memory leak. * * \param src the data stream for the surface. - * \param closeio if SDL_TRUE, calls SDL_CloseIO() on `src` before returning, + * \param closeio if true, calls SDL_CloseIO() on `src` before returning, * even in the case of an error. * \returns a pointer to a new SDL_Surface structure or NULL on failure; call * SDL_GetError() for more information. @@ -440,7 +440,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface); * \sa SDL_LoadBMP * \sa SDL_SaveBMP_IO */ -extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP_IO(SDL_IOStream *src, SDL_bool closeio); +extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP_IO(SDL_IOStream *src, bool closeio); /** * Load a BMP image from a file. @@ -471,9 +471,9 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP(const char *file); * * \param surface the SDL_Surface structure containing the image to be saved. * \param dst a data stream to save to. - * \param closeio if SDL_TRUE, calls SDL_CloseIO() on `dst` before returning, + * \param closeio if true, calls SDL_CloseIO() on `dst` before returning, * even in the case of an error. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -481,7 +481,7 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP(const char *file); * \sa SDL_LoadBMP_IO * \sa SDL_SaveBMP */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SaveBMP_IO(SDL_Surface *surface, SDL_IOStream *dst, SDL_bool closeio); +extern SDL_DECLSPEC bool SDLCALL SDL_SaveBMP_IO(SDL_Surface *surface, SDL_IOStream *dst, bool closeio); /** * Save a surface to a file. @@ -494,7 +494,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SaveBMP_IO(SDL_Surface *surface, SDL_IO * * \param surface the SDL_Surface structure containing the image to be saved. * \param file a file to save to. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -502,7 +502,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SaveBMP_IO(SDL_Surface *surface, SDL_IO * \sa SDL_LoadBMP * \sa SDL_SaveBMP_IO */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SaveBMP(SDL_Surface *surface, const char *file); +extern SDL_DECLSPEC bool SDLCALL SDL_SaveBMP(SDL_Surface *surface, const char *file); /** * Set the RLE acceleration hint for a surface. @@ -511,9 +511,9 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SaveBMP(SDL_Surface *surface, const cha * the surface must be locked before directly accessing the pixels. * * \param surface the SDL_Surface structure to optimize. - * \param enabled SDL_TRUE to enable RLE acceleration, SDL_FALSE to disable + * \param enabled true to enable RLE acceleration, false to disable * it. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -522,21 +522,21 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SaveBMP(SDL_Surface *surface, const cha * \sa SDL_LockSurface * \sa SDL_UnlockSurface */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceRLE(SDL_Surface *surface, SDL_bool enabled); +extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceRLE(SDL_Surface *surface, bool enabled); /** * Returns whether the surface is RLE enabled. * - * It is safe to pass a NULL `surface` here; it will return SDL_FALSE. + * It is safe to pass a NULL `surface` here; it will return false. * * \param surface the SDL_Surface structure to query. - * \returns SDL_TRUE if the surface is RLE enabled, SDL_FALSE otherwise. + * \returns true if the surface is RLE enabled, false otherwise. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetSurfaceRLE */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasRLE(SDL_Surface *surface); +extern SDL_DECLSPEC bool SDLCALL SDL_SurfaceHasRLE(SDL_Surface *surface); /** * Set the color key (transparent pixel) in a surface. @@ -549,10 +549,10 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasRLE(SDL_Surface *surface); * SDL_MapRGB(). * * \param surface the SDL_Surface structure to update. - * \param enabled SDL_TRUE to enable color key, SDL_FALSE to disable color + * \param enabled true to enable color key, false to disable color * key. * \param key the transparent pixel. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -561,22 +561,22 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasRLE(SDL_Surface *surface); * \sa SDL_SetSurfaceRLE * \sa SDL_SurfaceHasColorKey */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceColorKey(SDL_Surface *surface, SDL_bool enabled, Uint32 key); +extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceColorKey(SDL_Surface *surface, bool enabled, Uint32 key); /** * Returns whether the surface has a color key. * - * It is safe to pass a NULL `surface` here; it will return SDL_FALSE. + * It is safe to pass a NULL `surface` here; it will return false. * * \param surface the SDL_Surface structure to query. - * \returns SDL_TRUE if the surface has a color key, SDL_FALSE otherwise. + * \returns true if the surface has a color key, false otherwise. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetSurfaceColorKey * \sa SDL_GetSurfaceColorKey */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasColorKey(SDL_Surface *surface); +extern SDL_DECLSPEC bool SDLCALL SDL_SurfaceHasColorKey(SDL_Surface *surface); /** * Get the color key (transparent pixel) for a surface. @@ -585,11 +585,11 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasColorKey(SDL_Surface *surface * SDL_MapRGB(). * * If the surface doesn't have color key enabled this function returns - * SDL_FALSE. + * false. * * \param surface the SDL_Surface structure to query. * \param key a pointer filled in with the transparent pixel. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -597,7 +597,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasColorKey(SDL_Surface *surface * \sa SDL_SetSurfaceColorKey * \sa SDL_SurfaceHasColorKey */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetSurfaceColorKey(SDL_Surface *surface, Uint32 *key); +extern SDL_DECLSPEC bool SDLCALL SDL_GetSurfaceColorKey(SDL_Surface *surface, Uint32 *key); /** * Set an additional color value multiplied into blit operations. @@ -612,7 +612,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetSurfaceColorKey(SDL_Surface *surface * \param r the red color value multiplied into blit operations. * \param g the green color value multiplied into blit operations. * \param b the blue color value multiplied into blit operations. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -620,7 +620,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetSurfaceColorKey(SDL_Surface *surface * \sa SDL_GetSurfaceColorMod * \sa SDL_SetSurfaceAlphaMod */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceColorMod(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b); +extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceColorMod(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b); /** @@ -630,7 +630,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceColorMod(SDL_Surface *surface * \param r a pointer filled in with the current red color value. * \param g a pointer filled in with the current green color value. * \param b a pointer filled in with the current blue color value. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -638,7 +638,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceColorMod(SDL_Surface *surface * \sa SDL_GetSurfaceAlphaMod * \sa SDL_SetSurfaceColorMod */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetSurfaceColorMod(SDL_Surface *surface, Uint8 *r, Uint8 *g, Uint8 *b); +extern SDL_DECLSPEC bool SDLCALL SDL_GetSurfaceColorMod(SDL_Surface *surface, Uint8 *r, Uint8 *g, Uint8 *b); /** * Set an additional alpha value used in blit operations. @@ -650,7 +650,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetSurfaceColorMod(SDL_Surface *surface * * \param surface the SDL_Surface structure to update. * \param alpha the alpha value multiplied into blit operations. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -658,14 +658,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetSurfaceColorMod(SDL_Surface *surface * \sa SDL_GetSurfaceAlphaMod * \sa SDL_SetSurfaceColorMod */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface *surface, Uint8 alpha); +extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface *surface, Uint8 alpha); /** * Get the additional alpha value used in blit operations. * * \param surface the SDL_Surface structure to query. * \param alpha a pointer filled in with the current alpha value. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -673,7 +673,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface *surface * \sa SDL_GetSurfaceColorMod * \sa SDL_SetSurfaceAlphaMod */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Uint8 *alpha); +extern SDL_DECLSPEC bool SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Uint8 *alpha); /** * Set the blend mode used for blit operations. @@ -684,28 +684,28 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface *surface * * \param surface the SDL_Surface structure to update. * \param blendMode the SDL_BlendMode to use for blit blending. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetSurfaceBlendMode */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode blendMode); +extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode blendMode); /** * Get the blend mode used for blit operations. * * \param surface the SDL_Surface structure to query. * \param blendMode a pointer filled in with the current SDL_BlendMode. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetSurfaceBlendMode */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode); +extern SDL_DECLSPEC bool SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode); /** * Set the clipping rectangle for a surface. @@ -719,14 +719,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface *surfac * \param surface the SDL_Surface structure to be clipped. * \param rect the SDL_Rect structure representing the clipping rectangle, or * NULL to disable clipping. - * \returns SDL_TRUE if the rectangle intersects the surface, otherwise - * SDL_FALSE and blits will be completely clipped. + * \returns true if the rectangle intersects the surface, otherwise + * false and blits will be completely clipped. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetSurfaceClipRect */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceClipRect(SDL_Surface *surface, const SDL_Rect *rect); +extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceClipRect(SDL_Surface *surface, const SDL_Rect *rect); /** * Get the clipping rectangle for a surface. @@ -738,26 +738,26 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceClipRect(SDL_Surface *surface * clipped. * \param rect an SDL_Rect structure filled in with the clipping rectangle for * the surface. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetSurfaceClipRect */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetSurfaceClipRect(SDL_Surface *surface, SDL_Rect *rect); +extern SDL_DECLSPEC bool SDLCALL SDL_GetSurfaceClipRect(SDL_Surface *surface, SDL_Rect *rect); /** * Flip a surface vertically or horizontally. * * \param surface the surface to flip. * \param flip the direction to flip. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FlipSurface(SDL_Surface *surface, SDL_FlipMode flip); +extern SDL_DECLSPEC bool SDLCALL SDL_FlipSurface(SDL_Surface *surface, SDL_FlipMode flip); /** * Creates a new surface identical to the existing surface. @@ -860,14 +860,14 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_ConvertSurfaceAndColorspace(SDL_Su * \param dst_format an SDL_PixelFormat value of the `dst` pixels format. * \param dst a pointer to be filled in with new pixel data. * \param dst_pitch the pitch of the destination pixels, in bytes. - * \returns SDL_FALSE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns false on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_ConvertPixelsAndColorspace */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ConvertPixels(int width, int height, SDL_PixelFormat src_format, const void *src, int src_pitch, SDL_PixelFormat dst_format, void *dst, int dst_pitch); +extern SDL_DECLSPEC bool SDLCALL SDL_ConvertPixels(int width, int height, SDL_PixelFormat src_format, const void *src, int src_pitch, SDL_PixelFormat dst_format, void *dst, int dst_pitch); /** * Copy a block of pixels of one format and colorspace to another format and @@ -889,14 +889,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ConvertPixels(int width, int height, SD * properties, or 0. * \param dst a pointer to be filled in with new pixel data. * \param dst_pitch the pitch of the destination pixels, in bytes. - * \returns SDL_FALSE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns false on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_ConvertPixels */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ConvertPixelsAndColorspace(int width, int height, SDL_PixelFormat src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, const void *src, int src_pitch, SDL_PixelFormat dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, void *dst, int dst_pitch); +extern SDL_DECLSPEC bool SDLCALL SDL_ConvertPixelsAndColorspace(int width, int height, SDL_PixelFormat src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, const void *src, int src_pitch, SDL_PixelFormat dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, void *dst, int dst_pitch); /** * Premultiply the alpha on a block of pixels. @@ -911,14 +911,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ConvertPixelsAndColorspace(int width, i * \param dst_format an SDL_PixelFormat value of the `dst` pixels format. * \param dst a pointer to be filled in with premultiplied pixel data. * \param dst_pitch the pitch of the destination pixels, in bytes. - * \param linear SDL_TRUE to convert from sRGB to linear space for the alpha - * multiplication, SDL_FALSE to do multiplication in sRGB space. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \param linear true to convert from sRGB to linear space for the alpha + * multiplication, false to do multiplication in sRGB space. + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PremultiplyAlpha(int width, int height, SDL_PixelFormat src_format, const void *src, int src_pitch, SDL_PixelFormat dst_format, void *dst, int dst_pitch, SDL_bool linear); +extern SDL_DECLSPEC bool SDLCALL SDL_PremultiplyAlpha(int width, int height, SDL_PixelFormat src_format, const void *src, int src_pitch, SDL_PixelFormat dst_format, void *dst, int dst_pitch, bool linear); /** * Premultiply the alpha in a surface. @@ -926,14 +926,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PremultiplyAlpha(int width, int height, * This is safe to use with src == dst, but not for other overlapping areas. * * \param surface the surface to modify. - * \param linear SDL_TRUE to convert from sRGB to linear space for the alpha - * multiplication, SDL_FALSE to do multiplication in sRGB space. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \param linear true to convert from sRGB to linear space for the alpha + * multiplication, false to do multiplication in sRGB space. + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PremultiplySurfaceAlpha(SDL_Surface *surface, SDL_bool linear); +extern SDL_DECLSPEC bool SDLCALL SDL_PremultiplySurfaceAlpha(SDL_Surface *surface, bool linear); /** * Clear a surface with a specific color, with floating point precision. @@ -948,12 +948,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PremultiplySurfaceAlpha(SDL_Surface *su * \param g the green component of the pixel, normally in the range 0-1. * \param b the blue component of the pixel, normally in the range 0-1. * \param a the alpha component of the pixel, normally in the range 0-1. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearSurface(SDL_Surface *surface, float r, float g, float b, float a); +extern SDL_DECLSPEC bool SDLCALL SDL_ClearSurface(SDL_Surface *surface, float r, float g, float b, float a); /** * Perform a fast fill of a rectangle with a specific color. @@ -971,14 +971,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearSurface(SDL_Surface *surface, floa * \param rect the SDL_Rect structure representing the rectangle to fill, or * NULL to fill the entire surface. * \param color the color to fill with. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_FillSurfaceRects */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FillSurfaceRect(SDL_Surface *dst, const SDL_Rect *rect, Uint32 color); +extern SDL_DECLSPEC bool SDLCALL SDL_FillSurfaceRect(SDL_Surface *dst, const SDL_Rect *rect, Uint32 color); /** * Perform a fast fill of a set of rectangles with a specific color. @@ -996,14 +996,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FillSurfaceRect(SDL_Surface *dst, const * \param rects an array of SDL_Rects representing the rectangles to fill. * \param count the number of rectangles in the array. * \param color the color to fill with. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_FillSurfaceRect */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FillSurfaceRects(SDL_Surface *dst, const SDL_Rect *rects, int count, Uint32 color); +extern SDL_DECLSPEC bool SDLCALL SDL_FillSurfaceRects(SDL_Surface *dst, const SDL_Rect *rects, int count, Uint32 color); /** * Performs a fast blit from the source surface to the destination surface. @@ -1067,7 +1067,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FillSurfaceRects(SDL_Surface *dst, cons * height are ignored, and are copied from `srcrect`. If you * want a specific width and height, you should use * SDL_BlitSurfaceScaled(). - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety The same destination surface should not be used from two @@ -1078,7 +1078,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FillSurfaceRects(SDL_Surface *dst, cons * * \sa SDL_BlitSurfaceScaled */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurface(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect); +extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurface(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect); /** * Perform low-level surface blitting only. @@ -1092,7 +1092,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurface(SDL_Surface *src, const SDL * \param dst the SDL_Surface structure that is the blit target. * \param dstrect the SDL_Rect structure representing the target rectangle in * the destination surface, may not be NULL. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety The same destination surface should not be used from two @@ -1103,7 +1103,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurface(SDL_Surface *src, const SDL * * \sa SDL_BlitSurface */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceUnchecked(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect); +extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurfaceUnchecked(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect); /** * Perform a scaled blit to a destination surface, which may be of a different @@ -1117,7 +1117,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceUnchecked(SDL_Surface *src, * the destination surface, or NULL to fill the entire * destination surface. * \param scaleMode the SDL_ScaleMode to be used. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety The same destination surface should not be used from two @@ -1128,7 +1128,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceUnchecked(SDL_Surface *src, * * \sa SDL_BlitSurface */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode); +extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode); /** * Perform low-level surface scaled blitting only. @@ -1143,7 +1143,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceScaled(SDL_Surface *src, con * \param dstrect the SDL_Rect structure representing the target rectangle in * the destination surface, may not be NULL. * \param scaleMode the SDL_ScaleMode to be used. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety The same destination surface should not be used from two @@ -1154,7 +1154,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceScaled(SDL_Surface *src, con * * \sa SDL_BlitSurfaceScaled */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode); +extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode); /** * Perform a tiled blit to a destination surface, which may be of a different @@ -1169,7 +1169,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceUncheckedScaled(SDL_Surface * \param dst the SDL_Surface structure that is the blit target. * \param dstrect the SDL_Rect structure representing the target rectangle in * the destination surface, or NULL to fill the entire surface. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety The same destination surface should not be used from two @@ -1180,7 +1180,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceUncheckedScaled(SDL_Surface * * \sa SDL_BlitSurface */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceTiled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect); +extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurfaceTiled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect); /** * Perform a scaled and tiled blit to a destination surface, which may be of a @@ -1199,7 +1199,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceTiled(SDL_Surface *src, cons * \param dst the SDL_Surface structure that is the blit target. * \param dstrect the SDL_Rect structure representing the target rectangle in * the destination surface, or NULL to fill the entire surface. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety The same destination surface should not be used from two @@ -1210,7 +1210,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceTiled(SDL_Surface *src, cons * * \sa SDL_BlitSurface */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceTiledWithScale(SDL_Surface *src, const SDL_Rect *srcrect, float scale, SDL_ScaleMode scaleMode, SDL_Surface *dst, const SDL_Rect *dstrect); +extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurfaceTiledWithScale(SDL_Surface *src, const SDL_Rect *srcrect, float scale, SDL_ScaleMode scaleMode, SDL_Surface *dst, const SDL_Rect *dstrect); /** * Perform a scaled blit using the 9-grid algorithm to a destination surface, @@ -1236,7 +1236,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceTiledWithScale(SDL_Surface * * \param dst the SDL_Surface structure that is the blit target. * \param dstrect the SDL_Rect structure representing the target rectangle in * the destination surface, or NULL to fill the entire surface. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety The same destination surface should not be used from two @@ -1247,7 +1247,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceTiledWithScale(SDL_Surface * * * \sa SDL_BlitSurface */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurface9Grid(SDL_Surface *src, const SDL_Rect *srcrect, int left_width, int right_width, int top_height, int bottom_height, float scale, SDL_ScaleMode scaleMode, SDL_Surface *dst, const SDL_Rect *dstrect); +extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurface9Grid(SDL_Surface *src, const SDL_Rect *srcrect, int left_width, int right_width, int top_height, int bottom_height, float scale, SDL_ScaleMode scaleMode, SDL_Surface *dst, const SDL_Rect *dstrect); /** * Map an RGB triple to an opaque pixel value for a surface. @@ -1330,12 +1330,12 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapSurfaceRGBA(SDL_Surface *surface, Uint * ignore this channel. * \param a a pointer filled in with the alpha channel, 0-255, or NULL to * ignore this channel. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); +extern SDL_DECLSPEC bool SDLCALL SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); /** * Retrieves a single pixel from a surface. @@ -1354,12 +1354,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadSurfacePixel(SDL_Surface *surface, * 0-1, or NULL to ignore this channel. * \param a a pointer filled in with the alpha channel, normally in the range * 0-1, or NULL to ignore this channel. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadSurfacePixelFloat(SDL_Surface *surface, int x, int y, float *r, float *g, float *b, float *a); +extern SDL_DECLSPEC bool SDLCALL SDL_ReadSurfacePixelFloat(SDL_Surface *surface, int x, int y, float *r, float *g, float *b, float *a); /** * Writes a single pixel to a surface. @@ -1377,12 +1377,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadSurfacePixelFloat(SDL_Surface *surf * \param g the green channel value, 0-255. * \param b the blue channel value, 0-255. * \param a the alpha channel value, 0-255. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 r, Uint8 g, Uint8 b, Uint8 a); +extern SDL_DECLSPEC bool SDLCALL SDL_WriteSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /** * Writes a single pixel to a surface. @@ -1397,12 +1397,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteSurfacePixel(SDL_Surface *surface, * \param g the green channel value, normally in the range 0-1. * \param b the blue channel value, normally in the range 0-1. * \param a the alpha channel value, normally in the range 0-1. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteSurfacePixelFloat(SDL_Surface *surface, int x, int y, float r, float g, float b, float a); +extern SDL_DECLSPEC bool SDLCALL SDL_WriteSurfacePixelFloat(SDL_Surface *surface, int x, int y, float r, float g, float b, float a); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/include/SDL3/SDL_system.h b/include/SDL3/SDL_system.h index 595b955a3..ed5b7d4d9 100644 --- a/include/SDL3/SDL_system.h +++ b/include/SDL3/SDL_system.h @@ -50,8 +50,8 @@ typedef struct tagMSG MSG; /** * A callback to be used with SDL_SetWindowsMessageHook. * - * This callback may modify the message, and should return SDL_TRUE if the - * message should continue to be processed, or SDL_FALSE to prevent further + * This callback may modify the message, and should return true if the + * message should continue to be processed, or false to prevent further * processing. * * As this is processing a message directly from the Windows event loop, this @@ -60,7 +60,7 @@ typedef struct tagMSG MSG; * \param userdata the app-defined pointer provided to * SDL_SetWindowsMessageHook. * \param msg a pointer to a Win32 event structure to process. - * \returns SDL_TRUE to let event continue on, SDL_FALSE to drop it. + * \returns true to let event continue on, false to drop it. * * \threadsafety This may only be called (by SDL) from the thread handling the * Windows event loop. @@ -70,13 +70,13 @@ typedef struct tagMSG MSG; * \sa SDL_SetWindowsMessageHook * \sa SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP */ -typedef SDL_bool (SDLCALL *SDL_WindowsMessageHook)(void *userdata, MSG *msg); +typedef bool (SDLCALL *SDL_WindowsMessageHook)(void *userdata, MSG *msg); /** * Set a callback for every Windows message, run before TranslateMessage(). * - * The callback may modify the message, and should return SDL_TRUE if the - * message should continue to be processed, or SDL_FALSE to prevent further + * The callback may modify the message, and should return true if the + * message should continue to be processed, or false to prevent further * processing. * * \param callback the SDL_WindowsMessageHook function to call. @@ -117,12 +117,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetDirect3D9AdapterIndex(SDL_DisplayID displ * \param displayID the instance of the display to query. * \param adapterIndex a pointer to be filled in with the adapter index. * \param outputIndex a pointer to be filled in with the output index. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex); +extern SDL_DECLSPEC bool SDLCALL SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex); #endif /* defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK) */ @@ -132,13 +132,13 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetDXGIOutputInfo(SDL_DisplayID display */ typedef union _XEvent XEvent; -typedef SDL_bool (SDLCALL *SDL_X11EventHook)(void *userdata, XEvent *xevent); +typedef bool (SDLCALL *SDL_X11EventHook)(void *userdata, XEvent *xevent); /** * Set a callback for every X11 event. * - * The callback may modify the event, and should return SDL_TRUE if the event - * should continue to be processed, or SDL_FALSE to prevent further + * The callback may modify the event, and should return true if the event + * should continue to be processed, or false to prevent further * processing. * * \param callback the SDL_X11EventHook function to call. @@ -158,12 +158,12 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetX11EventHook(SDL_X11EventHook callback, * * \param threadID the Unix thread ID to change priority of. * \param priority the new, Unix-specific, priority value. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetLinuxThreadPriority(Sint64 threadID, int priority); +extern SDL_DECLSPEC bool SDLCALL SDL_SetLinuxThreadPriority(Sint64 threadID, int priority); /** * Sets the priority (not nice level) and scheduling policy for a thread. @@ -174,12 +174,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetLinuxThreadPriority(Sint64 threadID, * \param sdlPriority the new SDL_ThreadPriority value. * \param schedPolicy the new scheduling policy (SCHED_FIFO, SCHED_RR, * SCHED_OTHER, etc...). - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy); +extern SDL_DECLSPEC bool SDLCALL SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy); #endif /* SDL_PLATFORM_LINUX */ @@ -236,27 +236,27 @@ typedef void (SDLCALL *SDL_iOSAnimationCallback)(void *userdata); * called. * \param callback the function to call for every frame. * \param callbackParam a pointer that is passed to `callback`. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetiOSEventPump */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetiOSAnimationCallback(SDL_Window *window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam); +extern SDL_DECLSPEC bool SDLCALL SDL_SetiOSAnimationCallback(SDL_Window *window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam); /** * Use this function to enable or disable the SDL event pump on Apple iOS. * * This function is only available on Apple iOS. * - * \param enabled SDL_TRUE to enable the event pump, SDL_FALSE to disable it. + * \param enabled true to enable the event pump, false to disable it. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetiOSAnimationCallback */ -extern SDL_DECLSPEC void SDLCALL SDL_SetiOSEventPump(SDL_bool enabled); +extern SDL_DECLSPEC void SDLCALL SDL_SetiOSEventPump(bool enabled); #endif /* SDL_PLATFORM_IOS */ @@ -352,29 +352,29 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void); /** * Query if the application is running on Android TV. * - * \returns SDL_TRUE if this is Android TV, SDL_FALSE otherwise. + * \returns true if this is Android TV, false otherwise. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void); +extern SDL_DECLSPEC bool SDLCALL SDL_IsAndroidTV(void); /** * Query if the application is running on a Chromebook. * - * \returns SDL_TRUE if this is a Chromebook, SDL_FALSE otherwise. + * \returns true if this is a Chromebook, false otherwise. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void); +extern SDL_DECLSPEC bool SDLCALL SDL_IsChromebook(void); /** * Query if the application is running on a Samsung DeX docking station. * - * \returns SDL_TRUE if this is a DeX docking station, SDL_FALSE otherwise. + * \returns true if this is a DeX docking station, false otherwise. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void); +extern SDL_DECLSPEC bool SDLCALL SDL_IsDeXMode(void); /** * Trigger the Android system back button behavior. @@ -475,7 +475,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetAndroidExternalStoragePath(void) extern SDL_DECLSPEC const char * SDLCALL SDL_GetAndroidCachePath(void); -typedef void (SDLCALL *SDL_RequestAndroidPermissionCallback)(void *userdata, const char *permission, SDL_bool granted); +typedef void (SDLCALL *SDL_RequestAndroidPermissionCallback)(void *userdata, const char *permission, bool granted); /** * Request permissions at runtime, asynchronously. @@ -499,7 +499,7 @@ typedef void (SDLCALL *SDL_RequestAndroidPermissionCallback)(void *userdata, con * \param permission the permission to request. * \param cb the callback to trigger when the request has a response. * \param userdata an app-controlled pointer that is passed to the callback. - * \returns SDL_TRUE if the request was submitted, SDL_FALSE if there was an + * \returns true if the request was submitted, false if there was an * error submitting. The result of the request is only ever reported * through the callback, not this return value. * @@ -507,7 +507,7 @@ typedef void (SDLCALL *SDL_RequestAndroidPermissionCallback)(void *userdata, con * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata); +extern SDL_DECLSPEC bool SDLCALL SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata); /** * Shows an Android toast notification. @@ -528,14 +528,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RequestAndroidPermission(const char *pe * \param gravity where the notification should appear on the screen. * \param xoffset set this parameter only when gravity >=0. * \param yoffset set this parameter only when gravity >=0. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowAndroidToast(const char *message, int duration, int gravity, int xoffset, int yoffset); +extern SDL_DECLSPEC bool SDLCALL SDL_ShowAndroidToast(const char *message, int duration, int gravity, int xoffset, int yoffset); /** * Send a user command to SDLActivity. @@ -544,27 +544,27 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowAndroidToast(const char *message, i * * \param command user command that must be greater or equal to 0x8000. * \param param user parameter. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SendAndroidMessage(Uint32 command, int param); +extern SDL_DECLSPEC bool SDLCALL SDL_SendAndroidMessage(Uint32 command, int param); #endif /* SDL_PLATFORM_ANDROID */ /** * Query if the current device is a tablet. * - * If SDL can't determine this, it will return SDL_FALSE. + * If SDL can't determine this, it will return false. * - * \returns SDL_TRUE if the device is a tablet, SDL_FALSE otherwise. + * \returns true if the device is a tablet, false otherwise. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void); +extern SDL_DECLSPEC bool SDLCALL SDL_IsTablet(void); /* Functions used by iOS app delegates to notify SDL about state changes. */ @@ -706,12 +706,12 @@ typedef struct XUser *XUserHandle; * leak. * * \param outTaskQueue a pointer to be filled in with task queue handle. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGDKTaskQueue(XTaskQueueHandle *outTaskQueue); +extern SDL_DECLSPEC bool SDLCALL SDL_GetGDKTaskQueue(XTaskQueueHandle *outTaskQueue); /** * Gets a reference to the default user handle for GDK. @@ -721,12 +721,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGDKTaskQueue(XTaskQueueHandle *outTa * * \param outUserHandle a pointer to be filled in with the default user * handle. - * \returns SDL_TRUE if success or SDL_FALSE on failure; call SDL_GetError() + * \returns true if success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGDKDefaultUser(XUserHandle *outUserHandle); +extern SDL_DECLSPEC bool SDLCALL SDL_GetGDKDefaultUser(XUserHandle *outUserHandle); #endif diff --git a/include/SDL3/SDL_test_common.h b/include/SDL3/SDL_test_common.h index 85d1ec83f..69f63765f 100644 --- a/include/SDL3/SDL_test_common.h +++ b/include/SDL3/SDL_test_common.h @@ -88,7 +88,7 @@ typedef struct const char *window_title; const char *window_icon; SDL_WindowFlags window_flags; - SDL_bool flash_on_focus_loss; + bool flash_on_focus_loss; int window_x; int window_y; int window_w; @@ -101,14 +101,14 @@ typedef struct float window_max_aspect; int logical_w; int logical_h; - SDL_bool auto_scale_content; + bool auto_scale_content; SDL_RendererLogicalPresentation logical_presentation; SDL_ScaleMode logical_scale_mode; float scale; int depth; float refresh_rate; - SDL_bool fill_usable_bounds; - SDL_bool fullscreen_exclusive; + bool fill_usable_bounds; + bool fullscreen_exclusive; SDL_DisplayMode fullscreen_mode; int num_windows; SDL_Window **windows; @@ -117,7 +117,7 @@ typedef struct /* Renderer info */ const char *renderdriver; int render_vsync; - SDL_bool skip_renderer; + bool skip_renderer; SDL_Renderer **renderers; SDL_Texture **targets; @@ -153,7 +153,7 @@ typedef struct /* Mouse info */ SDL_Rect confine; - SDL_bool hide_cursor; + bool hide_cursor; /* Options info */ SDLTest_ArgumentParser common_argparser; @@ -220,9 +220,9 @@ void SDLCALL SDLTest_CommonLogUsage(SDLTest_CommonState *state, const char *argv * * \param state The common state describing the test window to create. * - * \returns SDL_TRUE if initialization succeeded, false otherwise + * \returns true if initialization succeeded, false otherwise */ -SDL_bool SDLCALL SDLTest_CommonInit(SDLTest_CommonState *state); +bool SDLCALL SDLTest_CommonInit(SDLTest_CommonState *state); /** * Easy argument handling when test app doesn't need any custom args. @@ -231,9 +231,9 @@ SDL_bool SDLCALL SDLTest_CommonInit(SDLTest_CommonState *state); * \param argc argc, as supplied to SDL_main * \param argv argv, as supplied to SDL_main * - * \returns SDL_FALSE if app should quit, true otherwise. + * \returns false if app should quit, true otherwise. */ -SDL_bool SDLCALL SDLTest_CommonDefaultArgs(SDLTest_CommonState *state, const int argc, char **argv); +bool SDLCALL SDLTest_CommonDefaultArgs(SDLTest_CommonState *state, const int argc, char **argv); /** * Print the details of an event. diff --git a/include/SDL3/SDL_test_crc32.h b/include/SDL3/SDL_test_crc32.h index 544d7332c..49c4cf21d 100644 --- a/include/SDL3/SDL_test_crc32.h +++ b/include/SDL3/SDL_test_crc32.h @@ -73,11 +73,11 @@ extern "C" { * * \param crcContext pointer to context variable * - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * */ -SDL_bool SDLCALL SDLTest_Crc32Init(SDLTest_Crc32Context *crcContext); +bool SDLCALL SDLTest_Crc32Init(SDLTest_Crc32Context *crcContext); /* * calculate a crc32 from a data block @@ -87,28 +87,28 @@ SDL_bool SDLCALL SDLTest_Crc32Init(SDLTest_Crc32Context *crcContext); * \param inLen length of input buffer * \param crc32 pointer to Uint32 to store the final CRC into * - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * */ -SDL_bool SDLCALL SDLTest_Crc32Calc(SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32); +bool SDLCALL SDLTest_Crc32Calc(SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32); /* Same routine broken down into three steps */ -SDL_bool SDLCALL SDLTest_Crc32CalcStart(SDLTest_Crc32Context *crcContext, CrcUint32 *crc32); -SDL_bool SDLCALL SDLTest_Crc32CalcEnd(SDLTest_Crc32Context *crcContext, CrcUint32 *crc32); -SDL_bool SDLCALL SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32); +bool SDLCALL SDLTest_Crc32CalcStart(SDLTest_Crc32Context *crcContext, CrcUint32 *crc32); +bool SDLCALL SDLTest_Crc32CalcEnd(SDLTest_Crc32Context *crcContext, CrcUint32 *crc32); +bool SDLCALL SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32); /* * clean up CRC context * * \param crcContext pointer to context variable * - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * */ -SDL_bool SDLCALL SDLTest_Crc32Done(SDLTest_Crc32Context *crcContext); +bool SDLCALL SDLTest_Crc32Done(SDLTest_Crc32Context *crcContext); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/include/SDL3/SDL_test_font.h b/include/SDL3/SDL_test_font.h index 1716c46a4..99308abbf 100644 --- a/include/SDL3/SDL_test_font.h +++ b/include/SDL3/SDL_test_font.h @@ -54,9 +54,9 @@ extern int FONT_CHARACTER_SIZE; * \param y The Y coordinate of the upper left corner of the character. * \param c The character to draw. * - * \returns SDL_TRUE on success, SDL_FALSE on failure. + * \returns true on success, false on failure. */ -SDL_bool SDLCALL SDLTest_DrawCharacter(SDL_Renderer *renderer, float x, float y, Uint32 c); +bool SDLCALL SDLTest_DrawCharacter(SDL_Renderer *renderer, float x, float y, Uint32 c); /* * Draw a UTF-8 string in the currently set font. @@ -68,9 +68,9 @@ SDL_bool SDLCALL SDLTest_DrawCharacter(SDL_Renderer *renderer, float x, float y, * \param y The Y coordinate of the upper left corner of the string. * \param s The string to draw. * - * \returns SDL_TRUE on success, SDL_FALSE on failure. + * \returns true on success, false on failure. */ -SDL_bool SDLCALL SDLTest_DrawString(SDL_Renderer *renderer, float x, float y, const char *s); +bool SDLCALL SDLTest_DrawString(SDL_Renderer *renderer, float x, float y, const char *s); /* * Data used for multi-line text output diff --git a/include/SDL3/SDL_test_fuzzer.h b/include/SDL3/SDL_test_fuzzer.h index 3264960da..4fdfd4989 100644 --- a/include/SDL3/SDL_test_fuzzer.h +++ b/include/SDL3/SDL_test_fuzzer.h @@ -145,10 +145,10 @@ double SDLCALL SDLTest_RandomDouble(void); * If boundary1 > boundary2, the values are swapped * * Usage examples: - * RandomUint8BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 - * RandomUint8BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21 - * RandomUint8BoundaryValue(0, 99, SDL_FALSE) returns 100 - * RandomUint8BoundaryValue(0, 255, SDL_FALSE) returns 0 (error set) + * RandomUint8BoundaryValue(10, 20, true) returns 10, 11, 19 or 20 + * RandomUint8BoundaryValue(1, 20, false) returns 0 or 21 + * RandomUint8BoundaryValue(0, 99, false) returns 100 + * RandomUint8BoundaryValue(0, 255, false) returns 0 (error set) * * \param boundary1 Lower boundary limit * \param boundary2 Upper boundary limit @@ -156,7 +156,7 @@ double SDLCALL SDLTest_RandomDouble(void); * * \returns a random boundary value for the given range and domain or 0 with error set */ -Uint8 SDLCALL SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain); +Uint8 SDLCALL SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, bool validDomain); /** * Returns a random boundary value for Uint16 within the given boundaries. @@ -166,10 +166,10 @@ Uint8 SDLCALL SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, * If boundary1 > boundary2, the values are swapped * * Usage examples: - * RandomUint16BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 - * RandomUint16BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21 - * RandomUint16BoundaryValue(0, 99, SDL_FALSE) returns 100 - * RandomUint16BoundaryValue(0, 0xFFFF, SDL_FALSE) returns 0 (error set) + * RandomUint16BoundaryValue(10, 20, true) returns 10, 11, 19 or 20 + * RandomUint16BoundaryValue(1, 20, false) returns 0 or 21 + * RandomUint16BoundaryValue(0, 99, false) returns 100 + * RandomUint16BoundaryValue(0, 0xFFFF, false) returns 0 (error set) * * \param boundary1 Lower boundary limit * \param boundary2 Upper boundary limit @@ -177,7 +177,7 @@ Uint8 SDLCALL SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, * * \returns a random boundary value for the given range and domain or 0 with error set */ -Uint16 SDLCALL SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain); +Uint16 SDLCALL SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, bool validDomain); /** * Returns a random boundary value for Uint32 within the given boundaries. @@ -187,10 +187,10 @@ Uint16 SDLCALL SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 bounda * If boundary1 > boundary2, the values are swapped * * Usage examples: - * RandomUint32BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 - * RandomUint32BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21 - * RandomUint32BoundaryValue(0, 99, SDL_FALSE) returns 100 - * RandomUint32BoundaryValue(0, 0xFFFFFFFF, SDL_FALSE) returns 0 (with error set) + * RandomUint32BoundaryValue(10, 20, true) returns 10, 11, 19 or 20 + * RandomUint32BoundaryValue(1, 20, false) returns 0 or 21 + * RandomUint32BoundaryValue(0, 99, false) returns 100 + * RandomUint32BoundaryValue(0, 0xFFFFFFFF, false) returns 0 (with error set) * * \param boundary1 Lower boundary limit * \param boundary2 Upper boundary limit @@ -198,7 +198,7 @@ Uint16 SDLCALL SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 bounda * * \returns a random boundary value for the given range and domain or 0 with error set */ -Uint32 SDLCALL SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain); +Uint32 SDLCALL SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, bool validDomain); /** * Returns a random boundary value for Uint64 within the given boundaries. @@ -208,10 +208,10 @@ Uint32 SDLCALL SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 bounda * If boundary1 > boundary2, the values are swapped * * Usage examples: - * RandomUint64BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 - * RandomUint64BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21 - * RandomUint64BoundaryValue(0, 99, SDL_FALSE) returns 100 - * RandomUint64BoundaryValue(0, 0xFFFFFFFFFFFFFFFF, SDL_FALSE) returns 0 (with error set) + * RandomUint64BoundaryValue(10, 20, true) returns 10, 11, 19 or 20 + * RandomUint64BoundaryValue(1, 20, false) returns 0 or 21 + * RandomUint64BoundaryValue(0, 99, false) returns 100 + * RandomUint64BoundaryValue(0, 0xFFFFFFFFFFFFFFFF, false) returns 0 (with error set) * * \param boundary1 Lower boundary limit * \param boundary2 Upper boundary limit @@ -219,7 +219,7 @@ Uint32 SDLCALL SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 bounda * * \returns a random boundary value for the given range and domain or 0 with error set */ -Uint64 SDLCALL SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain); +Uint64 SDLCALL SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, bool validDomain); /** * Returns a random boundary value for Sint8 within the given boundaries. @@ -229,10 +229,10 @@ Uint64 SDLCALL SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 bounda * If boundary1 > boundary2, the values are swapped * * Usage examples: - * RandomSint8BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20 - * RandomSint8BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9 - * RandomSint8BoundaryValue(SINT8_MIN, 99, SDL_FALSE) returns 100 - * RandomSint8BoundaryValue(SINT8_MIN, SINT8_MAX, SDL_FALSE) returns SINT8_MIN (== error value) with error set + * RandomSint8BoundaryValue(-10, 20, true) returns -11, -10, 19 or 20 + * RandomSint8BoundaryValue(-100, -10, false) returns -101 or -9 + * RandomSint8BoundaryValue(SINT8_MIN, 99, false) returns 100 + * RandomSint8BoundaryValue(SINT8_MIN, SINT8_MAX, false) returns SINT8_MIN (== error value) with error set * * \param boundary1 Lower boundary limit * \param boundary2 Upper boundary limit @@ -240,7 +240,7 @@ Uint64 SDLCALL SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 bounda * * \returns a random boundary value for the given range and domain or SINT8_MIN with error set */ -Sint8 SDLCALL SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain); +Sint8 SDLCALL SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, bool validDomain); /** * Returns a random boundary value for Sint16 within the given boundaries. @@ -250,10 +250,10 @@ Sint8 SDLCALL SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, * If boundary1 > boundary2, the values are swapped * * Usage examples: - * RandomSint16BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20 - * RandomSint16BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9 - * RandomSint16BoundaryValue(SINT16_MIN, 99, SDL_FALSE) returns 100 - * RandomSint16BoundaryValue(SINT16_MIN, SINT16_MAX, SDL_FALSE) returns SINT16_MIN (== error value) with error set + * RandomSint16BoundaryValue(-10, 20, true) returns -11, -10, 19 or 20 + * RandomSint16BoundaryValue(-100, -10, false) returns -101 or -9 + * RandomSint16BoundaryValue(SINT16_MIN, 99, false) returns 100 + * RandomSint16BoundaryValue(SINT16_MIN, SINT16_MAX, false) returns SINT16_MIN (== error value) with error set * * \param boundary1 Lower boundary limit * \param boundary2 Upper boundary limit @@ -261,7 +261,7 @@ Sint8 SDLCALL SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, * * \returns a random boundary value for the given range and domain or SINT16_MIN with error set */ -Sint16 SDLCALL SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain); +Sint16 SDLCALL SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, bool validDomain); /** * Returns a random boundary value for Sint32 within the given boundaries. @@ -271,10 +271,10 @@ Sint16 SDLCALL SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 bounda * If boundary1 > boundary2, the values are swapped * * Usage examples: - * RandomSint32BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20 - * RandomSint32BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9 - * RandomSint32BoundaryValue(SINT32_MIN, 99, SDL_FALSE) returns 100 - * RandomSint32BoundaryValue(SINT32_MIN, SINT32_MAX, SDL_FALSE) returns SINT32_MIN (== error value) + * RandomSint32BoundaryValue(-10, 20, true) returns -11, -10, 19 or 20 + * RandomSint32BoundaryValue(-100, -10, false) returns -101 or -9 + * RandomSint32BoundaryValue(SINT32_MIN, 99, false) returns 100 + * RandomSint32BoundaryValue(SINT32_MIN, SINT32_MAX, false) returns SINT32_MIN (== error value) * * \param boundary1 Lower boundary limit * \param boundary2 Upper boundary limit @@ -282,7 +282,7 @@ Sint16 SDLCALL SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 bounda * * \returns a random boundary value for the given range and domain or SINT32_MIN with error set */ -Sint32 SDLCALL SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain); +Sint32 SDLCALL SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, bool validDomain); /** * Returns a random boundary value for Sint64 within the given boundaries. @@ -292,10 +292,10 @@ Sint32 SDLCALL SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 bounda * If boundary1 > boundary2, the values are swapped * * Usage examples: - * RandomSint64BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20 - * RandomSint64BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9 - * RandomSint64BoundaryValue(SINT64_MIN, 99, SDL_FALSE) returns 100 - * RandomSint64BoundaryValue(SINT64_MIN, SINT64_MAX, SDL_FALSE) returns SINT64_MIN (== error value) and error set + * RandomSint64BoundaryValue(-10, 20, true) returns -11, -10, 19 or 20 + * RandomSint64BoundaryValue(-100, -10, false) returns -101 or -9 + * RandomSint64BoundaryValue(SINT64_MIN, 99, false) returns 100 + * RandomSint64BoundaryValue(SINT64_MIN, SINT64_MAX, false) returns SINT64_MIN (== error value) and error set * * \param boundary1 Lower boundary limit * \param boundary2 Upper boundary limit @@ -303,7 +303,7 @@ Sint32 SDLCALL SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 bounda * * \returns a random boundary value for the given range and domain or SINT64_MIN with error set */ -Sint64 SDLCALL SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain); +Sint64 SDLCALL SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, bool validDomain); /** * Returns integer in range [min, max] (inclusive). diff --git a/include/SDL3/SDL_thread.h b/include/SDL3/SDL_thread.h index 37915c455..8e9386323 100644 --- a/include/SDL3/SDL_thread.h +++ b/include/SDL3/SDL_thread.h @@ -380,12 +380,12 @@ extern SDL_DECLSPEC SDL_ThreadID SDLCALL SDL_GetThreadID(SDL_Thread *thread); * an administrator account. Be prepared for this to fail. * * \param priority the SDL_ThreadPriority to set. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority); +extern SDL_DECLSPEC bool SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority); /** * Wait for a thread to finish. @@ -503,7 +503,7 @@ typedef void (SDLCALL *SDL_TLSDestructorCallback)(void *value); * \param value the value to associate with the ID for the current thread. * \param destructor a function called when the thread exits, to free the * value, may be NULL. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -512,7 +512,7 @@ typedef void (SDLCALL *SDL_TLSDestructorCallback)(void *value); * * \sa SDL_GetTLS */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTLS(SDL_TLSID *id, const void *value, SDL_TLSDestructorCallback destructor); +extern SDL_DECLSPEC bool SDLCALL SDL_SetTLS(SDL_TLSID *id, const void *value, SDL_TLSDestructorCallback destructor); /** * Cleanup all TLS data for this thread. diff --git a/include/SDL3/SDL_time.h b/include/SDL3/SDL_time.h index 86c1fad01..7bb98b591 100644 --- a/include/SDL3/SDL_time.h +++ b/include/SDL3/SDL_time.h @@ -95,24 +95,24 @@ typedef enum SDL_TimeFormat * format, may be NULL. * \param timeFormat a pointer to the SDL_TimeFormat to hold the returned time * format, may be NULL. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetDateTimeLocalePreferences(SDL_DateFormat *dateFormat, SDL_TimeFormat *timeFormat); +extern SDL_DECLSPEC bool SDLCALL SDL_GetDateTimeLocalePreferences(SDL_DateFormat *dateFormat, SDL_TimeFormat *timeFormat); /** * Gets the current value of the system realtime clock in nanoseconds since * Jan 1, 1970 in Universal Coordinated Time (UTC). * * \param ticks the SDL_Time to hold the returned tick count. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetCurrentTime(SDL_Time *ticks); +extern SDL_DECLSPEC bool SDLCALL SDL_GetCurrentTime(SDL_Time *ticks); /** * Converts an SDL_Time in nanoseconds since the epoch to a calendar time in @@ -123,12 +123,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetCurrentTime(SDL_Time *ticks); * \param localTime the resulting SDL_DateTime will be expressed in local time * if true, otherwise it will be in Universal Coordinated * Time (UTC). - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, SDL_bool localTime); +extern SDL_DECLSPEC bool SDLCALL SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, bool localTime); /** * Converts a calendar time to an SDL_Time in nanoseconds since the epoch. @@ -138,12 +138,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TimeToDateTime(SDL_Time ticks, SDL_Date * * \param dt the source SDL_DateTime. * \param ticks the resulting SDL_Time. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_DateTimeToTime(const SDL_DateTime *dt, SDL_Time *ticks); +extern SDL_DECLSPEC bool SDLCALL SDL_DateTimeToTime(const SDL_DateTime *dt, SDL_Time *ticks); /** * Converts an SDL time into a Windows FILETIME (100-nanosecond intervals diff --git a/include/SDL3/SDL_timer.h b/include/SDL3/SDL_timer.h index 54780bf67..e5557f727 100644 --- a/include/SDL3/SDL_timer.h +++ b/include/SDL3/SDL_timer.h @@ -259,14 +259,14 @@ extern SDL_DECLSPEC SDL_TimerID SDLCALL SDL_AddTimerNS(Uint64 interval, SDL_NSTi * Remove a timer created with SDL_AddTimer(). * * \param id the ID of the timer to remove. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_AddTimer */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id); +extern SDL_DECLSPEC bool SDLCALL SDL_RemoveTimer(SDL_TimerID id); /* Ends C function definitions when using C++ */ diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h index cc21d712f..ada29ba58 100644 --- a/include/SDL3/SDL_video.h +++ b/include/SDL3/SDL_video.h @@ -475,7 +475,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetDisplayName(SDL_DisplayID displa * * \param displayID the instance ID of the display to query. * \param rect the SDL_Rect structure filled in with the display bounds. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -483,7 +483,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetDisplayName(SDL_DisplayID displa * \sa SDL_GetDisplayUsableBounds * \sa SDL_GetDisplays */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetDisplayBounds(SDL_DisplayID displayID, SDL_Rect *rect); +extern SDL_DECLSPEC bool SDLCALL SDL_GetDisplayBounds(SDL_DisplayID displayID, SDL_Rect *rect); /** * Get the usable desktop area represented by a display, in screen @@ -499,7 +499,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetDisplayBounds(SDL_DisplayID displayI * * \param displayID the instance ID of the display to query. * \param rect the SDL_Rect structure filled in with the display bounds. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -507,7 +507,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetDisplayBounds(SDL_DisplayID displayI * \sa SDL_GetDisplayBounds * \sa SDL_GetDisplays */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetDisplayUsableBounds(SDL_DisplayID displayID, SDL_Rect *rect); +extern SDL_DECLSPEC bool SDLCALL SDL_GetDisplayUsableBounds(SDL_DisplayID displayID, SDL_Rect *rect); /** * Get the orientation of a display when it is unrotated. @@ -598,7 +598,7 @@ extern SDL_DECLSPEC SDL_DisplayMode ** SDLCALL SDL_GetFullscreenDisplayModes(SDL * the search. * \param mode a pointer filled in with the closest display mode equal to or * larger than the desired mode. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -606,7 +606,7 @@ extern SDL_DECLSPEC SDL_DisplayMode ** SDLCALL SDL_GetFullscreenDisplayModes(SDL * \sa SDL_GetDisplays * \sa SDL_GetFullscreenDisplayModes */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetClosestFullscreenDisplayMode(SDL_DisplayID displayID, int w, int h, float refresh_rate, SDL_bool include_high_density_modes, SDL_DisplayMode *mode); +extern SDL_DECLSPEC bool SDLCALL SDL_GetClosestFullscreenDisplayMode(SDL_DisplayID displayID, int w, int h, float refresh_rate, bool include_high_density_modes, SDL_DisplayMode *mode); /** * Get information about the desktop's display mode. @@ -751,7 +751,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetWindowDisplayScale(SDL_Window *window); * borderless fullscreen desktop mode, or one of the fullscreen * modes returned by SDL_GetFullscreenDisplayModes() to set an * exclusive fullscreen mode. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -760,7 +760,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetWindowDisplayScale(SDL_Window *window); * \sa SDL_SetWindowFullscreen * \sa SDL_SyncWindow */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowFullscreenMode(SDL_Window *window, const SDL_DisplayMode *mode); +extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowFullscreenMode(SDL_Window *window, const SDL_DisplayMode *mode); /** * Query the display mode to use when a window is visible at fullscreen. @@ -1321,14 +1321,14 @@ extern SDL_DECLSPEC SDL_WindowFlags SDLCALL SDL_GetWindowFlags(SDL_Window *windo * * \param window the window to change. * \param title the desired window title in UTF-8 format. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetWindowTitle */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowTitle(SDL_Window *window, const char *title); +extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowTitle(SDL_Window *window, const char *title); /** * Get the title of a window. @@ -1358,12 +1358,12 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetWindowTitle(SDL_Window *window); * * \param window the window to change. * \param icon an SDL_Surface structure containing the icon for the window. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowIcon(SDL_Window *window, SDL_Surface *icon); +extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowIcon(SDL_Window *window, SDL_Surface *icon); /** * Request that the window's position be set. @@ -1395,7 +1395,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowIcon(SDL_Window *window, SDL_S * `SDL_WINDOWPOS_UNDEFINED`. * \param y the y coordinate of the window, or `SDL_WINDOWPOS_CENTERED` or * `SDL_WINDOWPOS_UNDEFINED`. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1403,7 +1403,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowIcon(SDL_Window *window, SDL_S * \sa SDL_GetWindowPosition * \sa SDL_SyncWindow */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowPosition(SDL_Window *window, int x, int y); +extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowPosition(SDL_Window *window, int x, int y); /** * Get the position of a window. @@ -1419,14 +1419,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowPosition(SDL_Window *window, i * NULL. * \param y a pointer filled in with the y position of the window, may be * NULL. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetWindowPosition */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowPosition(SDL_Window *window, int *x, int *y); +extern SDL_DECLSPEC bool SDLCALL SDL_GetWindowPosition(SDL_Window *window, int *x, int *y); /** * Request that the size of a window's client area be set. @@ -1453,7 +1453,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowPosition(SDL_Window *window, i * \param window the window to change. * \param w the width of the window, must be > 0. * \param h the height of the window, must be > 0. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1462,7 +1462,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowPosition(SDL_Window *window, i * \sa SDL_SetWindowFullscreenMode * \sa SDL_SyncWindow */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowSize(SDL_Window *window, int w, int h); +extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowSize(SDL_Window *window, int w, int h); /** * Get the size of a window's client area. @@ -1474,7 +1474,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowSize(SDL_Window *window, int w * \param window the window to query the width and height from. * \param w a pointer filled in with the width of the window, may be NULL. * \param h a pointer filled in with the height of the window, may be NULL. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1483,7 +1483,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowSize(SDL_Window *window, int w * \sa SDL_GetWindowSizeInPixels * \sa SDL_SetWindowSize */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowSize(SDL_Window *window, int *w, int *h); +extern SDL_DECLSPEC bool SDLCALL SDL_GetWindowSize(SDL_Window *window, int *w, int *h); /** * Get the safe area for this window. @@ -1498,12 +1498,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowSize(SDL_Window *window, int * * \param window the window to query. * \param rect a pointer filled in with the client area that is safe for * interactive content. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowSafeArea(SDL_Window *window, SDL_Rect *rect); +extern SDL_DECLSPEC bool SDLCALL SDL_GetWindowSafeArea(SDL_Window *window, SDL_Rect *rect); /** * Request that the aspect ratio of a window's client area be set. @@ -1534,7 +1534,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowSafeArea(SDL_Window *window, S * limit. * \param max_aspect the maximum aspect ratio of the window, or 0.0f for no * limit. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1542,7 +1542,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowSafeArea(SDL_Window *window, S * \sa SDL_GetWindowAspectRatio * \sa SDL_SyncWindow */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowAspectRatio(SDL_Window *window, float min_aspect, float max_aspect); +extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowAspectRatio(SDL_Window *window, float min_aspect, float max_aspect); /** * Get the size of a window's client area. @@ -1552,19 +1552,19 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowAspectRatio(SDL_Window *window * window, may be NULL. * \param max_aspect a pointer filled in with the maximum aspect ratio of the * window, may be NULL. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetWindowAspectRatio */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowAspectRatio(SDL_Window *window, float *min_aspect, float *max_aspect); +extern SDL_DECLSPEC bool SDLCALL SDL_GetWindowAspectRatio(SDL_Window *window, float *min_aspect, float *max_aspect); /** * Get the size of a window's borders (decorations) around the client area. * - * Note: If this function fails (returns SDL_FALSE), the size values will be + * Note: If this function fails (returns false), the size values will be * initialized to 0, 0, 0, 0 (if a non-NULL pointer is provided), as if the * window in question was borderless. * @@ -1574,7 +1574,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowAspectRatio(SDL_Window *window * window has been presented and composited, so that the window system has a * chance to decorate the window and provide the border dimensions to SDL. * - * This function also returns SDL_FALSE if getting the information is not + * This function also returns false if getting the information is not * supported. * * \param window the window to query the size values of the border @@ -1587,14 +1587,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowAspectRatio(SDL_Window *window * border; NULL is permitted. * \param right pointer to variable for storing the size of the right border; * NULL is permitted. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetWindowSize */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowBordersSize(SDL_Window *window, int *top, int *left, int *bottom, int *right); +extern SDL_DECLSPEC bool SDLCALL SDL_GetWindowBordersSize(SDL_Window *window, int *top, int *left, int *bottom, int *right); /** * Get the size of a window's client area, in pixels. @@ -1604,7 +1604,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowBordersSize(SDL_Window *window * NULL. * \param h a pointer to variable for storing the height in pixels, may be * NULL. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1612,7 +1612,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowBordersSize(SDL_Window *window * \sa SDL_CreateWindow * \sa SDL_GetWindowSize */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowSizeInPixels(SDL_Window *window, int *w, int *h); +extern SDL_DECLSPEC bool SDLCALL SDL_GetWindowSizeInPixels(SDL_Window *window, int *w, int *h); /** * Set the minimum size of a window's client area. @@ -1620,7 +1620,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowSizeInPixels(SDL_Window *windo * \param window the window to change. * \param min_w the minimum width of the window, or 0 for no limit. * \param min_h the minimum height of the window, or 0 for no limit. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1628,7 +1628,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowSizeInPixels(SDL_Window *windo * \sa SDL_GetWindowMinimumSize * \sa SDL_SetWindowMaximumSize */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowMinimumSize(SDL_Window *window, int min_w, int min_h); +extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowMinimumSize(SDL_Window *window, int min_w, int min_h); /** * Get the minimum size of a window's client area. @@ -1638,7 +1638,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowMinimumSize(SDL_Window *window * NULL. * \param h a pointer filled in with the minimum height of the window, may be * NULL. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1646,7 +1646,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowMinimumSize(SDL_Window *window * \sa SDL_GetWindowMaximumSize * \sa SDL_SetWindowMinimumSize */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowMinimumSize(SDL_Window *window, int *w, int *h); +extern SDL_DECLSPEC bool SDLCALL SDL_GetWindowMinimumSize(SDL_Window *window, int *w, int *h); /** * Set the maximum size of a window's client area. @@ -1654,7 +1654,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowMinimumSize(SDL_Window *window * \param window the window to change. * \param max_w the maximum width of the window, or 0 for no limit. * \param max_h the maximum height of the window, or 0 for no limit. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1662,7 +1662,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowMinimumSize(SDL_Window *window * \sa SDL_GetWindowMaximumSize * \sa SDL_SetWindowMinimumSize */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowMaximumSize(SDL_Window *window, int max_w, int max_h); +extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowMaximumSize(SDL_Window *window, int max_w, int max_h); /** * Get the maximum size of a window's client area. @@ -1672,7 +1672,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowMaximumSize(SDL_Window *window * NULL. * \param h a pointer filled in with the maximum height of the window, may be * NULL. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1680,7 +1680,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowMaximumSize(SDL_Window *window * \sa SDL_GetWindowMinimumSize * \sa SDL_SetWindowMaximumSize */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowMaximumSize(SDL_Window *window, int *w, int *h); +extern SDL_DECLSPEC bool SDLCALL SDL_GetWindowMaximumSize(SDL_Window *window, int *w, int *h); /** * Set the border state of a window. @@ -1692,15 +1692,15 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowMaximumSize(SDL_Window *window * You can't change the border state of a fullscreen window. * * \param window the window of which to change the border state. - * \param bordered SDL_FALSE to remove border, SDL_TRUE to add border. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \param bordered false to remove border, true to add border. + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetWindowFlags */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowBordered(SDL_Window *window, SDL_bool bordered); +extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowBordered(SDL_Window *window, bool bordered); /** * Set the user-resizable state of a window. @@ -1712,15 +1712,15 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowBordered(SDL_Window *window, S * You can't change the resizable state of a fullscreen window. * * \param window the window of which to change the resizable state. - * \param resizable SDL_TRUE to allow resizing, SDL_FALSE to disallow. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \param resizable true to allow resizing, false to disallow. + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetWindowFlags */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowResizable(SDL_Window *window, SDL_bool resizable); +extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowResizable(SDL_Window *window, bool resizable); /** * Set the window to always be above the others. @@ -1729,22 +1729,22 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowResizable(SDL_Window *window, * will bring the window to the front and keep the window above the rest. * * \param window the window of which to change the always on top state. - * \param on_top SDL_TRUE to set the window always on top, SDL_FALSE to + * \param on_top true to set the window always on top, false to * disable. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetWindowFlags */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowAlwaysOnTop(SDL_Window *window, SDL_bool on_top); +extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowAlwaysOnTop(SDL_Window *window, bool on_top); /** * Show a window. * * \param window the window to show. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1752,20 +1752,20 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowAlwaysOnTop(SDL_Window *window * \sa SDL_HideWindow * \sa SDL_RaiseWindow */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowWindow(SDL_Window *window); +extern SDL_DECLSPEC bool SDLCALL SDL_ShowWindow(SDL_Window *window); /** * Hide a window. * * \param window the window to hide. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_ShowWindow */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HideWindow(SDL_Window *window); +extern SDL_DECLSPEC bool SDLCALL SDL_HideWindow(SDL_Window *window); /** * Request that a window be raised above other windows and gain the input @@ -1778,12 +1778,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HideWindow(SDL_Window *window); * the window will have the SDL_WINDOW_INPUT_FOCUS flag set. * * \param window the window to raise. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RaiseWindow(SDL_Window *window); +extern SDL_DECLSPEC bool SDLCALL SDL_RaiseWindow(SDL_Window *window); /** * Request that the window be made as large as possible. @@ -1806,7 +1806,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RaiseWindow(SDL_Window *window); * and Wayland window managers may vary. * * \param window the window to maximize. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1815,7 +1815,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RaiseWindow(SDL_Window *window); * \sa SDL_RestoreWindow * \sa SDL_SyncWindow */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_MaximizeWindow(SDL_Window *window); +extern SDL_DECLSPEC bool SDLCALL SDL_MaximizeWindow(SDL_Window *window); /** * Request that the window be minimized to an iconic representation. @@ -1830,7 +1830,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_MaximizeWindow(SDL_Window *window); * deny the state change. * * \param window the window to minimize. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1839,7 +1839,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_MaximizeWindow(SDL_Window *window); * \sa SDL_RestoreWindow * \sa SDL_SyncWindow */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_MinimizeWindow(SDL_Window *window); +extern SDL_DECLSPEC bool SDLCALL SDL_MinimizeWindow(SDL_Window *window); /** * Request that the size and position of a minimized or maximized window be @@ -1855,7 +1855,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_MinimizeWindow(SDL_Window *window); * deny the state change. * * \param window the window to restore. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1864,7 +1864,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_MinimizeWindow(SDL_Window *window); * \sa SDL_MinimizeWindow * \sa SDL_SyncWindow */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RestoreWindow(SDL_Window *window); +extern SDL_DECLSPEC bool SDLCALL SDL_RestoreWindow(SDL_Window *window); /** * Request that the window's fullscreen state be changed. @@ -1883,9 +1883,9 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RestoreWindow(SDL_Window *window); * is just a request, it can be denied by the windowing system. * * \param window the window to change. - * \param fullscreen SDL_TRUE for fullscreen mode, SDL_FALSE for windowed + * \param fullscreen true for fullscreen mode, false for windowed * mode. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -1894,7 +1894,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RestoreWindow(SDL_Window *window); * \sa SDL_SetWindowFullscreenMode * \sa SDL_SyncWindow */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowFullscreen(SDL_Window *window, SDL_bool fullscreen); +extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowFullscreen(SDL_Window *window, bool fullscreen); /** * Block until any pending window state is finalized. @@ -1910,7 +1910,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowFullscreen(SDL_Window *window, * * \param window the window for which to wait for the pending state to be * applied. - * \returns SDL_TRUE on success or SDL_FALSE if the operation timed out before + * \returns true on success or false if the operation timed out before * the window was in the requested state. * * \since This function is available since SDL 3.0.0. @@ -1923,20 +1923,20 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowFullscreen(SDL_Window *window, * \sa SDL_RestoreWindow * \sa SDL_HINT_VIDEO_SYNC_WINDOW_OPERATIONS */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SyncWindow(SDL_Window *window); +extern SDL_DECLSPEC bool SDLCALL SDL_SyncWindow(SDL_Window *window); /** * Return whether the window has a surface associated with it. * * \param window the window to query. - * \returns SDL_TRUE if there is a surface associated with the window, or - * SDL_FALSE otherwise. + * \returns true if there is a surface associated with the window, or + * false otherwise. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetWindowSurface */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowHasSurface(SDL_Window *window); +extern SDL_DECLSPEC bool SDLCALL SDL_WindowHasSurface(SDL_Window *window); /** * Get the SDL surface associated with the window. @@ -1980,14 +1980,14 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_GetWindowSurface(SDL_Window *windo * * \param window the window. * \param vsync the vertical refresh sync interval. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetWindowSurfaceVSync */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowSurfaceVSync(SDL_Window *window, int vsync); +extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowSurfaceVSync(SDL_Window *window, int vsync); #define SDL_WINDOW_SURFACE_VSYNC_DISABLED 0 #define SDL_WINDOW_SURFACE_VSYNC_ADAPTIVE (-1) @@ -1998,14 +1998,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowSurfaceVSync(SDL_Window *windo * \param window the window to query. * \param vsync an int filled with the current vertical refresh sync interval. * See SDL_SetWindowSurfaceVSync() for the meaning of the value. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetWindowSurfaceVSync */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowSurfaceVSync(SDL_Window *window, int *vsync); +extern SDL_DECLSPEC bool SDLCALL SDL_GetWindowSurfaceVSync(SDL_Window *window, int *vsync); /** * Copy the window surface to the screen. @@ -2016,7 +2016,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowSurfaceVSync(SDL_Window *windo * This function is equivalent to the SDL 1.2 API SDL_Flip(). * * \param window the window to update. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -2024,7 +2024,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowSurfaceVSync(SDL_Window *windo * \sa SDL_GetWindowSurface * \sa SDL_UpdateWindowSurfaceRects */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateWindowSurface(SDL_Window *window); +extern SDL_DECLSPEC bool SDLCALL SDL_UpdateWindowSurface(SDL_Window *window); /** * Copy areas of the window surface to the screen. @@ -2043,7 +2043,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateWindowSurface(SDL_Window *window) * \param rects an array of SDL_Rect structures representing areas of the * surface to copy, in pixels. * \param numrects the number of rectangles. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -2051,13 +2051,13 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateWindowSurface(SDL_Window *window) * \sa SDL_GetWindowSurface * \sa SDL_UpdateWindowSurface */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window *window, const SDL_Rect *rects, int numrects); +extern SDL_DECLSPEC bool SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window *window, const SDL_Rect *rects, int numrects); /** * Destroy the surface associated with the window. * * \param window the window to update. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -2065,7 +2065,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window *wi * \sa SDL_GetWindowSurface * \sa SDL_WindowHasSurface */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_DestroyWindowSurface(SDL_Window *window); +extern SDL_DECLSPEC bool SDLCALL SDL_DestroyWindowSurface(SDL_Window *window); /** * Set a window's keyboard grab mode. @@ -2087,8 +2087,8 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_DestroyWindowSurface(SDL_Window *window * other window loses its grab in favor of the caller's window. * * \param window the window for which the keyboard grab mode should be set. - * \param grabbed this is SDL_TRUE to grab keyboard, and SDL_FALSE to release. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \param grabbed this is true to grab keyboard, and false to release. + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -2096,7 +2096,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_DestroyWindowSurface(SDL_Window *window * \sa SDL_GetWindowKeyboardGrab * \sa SDL_SetWindowMouseGrab */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowKeyboardGrab(SDL_Window *window, SDL_bool grabbed); +extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowKeyboardGrab(SDL_Window *window, bool grabbed); /** * Set a window's mouse grab mode. @@ -2104,8 +2104,8 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowKeyboardGrab(SDL_Window *windo * Mouse grab confines the mouse cursor to the window. * * \param window the window for which the mouse grab mode should be set. - * \param grabbed this is SDL_TRUE to grab mouse, and SDL_FALSE to release. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \param grabbed this is true to grab mouse, and false to release. + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -2113,31 +2113,31 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowKeyboardGrab(SDL_Window *windo * \sa SDL_GetWindowMouseGrab * \sa SDL_SetWindowKeyboardGrab */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowMouseGrab(SDL_Window *window, SDL_bool grabbed); +extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowMouseGrab(SDL_Window *window, bool grabbed); /** * Get a window's keyboard grab mode. * * \param window the window to query. - * \returns SDL_TRUE if keyboard is grabbed, and SDL_FALSE otherwise. + * \returns true if keyboard is grabbed, and false otherwise. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetWindowKeyboardGrab */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowKeyboardGrab(SDL_Window *window); +extern SDL_DECLSPEC bool SDLCALL SDL_GetWindowKeyboardGrab(SDL_Window *window); /** * Get a window's mouse grab mode. * * \param window the window to query. - * \returns SDL_TRUE if mouse is grabbed, and SDL_FALSE otherwise. + * \returns true if mouse is grabbed, and false otherwise. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetWindowKeyboardGrab */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowMouseGrab(SDL_Window *window); +extern SDL_DECLSPEC bool SDLCALL SDL_GetWindowMouseGrab(SDL_Window *window); /** * Get the window that currently has an input grab enabled. @@ -2160,7 +2160,7 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetGrabbedWindow(void); * \param window the window that will be associated with the barrier. * \param rect a rectangle area in window-relative coordinates. If NULL the * barrier for the specified window will be destroyed. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -2168,7 +2168,7 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetGrabbedWindow(void); * \sa SDL_GetWindowMouseRect * \sa SDL_SetWindowMouseGrab */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowMouseRect(SDL_Window *window, const SDL_Rect *rect); +extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowMouseRect(SDL_Window *window, const SDL_Rect *rect); /** * Get the mouse confinement rectangle of a window. @@ -2189,19 +2189,19 @@ extern SDL_DECLSPEC const SDL_Rect * SDLCALL SDL_GetWindowMouseRect(SDL_Window * * The parameter `opacity` will be clamped internally between 0.0f * (transparent) and 1.0f (opaque). * - * This function also returns SDL_FALSE if setting the opacity isn't + * This function also returns false if setting the opacity isn't * supported. * * \param window the window which will be made transparent or opaque. * \param opacity the opacity value (0.0f - transparent, 1.0f - opaque). - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetWindowOpacity */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowOpacity(SDL_Window *window, float opacity); +extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowOpacity(SDL_Window *window, float opacity); /** * Get the opacity of a window. @@ -2235,14 +2235,14 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetWindowOpacity(SDL_Window *window); * * \param window the window that should become the child of a parent. * \param parent the new parent window for the child window. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetWindowModal */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowParent(SDL_Window *window, SDL_Window *parent); +extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowParent(SDL_Window *window, SDL_Window *parent); /** * Toggle the state of the window as modal. @@ -2251,29 +2251,29 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowParent(SDL_Window *window, SDL * window of a parent, or toggling modal status on will fail. * * \param window the window on which to set the modal state. - * \param modal SDL_TRUE to toggle modal status on, SDL_FALSE to toggle it + * \param modal true to toggle modal status on, false to toggle it * off. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetWindowParent */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowModal(SDL_Window *window, SDL_bool modal); +extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowModal(SDL_Window *window, bool modal); /** * Set whether the window may have input focus. * * \param window the window to set focusable state. - * \param focusable SDL_TRUE to allow input focus, SDL_FALSE to not allow + * \param focusable true to allow input focus, false to not allow * input focus. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowFocusable(SDL_Window *window, SDL_bool focusable); +extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowFocusable(SDL_Window *window, bool focusable); /** @@ -2292,12 +2292,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowFocusable(SDL_Window *window, * the client area. * \param y the y coordinate of the menu, relative to the origin (top-left) of * the client area. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowWindowSystemMenu(SDL_Window *window, int x, int y); +extern SDL_DECLSPEC bool SDLCALL SDL_ShowWindowSystemMenu(SDL_Window *window, int x, int y); /** * Possible return values from the SDL_HitTest callback. @@ -2355,7 +2355,7 @@ typedef SDL_HitTestResult (SDLCALL *SDL_HitTest)(SDL_Window *win, * Specifying NULL for a callback disables hit-testing. Hit-testing is * disabled by default. * - * Platforms that don't support this functionality will return SDL_FALSE + * Platforms that don't support this functionality will return false * unconditionally, even if you're attempting to disable hit-testing. * * Your callback may fire at any time, and its firing does not indicate any @@ -2369,12 +2369,12 @@ typedef SDL_HitTestResult (SDLCALL *SDL_HitTest)(SDL_Window *win, * \param window the window to set hit-testing on. * \param callback the function to call when doing a hit-test. * \param callback_data an app-defined void pointer passed to **callback**. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowHitTest(SDL_Window *window, SDL_HitTest callback, void *callback_data); +extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowHitTest(SDL_Window *window, SDL_HitTest callback, void *callback_data); /** * Set the shape of a transparent window. @@ -2393,24 +2393,24 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowHitTest(SDL_Window *window, SD * \param window the window. * \param shape the surface representing the shape of the window, or NULL to * remove any current shape. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowShape(SDL_Window *window, SDL_Surface *shape); +extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowShape(SDL_Window *window, SDL_Surface *shape); /** * Request a window to demand attention from the user. * * \param window the window to be flashed. * \param operation the operation to perform. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FlashWindow(SDL_Window *window, SDL_FlashOperation operation); +extern SDL_DECLSPEC bool SDLCALL SDL_FlashWindow(SDL_Window *window, SDL_FlashOperation operation); /** * Destroy a window. @@ -2436,7 +2436,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window *window); * * The default can also be changed using `SDL_HINT_VIDEO_ALLOW_SCREENSAVER`. * - * \returns SDL_TRUE if the screensaver is enabled, SDL_FALSE if it is + * \returns true if the screensaver is enabled, false if it is * disabled. * * \since This function is available since SDL 3.0.0. @@ -2444,12 +2444,12 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window *window); * \sa SDL_DisableScreenSaver * \sa SDL_EnableScreenSaver */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ScreenSaverEnabled(void); +extern SDL_DECLSPEC bool SDLCALL SDL_ScreenSaverEnabled(void); /** * Allow the screen to be blanked by a screen saver. * - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -2457,7 +2457,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ScreenSaverEnabled(void); * \sa SDL_DisableScreenSaver * \sa SDL_ScreenSaverEnabled */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_EnableScreenSaver(void); +extern SDL_DECLSPEC bool SDLCALL SDL_EnableScreenSaver(void); /** * Prevent the screen from being blanked by a screen saver. @@ -2468,7 +2468,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_EnableScreenSaver(void); * The screensaver is disabled by default, but this may by changed by * SDL_HINT_VIDEO_ALLOW_SCREENSAVER. * - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -2476,7 +2476,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_EnableScreenSaver(void); * \sa SDL_EnableScreenSaver * \sa SDL_ScreenSaverEnabled */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_DisableScreenSaver(void); +extern SDL_DECLSPEC bool SDLCALL SDL_DisableScreenSaver(void); /** @@ -2496,7 +2496,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_DisableScreenSaver(void); * * \param path the platform dependent OpenGL library name, or NULL to open the * default OpenGL library. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -2504,7 +2504,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_DisableScreenSaver(void); * \sa SDL_GL_GetProcAddress * \sa SDL_GL_UnloadLibrary */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GL_LoadLibrary(const char *path); +extern SDL_DECLSPEC bool SDLCALL SDL_GL_LoadLibrary(const char *path); /** * Get an OpenGL function by name. @@ -2600,11 +2600,11 @@ extern SDL_DECLSPEC void SDLCALL SDL_GL_UnloadLibrary(void); * every time you need to know. * * \param extension the name of the extension to check. - * \returns SDL_TRUE if the extension is supported, SDL_FALSE otherwise. + * \returns true if the extension is supported, false otherwise. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char *extension); +extern SDL_DECLSPEC bool SDLCALL SDL_GL_ExtensionSupported(const char *extension); /** * Reset all previously set OpenGL context attributes to their default values. @@ -2627,7 +2627,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_GL_ResetAttributes(void); * \param attr an SDL_GLattr enum value specifying the OpenGL attribute to * set. * \param value the desired value for the attribute. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -2635,7 +2635,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_GL_ResetAttributes(void); * \sa SDL_GL_GetAttribute * \sa SDL_GL_ResetAttributes */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value); +extern SDL_DECLSPEC bool SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value); /** * Get the actual value for an attribute from the current context. @@ -2643,7 +2643,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int va * \param attr an SDL_GLattr enum value specifying the OpenGL attribute to * get. * \param value a pointer filled in with the current value of `attr`. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -2651,7 +2651,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int va * \sa SDL_GL_ResetAttributes * \sa SDL_GL_SetAttribute */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value); +extern SDL_DECLSPEC bool SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value); /** * Create an OpenGL context for an OpenGL window, and make it current. @@ -2682,14 +2682,14 @@ extern SDL_DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_Window *windo * * \param window the window to associate with the context. * \param context the OpenGL context to associate with the window. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GL_CreateContext */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GL_MakeCurrent(SDL_Window *window, SDL_GLContext context); +extern SDL_DECLSPEC bool SDLCALL SDL_GL_MakeCurrent(SDL_Window *window, SDL_GLContext context); /** * Get the currently active OpenGL window. @@ -2778,7 +2778,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_EGL_SetAttributeCallbacks(SDL_EGLAttribArra * the vertical retrace for a given frame, it swaps buffers immediately, which * might be less jarring for the user during occasional framerate drops. If an * application requests adaptive vsync and the system does not support it, - * this function will fail and return SDL_FALSE. In such a case, you should + * this function will fail and return false. In such a case, you should * probably retry the call with 1 for the interval. * * Adaptive vsync is implemented for some glX drivers with @@ -2790,14 +2790,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_EGL_SetAttributeCallbacks(SDL_EGLAttribArra * * \param interval 0 for immediate updates, 1 for updates synchronized with * the vertical retrace, -1 for adaptive vsync. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GL_GetSwapInterval */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GL_SetSwapInterval(int interval); +extern SDL_DECLSPEC bool SDLCALL SDL_GL_SetSwapInterval(int interval); /** * Get the swap interval for the current OpenGL context. @@ -2809,14 +2809,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GL_SetSwapInterval(int interval); * synchronization, 1 if the buffer swap is synchronized with * the vertical retrace, and -1 if late swaps happen * immediately instead of waiting for the next retrace. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GL_SetSwapInterval */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GL_GetSwapInterval(int *interval); +extern SDL_DECLSPEC bool SDLCALL SDL_GL_GetSwapInterval(int *interval); /** * Update a window with OpenGL rendering. @@ -2829,25 +2829,25 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GL_GetSwapInterval(int *interval); * extra. * * \param window the window to change. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GL_SwapWindow(SDL_Window *window); +extern SDL_DECLSPEC bool SDLCALL SDL_GL_SwapWindow(SDL_Window *window); /** * Delete an OpenGL context. * * \param context the OpenGL context to be deleted. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GL_CreateContext */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GL_DestroyContext(SDL_GLContext context); +extern SDL_DECLSPEC bool SDLCALL SDL_GL_DestroyContext(SDL_GLContext context); /* @} *//* OpenGL support functions */ diff --git a/include/SDL3/SDL_vulkan.h b/include/SDL3/SDL_vulkan.h index b94a70cb2..188e14b36 100644 --- a/include/SDL3/SDL_vulkan.h +++ b/include/SDL3/SDL_vulkan.h @@ -96,7 +96,7 @@ struct VkAllocationCallbacks; * library version. * * \param path the platform dependent Vulkan loader library name or NULL. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -104,7 +104,7 @@ struct VkAllocationCallbacks; * \sa SDL_Vulkan_GetVkGetInstanceProcAddr * \sa SDL_Vulkan_UnloadLibrary */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_Vulkan_LoadLibrary(const char *path); +extern SDL_DECLSPEC bool SDLCALL SDL_Vulkan_LoadLibrary(const char *path); /** * Get the address of the `vkGetInstanceProcAddr` function. @@ -176,7 +176,7 @@ extern SDL_DECLSPEC char const * const * SDLCALL SDL_Vulkan_GetInstanceExtension * allocator that creates the surface. Can be NULL. * \param surface a pointer to a VkSurfaceKHR handle to output the newly * created surface. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * \returns true on success or false on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -184,7 +184,7 @@ extern SDL_DECLSPEC char const * const * SDLCALL SDL_Vulkan_GetInstanceExtension * \sa SDL_Vulkan_GetInstanceExtensions * \sa SDL_Vulkan_DestroySurface */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window, +extern SDL_DECLSPEC bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window, VkInstance instance, const struct VkAllocationCallbacks *allocator, VkSurfaceKHR* surface); @@ -227,14 +227,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_Vulkan_DestroySurface(VkInstance instance, * \param physicalDevice a valid Vulkan physical device handle. * \param queueFamilyIndex a valid queue family index for the given physical * device. - * \returns SDL_TRUE if supported, SDL_FALSE if unsupported or an error + * \returns true if supported, false if unsupported or an error * occurred. * * \since This function is available since SDL 3.0.0. * * \sa SDL_Vulkan_GetInstanceExtensions */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetPresentationSupport(VkInstance instance, +extern SDL_DECLSPEC bool SDLCALL SDL_Vulkan_GetPresentationSupport(VkInstance instance, VkPhysicalDevice physicalDevice, Uint32 queueFamilyIndex); diff --git a/src/SDL.c b/src/SDL.c index 0116ba9c3..6875d968d 100644 --- a/src/SDL.c +++ b/src/SDL.c @@ -110,7 +110,7 @@ SDL_NORETURN void SDL_ExitProcess(int exitcode) // App metadata -SDL_bool SDL_SetAppMetadata(const char *appname, const char *appversion, const char *appidentifier) +bool SDL_SetAppMetadata(const char *appname, const char *appversion, const char *appidentifier) { SDL_SetAppMetadataProperty(SDL_PROP_APP_METADATA_NAME_STRING, appname); SDL_SetAppMetadataProperty(SDL_PROP_APP_METADATA_VERSION_STRING, appversion); @@ -136,7 +136,7 @@ static bool SDL_ValidMetadataProperty(const char *name) return false; } -SDL_bool SDL_SetAppMetadataProperty(const char *name, const char *value) +bool SDL_SetAppMetadataProperty(const char *name, const char *value) { if (!SDL_ValidMetadataProperty(name)) { return SDL_InvalidParamError("name"); @@ -264,7 +264,7 @@ static void SDL_QuitMainThread(void) SDL_QuitTLSData(); } -SDL_bool SDL_InitSubSystem(SDL_InitFlags flags) +bool SDL_InitSubSystem(SDL_InitFlags flags) { Uint32 flags_initialized = 0; @@ -471,7 +471,7 @@ quit_and_error: return false; } -SDL_bool SDL_Init(SDL_InitFlags flags) +bool SDL_Init(SDL_InitFlags flags) { return SDL_InitSubSystem(flags); } @@ -707,7 +707,7 @@ const char *SDL_GetPlatform(void) #endif } -SDL_bool SDL_IsTablet(void) +bool SDL_IsTablet(void) { #ifdef SDL_PLATFORM_ANDROID extern bool SDL_IsAndroidTablet(void); diff --git a/src/SDL_error.c b/src/SDL_error.c index 78943e667..f5cb0c2c1 100644 --- a/src/SDL_error.c +++ b/src/SDL_error.c @@ -24,7 +24,7 @@ #include "SDL_error_c.h" -SDL_bool SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) +bool SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { // Ignore call if invalid format pointer was passed if (fmt) { @@ -77,7 +77,7 @@ const char *SDL_GetError(void) } } -SDL_bool SDL_ClearError(void) +bool SDL_ClearError(void) { SDL_error *error = SDL_GetErrBuf(false); @@ -87,7 +87,7 @@ SDL_bool SDL_ClearError(void) return true; } -SDL_bool SDL_OutOfMemory(void) +bool SDL_OutOfMemory(void) { SDL_error *error = SDL_GetErrBuf(true); diff --git a/src/SDL_hints.c b/src/SDL_hints.c index 2d1d5b872..6fcd8b8c2 100644 --- a/src/SDL_hints.c +++ b/src/SDL_hints.c @@ -83,7 +83,7 @@ static void SDLCALL CleanupHintProperty(void *userdata, void *value) SDL_free(hint); } -SDL_bool SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriority priority) +bool SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriority priority) { if (!name || !*name) { return SDL_InvalidParamError("name"); @@ -137,7 +137,7 @@ SDL_bool SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPr return result; } -SDL_bool SDL_ResetHint(const char *name) +bool SDL_ResetHint(const char *name) { if (!name || !*name) { return SDL_InvalidParamError("name"); @@ -202,7 +202,7 @@ void SDL_ResetHints(void) SDL_EnumerateProperties(GetHintProperties(false), ResetHintsCallback, NULL); } -SDL_bool SDL_SetHint(const char *name, const char *value) +bool SDL_SetHint(const char *name, const char *value) { return SDL_SetHintWithPriority(name, value, SDL_HINT_NORMAL); } @@ -260,13 +260,13 @@ bool SDL_GetStringBoolean(const char *value, bool default_value) return true; } -SDL_bool SDL_GetHintBoolean(const char *name, SDL_bool default_value) +bool SDL_GetHintBoolean(const char *name, bool default_value) { const char *hint = SDL_GetHint(name); return SDL_GetStringBoolean(hint, default_value); } -SDL_bool SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata) +bool SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata) { if (!name || !*name) { return SDL_InvalidParamError("name"); diff --git a/src/SDL_internal.h b/src/SDL_internal.h index a86aa561a..4a83cf4c7 100644 --- a/src/SDL_internal.h +++ b/src/SDL_internal.h @@ -241,9 +241,9 @@ extern void SDL_InitMainThread(void); /* The internal implementations of these functions have up to nanosecond precision. We can expose these functions as part of the API if we want to later. */ -extern SDL_bool SDLCALL SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS); -extern SDL_bool SDLCALL SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS); -extern SDL_bool SDLCALL SDL_WaitEventTimeoutNS(SDL_Event *event, Sint64 timeoutNS); +extern bool SDLCALL SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS); +extern bool SDLCALL SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS); +extern bool SDLCALL SDL_WaitEventTimeoutNS(SDL_Event *event, Sint64 timeoutNS); // Ends C function definitions when using C++ #ifdef __cplusplus diff --git a/src/SDL_log.c b/src/SDL_log.c index 5abaf86c7..1b9be017e 100644 --- a/src/SDL_log.c +++ b/src/SDL_log.c @@ -446,7 +446,7 @@ static const char *GetLogPriorityPrefix(SDL_LogPriority priority) } } -SDL_bool SDL_SetLogPriorityPrefix(SDL_LogPriority priority, const char *prefix) +bool SDL_SetLogPriorityPrefix(SDL_LogPriority priority, const char *prefix) { char *prefix_copy; diff --git a/src/SDL_properties.c b/src/SDL_properties.c index eacbc588f..802717104 100644 --- a/src/SDL_properties.c +++ b/src/SDL_properties.c @@ -210,7 +210,7 @@ error: return 0; } -SDL_bool SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst) +bool SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst) { SDL_Properties *src_properties = NULL; SDL_Properties *dst_properties = NULL; @@ -282,7 +282,7 @@ SDL_bool SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst) return result; } -SDL_bool SDL_LockProperties(SDL_PropertiesID props) +bool SDL_LockProperties(SDL_PropertiesID props) { SDL_Properties *properties = NULL; @@ -321,7 +321,7 @@ void SDL_UnlockProperties(SDL_PropertiesID props) SDL_UnlockMutex(properties->lock); } -static SDL_bool SDL_PrivateSetProperty(SDL_PropertiesID props, const char *name, SDL_Property *property) +static bool SDL_PrivateSetProperty(SDL_PropertiesID props, const char *name, SDL_Property *property) { SDL_Properties *properties = NULL; bool result = true; @@ -360,7 +360,7 @@ static SDL_bool SDL_PrivateSetProperty(SDL_PropertiesID props, const char *name, return result; } -SDL_bool SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, SDL_CleanupPropertyCallback cleanup, void *userdata) +bool SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, SDL_CleanupPropertyCallback cleanup, void *userdata) { SDL_Property *property; @@ -386,7 +386,7 @@ SDL_bool SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, const char *n return SDL_PrivateSetProperty(props, name, property); } -SDL_bool SDL_SetPointerProperty(SDL_PropertiesID props, const char *name, void *value) +bool SDL_SetPointerProperty(SDL_PropertiesID props, const char *name, void *value) { SDL_Property *property; @@ -425,7 +425,7 @@ bool SDL_SetSurfaceProperty(SDL_PropertiesID props, const char *name, SDL_Surfac return SDL_SetPointerPropertyWithCleanup(props, name, surface, CleanupSurface, NULL); } -SDL_bool SDL_SetStringProperty(SDL_PropertiesID props, const char *name, const char *value) +bool SDL_SetStringProperty(SDL_PropertiesID props, const char *name, const char *value) { SDL_Property *property; @@ -446,7 +446,7 @@ SDL_bool SDL_SetStringProperty(SDL_PropertiesID props, const char *name, const c return SDL_PrivateSetProperty(props, name, property); } -SDL_bool SDL_SetNumberProperty(SDL_PropertiesID props, const char *name, Sint64 value) +bool SDL_SetNumberProperty(SDL_PropertiesID props, const char *name, Sint64 value) { SDL_Property *property = (SDL_Property *)SDL_calloc(1, sizeof(*property)); if (!property) { @@ -457,7 +457,7 @@ SDL_bool SDL_SetNumberProperty(SDL_PropertiesID props, const char *name, Sint64 return SDL_PrivateSetProperty(props, name, property); } -SDL_bool SDL_SetFloatProperty(SDL_PropertiesID props, const char *name, float value) +bool SDL_SetFloatProperty(SDL_PropertiesID props, const char *name, float value) { SDL_Property *property = (SDL_Property *)SDL_calloc(1, sizeof(*property)); if (!property) { @@ -468,7 +468,7 @@ SDL_bool SDL_SetFloatProperty(SDL_PropertiesID props, const char *name, float va return SDL_PrivateSetProperty(props, name, property); } -SDL_bool SDL_SetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bool value) +bool SDL_SetBooleanProperty(SDL_PropertiesID props, const char *name, bool value) { SDL_Property *property = (SDL_Property *)SDL_calloc(1, sizeof(*property)); if (!property) { @@ -479,7 +479,7 @@ SDL_bool SDL_SetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bo return SDL_PrivateSetProperty(props, name, property); } -SDL_bool SDL_HasProperty(SDL_PropertiesID props, const char *name) +bool SDL_HasProperty(SDL_PropertiesID props, const char *name) { return (SDL_GetPropertyType(props, name) != SDL_PROPERTY_TYPE_INVALID); } @@ -709,7 +709,7 @@ float SDL_GetFloatProperty(SDL_PropertiesID props, const char *name, float defau return value; } -SDL_bool SDL_GetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bool default_value) +bool SDL_GetBooleanProperty(SDL_PropertiesID props, const char *name, bool default_value) { SDL_Properties *properties = NULL; bool value = default_value ? true : false; @@ -756,12 +756,12 @@ SDL_bool SDL_GetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bo return value; } -SDL_bool SDL_ClearProperty(SDL_PropertiesID props, const char *name) +bool SDL_ClearProperty(SDL_PropertiesID props, const char *name) { return SDL_PrivateSetProperty(props, name, NULL); } -SDL_bool SDL_EnumerateProperties(SDL_PropertiesID props, SDL_EnumeratePropertiesCallback callback, void *userdata) +bool SDL_EnumerateProperties(SDL_PropertiesID props, SDL_EnumeratePropertiesCallback callback, void *userdata) { SDL_Properties *properties = NULL; diff --git a/src/atomic/SDL_atomic.c b/src/atomic/SDL_atomic.c index aceb23785..70ee1607d 100644 --- a/src/atomic/SDL_atomic.c +++ b/src/atomic/SDL_atomic.c @@ -122,7 +122,7 @@ static SDL_INLINE void leaveLock(void *a) } #endif -SDL_bool SDL_CompareAndSwapAtomicInt(SDL_AtomicInt *a, int oldval, int newval) +bool SDL_CompareAndSwapAtomicInt(SDL_AtomicInt *a, int oldval, int newval) { #ifdef HAVE_MSC_ATOMICS SDL_COMPILE_TIME_ASSERT(atomic_cas, sizeof(long) == sizeof(a->value)); @@ -152,7 +152,7 @@ SDL_bool SDL_CompareAndSwapAtomicInt(SDL_AtomicInt *a, int oldval, int newval) #endif } -SDL_bool SDL_CompareAndSwapAtomicU32(SDL_AtomicU32 *a, Uint32 oldval, Uint32 newval) +bool SDL_CompareAndSwapAtomicU32(SDL_AtomicU32 *a, Uint32 oldval, Uint32 newval) { #ifdef HAVE_MSC_ATOMICS SDL_COMPILE_TIME_ASSERT(atomic_cas, sizeof(long) == sizeof(a->value)); @@ -183,7 +183,7 @@ SDL_bool SDL_CompareAndSwapAtomicU32(SDL_AtomicU32 *a, Uint32 oldval, Uint32 new #endif } -SDL_bool SDL_CompareAndSwapAtomicPointer(void **a, void *oldval, void *newval) +bool SDL_CompareAndSwapAtomicPointer(void **a, void *oldval, void *newval) { #ifdef HAVE_MSC_ATOMICS return _InterlockedCompareExchangePointer(a, newval, oldval) == oldval; diff --git a/src/atomic/SDL_spinlock.c b/src/atomic/SDL_spinlock.c index ad5ba15df..b1f476985 100644 --- a/src/atomic/SDL_spinlock.c +++ b/src/atomic/SDL_spinlock.c @@ -57,7 +57,7 @@ extern __inline int _SDL_xchg_watcom(volatile int *a, int v); /* *INDENT-ON* */ // clang-format on // This function is where all the magic happens... -SDL_bool SDL_TryLockSpinlock(SDL_SpinLock *lock) +bool SDL_TryLockSpinlock(SDL_SpinLock *lock) { #if defined(HAVE_GCC_ATOMICS) || defined(HAVE_GCC_SYNC_LOCK_TEST_AND_SET) return __sync_lock_test_and_set(lock, 1) == 0; diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index eb20ed690..52dd90e09 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -1443,7 +1443,7 @@ const char *SDL_GetAudioDeviceName(SDL_AudioDeviceID devid) return result; } -SDL_bool SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec *spec, int *sample_frames) +bool SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec *spec, int *sample_frames) { if (!spec) { return SDL_InvalidParamError("spec"); @@ -1767,17 +1767,17 @@ static bool SetLogicalAudioDevicePauseState(SDL_AudioDeviceID devid, int value) return logdev ? true : false; // ObtainLogicalAudioDevice will have set an error. } -SDL_bool SDL_PauseAudioDevice(SDL_AudioDeviceID devid) +bool SDL_PauseAudioDevice(SDL_AudioDeviceID devid) { return SetLogicalAudioDevicePauseState(devid, 1); } -SDL_bool SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID devid) +bool SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID devid) { return SetLogicalAudioDevicePauseState(devid, 0); } -SDL_bool SDL_AudioDevicePaused(SDL_AudioDeviceID devid) +bool SDL_AudioDevicePaused(SDL_AudioDeviceID devid) { SDL_AudioDevice *device = NULL; SDL_LogicalAudioDevice *logdev = ObtainLogicalAudioDevice(devid, &device); @@ -1798,7 +1798,7 @@ float SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid) return result; } -SDL_bool SDL_SetAudioDeviceGain(SDL_AudioDeviceID devid, float gain) +bool SDL_SetAudioDeviceGain(SDL_AudioDeviceID devid, float gain) { if (gain < 0.0f) { return SDL_InvalidParamError("gain"); @@ -1827,7 +1827,7 @@ SDL_bool SDL_SetAudioDeviceGain(SDL_AudioDeviceID devid, float gain) return result; } -SDL_bool SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, SDL_AudioPostmixCallback callback, void *userdata) +bool SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, SDL_AudioPostmixCallback callback, void *userdata) { SDL_AudioDevice *device = NULL; SDL_LogicalAudioDevice *logdev = ObtainLogicalAudioDevice(devid, &device); @@ -1862,7 +1862,7 @@ SDL_bool SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, SDL_AudioPostmixCa return result; } -SDL_bool SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream **streams, int num_streams) +bool SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream **streams, int num_streams) { const bool islogical = !(devid & (1<<1)); SDL_AudioDevice *device = NULL; @@ -1955,7 +1955,7 @@ SDL_bool SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream **streams return result; } -SDL_bool SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_AudioStream *stream) +bool SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_AudioStream *stream) { return SDL_BindAudioStreams(devid, &stream, 1); } @@ -2120,7 +2120,7 @@ SDL_AudioStream *SDL_OpenAudioDeviceStream(SDL_AudioDeviceID devid, const SDL_Au return stream; } -SDL_bool SDL_PauseAudioStreamDevice(SDL_AudioStream *stream) +bool SDL_PauseAudioStreamDevice(SDL_AudioStream *stream) { SDL_AudioDeviceID devid = SDL_GetAudioStreamDevice(stream); if (!devid) { @@ -2130,7 +2130,7 @@ SDL_bool SDL_PauseAudioStreamDevice(SDL_AudioStream *stream) return SDL_PauseAudioDevice(devid); } -SDL_bool SDL_ResumeAudioStreamDevice(SDL_AudioStream *stream) +bool SDL_ResumeAudioStreamDevice(SDL_AudioStream *stream) { SDL_AudioDeviceID devid = SDL_GetAudioStreamDevice(stream); if (!devid) { diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c index 6423282d7..831b36e8c 100644 --- a/src/audio/SDL_audiocvt.c +++ b/src/audio/SDL_audiocvt.c @@ -448,7 +448,7 @@ SDL_PropertiesID SDL_GetAudioStreamProperties(SDL_AudioStream *stream) return stream->props; } -SDL_bool SDL_SetAudioStreamGetCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata) +bool SDL_SetAudioStreamGetCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata) { if (!stream) { return SDL_InvalidParamError("stream"); @@ -460,7 +460,7 @@ SDL_bool SDL_SetAudioStreamGetCallback(SDL_AudioStream *stream, SDL_AudioStreamC return true; } -SDL_bool SDL_SetAudioStreamPutCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata) +bool SDL_SetAudioStreamPutCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata) { if (!stream) { return SDL_InvalidParamError("stream"); @@ -472,7 +472,7 @@ SDL_bool SDL_SetAudioStreamPutCallback(SDL_AudioStream *stream, SDL_AudioStreamC return true; } -SDL_bool SDL_LockAudioStream(SDL_AudioStream *stream) +bool SDL_LockAudioStream(SDL_AudioStream *stream) { if (!stream) { return SDL_InvalidParamError("stream"); @@ -481,7 +481,7 @@ SDL_bool SDL_LockAudioStream(SDL_AudioStream *stream) return true; } -SDL_bool SDL_UnlockAudioStream(SDL_AudioStream *stream) +bool SDL_UnlockAudioStream(SDL_AudioStream *stream) { if (!stream) { return SDL_InvalidParamError("stream"); @@ -490,7 +490,7 @@ SDL_bool SDL_UnlockAudioStream(SDL_AudioStream *stream) return true; } -SDL_bool SDL_GetAudioStreamFormat(SDL_AudioStream *stream, SDL_AudioSpec *src_spec, SDL_AudioSpec *dst_spec) +bool SDL_GetAudioStreamFormat(SDL_AudioStream *stream, SDL_AudioSpec *src_spec, SDL_AudioSpec *dst_spec) { if (!stream) { return SDL_InvalidParamError("stream"); @@ -514,7 +514,7 @@ SDL_bool SDL_GetAudioStreamFormat(SDL_AudioStream *stream, SDL_AudioSpec *src_sp return true; } -SDL_bool SDL_SetAudioStreamFormat(SDL_AudioStream *stream, const SDL_AudioSpec *src_spec, const SDL_AudioSpec *dst_spec) +bool SDL_SetAudioStreamFormat(SDL_AudioStream *stream, const SDL_AudioSpec *src_spec, const SDL_AudioSpec *dst_spec) { if (!stream) { return SDL_InvalidParamError("stream"); @@ -626,12 +626,12 @@ bool SetAudioStreamChannelMap(SDL_AudioStream *stream, const SDL_AudioSpec *spec return result; } -SDL_bool SDL_SetAudioStreamInputChannelMap(SDL_AudioStream *stream, const int *chmap, int channels) +bool SDL_SetAudioStreamInputChannelMap(SDL_AudioStream *stream, const int *chmap, int channels) { return SetAudioStreamChannelMap(stream, &stream->src_spec, &stream->src_chmap, chmap, channels, true); } -SDL_bool SDL_SetAudioStreamOutputChannelMap(SDL_AudioStream *stream, const int *chmap, int channels) +bool SDL_SetAudioStreamOutputChannelMap(SDL_AudioStream *stream, const int *chmap, int channels) { return SetAudioStreamChannelMap(stream, &stream->dst_spec, &stream->dst_chmap, chmap, channels, false); } @@ -686,7 +686,7 @@ float SDL_GetAudioStreamFrequencyRatio(SDL_AudioStream *stream) return freq_ratio; } -SDL_bool SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream *stream, float freq_ratio) +bool SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream *stream, float freq_ratio) { if (!stream) { return SDL_InvalidParamError("stream"); @@ -723,7 +723,7 @@ float SDL_GetAudioStreamGain(SDL_AudioStream *stream) return gain; } -SDL_bool SDL_SetAudioStreamGain(SDL_AudioStream *stream, float gain) +bool SDL_SetAudioStreamGain(SDL_AudioStream *stream, float gain) { if (!stream) { return SDL_InvalidParamError("stream"); @@ -805,7 +805,7 @@ static void SDLCALL FreeAllocatedAudioBuffer(void *userdata, const void *buf, in SDL_free((void*) buf); } -SDL_bool SDL_PutAudioStreamData(SDL_AudioStream *stream, const void *buf, int len) +bool SDL_PutAudioStreamData(SDL_AudioStream *stream, const void *buf, int len) { if (!stream) { return SDL_InvalidParamError("stream"); @@ -841,7 +841,7 @@ SDL_bool SDL_PutAudioStreamData(SDL_AudioStream *stream, const void *buf, int le return PutAudioStreamBuffer(stream, buf, len, NULL, NULL); } -SDL_bool SDL_FlushAudioStream(SDL_AudioStream *stream) +bool SDL_FlushAudioStream(SDL_AudioStream *stream) { if (!stream) { return SDL_InvalidParamError("stream"); @@ -1254,7 +1254,7 @@ int SDL_GetAudioStreamQueued(SDL_AudioStream *stream) return (int) SDL_min(total, SDL_INT_MAX); } -SDL_bool SDL_ClearAudioStream(SDL_AudioStream *stream) +bool SDL_ClearAudioStream(SDL_AudioStream *stream) { if (!stream) { return SDL_InvalidParamError("stream"); @@ -1303,7 +1303,7 @@ static void SDLCALL DontFreeThisAudioBuffer(void *userdata, const void *buf, int // We don't own the buffer, but know it will outlive the stream } -SDL_bool SDL_ConvertAudioSamples(const SDL_AudioSpec *src_spec, const Uint8 *src_data, int src_len, const SDL_AudioSpec *dst_spec, Uint8 **dst_data, int *dst_len) +bool SDL_ConvertAudioSamples(const SDL_AudioSpec *src_spec, const Uint8 *src_data, int src_len, const SDL_AudioSpec *dst_spec, Uint8 **dst_data, int *dst_len) { if (dst_data) { *dst_data = NULL; diff --git a/src/audio/SDL_mixer.c b/src/audio/SDL_mixer.c index 920b56680..e6924ddc4 100644 --- a/src/audio/SDL_mixer.c +++ b/src/audio/SDL_mixer.c @@ -86,7 +86,7 @@ static const Uint8 mix8[] = { // !!! FIXME: Add fast-path for volume = 1 // !!! FIXME: Use larger scales for 16-bit/32-bit integers -SDL_bool SDL_MixAudio(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format, Uint32 len, float fvolume) +bool SDL_MixAudio(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format, Uint32 len, float fvolume) { int volume = (int)SDL_roundf(fvolume * MIX_MAXVOLUME); diff --git a/src/audio/SDL_wave.c b/src/audio/SDL_wave.c index 11012c5f4..181f504ea 100644 --- a/src/audio/SDL_wave.c +++ b/src/audio/SDL_wave.c @@ -2076,7 +2076,7 @@ static bool WaveLoad(SDL_IOStream *src, WaveFile *file, SDL_AudioSpec *spec, Uin return true; } -SDL_bool SDL_LoadWAV_IO(SDL_IOStream *src, SDL_bool closeio, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len) +bool SDL_LoadWAV_IO(SDL_IOStream *src, bool closeio, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len) { bool result = false; WaveFile file; @@ -2130,7 +2130,7 @@ done: return result; } -SDL_bool SDL_LoadWAV(const char *path, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len) +bool SDL_LoadWAV(const char *path, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len) { return SDL_LoadWAV_IO(SDL_IOFromFile(path, "rb"), 1, spec, audio_buf, audio_len); } diff --git a/src/audio/aaudio/SDL_aaudio.c b/src/audio/aaudio/SDL_aaudio.c index 6e8d7ddff..7d6e5cb0c 100644 --- a/src/audio/aaudio/SDL_aaudio.c +++ b/src/audio/aaudio/SDL_aaudio.c @@ -386,7 +386,7 @@ static bool BuildAAudioStream(SDL_AudioDevice *device) } // !!! FIXME: make this non-blocking! -static void SDLCALL RequestAndroidPermissionBlockingCallback(void *userdata, const char *permission, SDL_bool granted) +static void SDLCALL RequestAndroidPermissionBlockingCallback(void *userdata, const char *permission, bool granted) { SDL_SetAtomicInt((SDL_AtomicInt *) userdata, granted ? 1 : -1); } diff --git a/src/audio/openslES/SDL_openslES.c b/src/audio/openslES/SDL_openslES.c index e7aea4bb6..2ab0de0e0 100644 --- a/src/audio/openslES/SDL_openslES.c +++ b/src/audio/openslES/SDL_openslES.c @@ -229,7 +229,7 @@ static void OPENSLES_DestroyPCMRecorder(SDL_AudioDevice *device) } // !!! FIXME: make this non-blocking! -static void SDLCALL RequestAndroidPermissionBlockingCallback(void *userdata, const char *permission, SDL_bool granted) +static void SDLCALL RequestAndroidPermissionBlockingCallback(void *userdata, const char *permission, bool granted) { SDL_SetAtomicInt((SDL_AtomicInt *) userdata, granted ? 1 : -1); } diff --git a/src/camera/SDL_camera.c b/src/camera/SDL_camera.c index e153010d2..a76a095b2 100644 --- a/src/camera/SDL_camera.c +++ b/src/camera/SDL_camera.c @@ -650,7 +650,7 @@ void SDL_CloseCamera(SDL_Camera *camera) ClosePhysicalCamera(device); } -SDL_bool SDL_GetCameraFormat(SDL_Camera *camera, SDL_CameraSpec *spec) +bool SDL_GetCameraFormat(SDL_Camera *camera, SDL_CameraSpec *spec) { bool result; @@ -1407,7 +1407,7 @@ static void NukeCameraHashItem(const void *key, const void *value, void *data) // no-op, keys and values in this hashtable are treated as Plain Old Data and don't get freed here. } -SDL_bool SDL_CameraInit(const char *driver_name) +bool SDL_CameraInit(const char *driver_name) { if (SDL_GetCurrentCameraDriver()) { SDL_QuitCamera(); // shutdown driver if already running. diff --git a/src/camera/SDL_camera_c.h b/src/camera/SDL_camera_c.h index 2ffe2c161..7436ab43c 100644 --- a/src/camera/SDL_camera_c.h +++ b/src/camera/SDL_camera_c.h @@ -24,7 +24,7 @@ #define SDL_camera_c_h_ // Initialize the camera subsystem -extern SDL_bool SDL_CameraInit(const char *driver_name); +extern bool SDL_CameraInit(const char *driver_name); // Shutdown the camera subsystem extern void SDL_QuitCamera(void); diff --git a/src/camera/android/SDL_camera_android.c b/src/camera/android/SDL_camera_android.c index 835c22abc..1838f9b41 100644 --- a/src/camera/android/SDL_camera_android.c +++ b/src/camera/android/SDL_camera_android.c @@ -516,7 +516,7 @@ static bool PrepareCamera(SDL_Camera *device) return true; } -static void SDLCALL CameraPermissionCallback(void *userdata, const char *permission, SDL_bool granted) +static void SDLCALL CameraPermissionCallback(void *userdata, const char *permission, bool granted) { SDL_Camera *device = (SDL_Camera *) userdata; if (device->hidden != NULL) { // if device was already closed, don't send an event. diff --git a/src/core/SDL_core_unsupported.c b/src/core/SDL_core_unsupported.c index 02b09f569..244a596a6 100644 --- a/src/core/SDL_core_unsupported.c +++ b/src/core/SDL_core_unsupported.c @@ -31,16 +31,16 @@ void SDL_SetX11EventHook(SDL_X11EventHook callback, void *userdata) #ifndef SDL_PLATFORM_LINUX -SDL_DECLSPEC SDL_bool SDLCALL SDL_SetLinuxThreadPriority(Sint64 threadID, int priority); -SDL_bool SDL_SetLinuxThreadPriority(Sint64 threadID, int priority) +SDL_DECLSPEC bool SDLCALL SDL_SetLinuxThreadPriority(Sint64 threadID, int priority); +bool SDL_SetLinuxThreadPriority(Sint64 threadID, int priority) { (void)threadID; (void)priority; return SDL_Unsupported(); } -SDL_DECLSPEC SDL_bool SDLCALL SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy); -SDL_bool SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy) +SDL_DECLSPEC bool SDLCALL SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy); +bool SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy) { (void)threadID; (void)sdlPriority; @@ -58,8 +58,8 @@ void SDL_GDKSuspendComplete(void) SDL_Unsupported(); } -SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGDKDefaultUser(void *outUserHandle); /* XUserHandle *outUserHandle */ -SDL_bool SDL_GetGDKDefaultUser(void *outUserHandle) +SDL_DECLSPEC bool SDLCALL SDL_GetGDKDefaultUser(void *outUserHandle); /* XUserHandle *outUserHandle */ +bool SDL_GetGDKDefaultUser(void *outUserHandle) { return SDL_Unsupported(); } @@ -78,8 +78,8 @@ void SDL_GDKResumeGPU(SDL_GPUDevice *device) #if !defined(SDL_PLATFORM_WINDOWS) -SDL_DECLSPEC SDL_bool SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst); -SDL_bool SDL_RegisterApp(const char *name, Uint32 style, void *hInst) +SDL_DECLSPEC bool SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst); +bool SDL_RegisterApp(const char *name, Uint32 style, void *hInst) { (void)name; (void)style; @@ -154,8 +154,8 @@ void *SDL_GetAndroidJNIEnv(void) } typedef void (SDLCALL *SDL_RequestAndroidPermissionCallback)(void *userdata, const char *permission, bool granted); -SDL_DECLSPEC SDL_bool SDLCALL SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata); -SDL_bool SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata) +SDL_DECLSPEC bool SDLCALL SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata); +bool SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata) { (void)permission; (void)cb; @@ -163,16 +163,16 @@ SDL_bool SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroid return SDL_Unsupported(); } -SDL_DECLSPEC SDL_bool SDLCALL SDL_SendAndroidMessage(Uint32 command, int param); -SDL_bool SDL_SendAndroidMessage(Uint32 command, int param) +SDL_DECLSPEC bool SDLCALL SDL_SendAndroidMessage(Uint32 command, int param); +bool SDL_SendAndroidMessage(Uint32 command, int param) { (void)command; (void)param; return SDL_Unsupported(); } -SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowAndroidToast(const char* message, int duration, int gravity, int xoffset, int yoffset); -SDL_bool SDL_ShowAndroidToast(const char* message, int duration, int gravity, int xoffset, int yoffset) +SDL_DECLSPEC bool SDLCALL SDL_ShowAndroidToast(const char* message, int duration, int gravity, int xoffset, int yoffset); +bool SDL_ShowAndroidToast(const char* message, int duration, int gravity, int xoffset, int yoffset) { (void)message; (void)duration; @@ -188,22 +188,22 @@ int SDL_GetAndroidSDKVersion(void) return SDL_Unsupported(); } -SDL_DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void); -SDL_bool SDL_IsAndroidTV(void) +SDL_DECLSPEC bool SDLCALL SDL_IsAndroidTV(void); +bool SDL_IsAndroidTV(void) { SDL_Unsupported(); return false; } -SDL_DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void); -SDL_bool SDL_IsChromebook(void) +SDL_DECLSPEC bool SDLCALL SDL_IsChromebook(void); +bool SDL_IsChromebook(void) { SDL_Unsupported(); return false; } -SDL_DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void); -SDL_bool SDL_IsDeXMode(void) +SDL_DECLSPEC bool SDLCALL SDL_IsDeXMode(void); +bool SDL_IsDeXMode(void) { SDL_Unsupported(); return false; diff --git a/src/core/android/SDL_android.c b/src/core/android/SDL_android.c index 34fb3dcee..6f9db679e 100644 --- a/src/core/android/SDL_android.c +++ b/src/core/android/SDL_android.c @@ -1829,7 +1829,7 @@ Sint64 Android_JNI_FileSeek(void *userdata, Sint64 offset, SDL_IOWhence whence) return (Sint64) AAsset_seek64((AAsset *)userdata, offset, (int)whence); } -SDL_bool Android_JNI_FileClose(void *userdata) +bool Android_JNI_FileClose(void *userdata) { AAsset_close((AAsset *)userdata); return true; @@ -2029,7 +2029,7 @@ void Android_JNI_HapticStop(int device_id) // See SDLActivity.java for constants. #define COMMAND_SET_KEEP_SCREEN_ON 5 -SDL_bool SDL_SendAndroidMessage(Uint32 command, int param) +bool SDL_SendAndroidMessage(Uint32 command, int param) { if (command < 0x8000) { return SDL_InvalidParamError("command"); @@ -2211,19 +2211,19 @@ bool SDL_IsAndroidTablet(void) return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsTablet); } -SDL_bool SDL_IsAndroidTV(void) +bool SDL_IsAndroidTV(void) { JNIEnv *env = Android_JNI_GetEnv(); return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsAndroidTV); } -SDL_bool SDL_IsChromebook(void) +bool SDL_IsChromebook(void) { JNIEnv *env = Android_JNI_GetEnv(); return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsChromebook); } -SDL_bool SDL_IsDeXMode(void) +bool SDL_IsDeXMode(void) { JNIEnv *env = Android_JNI_GetEnv(); return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsDeXMode); @@ -2420,7 +2420,7 @@ const char *SDL_GetAndroidCachePath(void) return s_AndroidCachePath; } -SDL_bool SDL_ShowAndroidToast(const char *message, int duration, int gravity, int xOffset, int yOffset) +bool SDL_ShowAndroidToast(const char *message, int duration, int gravity, int xOffset, int yOffset) { return Android_JNI_ShowToast(message, duration, gravity, xOffset, yOffset); } @@ -2519,7 +2519,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativePermissionResult)( SDL_UnlockMutex(Android_ActivityMutex); } -SDL_bool SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata) +bool SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata) { if (!permission) { return SDL_InvalidParamError("permission"); diff --git a/src/core/android/SDL_android.h b/src/core/android/SDL_android.h index 3ca03c9be..4d810c99c 100644 --- a/src/core/android/SDL_android.h +++ b/src/core/android/SDL_android.h @@ -85,7 +85,7 @@ Sint64 Android_JNI_FileSize(void *userdata); Sint64 Android_JNI_FileSeek(void *userdata, Sint64 offset, SDL_IOWhence whence); size_t Android_JNI_FileRead(void *userdata, void *buffer, size_t size, SDL_IOStatus *status); size_t Android_JNI_FileWrite(void *userdata, const void *buffer, size_t size, SDL_IOStatus *status); -SDL_bool Android_JNI_FileClose(void *userdata); +bool Android_JNI_FileClose(void *userdata); // Environment support void Android_JNI_GetManifestEnvironmentVariables(void); diff --git a/src/core/gdk/SDL_gdk.cpp b/src/core/gdk/SDL_gdk.cpp index 2cde67b66..efd56f315 100644 --- a/src/core/gdk/SDL_gdk.cpp +++ b/src/core/gdk/SDL_gdk.cpp @@ -35,7 +35,7 @@ PAPPCONSTRAIN_REGISTRATION hCPLM = {}; HANDLE plmSuspendComplete = nullptr; extern "C" -SDL_bool SDL_GetGDKTaskQueue(XTaskQueueHandle *outTaskQueue) +bool SDL_GetGDKTaskQueue(XTaskQueueHandle *outTaskQueue) { // If this is the first call, first create the global task queue. if (!GDK_GlobalTaskQueue) { @@ -139,7 +139,7 @@ void SDL_GDKSuspendComplete() } extern "C" -SDL_bool SDL_GetGDKDefaultUser(XUserHandle *outUserHandle) +bool SDL_GetGDKDefaultUser(XUserHandle *outUserHandle) { XAsyncBlock block = { 0 }; HRESULT result; diff --git a/src/core/linux/SDL_evdev.c b/src/core/linux/SDL_evdev.c index c9efa536f..c5b62ae78 100644 --- a/src/core/linux/SDL_evdev.c +++ b/src/core/linux/SDL_evdev.c @@ -164,7 +164,7 @@ static void SDL_EVDEV_UpdateKeyboardMute(void) } } -SDL_bool SDL_EVDEV_Init(void) +bool SDL_EVDEV_Init(void) { if (!_this) { _this = (SDL_EVDEV_PrivateData *)SDL_calloc(1, sizeof(*_this)); diff --git a/src/core/linux/SDL_evdev.h b/src/core/linux/SDL_evdev.h index 3b4e3844a..0eaa60067 100644 --- a/src/core/linux/SDL_evdev.h +++ b/src/core/linux/SDL_evdev.h @@ -28,7 +28,7 @@ struct input_event; -extern SDL_bool SDL_EVDEV_Init(void); +extern bool SDL_EVDEV_Init(void); extern void SDL_EVDEV_Quit(void); extern void SDL_EVDEV_SetVTSwitchCallbacks(void (*release_callback)(void*), void *release_callback_data, void (*acquire_callback)(void*), void *acquire_callback_data); diff --git a/src/core/linux/SDL_threadprio.c b/src/core/linux/SDL_threadprio.c index 0a63b3b08..fb5b27be7 100644 --- a/src/core/linux/SDL_threadprio.c +++ b/src/core/linux/SDL_threadprio.c @@ -249,7 +249,7 @@ static bool rtkit_setpriority_realtime(pid_t thread, int rt_priority) #endif // threads // this is a public symbol, so it has to exist even if threads are disabled. -SDL_bool SDL_SetLinuxThreadPriority(Sint64 threadID, int priority) +bool SDL_SetLinuxThreadPriority(Sint64 threadID, int priority) { #ifdef SDL_THREADS_DISABLED return SDL_Unsupported(); @@ -281,7 +281,7 @@ SDL_bool SDL_SetLinuxThreadPriority(Sint64 threadID, int priority) } // this is a public symbol, so it has to exist even if threads are disabled. -SDL_bool SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy) +bool SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy) { #ifdef SDL_THREADS_DISABLED return SDL_Unsupported(); diff --git a/src/cpuinfo/SDL_cpuinfo.c b/src/cpuinfo/SDL_cpuinfo.c index 63f25ea62..6fdf3c024 100644 --- a/src/cpuinfo/SDL_cpuinfo.c +++ b/src/cpuinfo/SDL_cpuinfo.c @@ -1035,72 +1035,72 @@ void SDL_QuitCPUInfo(void) { #define CPU_FEATURE_AVAILABLE(f) ((SDL_GetCPUFeatures() & (f)) ? true : false) -SDL_bool SDL_HasAltiVec(void) +bool SDL_HasAltiVec(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_ALTIVEC); } -SDL_bool SDL_HasMMX(void) +bool SDL_HasMMX(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_MMX); } -SDL_bool SDL_HasSSE(void) +bool SDL_HasSSE(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE); } -SDL_bool SDL_HasSSE2(void) +bool SDL_HasSSE2(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE2); } -SDL_bool SDL_HasSSE3(void) +bool SDL_HasSSE3(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE3); } -SDL_bool SDL_HasSSE41(void) +bool SDL_HasSSE41(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE41); } -SDL_bool SDL_HasSSE42(void) +bool SDL_HasSSE42(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE42); } -SDL_bool SDL_HasAVX(void) +bool SDL_HasAVX(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_AVX); } -SDL_bool SDL_HasAVX2(void) +bool SDL_HasAVX2(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_AVX2); } -SDL_bool SDL_HasAVX512F(void) +bool SDL_HasAVX512F(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_AVX512F); } -SDL_bool SDL_HasARMSIMD(void) +bool SDL_HasARMSIMD(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_ARM_SIMD); } -SDL_bool SDL_HasNEON(void) +bool SDL_HasNEON(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_NEON); } -SDL_bool SDL_HasLSX(void) +bool SDL_HasLSX(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_LSX); } -SDL_bool SDL_HasLASX(void) +bool SDL_HasLASX(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_LASX); } diff --git a/src/dialog/android/SDL_androiddialog.c b/src/dialog/android/SDL_androiddialog.c index 80de9bfd7..fd9e102ef 100644 --- a/src/dialog/android/SDL_androiddialog.c +++ b/src/dialog/android/SDL_androiddialog.c @@ -22,7 +22,7 @@ #include "SDL_internal.h" #include "../../core/android/SDL_android.h" -void SDLCALL SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const SDL_DialogFileFilter *filters, int nfilters, const char *default_location, SDL_bool allow_many) +void SDLCALL SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const SDL_DialogFileFilter *filters, int nfilters, const char *default_location, bool allow_many) { if (!Android_JNI_OpenFileDialog(callback, userdata, filters, nfilters, false, allow_many)) { // SDL_SetError is already called when it fails @@ -38,7 +38,7 @@ void SDLCALL SDL_ShowSaveFileDialog(SDL_DialogFileCallback callback, void *userd } } -void SDLCALL SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const char *default_location, SDL_bool allow_many) +void SDLCALL SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const char *default_location, bool allow_many) { SDL_Unsupported(); callback(userdata, NULL, -1); diff --git a/src/dialog/cocoa/SDL_cocoadialog.m b/src/dialog/cocoa/SDL_cocoadialog.m index 72f2df6e8..eee685e26 100644 --- a/src/dialog/cocoa/SDL_cocoadialog.m +++ b/src/dialog/cocoa/SDL_cocoadialog.m @@ -178,7 +178,7 @@ void show_file_dialog(cocoa_FileDialogType type, SDL_DialogFileCallback callback #endif // defined(SDL_PLATFORM_TVOS) || defined(SDL_PLATFORM_IOS) } -void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location, SDL_bool allow_many) +void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location, bool allow_many) { show_file_dialog(FDT_OPEN, callback, userdata, window, filters, nfilters, default_location, allow_many); } @@ -188,7 +188,7 @@ void SDL_ShowSaveFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL show_file_dialog(FDT_SAVE, callback, userdata, window, filters, nfilters, default_location, 0); } -void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const char* default_location, SDL_bool allow_many) +void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const char* default_location, bool allow_many) { show_file_dialog(FDT_OPENFOLDER, callback, userdata, window, NULL, 0, default_location, allow_many); } diff --git a/src/dialog/dummy/SDL_dummydialog.c b/src/dialog/dummy/SDL_dummydialog.c index 0f7456b90..209efe766 100644 --- a/src/dialog/dummy/SDL_dummydialog.c +++ b/src/dialog/dummy/SDL_dummydialog.c @@ -20,7 +20,7 @@ */ #include "SDL_internal.h" -void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location, SDL_bool allow_many) +void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location, bool allow_many) { SDL_Unsupported(); callback(userdata, NULL, -1); @@ -32,7 +32,7 @@ void SDL_ShowSaveFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL callback(userdata, NULL, -1); } -void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const char* default_location, SDL_bool allow_many) +void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const char* default_location, bool allow_many) { SDL_Unsupported(); callback(userdata, NULL, -1); diff --git a/src/dialog/haiku/SDL_haikudialog.cc b/src/dialog/haiku/SDL_haikudialog.cc index 2aa485899..9d6e37303 100644 --- a/src/dialog/haiku/SDL_haikudialog.cc +++ b/src/dialog/haiku/SDL_haikudialog.cc @@ -243,7 +243,7 @@ void ShowDialog(bool save, SDL_DialogFileCallback callback, void *userdata, bool panel->Show(); } -void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const SDL_DialogFileFilter *filters, int nfilters, const char *default_location, SDL_bool allow_many) +void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const SDL_DialogFileFilter *filters, int nfilters, const char *default_location, bool allow_many) { ShowDialog(false, callback, userdata, allow_many == true, !!window, filters, nfilters, false, default_location); } @@ -253,7 +253,7 @@ void SDL_ShowSaveFileDialog(SDL_DialogFileCallback callback, void *userdata, SDL ShowDialog(true, callback, userdata, false, !!window, filters, nfilters, false, default_location); } -void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const char* default_location, SDL_bool allow_many) +void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const char* default_location, bool allow_many) { ShowDialog(false, callback, userdata, allow_many == true, !!window, NULL, 0, true, default_location); } diff --git a/src/dialog/unix/SDL_unixdialog.c b/src/dialog/unix/SDL_unixdialog.c index 91603e7d6..5e81b70cd 100644 --- a/src/dialog/unix/SDL_unixdialog.c +++ b/src/dialog/unix/SDL_unixdialog.c @@ -73,7 +73,7 @@ static int detect_available_methods(const char *value) return 0; } -void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location, SDL_bool allow_many) +void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location, bool allow_many) { // Call detect_available_methods() again each time in case the situation changed if (!detected_open && !detect_available_methods(NULL)) { @@ -97,7 +97,7 @@ void SDL_ShowSaveFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL detected_save(callback, userdata, window, filters, nfilters, default_location); } -void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const char* default_location, SDL_bool allow_many) +void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const char* default_location, bool allow_many) { // Call detect_available_methods() again each time in case the situation changed if (!detected_folder && !detect_available_methods(NULL)) { diff --git a/src/dialog/unix/SDL_zenitydialog.c b/src/dialog/unix/SDL_zenitydialog.c index d9277421d..bca4ed1c6 100644 --- a/src/dialog/unix/SDL_zenitydialog.c +++ b/src/dialog/unix/SDL_zenitydialog.c @@ -213,12 +213,12 @@ static void run_zenity(zenityArgs* arg_struct) /* Recent versions of Zenity have different exit codes, but picks up different codes from the environment */ - SDL_SetEnvironmentVariable(env, "ZENITY_OK", "0", SDL_TRUE); - SDL_SetEnvironmentVariable(env, "ZENITY_CANCEL", "1", SDL_TRUE); - SDL_SetEnvironmentVariable(env, "ZENITY_ESC", "1", SDL_TRUE); - SDL_SetEnvironmentVariable(env, "ZENITY_EXTRA", "2", SDL_TRUE); - SDL_SetEnvironmentVariable(env, "ZENITY_ERROR", "2", SDL_TRUE); - SDL_SetEnvironmentVariable(env, "ZENITY_TIMEOUT", "2", SDL_TRUE); + SDL_SetEnvironmentVariable(env, "ZENITY_OK", "0", true); + SDL_SetEnvironmentVariable(env, "ZENITY_CANCEL", "1", true); + SDL_SetEnvironmentVariable(env, "ZENITY_ESC", "1", true); + SDL_SetEnvironmentVariable(env, "ZENITY_EXTRA", "2", true); + SDL_SetEnvironmentVariable(env, "ZENITY_ERROR", "2", true); + SDL_SetEnvironmentVariable(env, "ZENITY_TIMEOUT", "2", true); SDL_PropertiesID props = SDL_CreateProperties(); SDL_SetPointerProperty(props, SDL_PROP_PROCESS_CREATE_ARGS_POINTER, args); diff --git a/src/dialog/windows/SDL_windowsdialog.c b/src/dialog/windows/SDL_windowsdialog.c index 6fb865038..9bb6d9918 100644 --- a/src/dialog/windows/SDL_windowsdialog.c +++ b/src/dialog/windows/SDL_windowsdialog.c @@ -426,7 +426,7 @@ int windows_folder_dialog_thread(void* ptr) return 0; } -void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location, SDL_bool allow_many) +void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location, bool allow_many) { winArgs *args; SDL_Thread *thread; @@ -449,7 +449,7 @@ void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL args->nfilters = nfilters; args->default_file = default_location; args->parent = window; - args->flags = (allow_many != SDL_FALSE) ? OFN_ALLOWMULTISELECT : 0; + args->flags = (allow_many != false) ? OFN_ALLOWMULTISELECT : 0; args->callback = callback; args->userdata = userdata; @@ -501,7 +501,7 @@ void SDL_ShowSaveFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL SDL_DetachThread(thread); } -void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const char* default_location, SDL_bool allow_many) +void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const char* default_location, bool allow_many) { winFArgs *args; SDL_Thread *thread; diff --git a/src/dynapi/SDL_dynapi.c b/src/dynapi/SDL_dynapi.c index ce170ba4a..c0078ad99 100644 --- a/src/dynapi/SDL_dynapi.c +++ b/src/dynapi/SDL_dynapi.c @@ -76,7 +76,7 @@ static void SDL_InitDynamicAPI(void); } #define SDL_DYNAPI_VARARGS(_static, name, initcall) \ - _static SDL_bool SDLCALL SDL_SetError##name(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) \ + _static bool SDLCALL SDL_SetError##name(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) \ { \ char buf[128], *str = buf; \ int result; \ @@ -100,7 +100,7 @@ static void SDL_InitDynamicAPI(void); if (str != buf) { \ jump_table.SDL_free(str); \ } \ - return SDL_FALSE; \ + return false; \ } \ _static int SDLCALL SDL_sscanf##name(const char *buf, SDL_SCANF_FORMAT_STRING const char *fmt, ...) \ { \ @@ -233,7 +233,7 @@ SDL_DYNAPI_VARARGS(, , ) #define ENABLE_SDL_CALL_LOGGING 0 #if ENABLE_SDL_CALL_LOGGING -static SDL_bool SDLCALL SDL_SetError_LOGSDLCALLS(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) +static bool SDLCALL SDL_SetError_LOGSDLCALLS(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { char buf[512]; // !!! FIXME: dynamic allocation va_list ap; @@ -354,7 +354,7 @@ static Sint32 initialize_jumptable(Uint32 apiver, void *table, Uint32 tablesize) #if ENABLE_SDL_CALL_LOGGING { const char *env = SDL_getenv_unsafe_REAL("SDL_DYNAPI_LOG_CALLS"); - const SDL_bool log_calls = (env && SDL_atoi_REAL(env)); + const bool log_calls = (env && SDL_atoi_REAL(env)); if (log_calls) { #define SDL_DYNAPI_PROC(rc, fn, params, args, ret) jump_table.fn = fn##_LOGSDLCALLS; #include "SDL_dynapi_procs.h" @@ -465,13 +465,13 @@ static void SDL_InitDynamicAPILocked(void) { const char *libname = SDL_getenv_unsafe_REAL(SDL_DYNAMIC_API_ENVVAR); SDL_DYNAPI_ENTRYFN entry = NULL; // funcs from here by default. - SDL_bool use_internal = SDL_TRUE; + bool use_internal = true; if (libname) { while (*libname && !entry) { // This is evil, but we're not making any permanent changes... char *ptr = (char *)libname; - while (SDL_TRUE) { + while (true) { char ch = *ptr; if ((ch == ',') || (ch == '\0')) { *ptr = '\0'; @@ -495,7 +495,7 @@ static void SDL_InitDynamicAPILocked(void) dynapi_warn("Couldn't override SDL library. Using a newer SDL build might help. Please fix or remove the " SDL_DYNAMIC_API_ENVVAR " environment variable. Using the default SDL."); // Just fill in the function pointers from this library, later. } else { - use_internal = SDL_FALSE; // We overrode SDL! Don't use the internal version! + use_internal = false; // We overrode SDL! Don't use the internal version! } } @@ -524,14 +524,14 @@ static void SDL_InitDynamicAPI(void) * SDL_CreateThread() would also call this function before building the * new thread). */ - static SDL_bool already_initialized = SDL_FALSE; + static bool already_initialized = false; static SDL_SpinLock lock = 0; SDL_LockSpinlock_REAL(&lock); if (!already_initialized) { SDL_InitDynamicAPILocked(); - already_initialized = SDL_TRUE; + already_initialized = true; } SDL_UnlockSpinlock_REAL(&lock); diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 6649326c6..051f0b9ce 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -40,7 +40,7 @@ SDL_DYNAPI_PROC(void,SDL_LogMessage,(int a, SDL_LogPriority b, SDL_PRINTF_FORMAT SDL_DYNAPI_PROC(void,SDL_LogTrace,(int a, SDL_PRINTF_FORMAT_STRING const char *b, ...),(a,b),) SDL_DYNAPI_PROC(void,SDL_LogVerbose,(int a, SDL_PRINTF_FORMAT_STRING const char *b, ...),(a,b),) SDL_DYNAPI_PROC(void,SDL_LogWarn,(int a, SDL_PRINTF_FORMAT_STRING const char *b, ...),(a,b),) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetError,(SDL_PRINTF_FORMAT_STRING const char *a, ...),(a),return) +SDL_DYNAPI_PROC(bool,SDL_SetError,(SDL_PRINTF_FORMAT_STRING const char *a, ...),(a),return) SDL_DYNAPI_PROC(int,SDL_asprintf,(char **a, SDL_PRINTF_FORMAT_STRING const char *b, ...),(a,b),return) SDL_DYNAPI_PROC(int,SDL_snprintf,(SDL_OUT_Z_CAP(b) char *a, size_t b, SDL_PRINTF_FORMAT_STRING const char *c, ...),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_sscanf,(const char *a, SDL_SCANF_FORMAT_STRING const char *b, ...),(a,b),return) @@ -52,22 +52,22 @@ SDL_DYNAPI_PROC(SDL_Surface*,SDL_AcquireCameraFrame,(SDL_Camera *a, Uint64 *b),( SDL_DYNAPI_PROC(SDL_GPUCommandBuffer*,SDL_AcquireGPUCommandBuffer,(SDL_GPUDevice *a),(a),return) SDL_DYNAPI_PROC(SDL_GPUTexture*,SDL_AcquireGPUSwapchainTexture,(SDL_GPUCommandBuffer *a, SDL_Window *b, Uint32 *c, Uint32 *d),(a,b,c,d),return) SDL_DYNAPI_PROC(int,SDL_AddAtomicInt,(SDL_AtomicInt *a, int b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_AddEventWatch,(SDL_EventFilter a, void *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_AddEventWatch,(SDL_EventFilter a, void *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_AddGamepadMapping,(const char *a),(a),return) SDL_DYNAPI_PROC(int,SDL_AddGamepadMappingsFromFile,(const char *a),(a),return) -SDL_DYNAPI_PROC(int,SDL_AddGamepadMappingsFromIO,(SDL_IOStream *a, SDL_bool b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_AddHintCallback,(const char *a, SDL_HintCallback b, void *c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_AddSurfaceAlternateImage,(SDL_Surface *a, SDL_Surface *b),(a,b),return) +SDL_DYNAPI_PROC(int,SDL_AddGamepadMappingsFromIO,(SDL_IOStream *a, bool b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_AddHintCallback,(const char *a, SDL_HintCallback b, void *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_AddSurfaceAlternateImage,(SDL_Surface *a, SDL_Surface *b),(a,b),return) SDL_DYNAPI_PROC(SDL_TimerID,SDL_AddTimer,(Uint32 a, SDL_TimerCallback b, void *c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_TimerID,SDL_AddTimerNS,(Uint64 a, SDL_NSTimerCallback b, void *c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_AddVulkanRenderSemaphores,(SDL_Renderer *a, Uint32 b, Sint64 c, Sint64 d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_AddVulkanRenderSemaphores,(SDL_Renderer *a, Uint32 b, Sint64 c, Sint64 d),(a,b,c,d),return) SDL_DYNAPI_PROC(SDL_JoystickID,SDL_AttachVirtualJoystick,(const SDL_VirtualJoystickDesc *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_AudioDevicePaused,(SDL_AudioDeviceID a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_AudioDevicePaused,(SDL_AudioDeviceID a),(a),return) SDL_DYNAPI_PROC(SDL_GPUComputePass*,SDL_BeginGPUComputePass,(SDL_GPUCommandBuffer *a, const SDL_GPUStorageTextureWriteOnlyBinding *b, Uint32 c, const SDL_GPUStorageBufferWriteOnlyBinding *d, Uint32 e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(SDL_GPUCopyPass*,SDL_BeginGPUCopyPass,(SDL_GPUCommandBuffer *a),(a),return) SDL_DYNAPI_PROC(SDL_GPURenderPass*,SDL_BeginGPURenderPass,(SDL_GPUCommandBuffer *a, const SDL_GPUColorTargetInfo *b, Uint32 c, const SDL_GPUDepthStencilTargetInfo *d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_BindAudioStream,(SDL_AudioDeviceID a, SDL_AudioStream *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_BindAudioStreams,(SDL_AudioDeviceID a, SDL_AudioStream **b, int c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_BindAudioStream,(SDL_AudioDeviceID a, SDL_AudioStream *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_BindAudioStreams,(SDL_AudioDeviceID a, SDL_AudioStream **b, int c),(a,b,c),return) SDL_DYNAPI_PROC(void,SDL_BindGPUComputePipeline,(SDL_GPUComputePass *a, SDL_GPUComputePipeline *b),(a,b),) SDL_DYNAPI_PROC(void,SDL_BindGPUComputeSamplers,(SDL_GPUComputePass *a, Uint32 b, const SDL_GPUTextureSamplerBinding *c, Uint32 d),(a,b,c,d),) SDL_DYNAPI_PROC(void,SDL_BindGPUComputeStorageBuffers,(SDL_GPUComputePass *a, Uint32 b, SDL_GPUBuffer *const *c, Uint32 d),(a,b,c,d),) @@ -82,55 +82,55 @@ SDL_DYNAPI_PROC(void,SDL_BindGPUVertexSamplers,(SDL_GPURenderPass *a, Uint32 b, SDL_DYNAPI_PROC(void,SDL_BindGPUVertexStorageBuffers,(SDL_GPURenderPass *a, Uint32 b, SDL_GPUBuffer *const *c, Uint32 d),(a,b,c,d),) SDL_DYNAPI_PROC(void,SDL_BindGPUVertexStorageTextures,(SDL_GPURenderPass *a, Uint32 b, SDL_GPUTexture *const *c, Uint32 d),(a,b,c,d),) SDL_DYNAPI_PROC(void,SDL_BlitGPUTexture,(SDL_GPUCommandBuffer *a, const SDL_GPUBlitInfo *b),(a,b),) -SDL_DYNAPI_PROC(SDL_bool,SDL_BlitSurface,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_BlitSurface9Grid,(SDL_Surface *a, const SDL_Rect *b, int c, int d, int e, int f, float g, SDL_ScaleMode h, SDL_Surface *i, const SDL_Rect *j),(a,b,c,d,e,f,g,h,i,j),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_BlitSurfaceScaled,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d, SDL_ScaleMode e),(a,b,c,d,e),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_BlitSurfaceTiled,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_BlitSurfaceTiledWithScale,(SDL_Surface *a, const SDL_Rect *b, float c, SDL_ScaleMode d, SDL_Surface *e, const SDL_Rect *f),(a,b,c,d,e,f),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_BlitSurfaceUnchecked,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_BlitSurfaceUncheckedScaled,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d, SDL_ScaleMode e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(bool,SDL_BlitSurface,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_BlitSurface9Grid,(SDL_Surface *a, const SDL_Rect *b, int c, int d, int e, int f, float g, SDL_ScaleMode h, SDL_Surface *i, const SDL_Rect *j),(a,b,c,d,e,f,g,h,i,j),return) +SDL_DYNAPI_PROC(bool,SDL_BlitSurfaceScaled,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d, SDL_ScaleMode e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(bool,SDL_BlitSurfaceTiled,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_BlitSurfaceTiledWithScale,(SDL_Surface *a, const SDL_Rect *b, float c, SDL_ScaleMode d, SDL_Surface *e, const SDL_Rect *f),(a,b,c,d,e,f),return) +SDL_DYNAPI_PROC(bool,SDL_BlitSurfaceUnchecked,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_BlitSurfaceUncheckedScaled,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d, SDL_ScaleMode e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(void,SDL_BroadcastCondition,(SDL_Condition *a),(a),) -SDL_DYNAPI_PROC(SDL_bool,SDL_CaptureMouse,(SDL_bool a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ClaimWindowForGPUDevice,(SDL_GPUDevice *a, SDL_Window *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_CaptureMouse,(bool a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_ClaimWindowForGPUDevice,(SDL_GPUDevice *a, SDL_Window *b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_CleanupTLS,(void),(),) -SDL_DYNAPI_PROC(SDL_bool,SDL_ClearAudioStream,(SDL_AudioStream *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ClearClipboardData,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ClearComposition,(SDL_Window *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ClearError,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ClearProperty,(SDL_PropertiesID a, const char *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ClearSurface,(SDL_Surface *a, float b, float c, float d, float e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(bool,SDL_ClearAudioStream,(SDL_AudioStream *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_ClearClipboardData,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_ClearComposition,(SDL_Window *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_ClearError,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_ClearProperty,(SDL_PropertiesID a, const char *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_ClearSurface,(SDL_Surface *a, float b, float c, float d, float e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(void,SDL_CloseAudioDevice,(SDL_AudioDeviceID a),(a),) SDL_DYNAPI_PROC(void,SDL_CloseCamera,(SDL_Camera *a),(a),) SDL_DYNAPI_PROC(void,SDL_CloseGamepad,(SDL_Gamepad *a),(a),) SDL_DYNAPI_PROC(void,SDL_CloseHaptic,(SDL_Haptic *a),(a),) -SDL_DYNAPI_PROC(SDL_bool,SDL_CloseIO,(SDL_IOStream *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_CloseIO,(SDL_IOStream *a),(a),return) SDL_DYNAPI_PROC(void,SDL_CloseJoystick,(SDL_Joystick *a),(a),) SDL_DYNAPI_PROC(void,SDL_CloseSensor,(SDL_Sensor *a),(a),) -SDL_DYNAPI_PROC(SDL_bool,SDL_CloseStorage,(SDL_Storage *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_CompareAndSwapAtomicInt,(SDL_AtomicInt *a, int b, int c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_CompareAndSwapAtomicPointer,(void **a, void *b, void *c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_CompareAndSwapAtomicU32,(SDL_AtomicU32 *a, Uint32 b, Uint32 c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_CloseStorage,(SDL_Storage *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_CompareAndSwapAtomicInt,(SDL_AtomicInt *a, int b, int c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_CompareAndSwapAtomicPointer,(void **a, void *b, void *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_CompareAndSwapAtomicU32,(SDL_AtomicU32 *a, Uint32 b, Uint32 c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_BlendMode,SDL_ComposeCustomBlendMode,(SDL_BlendFactor a, SDL_BlendFactor b, SDL_BlendOperation c, SDL_BlendFactor d, SDL_BlendFactor e, SDL_BlendOperation f),(a,b,c,d,e,f),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ConvertAudioSamples,(const SDL_AudioSpec *a, const Uint8 *b, int c, const SDL_AudioSpec *d, Uint8 **e, int *f),(a,b,c,d,e,f),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ConvertEventToRenderCoordinates,(SDL_Renderer *a, SDL_Event *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ConvertPixels,(int a, int b, SDL_PixelFormat c, const void *d, int e, SDL_PixelFormat f, void *g, int h),(a,b,c,d,e,f,g,h),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ConvertPixelsAndColorspace,(int a, int b, SDL_PixelFormat c, SDL_Colorspace d, SDL_PropertiesID e, const void *f, int g, SDL_PixelFormat h, SDL_Colorspace i, SDL_PropertiesID j, void *k, int l),(a,b,c,d,e,f,g,h,i,j,k,l),return) +SDL_DYNAPI_PROC(bool,SDL_ConvertAudioSamples,(const SDL_AudioSpec *a, const Uint8 *b, int c, const SDL_AudioSpec *d, Uint8 **e, int *f),(a,b,c,d,e,f),return) +SDL_DYNAPI_PROC(bool,SDL_ConvertEventToRenderCoordinates,(SDL_Renderer *a, SDL_Event *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_ConvertPixels,(int a, int b, SDL_PixelFormat c, const void *d, int e, SDL_PixelFormat f, void *g, int h),(a,b,c,d,e,f,g,h),return) +SDL_DYNAPI_PROC(bool,SDL_ConvertPixelsAndColorspace,(int a, int b, SDL_PixelFormat c, SDL_Colorspace d, SDL_PropertiesID e, const void *f, int g, SDL_PixelFormat h, SDL_Colorspace i, SDL_PropertiesID j, void *k, int l),(a,b,c,d,e,f,g,h,i,j,k,l),return) SDL_DYNAPI_PROC(SDL_Surface*,SDL_ConvertSurface,(SDL_Surface *a, SDL_PixelFormat b),(a,b),return) SDL_DYNAPI_PROC(SDL_Surface*,SDL_ConvertSurfaceAndColorspace,(SDL_Surface *a, SDL_PixelFormat b, SDL_Palette *c, SDL_Colorspace d, SDL_PropertiesID e),(a,b,c,d,e),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_CopyFile,(const char *a, const char *b),(a,b),return) -SDL_DYNAPI_PROC(void,SDL_CopyGPUBufferToBuffer,(SDL_GPUCopyPass *a, const SDL_GPUBufferLocation *b, const SDL_GPUBufferLocation *c, Uint32 d, SDL_bool e),(a,b,c,d,e),) -SDL_DYNAPI_PROC(void,SDL_CopyGPUTextureToTexture,(SDL_GPUCopyPass *a, const SDL_GPUTextureLocation *b, const SDL_GPUTextureLocation *c, Uint32 d, Uint32 e, Uint32 f, SDL_bool g),(a,b,c,d,e,f,g),) -SDL_DYNAPI_PROC(SDL_bool,SDL_CopyProperties,(SDL_PropertiesID a, SDL_PropertiesID b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_CopyStorageFile,(SDL_Storage *a, const char *b, const char *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_CopyFile,(const char *a, const char *b),(a,b),return) +SDL_DYNAPI_PROC(void,SDL_CopyGPUBufferToBuffer,(SDL_GPUCopyPass *a, const SDL_GPUBufferLocation *b, const SDL_GPUBufferLocation *c, Uint32 d, bool e),(a,b,c,d,e),) +SDL_DYNAPI_PROC(void,SDL_CopyGPUTextureToTexture,(SDL_GPUCopyPass *a, const SDL_GPUTextureLocation *b, const SDL_GPUTextureLocation *c, Uint32 d, Uint32 e, Uint32 f, bool g),(a,b,c,d,e,f,g),) +SDL_DYNAPI_PROC(bool,SDL_CopyProperties,(SDL_PropertiesID a, SDL_PropertiesID b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_CopyStorageFile,(SDL_Storage *a, const char *b, const char *c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_AudioStream*,SDL_CreateAudioStream,(const SDL_AudioSpec *a, const SDL_AudioSpec *b),(a,b),return) SDL_DYNAPI_PROC(SDL_Cursor*,SDL_CreateColorCursor,(SDL_Surface *a, int b, int c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_Condition*,SDL_CreateCondition,(void),(),return) SDL_DYNAPI_PROC(SDL_Cursor*,SDL_CreateCursor,(const Uint8 *a, const Uint8 *b, int c, int d, int e, int f),(a,b,c,d,e,f),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_CreateDirectory,(const char *a),(a),return) -SDL_DYNAPI_PROC(SDL_Environment*,SDL_CreateEnvironment,(SDL_bool a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_CreateDirectory,(const char *a),(a),return) +SDL_DYNAPI_PROC(SDL_Environment*,SDL_CreateEnvironment,(bool a),(a),return) SDL_DYNAPI_PROC(SDL_GPUBuffer*,SDL_CreateGPUBuffer,(SDL_GPUDevice *a, const SDL_GPUBufferCreateInfo* b),(a,b),return) SDL_DYNAPI_PROC(SDL_GPUComputePipeline*,SDL_CreateGPUComputePipeline,(SDL_GPUDevice *a, const SDL_GPUComputePipelineCreateInfo *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_GPUDevice*,SDL_CreateGPUDevice,(SDL_GPUShaderFormat a, SDL_bool b, const char *c),(a,b,c),return) +SDL_DYNAPI_PROC(SDL_GPUDevice*,SDL_CreateGPUDevice,(SDL_GPUShaderFormat a, bool b, const char *c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_GPUDevice*,SDL_CreateGPUDeviceWithProperties,(SDL_PropertiesID a),(a),return) SDL_DYNAPI_PROC(SDL_GPUGraphicsPipeline*,SDL_CreateGPUGraphicsPipeline,(SDL_GPUDevice *a, const SDL_GPUGraphicsPipelineCreateInfo *b),(a,b),return) SDL_DYNAPI_PROC(SDL_GPUSampler*,SDL_CreateGPUSampler,(SDL_GPUDevice *a, const SDL_GPUSamplerCreateInfo *b),(a,b),return) @@ -141,7 +141,7 @@ SDL_DYNAPI_PROC(int,SDL_CreateHapticEffect,(SDL_Haptic *a, const SDL_HapticEffec SDL_DYNAPI_PROC(SDL_Mutex*,SDL_CreateMutex,(void),(),return) SDL_DYNAPI_PROC(SDL_Palette*,SDL_CreatePalette,(int a),(a),return) SDL_DYNAPI_PROC(SDL_Window*,SDL_CreatePopupWindow,(SDL_Window *a, int b, int c, int d, int e, SDL_WindowFlags f),(a,b,c,d,e,f),return) -SDL_DYNAPI_PROC(SDL_Process*,SDL_CreateProcess,(const char * const *a, SDL_bool b),(a,b),return) +SDL_DYNAPI_PROC(SDL_Process*,SDL_CreateProcess,(const char * const *a, bool b),(a,b),return) SDL_DYNAPI_PROC(SDL_Process*,SDL_CreateProcessWithProperties,(SDL_PropertiesID a),(a),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_CreateProperties,(void),(),return) SDL_DYNAPI_PROC(SDL_RWLock*,SDL_CreateRWLock,(void),(),return) @@ -149,7 +149,7 @@ SDL_DYNAPI_PROC(SDL_Renderer*,SDL_CreateRenderer,(SDL_Window *a, const char *b), SDL_DYNAPI_PROC(SDL_Renderer*,SDL_CreateRendererWithProperties,(SDL_PropertiesID a),(a),return) SDL_DYNAPI_PROC(SDL_Semaphore*,SDL_CreateSemaphore,(Uint32 a),(a),return) SDL_DYNAPI_PROC(SDL_Renderer*,SDL_CreateSoftwareRenderer,(SDL_Surface *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_CreateStorageDirectory,(SDL_Storage *a, const char *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_CreateStorageDirectory,(SDL_Storage *a, const char *b),(a,b),return) SDL_DYNAPI_PROC(SDL_Surface*,SDL_CreateSurface,(int a, int b, SDL_PixelFormat c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_Surface*,SDL_CreateSurfaceFrom,(int a, int b, SDL_PixelFormat c, void *d, int e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(SDL_Palette*,SDL_CreateSurfacePalette,(SDL_Surface *a),(a),return) @@ -160,10 +160,10 @@ SDL_DYNAPI_PROC(SDL_Texture*,SDL_CreateTextureWithProperties,(SDL_Renderer *a, S SDL_DYNAPI_PROC(SDL_Thread*,SDL_CreateThreadRuntime,(SDL_ThreadFunction a, const char *b, void *c, SDL_FunctionPointer d, SDL_FunctionPointer e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(SDL_Thread*,SDL_CreateThreadWithPropertiesRuntime,(SDL_PropertiesID a, SDL_FunctionPointer b, SDL_FunctionPointer c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_Window*,SDL_CreateWindow,(const char *a, int b, int c, SDL_WindowFlags d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_CreateWindowAndRenderer,(const char *a, int b, int c, SDL_WindowFlags d, SDL_Window **e, SDL_Renderer **f),(a,b,c,d,e,f),return) +SDL_DYNAPI_PROC(bool,SDL_CreateWindowAndRenderer,(const char *a, int b, int c, SDL_WindowFlags d, SDL_Window **e, SDL_Renderer **f),(a,b,c,d,e,f),return) SDL_DYNAPI_PROC(SDL_Window*,SDL_CreateWindowWithProperties,(SDL_PropertiesID a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_CursorVisible,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_DateTimeToTime,(const SDL_DateTime *a, SDL_Time *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_CursorVisible,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_DateTimeToTime,(const SDL_DateTime *a, SDL_Time *b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_Delay,(Uint32 a),(a),) SDL_DYNAPI_PROC(void,SDL_DelayNS,(Uint64 a),(a),) SDL_DYNAPI_PROC(void,SDL_DestroyAudioStream,(SDL_AudioStream *a),(a),) @@ -182,10 +182,10 @@ SDL_DYNAPI_PROC(void,SDL_DestroySemaphore,(SDL_Semaphore *a),(a),) SDL_DYNAPI_PROC(void,SDL_DestroySurface,(SDL_Surface *a),(a),) SDL_DYNAPI_PROC(void,SDL_DestroyTexture,(SDL_Texture *a),(a),) SDL_DYNAPI_PROC(void,SDL_DestroyWindow,(SDL_Window *a),(a),) -SDL_DYNAPI_PROC(SDL_bool,SDL_DestroyWindowSurface,(SDL_Window *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_DestroyWindowSurface,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(void,SDL_DetachThread,(SDL_Thread *a),(a),) -SDL_DYNAPI_PROC(SDL_bool,SDL_DetachVirtualJoystick,(SDL_JoystickID a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_DisableScreenSaver,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_DetachVirtualJoystick,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_DisableScreenSaver,(void),(),return) SDL_DYNAPI_PROC(void,SDL_DispatchGPUCompute,(SDL_GPUComputePass *a, Uint32 b, Uint32 c, Uint32 d),(a,b,c,d),) SDL_DYNAPI_PROC(void,SDL_DispatchGPUComputeIndirect,(SDL_GPUComputePass *a, SDL_GPUBuffer *b, Uint32 c),(a,b,c),) SDL_DYNAPI_PROC(void,SDL_DownloadFromGPUBuffer,(SDL_GPUCopyPass *a, const SDL_GPUBufferRegion *b, const SDL_GPUTransferBufferLocation *c),(a,b,c),) @@ -200,55 +200,55 @@ SDL_DYNAPI_PROC(SDL_EGLDisplay,SDL_EGL_GetCurrentDisplay,(void),(),return) SDL_DYNAPI_PROC(SDL_FunctionPointer,SDL_EGL_GetProcAddress,(const char *a),(a),return) SDL_DYNAPI_PROC(SDL_EGLSurface,SDL_EGL_GetWindowSurface,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(void,SDL_EGL_SetAttributeCallbacks,(SDL_EGLAttribArrayCallback a, SDL_EGLIntArrayCallback b, SDL_EGLIntArrayCallback c),(a,b,c),) -SDL_DYNAPI_PROC(SDL_bool,SDL_EnableScreenSaver,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_EnableScreenSaver,(void),(),return) SDL_DYNAPI_PROC(void,SDL_EndGPUComputePass,(SDL_GPUComputePass *a),(a),) SDL_DYNAPI_PROC(void,SDL_EndGPUCopyPass,(SDL_GPUCopyPass *a),(a),) SDL_DYNAPI_PROC(void,SDL_EndGPURenderPass,(SDL_GPURenderPass *a),(a),) SDL_DYNAPI_PROC(int,SDL_EnterAppMainCallbacks,(int a, char *b[], SDL_AppInit_func c, SDL_AppIterate_func d, SDL_AppEvent_func e, SDL_AppQuit_func f),(a,b,c,d,e,f),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_EnumerateDirectory,(const char *a, SDL_EnumerateDirectoryCallback b, void *c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_EnumerateProperties,(SDL_PropertiesID a, SDL_EnumeratePropertiesCallback b, void *c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_EnumerateStorageDirectory,(SDL_Storage *a, const char *b, SDL_EnumerateDirectoryCallback c, void *d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_EventEnabled,(Uint32 a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_FillSurfaceRect,(SDL_Surface *a, const SDL_Rect *b, Uint32 c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_FillSurfaceRects,(SDL_Surface *a, const SDL_Rect *b, int c, Uint32 d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_EnumerateDirectory,(const char *a, SDL_EnumerateDirectoryCallback b, void *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_EnumerateProperties,(SDL_PropertiesID a, SDL_EnumeratePropertiesCallback b, void *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_EnumerateStorageDirectory,(SDL_Storage *a, const char *b, SDL_EnumerateDirectoryCallback c, void *d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_EventEnabled,(Uint32 a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_FillSurfaceRect,(SDL_Surface *a, const SDL_Rect *b, Uint32 c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_FillSurfaceRects,(SDL_Surface *a, const SDL_Rect *b, int c, Uint32 d),(a,b,c,d),return) SDL_DYNAPI_PROC(void,SDL_FilterEvents,(SDL_EventFilter a, void *b),(a,b),) -SDL_DYNAPI_PROC(SDL_bool,SDL_FlashWindow,(SDL_Window *a, SDL_FlashOperation b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_FlipSurface,(SDL_Surface *a, SDL_FlipMode b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_FlushAudioStream,(SDL_AudioStream *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_FlashWindow,(SDL_Window *a, SDL_FlashOperation b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_FlipSurface,(SDL_Surface *a, SDL_FlipMode b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_FlushAudioStream,(SDL_AudioStream *a),(a),return) SDL_DYNAPI_PROC(void,SDL_FlushEvent,(Uint32 a),(a),) SDL_DYNAPI_PROC(void,SDL_FlushEvents,(Uint32 a, Uint32 b),(a,b),) -SDL_DYNAPI_PROC(SDL_bool,SDL_FlushIO,(SDL_IOStream *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_FlushRenderer,(SDL_Renderer *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_FlushIO,(SDL_IOStream *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_FlushRenderer,(SDL_Renderer *a),(a),return) SDL_DYNAPI_PROC(void,SDL_GDKResumeGPU,(SDL_GPUDevice *a),(a),) SDL_DYNAPI_PROC(void,SDL_GDKSuspendComplete,(void),(),) SDL_DYNAPI_PROC(void,SDL_GDKSuspendGPU,(SDL_GPUDevice *a),(a),) SDL_DYNAPI_PROC(SDL_GLContext,SDL_GL_CreateContext,(SDL_Window *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GL_DestroyContext,(SDL_GLContext a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GL_ExtensionSupported,(const char *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GL_GetAttribute,(SDL_GLattr a, int *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GL_DestroyContext,(SDL_GLContext a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_GL_ExtensionSupported,(const char *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_GL_GetAttribute,(SDL_GLattr a, int *b),(a,b),return) SDL_DYNAPI_PROC(SDL_GLContext,SDL_GL_GetCurrentContext,(void),(),return) SDL_DYNAPI_PROC(SDL_Window*,SDL_GL_GetCurrentWindow,(void),(),return) SDL_DYNAPI_PROC(SDL_FunctionPointer,SDL_GL_GetProcAddress,(const char *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GL_GetSwapInterval,(int *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GL_LoadLibrary,(const char *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GL_MakeCurrent,(SDL_Window *a, SDL_GLContext b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GL_GetSwapInterval,(int *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_GL_LoadLibrary,(const char *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_GL_MakeCurrent,(SDL_Window *a, SDL_GLContext b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_GL_ResetAttributes,(void),(),) -SDL_DYNAPI_PROC(SDL_bool,SDL_GL_SetAttribute,(SDL_GLattr a, int b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GL_SetSwapInterval,(int a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GL_SwapWindow,(SDL_Window *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_GL_SetAttribute,(SDL_GLattr a, int b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GL_SetSwapInterval,(int a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_GL_SwapWindow,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(void,SDL_GL_UnloadLibrary,(void),(),) -SDL_DYNAPI_PROC(SDL_bool,SDL_GPUSupportsProperties,(SDL_PropertiesID a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GPUSupportsShaderFormats,(SDL_GPUShaderFormat a, const char *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GPUSupportsProperties,(SDL_PropertiesID a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_GPUSupportsShaderFormats,(SDL_GPUShaderFormat a, const char *b),(a,b),return) SDL_DYNAPI_PROC(Uint32,SDL_GPUTextureFormatTexelBlockSize,(SDL_GPUTextureFormat a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GPUTextureSupportsFormat,(SDL_GPUDevice *a, SDL_GPUTextureFormat b, SDL_GPUTextureType c, SDL_GPUTextureUsageFlags d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GPUTextureSupportsSampleCount,(SDL_GPUDevice *a, SDL_GPUTextureFormat b, SDL_GPUSampleCount c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_GPUTextureSupportsFormat,(SDL_GPUDevice *a, SDL_GPUTextureFormat b, SDL_GPUTextureType c, SDL_GPUTextureUsageFlags d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_GPUTextureSupportsSampleCount,(SDL_GPUDevice *a, SDL_GPUTextureFormat b, SDL_GPUSampleCount c),(a,b,c),return) SDL_DYNAPI_PROC(void,SDL_GUIDToString,(SDL_GUID a, char *b, int c),(a,b,c),) -SDL_DYNAPI_PROC(SDL_bool,SDL_GamepadConnected,(SDL_Gamepad *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GamepadEventsEnabled,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GamepadHasAxis,(SDL_Gamepad *a, SDL_GamepadAxis b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GamepadHasButton,(SDL_Gamepad *a, SDL_GamepadButton b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GamepadHasSensor,(SDL_Gamepad *a, SDL_SensorType b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GamepadSensorEnabled,(SDL_Gamepad *a, SDL_SensorType b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GamepadConnected,(SDL_Gamepad *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_GamepadEventsEnabled,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_GamepadHasAxis,(SDL_Gamepad *a, SDL_GamepadAxis b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GamepadHasButton,(SDL_Gamepad *a, SDL_GamepadButton b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GamepadHasSensor,(SDL_Gamepad *a, SDL_SensorType b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GamepadSensorEnabled,(SDL_Gamepad *a, SDL_SensorType b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_GenerateMipmapsForGPUTexture,(SDL_GPUCommandBuffer *a, SDL_GPUTexture *b),(a,b),) SDL_DYNAPI_PROC(void*,SDL_GetAndroidActivity,(void),(),return) SDL_DYNAPI_PROC(const char*,SDL_GetAndroidCachePath,(void),(),return) @@ -264,7 +264,7 @@ SDL_DYNAPI_PROC(int,SDL_GetAtomicInt,(SDL_AtomicInt *a),(a),return) SDL_DYNAPI_PROC(void*,SDL_GetAtomicPointer,(void **a),(a),return) SDL_DYNAPI_PROC(Uint32,SDL_GetAtomicU32,(SDL_AtomicU32 *a),(a),return) SDL_DYNAPI_PROC(int*,SDL_GetAudioDeviceChannelMap,(SDL_AudioDeviceID a, int *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetAudioDeviceFormat,(SDL_AudioDeviceID a, SDL_AudioSpec *b, int *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_GetAudioDeviceFormat,(SDL_AudioDeviceID a, SDL_AudioSpec *b, int *c),(a,b,c),return) SDL_DYNAPI_PROC(float,SDL_GetAudioDeviceGain,(SDL_AudioDeviceID a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetAudioDeviceName,(SDL_AudioDeviceID a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetAudioDriver,(int a),(a),return) @@ -274,7 +274,7 @@ SDL_DYNAPI_PROC(SDL_AudioDeviceID*,SDL_GetAudioRecordingDevices,(int *a),(a),ret SDL_DYNAPI_PROC(int,SDL_GetAudioStreamAvailable,(SDL_AudioStream *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetAudioStreamData,(SDL_AudioStream *a, void *b, int c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_AudioDeviceID,SDL_GetAudioStreamDevice,(SDL_AudioStream *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetAudioStreamFormat,(SDL_AudioStream *a, SDL_AudioSpec *b, SDL_AudioSpec *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_GetAudioStreamFormat,(SDL_AudioStream *a, SDL_AudioSpec *b, SDL_AudioSpec *c),(a,b,c),return) SDL_DYNAPI_PROC(float,SDL_GetAudioStreamFrequencyRatio,(SDL_AudioStream *a),(a),return) SDL_DYNAPI_PROC(float,SDL_GetAudioStreamGain,(SDL_AudioStream *a),(a),return) SDL_DYNAPI_PROC(int*,SDL_GetAudioStreamInputChannelMap,(SDL_AudioStream *a, int *b),(a,b),return) @@ -282,10 +282,10 @@ SDL_DYNAPI_PROC(int*,SDL_GetAudioStreamOutputChannelMap,(SDL_AudioStream *a, int SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetAudioStreamProperties,(SDL_AudioStream *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetAudioStreamQueued,(SDL_AudioStream *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetBasePath,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetBooleanProperty,(SDL_PropertiesID a, const char *b, SDL_bool c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_GetBooleanProperty,(SDL_PropertiesID a, const char *b, bool c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_GetCPUCacheLineSize,(void),(),return) SDL_DYNAPI_PROC(const char*,SDL_GetCameraDriver,(int a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetCameraFormat,(SDL_Camera *a, SDL_CameraSpec *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GetCameraFormat,(SDL_Camera *a, SDL_CameraSpec *b),(a,b),return) SDL_DYNAPI_PROC(SDL_CameraID,SDL_GetCameraID,(SDL_Camera *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetCameraName,(SDL_CameraID a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetCameraPermissionState,(SDL_Camera *a),(a),return) @@ -295,18 +295,18 @@ SDL_DYNAPI_PROC(SDL_CameraSpec**,SDL_GetCameraSupportedFormats,(SDL_CameraID a, SDL_DYNAPI_PROC(SDL_CameraID*,SDL_GetCameras,(int *a),(a),return) SDL_DYNAPI_PROC(void*,SDL_GetClipboardData,(const char *a, size_t *b),(a,b),return) SDL_DYNAPI_PROC(char*,SDL_GetClipboardText,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetClosestFullscreenDisplayMode,(SDL_DisplayID a, int b, int c, float d, SDL_bool e, SDL_DisplayMode *f),(a,b,c,d,e,f),return) +SDL_DYNAPI_PROC(bool,SDL_GetClosestFullscreenDisplayMode,(SDL_DisplayID a, int b, int c, float d, bool e, SDL_DisplayMode *f),(a,b,c,d,e,f),return) SDL_DYNAPI_PROC(const char*,SDL_GetCurrentAudioDriver,(void),(),return) SDL_DYNAPI_PROC(const char*,SDL_GetCurrentCameraDriver,(void),(),return) SDL_DYNAPI_PROC(const SDL_DisplayMode*,SDL_GetCurrentDisplayMode,(SDL_DisplayID a),(a),return) SDL_DYNAPI_PROC(SDL_DisplayOrientation,SDL_GetCurrentDisplayOrientation,(SDL_DisplayID a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetCurrentRenderOutputSize,(SDL_Renderer *a, int *b, int *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_GetCurrentRenderOutputSize,(SDL_Renderer *a, int *b, int *c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_ThreadID,SDL_GetCurrentThreadID,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetCurrentTime,(SDL_Time *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_GetCurrentTime,(SDL_Time *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetCurrentVideoDriver,(void),(),return) SDL_DYNAPI_PROC(SDL_Cursor*,SDL_GetCursor,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetDXGIOutputInfo,(SDL_DisplayID a, int *b, int *c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetDateTimeLocalePreferences,(SDL_DateFormat *a, SDL_TimeFormat *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GetDXGIOutputInfo,(SDL_DisplayID a, int *b, int *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_GetDateTimeLocalePreferences,(SDL_DateFormat *a, SDL_TimeFormat *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_GetDayOfWeek,(int a, int b, int c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_GetDayOfYear,(int a, int b, int c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_GetDaysInMonth,(int a, int b),(a,b),return) @@ -314,24 +314,24 @@ SDL_DYNAPI_PROC(SDL_AssertionHandler,SDL_GetDefaultAssertionHandler,(void),(),re SDL_DYNAPI_PROC(SDL_Cursor*,SDL_GetDefaultCursor,(void),(),return) SDL_DYNAPI_PROC(const SDL_DisplayMode*,SDL_GetDesktopDisplayMode,(SDL_DisplayID a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetDirect3D9AdapterIndex,(SDL_DisplayID a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetDisplayBounds,(SDL_DisplayID a, SDL_Rect *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GetDisplayBounds,(SDL_DisplayID a, SDL_Rect *b),(a,b),return) SDL_DYNAPI_PROC(float,SDL_GetDisplayContentScale,(SDL_DisplayID a),(a),return) SDL_DYNAPI_PROC(SDL_DisplayID,SDL_GetDisplayForPoint,(const SDL_Point *a),(a),return) SDL_DYNAPI_PROC(SDL_DisplayID,SDL_GetDisplayForRect,(const SDL_Rect *a),(a),return) SDL_DYNAPI_PROC(SDL_DisplayID,SDL_GetDisplayForWindow,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetDisplayName,(SDL_DisplayID a),(a),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetDisplayProperties,(SDL_DisplayID a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetDisplayUsableBounds,(SDL_DisplayID a, SDL_Rect *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GetDisplayUsableBounds,(SDL_DisplayID a, SDL_Rect *b),(a,b),return) SDL_DYNAPI_PROC(SDL_DisplayID*,SDL_GetDisplays,(int *a),(a),return) SDL_DYNAPI_PROC(SDL_Environment*,SDL_GetEnvironment,(void),(),return) SDL_DYNAPI_PROC(const char*,SDL_GetEnvironmentVariable,(SDL_Environment *a, const char *b),(a,b),return) SDL_DYNAPI_PROC(char**,SDL_GetEnvironmentVariables,(SDL_Environment *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetError,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetEventFilter,(SDL_EventFilter *a, void **b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GetEventFilter,(SDL_EventFilter *a, void **b),(a,b),return) SDL_DYNAPI_PROC(float,SDL_GetFloatProperty,(SDL_PropertiesID a, const char *b, float c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_DisplayMode**,SDL_GetFullscreenDisplayModes,(SDL_DisplayID a, int *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetGDKDefaultUser,(XUserHandle *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetGDKTaskQueue,(XTaskQueueHandle *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_GetGDKDefaultUser,(XUserHandle *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_GetGDKTaskQueue,(XTaskQueueHandle *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetGPUDeviceDriver,(SDL_GPUDevice *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetGPUDriver,(int a),(a),return) SDL_DYNAPI_PROC(SDL_GPUShaderFormat,SDL_GetGPUShaderFormats,(SDL_GPUDevice *a),(a),return) @@ -341,7 +341,7 @@ SDL_DYNAPI_PROC(const char*,SDL_GetGamepadAppleSFSymbolsNameForButton,(SDL_Gamep SDL_DYNAPI_PROC(Sint16,SDL_GetGamepadAxis,(SDL_Gamepad *a, SDL_GamepadAxis b),(a,b),return) SDL_DYNAPI_PROC(SDL_GamepadAxis,SDL_GetGamepadAxisFromString,(const char *a),(a),return) SDL_DYNAPI_PROC(SDL_GamepadBinding**,SDL_GetGamepadBindings,(SDL_Gamepad *a, int *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetGamepadButton,(SDL_Gamepad *a, SDL_GamepadButton b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GetGamepadButton,(SDL_Gamepad *a, SDL_GamepadButton b),(a,b),return) SDL_DYNAPI_PROC(SDL_GamepadButton,SDL_GetGamepadButtonFromString,(const char *a),(a),return) SDL_DYNAPI_PROC(SDL_GamepadButtonLabel,SDL_GetGamepadButtonLabel,(SDL_Gamepad *a, SDL_GamepadButton b),(a,b),return) SDL_DYNAPI_PROC(SDL_GamepadButtonLabel,SDL_GetGamepadButtonLabelForType,(SDL_GamepadType a, SDL_GamepadButton b),(a,b),return) @@ -368,14 +368,14 @@ SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadProductForID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadProductVersion,(SDL_Gamepad *a),(a),return) SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadProductVersionForID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetGamepadProperties,(SDL_Gamepad *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetGamepadSensorData,(SDL_Gamepad *a, SDL_SensorType b, float *c, int d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_GetGamepadSensorData,(SDL_Gamepad *a, SDL_SensorType b, float *c, int d),(a,b,c,d),return) SDL_DYNAPI_PROC(float,SDL_GetGamepadSensorDataRate,(SDL_Gamepad *a, SDL_SensorType b),(a,b),return) SDL_DYNAPI_PROC(const char*,SDL_GetGamepadSerial,(SDL_Gamepad *a),(a),return) SDL_DYNAPI_PROC(Uint64,SDL_GetGamepadSteamHandle,(SDL_Gamepad *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetGamepadStringForAxis,(SDL_GamepadAxis a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetGamepadStringForButton,(SDL_GamepadButton a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetGamepadStringForType,(SDL_GamepadType a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetGamepadTouchpadFinger,(SDL_Gamepad *a, int b, int c, SDL_bool *d, float *e, float *f, float *g),(a,b,c,d,e,f,g),return) +SDL_DYNAPI_PROC(bool,SDL_GetGamepadTouchpadFinger,(SDL_Gamepad *a, int b, int c, bool *d, float *e, float *f, float *g),(a,b,c,d,e,f,g),return) SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetGamepadType,(SDL_Gamepad *a),(a),return) SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetGamepadTypeForID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetGamepadTypeFromString,(const char *a),(a),return) @@ -385,7 +385,7 @@ SDL_DYNAPI_PROC(SDL_JoystickID*,SDL_GetGamepads,(int *a),(a),return) SDL_DYNAPI_PROC(SDL_MouseButtonFlags,SDL_GetGlobalMouseState,(float *a, float *b),(a,b),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetGlobalProperties,(void),(),return) SDL_DYNAPI_PROC(SDL_Window*,SDL_GetGrabbedWindow,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetHapticEffectStatus,(SDL_Haptic *a, int b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GetHapticEffectStatus,(SDL_Haptic *a, int b),(a,b),return) SDL_DYNAPI_PROC(Uint32,SDL_GetHapticFeatures,(SDL_Haptic *a),(a),return) SDL_DYNAPI_PROC(SDL_Haptic*,SDL_GetHapticFromID,(SDL_HapticID a),(a),return) SDL_DYNAPI_PROC(SDL_HapticID,SDL_GetHapticID,(SDL_Haptic *a),(a),return) @@ -393,14 +393,14 @@ SDL_DYNAPI_PROC(const char*,SDL_GetHapticName,(SDL_Haptic *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetHapticNameForID,(SDL_HapticID a),(a),return) SDL_DYNAPI_PROC(SDL_HapticID*,SDL_GetHaptics,(int *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetHint,(const char *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetHintBoolean,(const char *a, SDL_bool b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GetHintBoolean,(const char *a, bool b),(a,b),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetIOProperties,(SDL_IOStream *a),(a),return) SDL_DYNAPI_PROC(Sint64,SDL_GetIOSize,(SDL_IOStream *a),(a),return) SDL_DYNAPI_PROC(SDL_IOStatus,SDL_GetIOStatus,(SDL_IOStream *a),(a),return) SDL_DYNAPI_PROC(Sint16,SDL_GetJoystickAxis,(SDL_Joystick *a, int b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetJoystickAxisInitialState,(SDL_Joystick *a, int b, Sint16 *c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetJoystickBall,(SDL_Joystick *a, int b, int *c, int *d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetJoystickButton,(SDL_Joystick *a, int b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GetJoystickAxisInitialState,(SDL_Joystick *a, int b, Sint16 *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_GetJoystickBall,(SDL_Joystick *a, int b, int *c, int *d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_GetJoystickButton,(SDL_Joystick *a, int b),(a,b),return) SDL_DYNAPI_PROC(SDL_JoystickConnectionState,SDL_GetJoystickConnectionState,(SDL_Joystick *a),(a),return) SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickFirmwareVersion,(SDL_Joystick *a),(a),return) SDL_DYNAPI_PROC(SDL_Joystick*,SDL_GetJoystickFromID,(SDL_JoystickID a),(a),return) @@ -429,15 +429,15 @@ SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickVendor,(SDL_Joystick *a),(a),return) SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickVendorForID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_JoystickID*,SDL_GetJoysticks,(int *a),(a),return) SDL_DYNAPI_PROC(SDL_Keycode,SDL_GetKeyFromName,(const char *a),(a),return) -SDL_DYNAPI_PROC(SDL_Keycode,SDL_GetKeyFromScancode,(SDL_Scancode a, SDL_Keymod b, SDL_bool c),(a,b,c),return) +SDL_DYNAPI_PROC(SDL_Keycode,SDL_GetKeyFromScancode,(SDL_Scancode a, SDL_Keymod b, bool c),(a,b,c),return) SDL_DYNAPI_PROC(const char*,SDL_GetKeyName,(SDL_Keycode a),(a),return) SDL_DYNAPI_PROC(SDL_Window*,SDL_GetKeyboardFocus,(void),(),return) SDL_DYNAPI_PROC(const char*,SDL_GetKeyboardNameForID,(SDL_KeyboardID a),(a),return) -SDL_DYNAPI_PROC(const SDL_bool*,SDL_GetKeyboardState,(int *a),(a),return) +SDL_DYNAPI_PROC(const bool*,SDL_GetKeyboardState,(int *a),(a),return) SDL_DYNAPI_PROC(SDL_KeyboardID*,SDL_GetKeyboards,(int *a),(a),return) SDL_DYNAPI_PROC(void,SDL_GetLogOutputFunction,(SDL_LogOutputFunction *a, void **b),(a,b),) SDL_DYNAPI_PROC(SDL_LogPriority,SDL_GetLogPriority,(int a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetMasksForPixelFormat,(SDL_PixelFormat a, int *b, Uint32 *c, Uint32 *d, Uint32 *e, Uint32 *f),(a,b,c,d,e,f),return) +SDL_DYNAPI_PROC(bool,SDL_GetMasksForPixelFormat,(SDL_PixelFormat a, int *b, Uint32 *c, Uint32 *d, Uint32 *e, Uint32 *f),(a,b,c,d,e,f),return) SDL_DYNAPI_PROC(int,SDL_GetMaxHapticEffects,(SDL_Haptic *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetMaxHapticEffectsPlaying,(SDL_Haptic *a),(a),return) SDL_DYNAPI_PROC(void,SDL_GetMemoryFunctions,(SDL_malloc_func *a, SDL_calloc_func *b, SDL_realloc_func *c, SDL_free_func *d),(a,b,c,d),) @@ -463,7 +463,7 @@ SDL_DYNAPI_PROC(int,SDL_GetNumRenderDrivers,(void),(),return) SDL_DYNAPI_PROC(int,SDL_GetNumVideoDrivers,(void),(),return) SDL_DYNAPI_PROC(Sint64,SDL_GetNumberProperty,(SDL_PropertiesID a, const char *b, Sint64 c),(a,b,c),return) SDL_DYNAPI_PROC(void,SDL_GetOriginalMemoryFunctions,(SDL_malloc_func *a, SDL_calloc_func *b, SDL_realloc_func *c, SDL_free_func *d),(a,b,c,d),) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetPathInfo,(const char *a, SDL_PathInfo *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GetPathInfo,(const char *a, SDL_PathInfo *b),(a,b),return) SDL_DYNAPI_PROC(Uint64,SDL_GetPerformanceCounter,(void),(),return) SDL_DYNAPI_PROC(Uint64,SDL_GetPerformanceFrequency,(void),(),return) SDL_DYNAPI_PROC(const SDL_PixelFormatDetails*,SDL_GetPixelFormatDetails,(SDL_PixelFormat a),(a),return) @@ -484,31 +484,31 @@ SDL_DYNAPI_PROC(void,SDL_GetRGB,(Uint32 a, const SDL_PixelFormatDetails *b, cons SDL_DYNAPI_PROC(void,SDL_GetRGBA,(Uint32 a, const SDL_PixelFormatDetails *b, const SDL_Palette *c, Uint8 *d, Uint8 *e, Uint8 *f, Uint8 *g),(a,b,c,d,e,f,g),) SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetRealGamepadType,(SDL_Gamepad *a),(a),return) SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetRealGamepadTypeForID,(SDL_JoystickID a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetRectAndLineIntersection,(const SDL_Rect *a, int *b, int *c, int *d, int *e),(a,b,c,d,e),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetRectAndLineIntersectionFloat,(const SDL_FRect *a, float *b, float *c, float *d, float *e),(a,b,c,d,e),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetRectEnclosingPoints,(const SDL_Point *a, int b, const SDL_Rect *c, SDL_Rect *d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetRectEnclosingPointsFloat,(const SDL_FPoint *a, int b, const SDL_FRect *c, SDL_FRect *d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetRectIntersection,(const SDL_Rect *a, const SDL_Rect *b, SDL_Rect *c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetRectIntersectionFloat,(const SDL_FRect *a, const SDL_FRect *b, SDL_FRect *c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetRectUnion,(const SDL_Rect *a, const SDL_Rect *b, SDL_Rect *c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetRectUnionFloat,(const SDL_FRect *a, const SDL_FRect *b, SDL_FRect *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_GetRectAndLineIntersection,(const SDL_Rect *a, int *b, int *c, int *d, int *e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(bool,SDL_GetRectAndLineIntersectionFloat,(const SDL_FRect *a, float *b, float *c, float *d, float *e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(bool,SDL_GetRectEnclosingPoints,(const SDL_Point *a, int b, const SDL_Rect *c, SDL_Rect *d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_GetRectEnclosingPointsFloat,(const SDL_FPoint *a, int b, const SDL_FRect *c, SDL_FRect *d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_GetRectIntersection,(const SDL_Rect *a, const SDL_Rect *b, SDL_Rect *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_GetRectIntersectionFloat,(const SDL_FRect *a, const SDL_FRect *b, SDL_FRect *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_GetRectUnion,(const SDL_Rect *a, const SDL_Rect *b, SDL_Rect *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_GetRectUnionFloat,(const SDL_FRect *a, const SDL_FRect *b, SDL_FRect *c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_MouseButtonFlags,SDL_GetRelativeMouseState,(float *a, float *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetRenderClipRect,(SDL_Renderer *a, SDL_Rect *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetRenderColorScale,(SDL_Renderer *a, float *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetRenderDrawBlendMode,(SDL_Renderer *a, SDL_BlendMode *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetRenderDrawColor,(SDL_Renderer *a, Uint8 *b, Uint8 *c, Uint8 *d, Uint8 *e),(a,b,c,d,e),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetRenderDrawColorFloat,(SDL_Renderer *a, float *b, float *c, float *d, float *e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(bool,SDL_GetRenderClipRect,(SDL_Renderer *a, SDL_Rect *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GetRenderColorScale,(SDL_Renderer *a, float *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GetRenderDrawBlendMode,(SDL_Renderer *a, SDL_BlendMode *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GetRenderDrawColor,(SDL_Renderer *a, Uint8 *b, Uint8 *c, Uint8 *d, Uint8 *e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(bool,SDL_GetRenderDrawColorFloat,(SDL_Renderer *a, float *b, float *c, float *d, float *e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(const char*,SDL_GetRenderDriver,(int a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetRenderLogicalPresentation,(SDL_Renderer *a, int *b, int *c, SDL_RendererLogicalPresentation *d, SDL_ScaleMode *e),(a,b,c,d,e),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetRenderLogicalPresentationRect,(SDL_Renderer *a, SDL_FRect *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GetRenderLogicalPresentation,(SDL_Renderer *a, int *b, int *c, SDL_RendererLogicalPresentation *d, SDL_ScaleMode *e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(bool,SDL_GetRenderLogicalPresentationRect,(SDL_Renderer *a, SDL_FRect *b),(a,b),return) SDL_DYNAPI_PROC(void*,SDL_GetRenderMetalCommandEncoder,(SDL_Renderer *a),(a),return) SDL_DYNAPI_PROC(void*,SDL_GetRenderMetalLayer,(SDL_Renderer *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetRenderOutputSize,(SDL_Renderer *a, int *b, int *c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetRenderSafeArea,(SDL_Renderer *a, SDL_Rect *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetRenderScale,(SDL_Renderer *a, float *b, float *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_GetRenderOutputSize,(SDL_Renderer *a, int *b, int *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_GetRenderSafeArea,(SDL_Renderer *a, SDL_Rect *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GetRenderScale,(SDL_Renderer *a, float *b, float *c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_Texture*,SDL_GetRenderTarget,(SDL_Renderer *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetRenderVSync,(SDL_Renderer *a, int *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetRenderViewport,(SDL_Renderer *a, SDL_Rect *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GetRenderVSync,(SDL_Renderer *a, int *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GetRenderViewport,(SDL_Renderer *a, SDL_Rect *b),(a,b),return) SDL_DYNAPI_PROC(SDL_Window*,SDL_GetRenderWindow,(SDL_Renderer *a),(a),return) SDL_DYNAPI_PROC(SDL_Renderer*,SDL_GetRenderer,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(SDL_Renderer*,SDL_GetRendererFromTexture,(SDL_Texture *a),(a),return) @@ -520,7 +520,7 @@ SDL_DYNAPI_PROC(SDL_Scancode,SDL_GetScancodeFromKey,(SDL_Keycode a, SDL_Keymod * SDL_DYNAPI_PROC(SDL_Scancode,SDL_GetScancodeFromName,(const char *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetScancodeName,(SDL_Scancode a),(a),return) SDL_DYNAPI_PROC(Uint32,SDL_GetSemaphoreValue,(SDL_Semaphore *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetSensorData,(SDL_Sensor *a, float *b, int c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_GetSensorData,(SDL_Sensor *a, float *b, int c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_Sensor*,SDL_GetSensorFromID,(SDL_SensorID a),(a),return) SDL_DYNAPI_PROC(SDL_SensorID,SDL_GetSensorID,(SDL_Sensor *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetSensorName,(SDL_Sensor *a),(a),return) @@ -532,15 +532,15 @@ SDL_DYNAPI_PROC(SDL_SensorType,SDL_GetSensorType,(SDL_Sensor *a),(a),return) SDL_DYNAPI_PROC(SDL_SensorType,SDL_GetSensorTypeForID,(SDL_SensorID a),(a),return) SDL_DYNAPI_PROC(SDL_SensorID*,SDL_GetSensors,(int *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetSilenceValueForFormat,(SDL_AudioFormat a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetStorageFileSize,(SDL_Storage *a, const char *b, Uint64 *c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetStoragePathInfo,(SDL_Storage *a, const char *b, SDL_PathInfo *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_GetStorageFileSize,(SDL_Storage *a, const char *b, Uint64 *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_GetStoragePathInfo,(SDL_Storage *a, const char *b, SDL_PathInfo *c),(a,b,c),return) SDL_DYNAPI_PROC(Uint64,SDL_GetStorageSpaceRemaining,(SDL_Storage *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetStringProperty,(SDL_PropertiesID a, const char *b, const char *c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetSurfaceAlphaMod,(SDL_Surface *a, Uint8 *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetSurfaceBlendMode,(SDL_Surface *a, SDL_BlendMode *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetSurfaceClipRect,(SDL_Surface *a, SDL_Rect *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetSurfaceColorKey,(SDL_Surface *a, Uint32 *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetSurfaceColorMod,(SDL_Surface *a, Uint8 *b, Uint8 *c, Uint8 *d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_GetSurfaceAlphaMod,(SDL_Surface *a, Uint8 *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GetSurfaceBlendMode,(SDL_Surface *a, SDL_BlendMode *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GetSurfaceClipRect,(SDL_Surface *a, SDL_Rect *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GetSurfaceColorKey,(SDL_Surface *a, Uint32 *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GetSurfaceColorMod,(SDL_Surface *a, Uint8 *b, Uint8 *c, Uint8 *d),(a,b,c,d),return) SDL_DYNAPI_PROC(SDL_Colorspace,SDL_GetSurfaceColorspace,(SDL_Surface *a),(a),return) SDL_DYNAPI_PROC(SDL_Surface**,SDL_GetSurfaceImages,(SDL_Surface *a, int *b),(a,b),return) SDL_DYNAPI_PROC(SDL_Palette*,SDL_GetSurfacePalette,(SDL_Surface *a),(a),return) @@ -548,15 +548,15 @@ SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetSurfaceProperties,(SDL_Surface *a),(a),r SDL_DYNAPI_PROC(int,SDL_GetSystemRAM,(void),(),return) SDL_DYNAPI_PROC(SDL_SystemTheme,SDL_GetSystemTheme,(void),(),return) SDL_DYNAPI_PROC(void*,SDL_GetTLS,(SDL_TLSID *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetTextInputArea,(SDL_Window *a, SDL_Rect *b, int *c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetTextureAlphaMod,(SDL_Texture *a, Uint8 *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetTextureAlphaModFloat,(SDL_Texture *a, float *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetTextureBlendMode,(SDL_Texture *a, SDL_BlendMode *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetTextureColorMod,(SDL_Texture *a, Uint8 *b, Uint8 *c, Uint8 *d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetTextureColorModFloat,(SDL_Texture *a, float *b, float *c, float *d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_GetTextInputArea,(SDL_Window *a, SDL_Rect *b, int *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_GetTextureAlphaMod,(SDL_Texture *a, Uint8 *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GetTextureAlphaModFloat,(SDL_Texture *a, float *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GetTextureBlendMode,(SDL_Texture *a, SDL_BlendMode *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GetTextureColorMod,(SDL_Texture *a, Uint8 *b, Uint8 *c, Uint8 *d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_GetTextureColorModFloat,(SDL_Texture *a, float *b, float *c, float *d),(a,b,c,d),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetTextureProperties,(SDL_Texture *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetTextureScaleMode,(SDL_Texture *a, SDL_ScaleMode *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetTextureSize,(SDL_Texture *a, float *b, float *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_GetTextureScaleMode,(SDL_Texture *a, SDL_ScaleMode *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GetTextureSize,(SDL_Texture *a, float *b, float *c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_ThreadID,SDL_GetThreadID,(SDL_Thread *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetThreadName,(SDL_Thread *a),(a),return) SDL_DYNAPI_PROC(Uint64,SDL_GetTicks,(void),(),return) @@ -568,8 +568,8 @@ SDL_DYNAPI_PROC(SDL_Finger**,SDL_GetTouchFingers,(SDL_TouchID a, int *b),(a,b),r SDL_DYNAPI_PROC(const char*,SDL_GetUserFolder,(SDL_Folder a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetVersion,(void),(),return) SDL_DYNAPI_PROC(const char*,SDL_GetVideoDriver,(int a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetWindowAspectRatio,(SDL_Window *a, float *b, float *c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetWindowBordersSize,(SDL_Window *a, int *b, int *c, int *d, int *e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(bool,SDL_GetWindowAspectRatio,(SDL_Window *a, float *b, float *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_GetWindowBordersSize,(SDL_Window *a, int *b, int *c, int *d, int *e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(float,SDL_GetWindowDisplayScale,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(SDL_WindowFlags,SDL_GetWindowFlags,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(SDL_Window*,SDL_GetWindowFromEvent,(const SDL_Event *a),(a),return) @@ -577,110 +577,110 @@ SDL_DYNAPI_PROC(SDL_Window*,SDL_GetWindowFromID,(SDL_WindowID a),(a),return) SDL_DYNAPI_PROC(const SDL_DisplayMode*,SDL_GetWindowFullscreenMode,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(void*,SDL_GetWindowICCProfile,(SDL_Window *a, size_t *b),(a,b),return) SDL_DYNAPI_PROC(SDL_WindowID,SDL_GetWindowID,(SDL_Window *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetWindowKeyboardGrab,(SDL_Window *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetWindowMaximumSize,(SDL_Window *a, int *b, int *c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetWindowMinimumSize,(SDL_Window *a, int *b, int *c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetWindowMouseGrab,(SDL_Window *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_GetWindowKeyboardGrab,(SDL_Window *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_GetWindowMaximumSize,(SDL_Window *a, int *b, int *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_GetWindowMinimumSize,(SDL_Window *a, int *b, int *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_GetWindowMouseGrab,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(const SDL_Rect*,SDL_GetWindowMouseRect,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(float,SDL_GetWindowOpacity,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(SDL_Window*,SDL_GetWindowParent,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(float,SDL_GetWindowPixelDensity,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(SDL_PixelFormat,SDL_GetWindowPixelFormat,(SDL_Window *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetWindowPosition,(SDL_Window *a, int *b, int *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_GetWindowPosition,(SDL_Window *a, int *b, int *c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetWindowProperties,(SDL_Window *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetWindowRelativeMouseMode,(SDL_Window *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetWindowSafeArea,(SDL_Window *a, SDL_Rect *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetWindowSize,(SDL_Window *a, int *b, int *c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetWindowSizeInPixels,(SDL_Window *a, int *b, int *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_GetWindowRelativeMouseMode,(SDL_Window *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_GetWindowSafeArea,(SDL_Window *a, SDL_Rect *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GetWindowSize,(SDL_Window *a, int *b, int *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_GetWindowSizeInPixels,(SDL_Window *a, int *b, int *c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_Surface*,SDL_GetWindowSurface,(SDL_Window *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetWindowSurfaceVSync,(SDL_Window *a, int *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_GetWindowSurfaceVSync,(SDL_Window *a, int *b),(a,b),return) SDL_DYNAPI_PROC(const char*,SDL_GetWindowTitle,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(SDL_Window**,SDL_GetWindows,(int *a),(a),return) SDL_DYNAPI_PROC(char **,SDL_GlobDirectory,(const char *a, const char *b, SDL_GlobFlags c, int *d),(a,b,c,d),return) SDL_DYNAPI_PROC(char **,SDL_GlobStorageDirectory,(SDL_Storage *a, const char *b, const char *c, SDL_GlobFlags d, int *e),(a,b,c,d,e),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HapticEffectSupported,(SDL_Haptic *a, const SDL_HapticEffect *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HapticRumbleSupported,(SDL_Haptic *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HasARMSIMD,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HasAVX,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HasAVX2,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HasAVX512F,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HasAltiVec,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HasClipboardData,(const char *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HasClipboardText,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HasEvent,(Uint32 a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HasEvents,(Uint32 a, Uint32 b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HasGamepad,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HasJoystick,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HasKeyboard,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HasLASX,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HasLSX,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HasMMX,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HasMouse,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HasNEON,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HasPrimarySelectionText,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HasProperty,(SDL_PropertiesID a, const char *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HasRectIntersection,(const SDL_Rect *a, const SDL_Rect *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HasRectIntersectionFloat,(const SDL_FRect *a, const SDL_FRect *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HasSSE,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HasSSE2,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HasSSE3,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HasSSE41,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HasSSE42,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HasScreenKeyboardSupport,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HideCursor,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_HideWindow,(SDL_Window *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_HapticEffectSupported,(SDL_Haptic *a, const SDL_HapticEffect *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_HapticRumbleSupported,(SDL_Haptic *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_HasARMSIMD,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_HasAVX,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_HasAVX2,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_HasAVX512F,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_HasAltiVec,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_HasClipboardData,(const char *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_HasClipboardText,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_HasEvent,(Uint32 a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_HasEvents,(Uint32 a, Uint32 b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_HasGamepad,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_HasJoystick,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_HasKeyboard,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_HasLASX,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_HasLSX,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_HasMMX,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_HasMouse,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_HasNEON,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_HasPrimarySelectionText,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_HasProperty,(SDL_PropertiesID a, const char *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_HasRectIntersection,(const SDL_Rect *a, const SDL_Rect *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_HasRectIntersectionFloat,(const SDL_FRect *a, const SDL_FRect *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_HasSSE,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_HasSSE2,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_HasSSE3,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_HasSSE41,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_HasSSE42,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_HasScreenKeyboardSupport,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_HideCursor,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_HideWindow,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(SDL_IOStream*,SDL_IOFromConstMem,(const void *a, size_t b),(a,b),return) SDL_DYNAPI_PROC(SDL_IOStream*,SDL_IOFromDynamicMem,(void),(),return) SDL_DYNAPI_PROC(SDL_IOStream*,SDL_IOFromFile,(const char *a, const char *b),(a,b),return) SDL_DYNAPI_PROC(SDL_IOStream*,SDL_IOFromMem,(void *a, size_t b),(a,b),return) SDL_DYNAPI_PROC(size_t,SDL_IOvprintf,(SDL_IOStream *a, SDL_PRINTF_FORMAT_STRING const char *b, va_list c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_Init,(SDL_InitFlags a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_InitHapticRumble,(SDL_Haptic *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_InitSubSystem,(SDL_InitFlags a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_Init,(SDL_InitFlags a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_InitHapticRumble,(SDL_Haptic *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_InitSubSystem,(SDL_InitFlags a),(a),return) SDL_DYNAPI_PROC(void,SDL_InsertGPUDebugLabel,(SDL_GPUCommandBuffer *a, const char *b),(a,b),) -SDL_DYNAPI_PROC(SDL_bool,SDL_IsAndroidTV,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_IsChromebook,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_IsDeXMode,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_IsGamepad,(SDL_JoystickID a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_IsJoystickHaptic,(SDL_Joystick *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_IsJoystickVirtual,(SDL_JoystickID a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_IsMouseHaptic,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_IsTablet,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_JoystickConnected,(SDL_Joystick *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_JoystickEventsEnabled,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_KillProcess,(SDL_Process *a, SDL_bool b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_IsAndroidTV,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_IsChromebook,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_IsDeXMode,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_IsGamepad,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_IsJoystickHaptic,(SDL_Joystick *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_IsJoystickVirtual,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_IsMouseHaptic,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_IsTablet,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_JoystickConnected,(SDL_Joystick *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_JoystickEventsEnabled,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_KillProcess,(SDL_Process *a, bool b),(a,b),return) SDL_DYNAPI_PROC(SDL_Surface*,SDL_LoadBMP,(const char *a),(a),return) -SDL_DYNAPI_PROC(SDL_Surface*,SDL_LoadBMP_IO,(SDL_IOStream *a, SDL_bool b),(a,b),return) +SDL_DYNAPI_PROC(SDL_Surface*,SDL_LoadBMP_IO,(SDL_IOStream *a, bool b),(a,b),return) SDL_DYNAPI_PROC(void*,SDL_LoadFile,(const char *a, size_t *b),(a,b),return) -SDL_DYNAPI_PROC(void*,SDL_LoadFile_IO,(SDL_IOStream *a, size_t *b, SDL_bool c),(a,b,c),return) +SDL_DYNAPI_PROC(void*,SDL_LoadFile_IO,(SDL_IOStream *a, size_t *b, bool c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_FunctionPointer,SDL_LoadFunction,(void *a, const char *b),(a,b),return) SDL_DYNAPI_PROC(void*,SDL_LoadObject,(const char *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_LoadWAV,(const char *a, SDL_AudioSpec *b, Uint8 **c, Uint32 *d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_LoadWAV_IO,(SDL_IOStream *a, SDL_bool b, SDL_AudioSpec *c, Uint8 **d, Uint32 *e),(a,b,c,d,e),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_LockAudioStream,(SDL_AudioStream *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_LoadWAV,(const char *a, SDL_AudioSpec *b, Uint8 **c, Uint32 *d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_LoadWAV_IO,(SDL_IOStream *a, bool b, SDL_AudioSpec *c, Uint8 **d, Uint32 *e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(bool,SDL_LockAudioStream,(SDL_AudioStream *a),(a),return) SDL_DYNAPI_PROC(void,SDL_LockJoysticks,(void),(),) SDL_DYNAPI_PROC(void,SDL_LockMutex,(SDL_Mutex *a),(a),) -SDL_DYNAPI_PROC(SDL_bool,SDL_LockProperties,(SDL_PropertiesID a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_LockProperties,(SDL_PropertiesID a),(a),return) SDL_DYNAPI_PROC(void,SDL_LockRWLockForReading,(SDL_RWLock *a),(a),) SDL_DYNAPI_PROC(void,SDL_LockRWLockForWriting,(SDL_RWLock *a),(a),) SDL_DYNAPI_PROC(void,SDL_LockSpinlock,(SDL_SpinLock *a),(a),) -SDL_DYNAPI_PROC(SDL_bool,SDL_LockSurface,(SDL_Surface *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_LockTexture,(SDL_Texture *a, const SDL_Rect *b, void **c, int *d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_LockTextureToSurface,(SDL_Texture *a, const SDL_Rect *b, SDL_Surface **c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_LockSurface,(SDL_Surface *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_LockTexture,(SDL_Texture *a, const SDL_Rect *b, void **c, int *d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_LockTextureToSurface,(SDL_Texture *a, const SDL_Rect *b, SDL_Surface **c),(a,b,c),return) SDL_DYNAPI_PROC(void,SDL_LogMessageV,(int a, SDL_LogPriority b, SDL_PRINTF_FORMAT_STRING const char *c, va_list d),(a,b,c,d),) -SDL_DYNAPI_PROC(void*,SDL_MapGPUTransferBuffer,(SDL_GPUDevice *a, SDL_GPUTransferBuffer *b, SDL_bool c),(a,b,c),return) +SDL_DYNAPI_PROC(void*,SDL_MapGPUTransferBuffer,(SDL_GPUDevice *a, SDL_GPUTransferBuffer *b, bool c),(a,b,c),return) SDL_DYNAPI_PROC(Uint32,SDL_MapRGB,(const SDL_PixelFormatDetails *a, const SDL_Palette *b, Uint8 c, Uint8 d, Uint8 e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(Uint32,SDL_MapRGBA,(const SDL_PixelFormatDetails *a, const SDL_Palette *b, Uint8 c, Uint8 d, Uint8 e, Uint8 f),(a,b,c,d,e,f),return) SDL_DYNAPI_PROC(Uint32,SDL_MapSurfaceRGB,(SDL_Surface *a, Uint8 b, Uint8 c, Uint8 d),(a,b,c,d),return) SDL_DYNAPI_PROC(Uint32,SDL_MapSurfaceRGBA,(SDL_Surface *a, Uint8 b, Uint8 c, Uint8 d, Uint8 e),(a,b,c,d,e),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_MaximizeWindow,(SDL_Window *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_MaximizeWindow,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(void,SDL_MemoryBarrierAcquireFunction,(void),(),) SDL_DYNAPI_PROC(void,SDL_MemoryBarrierReleaseFunction,(void),(),) SDL_DYNAPI_PROC(SDL_MetalView,SDL_Metal_CreateView,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(void,SDL_Metal_DestroyView,(SDL_MetalView a),(a),) SDL_DYNAPI_PROC(void*,SDL_Metal_GetLayer,(SDL_MetalView a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_MinimizeWindow,(SDL_Window *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_MixAudio,(Uint8 *a, const Uint8 *b, SDL_AudioFormat c, Uint32 d, float e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(bool,SDL_MinimizeWindow,(SDL_Window *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_MixAudio,(Uint8 *a, const Uint8 *b, SDL_AudioFormat c, Uint32 d, float e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(void,SDL_OnApplicationDidChangeStatusBarOrientation,(void),(),) SDL_DYNAPI_PROC(void,SDL_OnApplicationDidEnterBackground,(void),(),) SDL_DYNAPI_PROC(void,SDL_OnApplicationDidEnterForeground,(void),(),) @@ -701,49 +701,49 @@ SDL_DYNAPI_PROC(SDL_Joystick*,SDL_OpenJoystick,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_Sensor*,SDL_OpenSensor,(SDL_SensorID a),(a),return) SDL_DYNAPI_PROC(SDL_Storage*,SDL_OpenStorage,(const SDL_StorageInterface *a, void *b),(a,b),return) SDL_DYNAPI_PROC(SDL_Storage*,SDL_OpenTitleStorage,(const char *a, SDL_PropertiesID b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_OpenURL,(const char *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_OpenURL,(const char *a),(a),return) SDL_DYNAPI_PROC(SDL_Storage*,SDL_OpenUserStorage,(const char *a, const char *b, SDL_PropertiesID c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_OutOfMemory,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_PauseAudioDevice,(SDL_AudioDeviceID a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_PauseAudioStreamDevice,(SDL_AudioStream *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_PauseHaptic,(SDL_Haptic *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_OutOfMemory,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_PauseAudioDevice,(SDL_AudioDeviceID a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_PauseAudioStreamDevice,(SDL_AudioStream *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_PauseHaptic,(SDL_Haptic *a),(a),return) SDL_DYNAPI_PROC(int,SDL_PeepEvents,(SDL_Event *a, int b, SDL_EventAction c, Uint32 d, Uint32 e),(a,b,c,d,e),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_PlayHapticRumble,(SDL_Haptic *a, float b, Uint32 c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_PollEvent,(SDL_Event *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_PlayHapticRumble,(SDL_Haptic *a, float b, Uint32 c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_PollEvent,(SDL_Event *a),(a),return) SDL_DYNAPI_PROC(void,SDL_PopGPUDebugGroup,(SDL_GPUCommandBuffer *a),(a),) -SDL_DYNAPI_PROC(SDL_bool,SDL_PremultiplyAlpha,(int a, int b, SDL_PixelFormat c, const void *d, int e, SDL_PixelFormat f, void *g, int h, SDL_bool i),(a,b,c,d,e,f,g,h,i),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_PremultiplySurfaceAlpha,(SDL_Surface *a, SDL_bool b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_PremultiplyAlpha,(int a, int b, SDL_PixelFormat c, const void *d, int e, SDL_PixelFormat f, void *g, int h, bool i),(a,b,c,d,e,f,g,h,i),return) +SDL_DYNAPI_PROC(bool,SDL_PremultiplySurfaceAlpha,(SDL_Surface *a, bool b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_PumpEvents,(void),(),) -SDL_DYNAPI_PROC(SDL_bool,SDL_PushEvent,(SDL_Event *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_PushEvent,(SDL_Event *a),(a),return) SDL_DYNAPI_PROC(void,SDL_PushGPUComputeUniformData,(SDL_GPUCommandBuffer *a, Uint32 b, const void *c, Uint32 d),(a,b,c,d),) SDL_DYNAPI_PROC(void,SDL_PushGPUDebugGroup,(SDL_GPUCommandBuffer *a, const char *b),(a,b),) SDL_DYNAPI_PROC(void,SDL_PushGPUFragmentUniformData,(SDL_GPUCommandBuffer *a, Uint32 b, const void *c, Uint32 d),(a,b,c,d),) SDL_DYNAPI_PROC(void,SDL_PushGPUVertexUniformData,(SDL_GPUCommandBuffer *a, Uint32 b, const void *c, Uint32 d),(a,b,c,d),) -SDL_DYNAPI_PROC(SDL_bool,SDL_PutAudioStreamData,(SDL_AudioStream *a, const void *b, int c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_QueryGPUFence,(SDL_GPUDevice *a, SDL_GPUFence *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_PutAudioStreamData,(SDL_AudioStream *a, const void *b, int c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_QueryGPUFence,(SDL_GPUDevice *a, SDL_GPUFence *b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_Quit,(void),(),) SDL_DYNAPI_PROC(void,SDL_QuitSubSystem,(SDL_InitFlags a),(a),) -SDL_DYNAPI_PROC(SDL_bool,SDL_RaiseWindow,(SDL_Window *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_RaiseWindow,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(size_t,SDL_ReadIO,(SDL_IOStream *a, void *b, size_t c),(a,b,c),return) SDL_DYNAPI_PROC(void*,SDL_ReadProcess,(SDL_Process *a, size_t *b, int *c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ReadS16BE,(SDL_IOStream *a, Sint16 *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ReadS16LE,(SDL_IOStream *a, Sint16 *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ReadS32BE,(SDL_IOStream *a, Sint32 *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ReadS32LE,(SDL_IOStream *a, Sint32 *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ReadS64BE,(SDL_IOStream *a, Sint64 *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ReadS64LE,(SDL_IOStream *a, Sint64 *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ReadS8,(SDL_IOStream *a, Sint8 *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ReadStorageFile,(SDL_Storage *a, const char *b, void *c, Uint64 d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ReadSurfacePixel,(SDL_Surface *a, int b, int c, Uint8 *d, Uint8 *e, Uint8 *f, Uint8 *g),(a,b,c,d,e,f,g),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ReadSurfacePixelFloat,(SDL_Surface *a, int b, int c, float *d, float *e, float *f, float *g),(a,b,c,d,e,f,g),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ReadU16BE,(SDL_IOStream *a, Uint16 *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ReadU16LE,(SDL_IOStream *a, Uint16 *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ReadU32BE,(SDL_IOStream *a, Uint32 *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ReadU32LE,(SDL_IOStream *a, Uint32 *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ReadU64BE,(SDL_IOStream *a, Uint64 *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ReadU64LE,(SDL_IOStream *a, Uint64 *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ReadU8,(SDL_IOStream *a, Uint8 *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RegisterApp,(const char *a, Uint32 b, void *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_ReadS16BE,(SDL_IOStream *a, Sint16 *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_ReadS16LE,(SDL_IOStream *a, Sint16 *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_ReadS32BE,(SDL_IOStream *a, Sint32 *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_ReadS32LE,(SDL_IOStream *a, Sint32 *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_ReadS64BE,(SDL_IOStream *a, Sint64 *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_ReadS64LE,(SDL_IOStream *a, Sint64 *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_ReadS8,(SDL_IOStream *a, Sint8 *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_ReadStorageFile,(SDL_Storage *a, const char *b, void *c, Uint64 d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_ReadSurfacePixel,(SDL_Surface *a, int b, int c, Uint8 *d, Uint8 *e, Uint8 *f, Uint8 *g),(a,b,c,d,e,f,g),return) +SDL_DYNAPI_PROC(bool,SDL_ReadSurfacePixelFloat,(SDL_Surface *a, int b, int c, float *d, float *e, float *f, float *g),(a,b,c,d,e,f,g),return) +SDL_DYNAPI_PROC(bool,SDL_ReadU16BE,(SDL_IOStream *a, Uint16 *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_ReadU16LE,(SDL_IOStream *a, Uint16 *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_ReadU32BE,(SDL_IOStream *a, Uint32 *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_ReadU32LE,(SDL_IOStream *a, Uint32 *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_ReadU64BE,(SDL_IOStream *a, Uint64 *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_ReadU64LE,(SDL_IOStream *a, Uint64 *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_ReadU8,(SDL_IOStream *a, Uint8 *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_RegisterApp,(const char *a, Uint32 b, void *c),(a,b,c),return) SDL_DYNAPI_PROC(Uint32,SDL_RegisterEvents,(int a),(a),return) SDL_DYNAPI_PROC(void,SDL_ReleaseCameraFrame,(SDL_Camera *a, SDL_Surface *b),(a,b),) SDL_DYNAPI_PROC(void,SDL_ReleaseGPUBuffer,(SDL_GPUDevice *a, SDL_GPUBuffer *b),(a,b),) @@ -755,222 +755,222 @@ SDL_DYNAPI_PROC(void,SDL_ReleaseGPUShader,(SDL_GPUDevice *a, SDL_GPUShader *b),( SDL_DYNAPI_PROC(void,SDL_ReleaseGPUTexture,(SDL_GPUDevice *a, SDL_GPUTexture *b),(a,b),) SDL_DYNAPI_PROC(void,SDL_ReleaseGPUTransferBuffer,(SDL_GPUDevice *a, SDL_GPUTransferBuffer *b),(a,b),) SDL_DYNAPI_PROC(void,SDL_ReleaseWindowFromGPUDevice,(SDL_GPUDevice *a, SDL_Window *b),(a,b),) -SDL_DYNAPI_PROC(SDL_bool,SDL_ReloadGamepadMappings,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_ReloadGamepadMappings,(void),(),return) SDL_DYNAPI_PROC(void,SDL_RemoveEventWatch,(SDL_EventFilter a, void *b),(a,b),) SDL_DYNAPI_PROC(void,SDL_RemoveHintCallback,(const char *a, SDL_HintCallback b, void *c),(a,b,c),) -SDL_DYNAPI_PROC(SDL_bool,SDL_RemovePath,(const char *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RemoveStoragePath,(SDL_Storage *a, const char *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_RemovePath,(const char *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_RemoveStoragePath,(SDL_Storage *a, const char *b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_RemoveSurfaceAlternateImages,(SDL_Surface *a),(a),) -SDL_DYNAPI_PROC(SDL_bool,SDL_RemoveTimer,(SDL_TimerID a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RenamePath,(const char *a, const char *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RenameStoragePath,(SDL_Storage *a, const char *b, const char *c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RenderClear,(SDL_Renderer *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RenderClipEnabled,(SDL_Renderer *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RenderCoordinatesFromWindow,(SDL_Renderer *a, float b, float c, float *d, float *e),(a,b,c,d,e),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RenderCoordinatesToWindow,(SDL_Renderer *a, float b, float c, float *d, float *e),(a,b,c,d,e),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RenderFillRect,(SDL_Renderer *a, const SDL_FRect *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RenderFillRects,(SDL_Renderer *a, const SDL_FRect *b, int c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RenderGeometry,(SDL_Renderer *a, SDL_Texture *b, const SDL_Vertex *c, int d, const int *e, int f),(a,b,c,d,e,f),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RenderGeometryRaw,(SDL_Renderer *a, SDL_Texture *b, const float *c, int d, const SDL_FColor *e, int f, const float *g, int h, int i, const void *j, int k, int l),(a,b,c,d,e,f,g,h,i,j,k,l),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RenderLine,(SDL_Renderer *a, float b, float c, float d, float e),(a,b,c,d,e),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RenderLines,(SDL_Renderer *a, const SDL_FPoint *b, int c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RenderPoint,(SDL_Renderer *a, float b, float c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RenderPoints,(SDL_Renderer *a, const SDL_FPoint *b, int c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RenderPresent,(SDL_Renderer *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_RemoveTimer,(SDL_TimerID a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_RenamePath,(const char *a, const char *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_RenameStoragePath,(SDL_Storage *a, const char *b, const char *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_RenderClear,(SDL_Renderer *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_RenderClipEnabled,(SDL_Renderer *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_RenderCoordinatesFromWindow,(SDL_Renderer *a, float b, float c, float *d, float *e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(bool,SDL_RenderCoordinatesToWindow,(SDL_Renderer *a, float b, float c, float *d, float *e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(bool,SDL_RenderFillRect,(SDL_Renderer *a, const SDL_FRect *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_RenderFillRects,(SDL_Renderer *a, const SDL_FRect *b, int c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_RenderGeometry,(SDL_Renderer *a, SDL_Texture *b, const SDL_Vertex *c, int d, const int *e, int f),(a,b,c,d,e,f),return) +SDL_DYNAPI_PROC(bool,SDL_RenderGeometryRaw,(SDL_Renderer *a, SDL_Texture *b, const float *c, int d, const SDL_FColor *e, int f, const float *g, int h, int i, const void *j, int k, int l),(a,b,c,d,e,f,g,h,i,j,k,l),return) +SDL_DYNAPI_PROC(bool,SDL_RenderLine,(SDL_Renderer *a, float b, float c, float d, float e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(bool,SDL_RenderLines,(SDL_Renderer *a, const SDL_FPoint *b, int c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_RenderPoint,(SDL_Renderer *a, float b, float c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_RenderPoints,(SDL_Renderer *a, const SDL_FPoint *b, int c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_RenderPresent,(SDL_Renderer *a),(a),return) SDL_DYNAPI_PROC(SDL_Surface*,SDL_RenderReadPixels,(SDL_Renderer *a, const SDL_Rect *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RenderRect,(SDL_Renderer *a, const SDL_FRect *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RenderRects,(SDL_Renderer *a, const SDL_FRect *b, int c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RenderTexture,(SDL_Renderer *a, SDL_Texture *b, const SDL_FRect *c, const SDL_FRect *d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RenderTexture9Grid,(SDL_Renderer *a, SDL_Texture *b, const SDL_FRect *c, float d, float e, float f, float g, float h, const SDL_FRect *i),(a,b,c,d,e,f,g,h,i),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RenderTextureRotated,(SDL_Renderer *a, SDL_Texture *b, const SDL_FRect *c, const SDL_FRect *d, const double e, const SDL_FPoint *f, const SDL_FlipMode g),(a,b,c,d,e,f,g),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RenderTextureTiled,(SDL_Renderer *a, SDL_Texture *b, const SDL_FRect *c, float d, const SDL_FRect *e),(a,b,c,d,e),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RenderViewportSet,(SDL_Renderer *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_RenderRect,(SDL_Renderer *a, const SDL_FRect *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_RenderRects,(SDL_Renderer *a, const SDL_FRect *b, int c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_RenderTexture,(SDL_Renderer *a, SDL_Texture *b, const SDL_FRect *c, const SDL_FRect *d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_RenderTexture9Grid,(SDL_Renderer *a, SDL_Texture *b, const SDL_FRect *c, float d, float e, float f, float g, float h, const SDL_FRect *i),(a,b,c,d,e,f,g,h,i),return) +SDL_DYNAPI_PROC(bool,SDL_RenderTextureRotated,(SDL_Renderer *a, SDL_Texture *b, const SDL_FRect *c, const SDL_FRect *d, const double e, const SDL_FPoint *f, const SDL_FlipMode g),(a,b,c,d,e,f,g),return) +SDL_DYNAPI_PROC(bool,SDL_RenderTextureTiled,(SDL_Renderer *a, SDL_Texture *b, const SDL_FRect *c, float d, const SDL_FRect *e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(bool,SDL_RenderViewportSet,(SDL_Renderer *a),(a),return) SDL_DYNAPI_PROC(SDL_AssertState,SDL_ReportAssertion,(SDL_AssertData *a, const char *b, const char *c, int d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RequestAndroidPermission,(const char *a, SDL_RequestAndroidPermissionCallback b, void *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_RequestAndroidPermission,(const char *a, SDL_RequestAndroidPermissionCallback b, void *c),(a,b,c),return) SDL_DYNAPI_PROC(void,SDL_ResetAssertionReport,(void),(),) -SDL_DYNAPI_PROC(SDL_bool,SDL_ResetHint,(const char *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_ResetHint,(const char *a),(a),return) SDL_DYNAPI_PROC(void,SDL_ResetHints,(void),(),) SDL_DYNAPI_PROC(void,SDL_ResetKeyboard,(void),(),) SDL_DYNAPI_PROC(void,SDL_ResetLogPriorities,(void),(),) -SDL_DYNAPI_PROC(SDL_bool,SDL_RestoreWindow,(SDL_Window *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ResumeAudioDevice,(SDL_AudioDeviceID a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ResumeAudioStreamDevice,(SDL_AudioStream *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ResumeHaptic,(SDL_Haptic *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RumbleGamepad,(SDL_Gamepad *a, Uint16 b, Uint16 c, Uint32 d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RumbleGamepadTriggers,(SDL_Gamepad *a, Uint16 b, Uint16 c, Uint32 d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RumbleJoystick,(SDL_Joystick *a, Uint16 b, Uint16 c, Uint32 d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RumbleJoystickTriggers,(SDL_Joystick *a, Uint16 b, Uint16 c, Uint32 d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_RestoreWindow,(SDL_Window *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_ResumeAudioDevice,(SDL_AudioDeviceID a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_ResumeAudioStreamDevice,(SDL_AudioStream *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_ResumeHaptic,(SDL_Haptic *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_RumbleGamepad,(SDL_Gamepad *a, Uint16 b, Uint16 c, Uint32 d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_RumbleGamepadTriggers,(SDL_Gamepad *a, Uint16 b, Uint16 c, Uint32 d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_RumbleJoystick,(SDL_Joystick *a, Uint16 b, Uint16 c, Uint32 d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_RumbleJoystickTriggers,(SDL_Joystick *a, Uint16 b, Uint16 c, Uint32 d),(a,b,c,d),return) SDL_DYNAPI_PROC(int,SDL_RunApp,(int a, char *b[], SDL_main_func c, void *d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_RunHapticEffect,(SDL_Haptic *a, int b, Uint32 c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SaveBMP,(SDL_Surface *a, const char *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SaveBMP_IO,(SDL_Surface *a, SDL_IOStream *b, SDL_bool c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_RunHapticEffect,(SDL_Haptic *a, int b, Uint32 c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SaveBMP,(SDL_Surface *a, const char *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SaveBMP_IO,(SDL_Surface *a, SDL_IOStream *b, bool c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_Surface*,SDL_ScaleSurface,(SDL_Surface *a, int b, int c, SDL_ScaleMode d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ScreenKeyboardShown,(SDL_Window *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ScreenSaverEnabled,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_ScreenKeyboardShown,(SDL_Window *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_ScreenSaverEnabled,(void),(),return) SDL_DYNAPI_PROC(Sint64,SDL_SeekIO,(SDL_IOStream *a, Sint64 b, SDL_IOWhence c),(a,b,c),return) SDL_DYNAPI_PROC(void,SDL_SendAndroidBackButton,(void),(),) -SDL_DYNAPI_PROC(SDL_bool,SDL_SendAndroidMessage,(Uint32 a, int b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SendGamepadEffect,(SDL_Gamepad *a, const void *b, int c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SendJoystickEffect,(SDL_Joystick *a, const void *b, int c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SendJoystickVirtualSensorData,(SDL_Joystick *a, SDL_SensorType b, Uint64 c, const float *d, int e),(a,b,c,d,e),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetAppMetadata,(const char *a, const char *b, const char *c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetAppMetadataProperty,(const char *a, const char *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SendAndroidMessage,(Uint32 a, int b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SendGamepadEffect,(SDL_Gamepad *a, const void *b, int c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SendJoystickEffect,(SDL_Joystick *a, const void *b, int c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SendJoystickVirtualSensorData,(SDL_Joystick *a, SDL_SensorType b, Uint64 c, const float *d, int e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(bool,SDL_SetAppMetadata,(const char *a, const char *b, const char *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SetAppMetadataProperty,(const char *a, const char *b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_SetAssertionHandler,(SDL_AssertionHandler a, void *b),(a,b),) SDL_DYNAPI_PROC(int,SDL_SetAtomicInt,(SDL_AtomicInt *a, int b),(a,b),return) SDL_DYNAPI_PROC(void*,SDL_SetAtomicPointer,(void **a, void *b),(a,b),return) SDL_DYNAPI_PROC(Uint32,SDL_SetAtomicU32,(SDL_AtomicU32 *a, Uint32 b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetAudioDeviceGain,(SDL_AudioDeviceID a, float b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetAudioPostmixCallback,(SDL_AudioDeviceID a, SDL_AudioPostmixCallback b, void *c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetAudioStreamFormat,(SDL_AudioStream *a, const SDL_AudioSpec *b, const SDL_AudioSpec *c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetAudioStreamFrequencyRatio,(SDL_AudioStream *a, float b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetAudioStreamGain,(SDL_AudioStream *a, float b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetAudioStreamGetCallback,(SDL_AudioStream *a, SDL_AudioStreamCallback b, void *c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetAudioStreamInputChannelMap,(SDL_AudioStream *a, const int *b, int c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetAudioStreamOutputChannelMap,(SDL_AudioStream *a, const int *b, int c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetAudioStreamPutCallback,(SDL_AudioStream *a, SDL_AudioStreamCallback b, void *c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetBooleanProperty,(SDL_PropertiesID a, const char *b, SDL_bool c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetClipboardData,(SDL_ClipboardDataCallback a, SDL_ClipboardCleanupCallback b, void *c, const char **d, size_t e),(a,b,c,d,e),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetClipboardText,(const char *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetCursor,(SDL_Cursor *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetEnvironmentVariable,(SDL_Environment *a, const char *b, const char *c, SDL_bool d),(a,b,c,d),return) -SDL_DYNAPI_PROC(void,SDL_SetEventEnabled,(Uint32 a, SDL_bool b),(a,b),) +SDL_DYNAPI_PROC(bool,SDL_SetAudioDeviceGain,(SDL_AudioDeviceID a, float b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetAudioPostmixCallback,(SDL_AudioDeviceID a, SDL_AudioPostmixCallback b, void *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SetAudioStreamFormat,(SDL_AudioStream *a, const SDL_AudioSpec *b, const SDL_AudioSpec *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SetAudioStreamFrequencyRatio,(SDL_AudioStream *a, float b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetAudioStreamGain,(SDL_AudioStream *a, float b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetAudioStreamGetCallback,(SDL_AudioStream *a, SDL_AudioStreamCallback b, void *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SetAudioStreamInputChannelMap,(SDL_AudioStream *a, const int *b, int c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SetAudioStreamOutputChannelMap,(SDL_AudioStream *a, const int *b, int c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SetAudioStreamPutCallback,(SDL_AudioStream *a, SDL_AudioStreamCallback b, void *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SetBooleanProperty,(SDL_PropertiesID a, const char *b, bool c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SetClipboardData,(SDL_ClipboardDataCallback a, SDL_ClipboardCleanupCallback b, void *c, const char **d, size_t e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(bool,SDL_SetClipboardText,(const char *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_SetCursor,(SDL_Cursor *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_SetEnvironmentVariable,(SDL_Environment *a, const char *b, const char *c, bool d),(a,b,c,d),return) +SDL_DYNAPI_PROC(void,SDL_SetEventEnabled,(Uint32 a, bool b),(a,b),) SDL_DYNAPI_PROC(void,SDL_SetEventFilter,(SDL_EventFilter a, void *b),(a,b),) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetFloatProperty,(SDL_PropertiesID a, const char *b, float c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SetFloatProperty,(SDL_PropertiesID a, const char *b, float c),(a,b,c),return) SDL_DYNAPI_PROC(void,SDL_SetGPUBlendConstants,(SDL_GPURenderPass *a, SDL_FColor b),(a,b),) SDL_DYNAPI_PROC(void,SDL_SetGPUBufferName,(SDL_GPUDevice *a, SDL_GPUBuffer *b, const char *c),(a,b,c),) SDL_DYNAPI_PROC(void,SDL_SetGPUScissor,(SDL_GPURenderPass *a, const SDL_Rect *b),(a,b),) SDL_DYNAPI_PROC(void,SDL_SetGPUStencilReference,(SDL_GPURenderPass *a, Uint8 b),(a,b),) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetGPUSwapchainParameters,(SDL_GPUDevice *a, SDL_Window *b, SDL_GPUSwapchainComposition c, SDL_GPUPresentMode d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_SetGPUSwapchainParameters,(SDL_GPUDevice *a, SDL_Window *b, SDL_GPUSwapchainComposition c, SDL_GPUPresentMode d),(a,b,c,d),return) SDL_DYNAPI_PROC(void,SDL_SetGPUTextureName,(SDL_GPUDevice *a, SDL_GPUTexture *b, const char *c),(a,b,c),) SDL_DYNAPI_PROC(void,SDL_SetGPUViewport,(SDL_GPURenderPass *a, const SDL_GPUViewport *b),(a,b),) -SDL_DYNAPI_PROC(void,SDL_SetGamepadEventsEnabled,(SDL_bool a),(a),) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetGamepadLED,(SDL_Gamepad *a, Uint8 b, Uint8 c, Uint8 d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetGamepadMapping,(SDL_JoystickID a, const char *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetGamepadPlayerIndex,(SDL_Gamepad *a, int b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetGamepadSensorEnabled,(SDL_Gamepad *a, SDL_SensorType b, SDL_bool c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetHapticAutocenter,(SDL_Haptic *a, int b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetHapticGain,(SDL_Haptic *a, int b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetHint,(const char *a, const char *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetHintWithPriority,(const char *a, const char *b, SDL_HintPriority c),(a,b,c),return) -SDL_DYNAPI_PROC(void,SDL_SetJoystickEventsEnabled,(SDL_bool a),(a),) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetJoystickLED,(SDL_Joystick *a, Uint8 b, Uint8 c, Uint8 d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetJoystickPlayerIndex,(SDL_Joystick *a, int b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetJoystickVirtualAxis,(SDL_Joystick *a, int b, Sint16 c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetJoystickVirtualBall,(SDL_Joystick *a, int b, Sint16 c, Sint16 d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetJoystickVirtualButton,(SDL_Joystick *a, int b, SDL_bool c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetJoystickVirtualHat,(SDL_Joystick *a, int b, Uint8 c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetJoystickVirtualTouchpad,(SDL_Joystick *a, int b, int c, SDL_bool d, float e, float f, float g),(a,b,c,d,e,f,g),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetLinuxThreadPriority,(Sint64 a, int b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetLinuxThreadPriorityAndPolicy,(Sint64 a, int b, int c),(a,b,c),return) +SDL_DYNAPI_PROC(void,SDL_SetGamepadEventsEnabled,(bool a),(a),) +SDL_DYNAPI_PROC(bool,SDL_SetGamepadLED,(SDL_Gamepad *a, Uint8 b, Uint8 c, Uint8 d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_SetGamepadMapping,(SDL_JoystickID a, const char *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetGamepadPlayerIndex,(SDL_Gamepad *a, int b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetGamepadSensorEnabled,(SDL_Gamepad *a, SDL_SensorType b, bool c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SetHapticAutocenter,(SDL_Haptic *a, int b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetHapticGain,(SDL_Haptic *a, int b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetHint,(const char *a, const char *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetHintWithPriority,(const char *a, const char *b, SDL_HintPriority c),(a,b,c),return) +SDL_DYNAPI_PROC(void,SDL_SetJoystickEventsEnabled,(bool a),(a),) +SDL_DYNAPI_PROC(bool,SDL_SetJoystickLED,(SDL_Joystick *a, Uint8 b, Uint8 c, Uint8 d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_SetJoystickPlayerIndex,(SDL_Joystick *a, int b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetJoystickVirtualAxis,(SDL_Joystick *a, int b, Sint16 c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SetJoystickVirtualBall,(SDL_Joystick *a, int b, Sint16 c, Sint16 d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_SetJoystickVirtualButton,(SDL_Joystick *a, int b, bool c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SetJoystickVirtualHat,(SDL_Joystick *a, int b, Uint8 c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SetJoystickVirtualTouchpad,(SDL_Joystick *a, int b, int c, bool d, float e, float f, float g),(a,b,c,d,e,f,g),return) +SDL_DYNAPI_PROC(bool,SDL_SetLinuxThreadPriority,(Sint64 a, int b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetLinuxThreadPriorityAndPolicy,(Sint64 a, int b, int c),(a,b,c),return) SDL_DYNAPI_PROC(void,SDL_SetLogOutputFunction,(SDL_LogOutputFunction a, void *b),(a,b),) SDL_DYNAPI_PROC(void,SDL_SetLogPriorities,(SDL_LogPriority a),(a),) SDL_DYNAPI_PROC(void,SDL_SetLogPriority,(int a, SDL_LogPriority b),(a,b),) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetLogPriorityPrefix,(SDL_LogPriority a, const char *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetLogPriorityPrefix,(SDL_LogPriority a, const char *b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_SetMainReady,(void),(),) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetMemoryFunctions,(SDL_malloc_func a, SDL_calloc_func b, SDL_realloc_func c, SDL_free_func d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_SetMemoryFunctions,(SDL_malloc_func a, SDL_calloc_func b, SDL_realloc_func c, SDL_free_func d),(a,b,c,d),return) SDL_DYNAPI_PROC(void,SDL_SetModState,(SDL_Keymod a),(a),) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetNumberProperty,(SDL_PropertiesID a, const char *b, Sint64 c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetPaletteColors,(SDL_Palette *a, const SDL_Color *b, int c, int d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetPointerProperty,(SDL_PropertiesID a, const char *b, void *c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetPointerPropertyWithCleanup,(SDL_PropertiesID a, const char *b, void *c, SDL_CleanupPropertyCallback d, void *e),(a,b,c,d,e),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetPrimarySelectionText,(const char *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetRenderClipRect,(SDL_Renderer *a, const SDL_Rect *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetRenderColorScale,(SDL_Renderer *a, float b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetRenderDrawBlendMode,(SDL_Renderer *a, SDL_BlendMode b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetRenderDrawColor,(SDL_Renderer *a, Uint8 b, Uint8 c, Uint8 d, Uint8 e),(a,b,c,d,e),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetRenderDrawColorFloat,(SDL_Renderer *a, float b, float c, float d, float e),(a,b,c,d,e),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetRenderLogicalPresentation,(SDL_Renderer *a, int b, int c, SDL_RendererLogicalPresentation d, SDL_ScaleMode e),(a,b,c,d,e),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetRenderScale,(SDL_Renderer *a, float b, float c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetRenderTarget,(SDL_Renderer *a, SDL_Texture *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetRenderVSync,(SDL_Renderer *a, int b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetRenderViewport,(SDL_Renderer *a, const SDL_Rect *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetScancodeName,(SDL_Scancode a, const char *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetStringProperty,(SDL_PropertiesID a, const char *b, const char *c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetSurfaceAlphaMod,(SDL_Surface *a, Uint8 b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetSurfaceBlendMode,(SDL_Surface *a, SDL_BlendMode b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetSurfaceClipRect,(SDL_Surface *a, const SDL_Rect *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetSurfaceColorKey,(SDL_Surface *a, SDL_bool b, Uint32 c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetSurfaceColorMod,(SDL_Surface *a, Uint8 b, Uint8 c, Uint8 d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetSurfaceColorspace,(SDL_Surface *a, SDL_Colorspace b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetSurfacePalette,(SDL_Surface *a, SDL_Palette *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetSurfaceRLE,(SDL_Surface *a, SDL_bool b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetTLS,(SDL_TLSID *a, const void *b, SDL_TLSDestructorCallback c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetTextInputArea,(SDL_Window *a, const SDL_Rect *b, int c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetTextureAlphaMod,(SDL_Texture *a, Uint8 b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetTextureAlphaModFloat,(SDL_Texture *a, float b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetTextureBlendMode,(SDL_Texture *a, SDL_BlendMode b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetTextureColorMod,(SDL_Texture *a, Uint8 b, Uint8 c, Uint8 d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetTextureColorModFloat,(SDL_Texture *a, float b, float c, float d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetTextureScaleMode,(SDL_Texture *a, SDL_ScaleMode b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetThreadPriority,(SDL_ThreadPriority a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetWindowAlwaysOnTop,(SDL_Window *a, SDL_bool b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetWindowAspectRatio,(SDL_Window *a, float b, float c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetWindowBordered,(SDL_Window *a, SDL_bool b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetWindowFocusable,(SDL_Window *a, SDL_bool b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetWindowFullscreen,(SDL_Window *a, SDL_bool b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetWindowFullscreenMode,(SDL_Window *a, const SDL_DisplayMode *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetWindowHitTest,(SDL_Window *a, SDL_HitTest b, void *c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetWindowIcon,(SDL_Window *a, SDL_Surface *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetWindowKeyboardGrab,(SDL_Window *a, SDL_bool b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetWindowMaximumSize,(SDL_Window *a, int b, int c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetWindowMinimumSize,(SDL_Window *a, int b, int c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetWindowModal,(SDL_Window *a, SDL_bool b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetWindowMouseGrab,(SDL_Window *a, SDL_bool b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetWindowMouseRect,(SDL_Window *a, const SDL_Rect *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetWindowOpacity,(SDL_Window *a, float b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetWindowParent,(SDL_Window *a, SDL_Window *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetWindowPosition,(SDL_Window *a, int b, int c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetWindowRelativeMouseMode,(SDL_Window *a, SDL_bool b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetWindowResizable,(SDL_Window *a, SDL_bool b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetWindowShape,(SDL_Window *a, SDL_Surface *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetWindowSize,(SDL_Window *a, int b, int c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetWindowSurfaceVSync,(SDL_Window *a, int b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetWindowTitle,(SDL_Window *a, const char *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetNumberProperty,(SDL_PropertiesID a, const char *b, Sint64 c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SetPaletteColors,(SDL_Palette *a, const SDL_Color *b, int c, int d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_SetPointerProperty,(SDL_PropertiesID a, const char *b, void *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SetPointerPropertyWithCleanup,(SDL_PropertiesID a, const char *b, void *c, SDL_CleanupPropertyCallback d, void *e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(bool,SDL_SetPrimarySelectionText,(const char *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_SetRenderClipRect,(SDL_Renderer *a, const SDL_Rect *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetRenderColorScale,(SDL_Renderer *a, float b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetRenderDrawBlendMode,(SDL_Renderer *a, SDL_BlendMode b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetRenderDrawColor,(SDL_Renderer *a, Uint8 b, Uint8 c, Uint8 d, Uint8 e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(bool,SDL_SetRenderDrawColorFloat,(SDL_Renderer *a, float b, float c, float d, float e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(bool,SDL_SetRenderLogicalPresentation,(SDL_Renderer *a, int b, int c, SDL_RendererLogicalPresentation d, SDL_ScaleMode e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(bool,SDL_SetRenderScale,(SDL_Renderer *a, float b, float c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SetRenderTarget,(SDL_Renderer *a, SDL_Texture *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetRenderVSync,(SDL_Renderer *a, int b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetRenderViewport,(SDL_Renderer *a, const SDL_Rect *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetScancodeName,(SDL_Scancode a, const char *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetStringProperty,(SDL_PropertiesID a, const char *b, const char *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SetSurfaceAlphaMod,(SDL_Surface *a, Uint8 b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetSurfaceBlendMode,(SDL_Surface *a, SDL_BlendMode b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetSurfaceClipRect,(SDL_Surface *a, const SDL_Rect *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetSurfaceColorKey,(SDL_Surface *a, bool b, Uint32 c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SetSurfaceColorMod,(SDL_Surface *a, Uint8 b, Uint8 c, Uint8 d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_SetSurfaceColorspace,(SDL_Surface *a, SDL_Colorspace b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetSurfacePalette,(SDL_Surface *a, SDL_Palette *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetSurfaceRLE,(SDL_Surface *a, bool b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetTLS,(SDL_TLSID *a, const void *b, SDL_TLSDestructorCallback c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SetTextInputArea,(SDL_Window *a, const SDL_Rect *b, int c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SetTextureAlphaMod,(SDL_Texture *a, Uint8 b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetTextureAlphaModFloat,(SDL_Texture *a, float b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetTextureBlendMode,(SDL_Texture *a, SDL_BlendMode b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetTextureColorMod,(SDL_Texture *a, Uint8 b, Uint8 c, Uint8 d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_SetTextureColorModFloat,(SDL_Texture *a, float b, float c, float d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_SetTextureScaleMode,(SDL_Texture *a, SDL_ScaleMode b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetThreadPriority,(SDL_ThreadPriority a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_SetWindowAlwaysOnTop,(SDL_Window *a, bool b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetWindowAspectRatio,(SDL_Window *a, float b, float c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SetWindowBordered,(SDL_Window *a, bool b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetWindowFocusable,(SDL_Window *a, bool b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetWindowFullscreen,(SDL_Window *a, bool b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetWindowFullscreenMode,(SDL_Window *a, const SDL_DisplayMode *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetWindowHitTest,(SDL_Window *a, SDL_HitTest b, void *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SetWindowIcon,(SDL_Window *a, SDL_Surface *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetWindowKeyboardGrab,(SDL_Window *a, bool b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetWindowMaximumSize,(SDL_Window *a, int b, int c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SetWindowMinimumSize,(SDL_Window *a, int b, int c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SetWindowModal,(SDL_Window *a, bool b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetWindowMouseGrab,(SDL_Window *a, bool b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetWindowMouseRect,(SDL_Window *a, const SDL_Rect *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetWindowOpacity,(SDL_Window *a, float b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetWindowParent,(SDL_Window *a, SDL_Window *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetWindowPosition,(SDL_Window *a, int b, int c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SetWindowRelativeMouseMode,(SDL_Window *a, bool b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetWindowResizable,(SDL_Window *a, bool b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetWindowShape,(SDL_Window *a, SDL_Surface *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetWindowSize,(SDL_Window *a, int b, int c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_SetWindowSurfaceVSync,(SDL_Window *a, int b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_SetWindowTitle,(SDL_Window *a, const char *b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_SetWindowsMessageHook,(SDL_WindowsMessageHook a, void *b),(a,b),) SDL_DYNAPI_PROC(void,SDL_SetX11EventHook,(SDL_X11EventHook a, void *b),(a,b),) -SDL_DYNAPI_PROC(SDL_bool,SDL_SetiOSAnimationCallback,(SDL_Window *a, int b, SDL_iOSAnimationCallback c, void *d),(a,b,c,d),return) -SDL_DYNAPI_PROC(void,SDL_SetiOSEventPump,(SDL_bool a),(a),) -SDL_DYNAPI_PROC(SDL_bool,SDL_ShowAndroidToast,(const char *a, int b, int c, int d, int e),(a,b,c,d,e),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ShowCursor,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ShowMessageBox,(const SDL_MessageBoxData *a, int *b),(a,b),return) -SDL_DYNAPI_PROC(void,SDL_ShowOpenFileDialog,(SDL_DialogFileCallback a, void *b, SDL_Window *c, const SDL_DialogFileFilter *d, int e, const char *f, SDL_bool g),(a,b,c,d,e,f,g),) -SDL_DYNAPI_PROC(void,SDL_ShowOpenFolderDialog,(SDL_DialogFileCallback a, void *b, SDL_Window *c, const char *d, SDL_bool e),(a,b,c,d,e),) +SDL_DYNAPI_PROC(bool,SDL_SetiOSAnimationCallback,(SDL_Window *a, int b, SDL_iOSAnimationCallback c, void *d),(a,b,c,d),return) +SDL_DYNAPI_PROC(void,SDL_SetiOSEventPump,(bool a),(a),) +SDL_DYNAPI_PROC(bool,SDL_ShowAndroidToast,(const char *a, int b, int c, int d, int e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(bool,SDL_ShowCursor,(void),(),return) +SDL_DYNAPI_PROC(bool,SDL_ShowMessageBox,(const SDL_MessageBoxData *a, int *b),(a,b),return) +SDL_DYNAPI_PROC(void,SDL_ShowOpenFileDialog,(SDL_DialogFileCallback a, void *b, SDL_Window *c, const SDL_DialogFileFilter *d, int e, const char *f, bool g),(a,b,c,d,e,f,g),) +SDL_DYNAPI_PROC(void,SDL_ShowOpenFolderDialog,(SDL_DialogFileCallback a, void *b, SDL_Window *c, const char *d, bool e),(a,b,c,d,e),) SDL_DYNAPI_PROC(void,SDL_ShowSaveFileDialog,(SDL_DialogFileCallback a, void *b, SDL_Window *c, const SDL_DialogFileFilter *d, int e, const char *f),(a,b,c,d,e,f),) -SDL_DYNAPI_PROC(SDL_bool,SDL_ShowSimpleMessageBox,(SDL_MessageBoxFlags a, const char *b, const char *c, SDL_Window *d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ShowWindow,(SDL_Window *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_ShowWindowSystemMenu,(SDL_Window *a, int b, int c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_ShowSimpleMessageBox,(SDL_MessageBoxFlags a, const char *b, const char *c, SDL_Window *d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_ShowWindow,(SDL_Window *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_ShowWindowSystemMenu,(SDL_Window *a, int b, int c),(a,b,c),return) SDL_DYNAPI_PROC(void,SDL_SignalCondition,(SDL_Condition *a),(a),) SDL_DYNAPI_PROC(void,SDL_SignalSemaphore,(SDL_Semaphore *a),(a),) -SDL_DYNAPI_PROC(SDL_bool,SDL_StartTextInput,(SDL_Window *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_StartTextInputWithProperties,(SDL_Window *a, SDL_PropertiesID b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_StartTextInput,(SDL_Window *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_StartTextInputWithProperties,(SDL_Window *a, SDL_PropertiesID b),(a,b),return) SDL_DYNAPI_PROC(Uint32,SDL_StepUTF8,(const char **a, size_t *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_StopHapticEffect,(SDL_Haptic *a, int b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_StopHapticEffects,(SDL_Haptic *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_StopHapticRumble,(SDL_Haptic *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_StopTextInput,(SDL_Window *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_StorageReady,(SDL_Storage *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_StopHapticEffect,(SDL_Haptic *a, int b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_StopHapticEffects,(SDL_Haptic *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_StopHapticRumble,(SDL_Haptic *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_StopTextInput,(SDL_Window *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_StorageReady,(SDL_Storage *a),(a),return) SDL_DYNAPI_PROC(SDL_GUID,SDL_StringToGUID,(const char *a),(a),return) SDL_DYNAPI_PROC(void,SDL_SubmitGPUCommandBuffer,(SDL_GPUCommandBuffer *a),(a),) SDL_DYNAPI_PROC(SDL_GPUFence*,SDL_SubmitGPUCommandBufferAndAcquireFence,(SDL_GPUCommandBuffer *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SurfaceHasAlternateImages,(SDL_Surface *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SurfaceHasColorKey,(SDL_Surface *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SurfaceHasRLE,(SDL_Surface *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_SyncWindow,(SDL_Window *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_SurfaceHasAlternateImages,(SDL_Surface *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_SurfaceHasColorKey,(SDL_Surface *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_SurfaceHasRLE,(SDL_Surface *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_SyncWindow,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(Sint64,SDL_TellIO,(SDL_IOStream *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_TextInputActive,(SDL_Window *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_TextInputActive,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(SDL_Time,SDL_TimeFromWindows,(Uint32 a, Uint32 b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_TimeToDateTime,(SDL_Time a, SDL_DateTime *b, SDL_bool c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_TimeToDateTime,(SDL_Time a, SDL_DateTime *b, bool c),(a,b,c),return) SDL_DYNAPI_PROC(void,SDL_TimeToWindows,(SDL_Time a, Uint32 *b, Uint32 *c),(a,b,c),) -SDL_DYNAPI_PROC(SDL_bool,SDL_TryLockMutex,(SDL_Mutex *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_TryLockRWLockForReading,(SDL_RWLock *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_TryLockRWLockForWriting,(SDL_RWLock *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_TryLockSpinlock,(SDL_SpinLock *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_TryWaitSemaphore,(SDL_Semaphore *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_TryLockMutex,(SDL_Mutex *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_TryLockRWLockForReading,(SDL_RWLock *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_TryLockRWLockForWriting,(SDL_RWLock *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_TryLockSpinlock,(SDL_SpinLock *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_TryWaitSemaphore,(SDL_Semaphore *a),(a),return) SDL_DYNAPI_PROC(char*,SDL_UCS4ToUTF8,(Uint32 a, char *b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_UnbindAudioStream,(SDL_AudioStream *a),(a),) SDL_DYNAPI_PROC(void,SDL_UnbindAudioStreams,(SDL_AudioStream **a, int b),(a,b),) SDL_DYNAPI_PROC(void,SDL_UnloadObject,(void *a),(a),) -SDL_DYNAPI_PROC(SDL_bool,SDL_UnlockAudioStream,(SDL_AudioStream *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_UnlockAudioStream,(SDL_AudioStream *a),(a),return) SDL_DYNAPI_PROC(void,SDL_UnlockJoysticks,(void),(),) SDL_DYNAPI_PROC(void,SDL_UnlockMutex,(SDL_Mutex *a),(a),) SDL_DYNAPI_PROC(void,SDL_UnlockProperties,(SDL_PropertiesID a),(a),) @@ -980,59 +980,59 @@ SDL_DYNAPI_PROC(void,SDL_UnlockSurface,(SDL_Surface *a),(a),) SDL_DYNAPI_PROC(void,SDL_UnlockTexture,(SDL_Texture *a),(a),) SDL_DYNAPI_PROC(void,SDL_UnmapGPUTransferBuffer,(SDL_GPUDevice *a, SDL_GPUTransferBuffer *b),(a,b),) SDL_DYNAPI_PROC(void,SDL_UnregisterApp,(void),(),) -SDL_DYNAPI_PROC(SDL_bool,SDL_UnsetEnvironmentVariable,(SDL_Environment *a, const char *b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_UnsetEnvironmentVariable,(SDL_Environment *a, const char *b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_UpdateGamepads,(void),(),) -SDL_DYNAPI_PROC(SDL_bool,SDL_UpdateHapticEffect,(SDL_Haptic *a, int b, const SDL_HapticEffect *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_UpdateHapticEffect,(SDL_Haptic *a, int b, const SDL_HapticEffect *c),(a,b,c),return) SDL_DYNAPI_PROC(void,SDL_UpdateJoysticks,(void),(),) -SDL_DYNAPI_PROC(SDL_bool,SDL_UpdateNVTexture,(SDL_Texture *a, const SDL_Rect *b, const Uint8 *c, int d, const Uint8 *e, int f),(a,b,c,d,e,f),return) +SDL_DYNAPI_PROC(bool,SDL_UpdateNVTexture,(SDL_Texture *a, const SDL_Rect *b, const Uint8 *c, int d, const Uint8 *e, int f),(a,b,c,d,e,f),return) SDL_DYNAPI_PROC(void,SDL_UpdateSensors,(void),(),) -SDL_DYNAPI_PROC(SDL_bool,SDL_UpdateTexture,(SDL_Texture *a, const SDL_Rect *b, const void *c, int d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_UpdateWindowSurface,(SDL_Window *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_UpdateWindowSurfaceRects,(SDL_Window *a, const SDL_Rect *b, int c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_UpdateYUVTexture,(SDL_Texture *a, const SDL_Rect *b, const Uint8 *c, int d, const Uint8 *e, int f, const Uint8 *g, int h),(a,b,c,d,e,f,g,h),return) -SDL_DYNAPI_PROC(void,SDL_UploadToGPUBuffer,(SDL_GPUCopyPass *a, const SDL_GPUTransferBufferLocation *b, const SDL_GPUBufferRegion *c, SDL_bool d),(a,b,c,d),) -SDL_DYNAPI_PROC(void,SDL_UploadToGPUTexture,(SDL_GPUCopyPass *a, const SDL_GPUTextureTransferInfo *b, const SDL_GPUTextureRegion *c, SDL_bool d),(a,b,c,d),) -SDL_DYNAPI_PROC(SDL_bool,SDL_Vulkan_CreateSurface,(SDL_Window *a, VkInstance b, const struct VkAllocationCallbacks *c, VkSurfaceKHR *d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_UpdateTexture,(SDL_Texture *a, const SDL_Rect *b, const void *c, int d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_UpdateWindowSurface,(SDL_Window *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_UpdateWindowSurfaceRects,(SDL_Window *a, const SDL_Rect *b, int c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_UpdateYUVTexture,(SDL_Texture *a, const SDL_Rect *b, const Uint8 *c, int d, const Uint8 *e, int f, const Uint8 *g, int h),(a,b,c,d,e,f,g,h),return) +SDL_DYNAPI_PROC(void,SDL_UploadToGPUBuffer,(SDL_GPUCopyPass *a, const SDL_GPUTransferBufferLocation *b, const SDL_GPUBufferRegion *c, bool d),(a,b,c,d),) +SDL_DYNAPI_PROC(void,SDL_UploadToGPUTexture,(SDL_GPUCopyPass *a, const SDL_GPUTextureTransferInfo *b, const SDL_GPUTextureRegion *c, bool d),(a,b,c,d),) +SDL_DYNAPI_PROC(bool,SDL_Vulkan_CreateSurface,(SDL_Window *a, VkInstance b, const struct VkAllocationCallbacks *c, VkSurfaceKHR *d),(a,b,c,d),return) SDL_DYNAPI_PROC(void,SDL_Vulkan_DestroySurface,(VkInstance a, VkSurfaceKHR b, const struct VkAllocationCallbacks *c),(a,b,c),) SDL_DYNAPI_PROC(char const* const*,SDL_Vulkan_GetInstanceExtensions,(Uint32 *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_Vulkan_GetPresentationSupport,(VkInstance a, VkPhysicalDevice b, Uint32 c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_Vulkan_GetPresentationSupport,(VkInstance a, VkPhysicalDevice b, Uint32 c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_FunctionPointer,SDL_Vulkan_GetVkGetInstanceProcAddr,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_Vulkan_LoadLibrary,(const char *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_Vulkan_LoadLibrary,(const char *a),(a),return) SDL_DYNAPI_PROC(void,SDL_Vulkan_UnloadLibrary,(void),(),) SDL_DYNAPI_PROC(void,SDL_WaitCondition,(SDL_Condition *a, SDL_Mutex *b),(a,b),) -SDL_DYNAPI_PROC(SDL_bool,SDL_WaitConditionTimeout,(SDL_Condition *a, SDL_Mutex *b, Sint32 c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_WaitEvent,(SDL_Event *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_WaitEventTimeout,(SDL_Event *a, Sint32 b),(a,b),return) -SDL_DYNAPI_PROC(void,SDL_WaitForGPUFences,(SDL_GPUDevice *a, SDL_bool b, SDL_GPUFence *const *c, Uint32 d),(a,b,c,d),) +SDL_DYNAPI_PROC(bool,SDL_WaitConditionTimeout,(SDL_Condition *a, SDL_Mutex *b, Sint32 c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_WaitEvent,(SDL_Event *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_WaitEventTimeout,(SDL_Event *a, Sint32 b),(a,b),return) +SDL_DYNAPI_PROC(void,SDL_WaitForGPUFences,(SDL_GPUDevice *a, bool b, SDL_GPUFence *const *c, Uint32 d),(a,b,c,d),) SDL_DYNAPI_PROC(void,SDL_WaitForGPUIdle,(SDL_GPUDevice *a),(a),) -SDL_DYNAPI_PROC(SDL_bool,SDL_WaitProcess,(SDL_Process *a, SDL_bool b, int *c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_WaitProcess,(SDL_Process *a, bool b, int *c),(a,b,c),return) SDL_DYNAPI_PROC(void,SDL_WaitSemaphore,(SDL_Semaphore *a),(a),) -SDL_DYNAPI_PROC(SDL_bool,SDL_WaitSemaphoreTimeout,(SDL_Semaphore *a, Sint32 b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_WaitSemaphoreTimeout,(SDL_Semaphore *a, Sint32 b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_WaitThread,(SDL_Thread *a, int *b),(a,b),) -SDL_DYNAPI_PROC(SDL_bool,SDL_WarpMouseGlobal,(float a, float b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_WarpMouseGlobal,(float a, float b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_WarpMouseInWindow,(SDL_Window *a, float b, float c),(a,b,c),) SDL_DYNAPI_PROC(SDL_InitFlags,SDL_WasInit,(SDL_InitFlags a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_WindowHasSurface,(SDL_Window *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_WindowSupportsGPUPresentMode,(SDL_GPUDevice *a, SDL_Window *b, SDL_GPUPresentMode c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_WindowSupportsGPUSwapchainComposition,(SDL_GPUDevice *a, SDL_Window *b, SDL_GPUSwapchainComposition c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_WindowHasSurface,(SDL_Window *a),(a),return) +SDL_DYNAPI_PROC(bool,SDL_WindowSupportsGPUPresentMode,(SDL_GPUDevice *a, SDL_Window *b, SDL_GPUPresentMode c),(a,b,c),return) +SDL_DYNAPI_PROC(bool,SDL_WindowSupportsGPUSwapchainComposition,(SDL_GPUDevice *a, SDL_Window *b, SDL_GPUSwapchainComposition c),(a,b,c),return) SDL_DYNAPI_PROC(size_t,SDL_WriteIO,(SDL_IOStream *a, const void *b, size_t c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_WriteS16BE,(SDL_IOStream *a, Sint16 b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_WriteS16LE,(SDL_IOStream *a, Sint16 b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_WriteS32BE,(SDL_IOStream *a, Sint32 b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_WriteS32LE,(SDL_IOStream *a, Sint32 b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_WriteS64BE,(SDL_IOStream *a, Sint64 b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_WriteS64LE,(SDL_IOStream *a, Sint64 b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_WriteS8,(SDL_IOStream *a, Sint8 b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_WriteStorageFile,(SDL_Storage *a, const char *b, const void *c, Uint64 d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_WriteSurfacePixel,(SDL_Surface *a, int b, int c, Uint8 d, Uint8 e, Uint8 f, Uint8 g),(a,b,c,d,e,f,g),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_WriteSurfacePixelFloat,(SDL_Surface *a, int b, int c, float d, float e, float f, float g),(a,b,c,d,e,f,g),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_WriteU16BE,(SDL_IOStream *a, Uint16 b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_WriteU16LE,(SDL_IOStream *a, Uint16 b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_WriteU32BE,(SDL_IOStream *a, Uint32 b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_WriteU32LE,(SDL_IOStream *a, Uint32 b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_WriteU64BE,(SDL_IOStream *a, Uint64 b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_WriteU64LE,(SDL_IOStream *a, Uint64 b),(a,b),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_WriteU8,(SDL_IOStream *a, Uint8 b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_WriteS16BE,(SDL_IOStream *a, Sint16 b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_WriteS16LE,(SDL_IOStream *a, Sint16 b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_WriteS32BE,(SDL_IOStream *a, Sint32 b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_WriteS32LE,(SDL_IOStream *a, Sint32 b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_WriteS64BE,(SDL_IOStream *a, Sint64 b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_WriteS64LE,(SDL_IOStream *a, Sint64 b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_WriteS8,(SDL_IOStream *a, Sint8 b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_WriteStorageFile,(SDL_Storage *a, const char *b, const void *c, Uint64 d),(a,b,c,d),return) +SDL_DYNAPI_PROC(bool,SDL_WriteSurfacePixel,(SDL_Surface *a, int b, int c, Uint8 d, Uint8 e, Uint8 f, Uint8 g),(a,b,c,d,e,f,g),return) +SDL_DYNAPI_PROC(bool,SDL_WriteSurfacePixelFloat,(SDL_Surface *a, int b, int c, float d, float e, float f, float g),(a,b,c,d,e,f,g),return) +SDL_DYNAPI_PROC(bool,SDL_WriteU16BE,(SDL_IOStream *a, Uint16 b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_WriteU16LE,(SDL_IOStream *a, Uint16 b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_WriteU32BE,(SDL_IOStream *a, Uint32 b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_WriteU32LE,(SDL_IOStream *a, Uint32 b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_WriteU64BE,(SDL_IOStream *a, Uint64 b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_WriteU64LE,(SDL_IOStream *a, Uint64 b),(a,b),return) +SDL_DYNAPI_PROC(bool,SDL_WriteU8,(SDL_IOStream *a, Uint8 b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_abs,(int a),(a),return) SDL_DYNAPI_PROC(double,SDL_acos,(double a),(a),return) SDL_DYNAPI_PROC(float,SDL_acosf,(float a),(a),return) @@ -1068,7 +1068,7 @@ SDL_DYNAPI_PROC(float,SDL_fmodf,(float a, float b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_free,(void *a),(a),) SDL_DYNAPI_PROC(const char*,SDL_getenv,(const char *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_getenv_unsafe,(const char *a),(a),return) -SDL_DYNAPI_PROC(void,SDL_hid_ble_scan,(SDL_bool a),(a),) +SDL_DYNAPI_PROC(void,SDL_hid_ble_scan,(bool a),(a),) SDL_DYNAPI_PROC(int,SDL_hid_close,(SDL_hid_device *a),(a),return) SDL_DYNAPI_PROC(Uint32,SDL_hid_device_change_count,(void),(),return) SDL_DYNAPI_PROC(SDL_hid_device_info*,SDL_hid_enumerate,(unsigned short a, unsigned short b),(a,b),return) diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c index 437b39f48..81bed4459 100644 --- a/src/events/SDL_events.c +++ b/src/events/SDL_events.c @@ -1103,12 +1103,12 @@ int SDL_PeepEvents(SDL_Event *events, int numevents, SDL_EventAction action, return SDL_PeepEventsInternal(events, numevents, action, minType, maxType, false); } -SDL_bool SDL_HasEvent(Uint32 type) +bool SDL_HasEvent(Uint32 type) { return SDL_PeepEvents(NULL, 0, SDL_PEEKEVENT, type, type) > 0; } -SDL_bool SDL_HasEvents(Uint32 minType, Uint32 maxType) +bool SDL_HasEvents(Uint32 minType, Uint32 maxType) { return SDL_PeepEvents(NULL, 0, SDL_PEEKEVENT, minType, maxType) > 0; } @@ -1215,7 +1215,7 @@ void SDL_PumpEvents(void) // Public functions -SDL_bool SDL_PollEvent(SDL_Event *event) +bool SDL_PollEvent(SDL_Event *event) { return SDL_WaitEventTimeoutNS(event, 0); } @@ -1330,12 +1330,12 @@ static SDL_Window *SDL_find_active_window(SDL_VideoDevice *_this) #endif // !SDL_PLATFORM_ANDROID -SDL_bool SDL_WaitEvent(SDL_Event *event) +bool SDL_WaitEvent(SDL_Event *event) { return SDL_WaitEventTimeoutNS(event, -1); } -SDL_bool SDL_WaitEventTimeout(SDL_Event *event, Sint32 timeoutMS) +bool SDL_WaitEventTimeout(SDL_Event *event, Sint32 timeoutMS) { Sint64 timeoutNS; @@ -1347,7 +1347,7 @@ SDL_bool SDL_WaitEventTimeout(SDL_Event *event, Sint32 timeoutMS) return SDL_WaitEventTimeoutNS(event, timeoutNS); } -SDL_bool SDL_WaitEventTimeoutNS(SDL_Event *event, Sint64 timeoutNS) +bool SDL_WaitEventTimeoutNS(SDL_Event *event, Sint64 timeoutNS) { Uint64 start, expiration; bool include_sentinel = (timeoutNS == 0); @@ -1500,7 +1500,7 @@ static bool SDL_CallEventWatchers(SDL_Event *event) return true; } -SDL_bool SDL_PushEvent(SDL_Event *event) +bool SDL_PushEvent(SDL_Event *event) { if (!event->common.timestamp) { event->common.timestamp = SDL_GetTicksNS(); @@ -1543,7 +1543,7 @@ void SDL_SetEventFilter(SDL_EventFilter filter, void *userdata) SDL_UnlockMutex(SDL_event_watchers_lock); } -SDL_bool SDL_GetEventFilter(SDL_EventFilter *filter, void **userdata) +bool SDL_GetEventFilter(SDL_EventFilter *filter, void **userdata) { SDL_EventWatcher event_ok; @@ -1562,7 +1562,7 @@ SDL_bool SDL_GetEventFilter(SDL_EventFilter *filter, void **userdata) return event_ok.callback ? true : false; } -SDL_bool SDL_AddEventWatch(SDL_EventFilter filter, void *userdata) +bool SDL_AddEventWatch(SDL_EventFilter filter, void *userdata) { bool result = true; @@ -1628,7 +1628,7 @@ void SDL_FilterEvents(SDL_EventFilter filter, void *userdata) SDL_UnlockMutex(SDL_EventQ.lock); } -void SDL_SetEventEnabled(Uint32 type, SDL_bool enabled) +void SDL_SetEventEnabled(Uint32 type, bool enabled) { bool current_state; Uint8 hi = ((type >> 8) & 0xff); @@ -1641,7 +1641,7 @@ void SDL_SetEventEnabled(Uint32 type, SDL_bool enabled) current_state = true; } - if ((enabled != SDL_FALSE) != current_state) { + if ((enabled != false) != current_state) { if (enabled) { SDL_assert(SDL_disabled_events[hi] != NULL); SDL_disabled_events[hi]->bits[lo / 32] &= ~(1 << (lo & 31)); @@ -1688,7 +1688,7 @@ void SDL_SetEventEnabled(Uint32 type, SDL_bool enabled) } } -SDL_bool SDL_EventEnabled(Uint32 type) +bool SDL_EventEnabled(Uint32 type) { Uint8 hi = ((type >> 8) & 0xff); Uint8 lo = (type & 0xff); diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index 3ba9da7ec..2e7dcb839 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -54,7 +54,7 @@ typedef struct SDL_Keyboard SDL_Window *focus; SDL_Keymod modstate; Uint8 keysource[SDL_SCANCODE_COUNT]; - SDL_bool keystate[SDL_SCANCODE_COUNT]; + bool keystate[SDL_SCANCODE_COUNT]; SDL_Keymap *keymap; bool french_numbers; bool latin_letters; @@ -173,7 +173,7 @@ void SDL_RemoveKeyboard(SDL_KeyboardID keyboardID, bool send_event) } } -SDL_bool SDL_HasKeyboard(void) +bool SDL_HasKeyboard(void) { return (SDL_keyboard_count > 0); } @@ -453,7 +453,7 @@ static SDL_Keycode SDL_ConvertNumpadKeycode(SDL_Keycode keycode, bool numlock) } } -SDL_Keycode SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate, SDL_bool key_event) +SDL_Keycode SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate, bool key_event) { SDL_Keyboard *keyboard = &SDL_keyboard; @@ -863,7 +863,7 @@ void SDL_QuitKeyboard(void) SDL_KeycodeOptionsChanged, &SDL_keyboard); } -const SDL_bool *SDL_GetKeyboardState(int *numkeys) +const bool *SDL_GetKeyboardState(int *numkeys) { SDL_Keyboard *keyboard = &SDL_keyboard; diff --git a/src/events/SDL_keymap.c b/src/events/SDL_keymap.c index 644688698..eb1e0973c 100644 --- a/src/events/SDL_keymap.c +++ b/src/events/SDL_keymap.c @@ -933,7 +933,7 @@ static const char *SDL_scancode_names[SDL_SCANCODE_COUNT] = /* 290 */ "EndCall", }; -SDL_bool SDL_SetScancodeName(SDL_Scancode scancode, const char *name) +bool SDL_SetScancodeName(SDL_Scancode scancode, const char *name) { if (((int)scancode) < SDL_SCANCODE_UNKNOWN || scancode >= SDL_SCANCODE_COUNT) { return SDL_InvalidParamError("scancode"); diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c index ac6835e3c..80a3c6329 100644 --- a/src/events/SDL_mouse.c +++ b/src/events/SDL_mouse.c @@ -356,7 +356,7 @@ void SDL_RemoveMouse(SDL_MouseID mouseID, bool send_event) } } -SDL_bool SDL_HasMouse(void) +bool SDL_HasMouse(void) { return (SDL_mouse_count > 0); } @@ -1305,7 +1305,7 @@ void SDL_WarpMouseInWindow(SDL_Window *window, float x, float y) SDL_PerformWarpMouseInWindow(window, x, y, mouse->warp_emulation_active); } -SDL_bool SDL_WarpMouseGlobal(float x, float y) +bool SDL_WarpMouseGlobal(float x, float y) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -1462,7 +1462,7 @@ bool SDL_UpdateMouseCapture(bool force_release) return true; } -SDL_bool SDL_CaptureMouse(SDL_bool enabled) +bool SDL_CaptureMouse(bool enabled) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -1602,7 +1602,7 @@ SDL_Cursor *SDL_CreateSystemCursor(SDL_SystemCursor id) if this is desired for any reason. This is used when setting the video mode and when the SDL window gains the mouse focus. */ -SDL_bool SDL_SetCursor(SDL_Cursor *cursor) +bool SDL_SetCursor(SDL_Cursor *cursor) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -1701,7 +1701,7 @@ void SDL_DestroyCursor(SDL_Cursor *cursor) } } -SDL_bool SDL_ShowCursor(void) +bool SDL_ShowCursor(void) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -1717,7 +1717,7 @@ SDL_bool SDL_ShowCursor(void) return true; } -SDL_bool SDL_HideCursor(void) +bool SDL_HideCursor(void) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -1728,7 +1728,7 @@ SDL_bool SDL_HideCursor(void) return true; } -SDL_bool SDL_CursorVisible(void) +bool SDL_CursorVisible(void) { SDL_Mouse *mouse = SDL_GetMouse(); diff --git a/src/events/SDL_pen.c b/src/events/SDL_pen.c index 16b2195d9..9d234efa8 100644 --- a/src/events/SDL_pen.c +++ b/src/events/SDL_pen.c @@ -142,7 +142,7 @@ const char *SDL_GetPenName(SDL_PenID instance_id) return result; } -SDL_bool SDL_GetPenInfo(SDL_PenID instance_id, SDL_PenInfo *info) +bool SDL_GetPenInfo(SDL_PenID instance_id, SDL_PenInfo *info) { SDL_LockRWLockForReading(pen_device_rwlock); const SDL_Pen *pen = FindPenByInstanceId(instance_id); diff --git a/src/events/SDL_windowevents.c b/src/events/SDL_windowevents.c index 82b39939a..01a09ab7e 100644 --- a/src/events/SDL_windowevents.c +++ b/src/events/SDL_windowevents.c @@ -26,7 +26,7 @@ #include "SDL_mouse_c.h" -static SDL_bool SDLCALL RemoveSupercededWindowEvents(void *userdata, SDL_Event *event) +static bool SDLCALL RemoveSupercededWindowEvents(void *userdata, SDL_Event *event) { SDL_Event *new_event = (SDL_Event *)userdata; diff --git a/src/file/SDL_iostream.c b/src/file/SDL_iostream.c index 41ac90fd8..bb14e090a 100644 --- a/src/file/SDL_iostream.c +++ b/src/file/SDL_iostream.c @@ -275,7 +275,7 @@ static size_t SDLCALL windows_file_write(void *userdata, const void *ptr, size_t return bytes; } -static SDL_bool SDLCALL windows_file_close(void *userdata) +static bool SDLCALL windows_file_close(void *userdata) { IOStreamWindowsData *iodata = (IOStreamWindowsData *) userdata; if (iodata->h != INVALID_HANDLE_VALUE) { @@ -451,7 +451,7 @@ static size_t SDLCALL stdio_write(void *userdata, const void *ptr, size_t size, return bytes; } -static SDL_bool SDLCALL stdio_flush(void *userdata, SDL_IOStatus *status) +static bool SDLCALL stdio_flush(void *userdata, SDL_IOStatus *status) { IOStreamStdioData *iodata = (IOStreamStdioData *) userdata; if (fflush(iodata->fp) != 0) { @@ -465,7 +465,7 @@ static SDL_bool SDLCALL stdio_flush(void *userdata, SDL_IOStatus *status) return true; } -static SDL_bool SDLCALL stdio_close(void *userdata) +static bool SDLCALL stdio_close(void *userdata) { IOStreamStdioData *iodata = (IOStreamStdioData *) userdata; bool status = true; @@ -583,7 +583,7 @@ static size_t SDLCALL mem_write(void *userdata, const void *ptr, size_t size, SD return mem_io(userdata, iodata->here, ptr, size); } -static SDL_bool SDLCALL mem_close(void *userdata) +static bool SDLCALL mem_close(void *userdata) { SDL_free(userdata); return true; @@ -851,7 +851,7 @@ static size_t SDLCALL dynamic_mem_write(void *userdata, const void *ptr, size_t return mem_io(&iodata->data, iodata->data.here, ptr, size); } -static SDL_bool SDLCALL dynamic_mem_close(void *userdata) +static bool SDLCALL dynamic_mem_close(void *userdata) { const IOStreamDynamicMemData *iodata = (IOStreamDynamicMemData *) userdata; void *mem = SDL_GetPointerProperty(SDL_GetIOProperties(iodata->stream), SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL); @@ -915,7 +915,7 @@ SDL_IOStream *SDL_OpenIO(const SDL_IOStreamInterface *iface, void *userdata) return iostr; } -SDL_bool SDL_CloseIO(SDL_IOStream *iostr) +bool SDL_CloseIO(SDL_IOStream *iostr) { bool result = true; if (iostr) { @@ -929,7 +929,7 @@ SDL_bool SDL_CloseIO(SDL_IOStream *iostr) } // Load all the data from an SDL data stream -void *SDL_LoadFile_IO(SDL_IOStream *src, size_t *datasize, SDL_bool closeio) +void *SDL_LoadFile_IO(SDL_IOStream *src, size_t *datasize, bool closeio) { const int FILE_CHUNK_SIZE = 1024; Sint64 size, size_total = 0; @@ -1148,7 +1148,7 @@ size_t SDL_IOvprintf(SDL_IOStream *context, SDL_PRINTF_FORMAT_STRING const char return bytes; } -SDL_bool SDL_FlushIO(SDL_IOStream *context) +bool SDL_FlushIO(SDL_IOStream *context) { bool result = true; @@ -1170,7 +1170,7 @@ SDL_bool SDL_FlushIO(SDL_IOStream *context) // Functions for dynamically reading and writing endian-specific values -SDL_bool SDL_ReadU8(SDL_IOStream *src, Uint8 *value) +bool SDL_ReadU8(SDL_IOStream *src, Uint8 *value) { Uint8 data = 0; bool result = false; @@ -1184,7 +1184,7 @@ SDL_bool SDL_ReadU8(SDL_IOStream *src, Uint8 *value) return result; } -SDL_bool SDL_ReadS8(SDL_IOStream *src, Sint8 *value) +bool SDL_ReadS8(SDL_IOStream *src, Sint8 *value) { Sint8 data = 0; bool result = false; @@ -1198,7 +1198,7 @@ SDL_bool SDL_ReadS8(SDL_IOStream *src, Sint8 *value) return result; } -SDL_bool SDL_ReadU16LE(SDL_IOStream *src, Uint16 *value) +bool SDL_ReadU16LE(SDL_IOStream *src, Uint16 *value) { Uint16 data = 0; bool result = false; @@ -1212,12 +1212,12 @@ SDL_bool SDL_ReadU16LE(SDL_IOStream *src, Uint16 *value) return result; } -SDL_bool SDL_ReadS16LE(SDL_IOStream *src, Sint16 *value) +bool SDL_ReadS16LE(SDL_IOStream *src, Sint16 *value) { return SDL_ReadU16LE(src, (Uint16 *)value); } -SDL_bool SDL_ReadU16BE(SDL_IOStream *src, Uint16 *value) +bool SDL_ReadU16BE(SDL_IOStream *src, Uint16 *value) { Uint16 data = 0; bool result = false; @@ -1231,12 +1231,12 @@ SDL_bool SDL_ReadU16BE(SDL_IOStream *src, Uint16 *value) return result; } -SDL_bool SDL_ReadS16BE(SDL_IOStream *src, Sint16 *value) +bool SDL_ReadS16BE(SDL_IOStream *src, Sint16 *value) { return SDL_ReadU16BE(src, (Uint16 *)value); } -SDL_bool SDL_ReadU32LE(SDL_IOStream *src, Uint32 *value) +bool SDL_ReadU32LE(SDL_IOStream *src, Uint32 *value) { Uint32 data = 0; bool result = false; @@ -1250,12 +1250,12 @@ SDL_bool SDL_ReadU32LE(SDL_IOStream *src, Uint32 *value) return result; } -SDL_bool SDL_ReadS32LE(SDL_IOStream *src, Sint32 *value) +bool SDL_ReadS32LE(SDL_IOStream *src, Sint32 *value) { return SDL_ReadU32LE(src, (Uint32 *)value); } -SDL_bool SDL_ReadU32BE(SDL_IOStream *src, Uint32 *value) +bool SDL_ReadU32BE(SDL_IOStream *src, Uint32 *value) { Uint32 data = 0; bool result = false; @@ -1269,12 +1269,12 @@ SDL_bool SDL_ReadU32BE(SDL_IOStream *src, Uint32 *value) return result; } -SDL_bool SDL_ReadS32BE(SDL_IOStream *src, Sint32 *value) +bool SDL_ReadS32BE(SDL_IOStream *src, Sint32 *value) { return SDL_ReadU32BE(src, (Uint32 *)value); } -SDL_bool SDL_ReadU64LE(SDL_IOStream *src, Uint64 *value) +bool SDL_ReadU64LE(SDL_IOStream *src, Uint64 *value) { Uint64 data = 0; bool result = false; @@ -1288,12 +1288,12 @@ SDL_bool SDL_ReadU64LE(SDL_IOStream *src, Uint64 *value) return result; } -SDL_bool SDL_ReadS64LE(SDL_IOStream *src, Sint64 *value) +bool SDL_ReadS64LE(SDL_IOStream *src, Sint64 *value) { return SDL_ReadU64LE(src, (Uint64 *)value); } -SDL_bool SDL_ReadU64BE(SDL_IOStream *src, Uint64 *value) +bool SDL_ReadU64BE(SDL_IOStream *src, Uint64 *value) { Uint64 data = 0; bool result = false; @@ -1307,83 +1307,83 @@ SDL_bool SDL_ReadU64BE(SDL_IOStream *src, Uint64 *value) return result; } -SDL_bool SDL_ReadS64BE(SDL_IOStream *src, Sint64 *value) +bool SDL_ReadS64BE(SDL_IOStream *src, Sint64 *value) { return SDL_ReadU64BE(src, (Uint64 *)value); } -SDL_bool SDL_WriteU8(SDL_IOStream *dst, Uint8 value) +bool SDL_WriteU8(SDL_IOStream *dst, Uint8 value) { return (SDL_WriteIO(dst, &value, sizeof(value)) == sizeof(value)); } -SDL_bool SDL_WriteS8(SDL_IOStream *dst, Sint8 value) +bool SDL_WriteS8(SDL_IOStream *dst, Sint8 value) { return (SDL_WriteIO(dst, &value, sizeof(value)) == sizeof(value)); } -SDL_bool SDL_WriteU16LE(SDL_IOStream *dst, Uint16 value) +bool SDL_WriteU16LE(SDL_IOStream *dst, Uint16 value) { const Uint16 swapped = SDL_Swap16LE(value); return (SDL_WriteIO(dst, &swapped, sizeof(swapped)) == sizeof(swapped)); } -SDL_bool SDL_WriteS16LE(SDL_IOStream *dst, Sint16 value) +bool SDL_WriteS16LE(SDL_IOStream *dst, Sint16 value) { return SDL_WriteU16LE(dst, (Uint16)value); } -SDL_bool SDL_WriteU16BE(SDL_IOStream *dst, Uint16 value) +bool SDL_WriteU16BE(SDL_IOStream *dst, Uint16 value) { const Uint16 swapped = SDL_Swap16BE(value); return (SDL_WriteIO(dst, &swapped, sizeof(swapped)) == sizeof(swapped)); } -SDL_bool SDL_WriteS16BE(SDL_IOStream *dst, Sint16 value) +bool SDL_WriteS16BE(SDL_IOStream *dst, Sint16 value) { return SDL_WriteU16BE(dst, (Uint16)value); } -SDL_bool SDL_WriteU32LE(SDL_IOStream *dst, Uint32 value) +bool SDL_WriteU32LE(SDL_IOStream *dst, Uint32 value) { const Uint32 swapped = SDL_Swap32LE(value); return (SDL_WriteIO(dst, &swapped, sizeof(swapped)) == sizeof(swapped)); } -SDL_bool SDL_WriteS32LE(SDL_IOStream *dst, Sint32 value) +bool SDL_WriteS32LE(SDL_IOStream *dst, Sint32 value) { return SDL_WriteU32LE(dst, (Uint32)value); } -SDL_bool SDL_WriteU32BE(SDL_IOStream *dst, Uint32 value) +bool SDL_WriteU32BE(SDL_IOStream *dst, Uint32 value) { const Uint32 swapped = SDL_Swap32BE(value); return (SDL_WriteIO(dst, &swapped, sizeof(swapped)) == sizeof(swapped)); } -SDL_bool SDL_WriteS32BE(SDL_IOStream *dst, Sint32 value) +bool SDL_WriteS32BE(SDL_IOStream *dst, Sint32 value) { return SDL_WriteU32BE(dst, (Uint32)value); } -SDL_bool SDL_WriteU64LE(SDL_IOStream *dst, Uint64 value) +bool SDL_WriteU64LE(SDL_IOStream *dst, Uint64 value) { const Uint64 swapped = SDL_Swap64LE(value); return (SDL_WriteIO(dst, &swapped, sizeof(swapped)) == sizeof(swapped)); } -SDL_bool SDL_WriteS64LE(SDL_IOStream *dst, Sint64 value) +bool SDL_WriteS64LE(SDL_IOStream *dst, Sint64 value) { return SDL_WriteU64LE(dst, (Uint64)value); } -SDL_bool SDL_WriteU64BE(SDL_IOStream *dst, Uint64 value) +bool SDL_WriteU64BE(SDL_IOStream *dst, Uint64 value) { const Uint64 swapped = SDL_Swap64BE(value); return (SDL_WriteIO(dst, &swapped, sizeof(swapped)) == sizeof(swapped)); } -SDL_bool SDL_WriteS64BE(SDL_IOStream *dst, Sint64 value) +bool SDL_WriteS64BE(SDL_IOStream *dst, Sint64 value) { return SDL_WriteU64BE(dst, (Uint64)value); } diff --git a/src/filesystem/SDL_filesystem.c b/src/filesystem/SDL_filesystem.c index 775c9f852..69056148e 100644 --- a/src/filesystem/SDL_filesystem.c +++ b/src/filesystem/SDL_filesystem.c @@ -25,7 +25,7 @@ #include "SDL_sysfilesystem.h" #include "../stdlib/SDL_sysstdlib.h" -SDL_bool SDL_RemovePath(const char *path) +bool SDL_RemovePath(const char *path) { if (!path) { return SDL_InvalidParamError("path"); @@ -33,7 +33,7 @@ SDL_bool SDL_RemovePath(const char *path) return SDL_SYS_RemovePath(path); } -SDL_bool SDL_RenamePath(const char *oldpath, const char *newpath) +bool SDL_RenamePath(const char *oldpath, const char *newpath) { if (!oldpath) { return SDL_InvalidParamError("oldpath"); @@ -43,7 +43,7 @@ SDL_bool SDL_RenamePath(const char *oldpath, const char *newpath) return SDL_SYS_RenamePath(oldpath, newpath); } -SDL_bool SDL_CopyFile(const char *oldpath, const char *newpath) +bool SDL_CopyFile(const char *oldpath, const char *newpath) { if (!oldpath) { return SDL_InvalidParamError("oldpath"); @@ -53,7 +53,7 @@ SDL_bool SDL_CopyFile(const char *oldpath, const char *newpath) return SDL_SYS_CopyFile(oldpath, newpath); } -SDL_bool SDL_CreateDirectory(const char *path) +bool SDL_CreateDirectory(const char *path) { // TODO: Recursively create subdirectories if (!path) { @@ -62,7 +62,7 @@ SDL_bool SDL_CreateDirectory(const char *path) return SDL_SYS_CreateDirectory(path); } -SDL_bool SDL_EnumerateDirectory(const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata) +bool SDL_EnumerateDirectory(const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata) { if (!path) { return SDL_InvalidParamError("path"); @@ -75,7 +75,7 @@ SDL_bool SDL_EnumerateDirectory(const char *path, SDL_EnumerateDirectoryCallback return true; } -SDL_bool SDL_GetPathInfo(const char *path, SDL_PathInfo *info) +bool SDL_GetPathInfo(const char *path, SDL_PathInfo *info) { SDL_PathInfo dummy; @@ -399,12 +399,12 @@ char **SDL_InternalGlobDirectory(const char *path, const char *pattern, SDL_Glob return result; } -static SDL_bool GlobDirectoryGetPathInfo(const char *path, SDL_PathInfo *info, void *userdata) +static bool GlobDirectoryGetPathInfo(const char *path, SDL_PathInfo *info, void *userdata) { return SDL_GetPathInfo(path, info); } -static SDL_bool GlobDirectoryEnumerator(const char *path, SDL_EnumerateDirectoryCallback cb, void *cbuserdata, void *userdata) +static bool GlobDirectoryEnumerator(const char *path, SDL_EnumerateDirectoryCallback cb, void *cbuserdata, void *userdata) { return SDL_EnumerateDirectory(path, cb, cbuserdata); } diff --git a/src/filesystem/SDL_sysfilesystem.h b/src/filesystem/SDL_sysfilesystem.h index 615f39476..c35035bce 100644 --- a/src/filesystem/SDL_sysfilesystem.h +++ b/src/filesystem/SDL_sysfilesystem.h @@ -34,8 +34,8 @@ extern bool SDL_SYS_CopyFile(const char *oldpath, const char *newpath); extern bool SDL_SYS_CreateDirectory(const char *path); extern bool SDL_SYS_GetPathInfo(const char *path, SDL_PathInfo *info); -typedef SDL_bool (*SDL_GlobEnumeratorFunc)(const char *path, SDL_EnumerateDirectoryCallback cb, void *cbuserdata, void *userdata); -typedef SDL_bool (*SDL_GlobGetPathInfoFunc)(const char *path, SDL_PathInfo *info, void *userdata); +typedef bool (*SDL_GlobEnumeratorFunc)(const char *path, SDL_EnumerateDirectoryCallback cb, void *cbuserdata, void *userdata); +typedef bool (*SDL_GlobGetPathInfoFunc)(const char *path, SDL_PathInfo *info, void *userdata); extern char **SDL_InternalGlobDirectory(const char *path, const char *pattern, SDL_GlobFlags flags, int *count, SDL_GlobEnumeratorFunc enumerator, SDL_GlobGetPathInfoFunc getpathinfo, void *userdata); #endif diff --git a/src/gpu/SDL_gpu.c b/src/gpu/SDL_gpu.c index 02a5eb23c..935137fea 100644 --- a/src/gpu/SDL_gpu.c +++ b/src/gpu/SDL_gpu.c @@ -225,7 +225,7 @@ SDL_GPUGraphicsPipeline *SDL_GPU_FetchBlitPipeline( } blit_pipeline_create_info.multisample_state.sample_count = SDL_GPU_SAMPLECOUNT_1; - blit_pipeline_create_info.multisample_state.enable_mask = SDL_FALSE; + blit_pipeline_create_info.multisample_state.enable_mask = false; blit_pipeline_create_info.primitive_type = SDL_GPU_PRIMITIVETYPE_TRIANGLELIST; @@ -442,7 +442,7 @@ static const SDL_GPUBootstrap * SDL_GPUSelectBackend(SDL_PropertiesID props) static void SDL_GPU_FillProperties( SDL_PropertiesID props, SDL_GPUShaderFormat format_flags, - SDL_bool debug_mode, + bool debug_mode, const char *name) { if (format_flags & SDL_GPU_SHADERFORMAT_PRIVATE) { @@ -468,36 +468,36 @@ static void SDL_GPU_FillProperties( } #endif // SDL_GPU_DISABLED -SDL_bool SDL_GPUSupportsShaderFormats( +bool SDL_GPUSupportsShaderFormats( SDL_GPUShaderFormat format_flags, const char *name) { #ifndef SDL_GPU_DISABLED bool result; SDL_PropertiesID props = SDL_CreateProperties(); - SDL_GPU_FillProperties(props, format_flags, SDL_FALSE, name); + SDL_GPU_FillProperties(props, format_flags, false, name); result = SDL_GPUSupportsProperties(props); SDL_DestroyProperties(props); return result; #else SDL_SetError("SDL not built with GPU support"); - return SDL_FALSE; + return false; #endif } -SDL_bool SDL_GPUSupportsProperties(SDL_PropertiesID props) +bool SDL_GPUSupportsProperties(SDL_PropertiesID props) { #ifndef SDL_GPU_DISABLED return (SDL_GPUSelectBackend(props) != NULL); #else SDL_SetError("SDL not built with GPU support"); - return SDL_FALSE; + return false; #endif } SDL_GPUDevice *SDL_CreateGPUDevice( SDL_GPUShaderFormat format_flags, - SDL_bool debug_mode, + bool debug_mode, const char *name) { #ifndef SDL_GPU_DISABLED @@ -641,7 +641,7 @@ Uint32 SDL_GPUTextureFormatTexelBlockSize( } } -SDL_bool SDL_GPUTextureSupportsFormat( +bool SDL_GPUTextureSupportsFormat( SDL_GPUDevice *device, SDL_GPUTextureFormat format, SDL_GPUTextureType type, @@ -660,7 +660,7 @@ SDL_bool SDL_GPUTextureSupportsFormat( usage); } -SDL_bool SDL_GPUTextureSupportsSampleCount( +bool SDL_GPUTextureSupportsSampleCount( SDL_GPUDevice *device, SDL_GPUTextureFormat format, SDL_GPUSampleCount sample_count) @@ -2074,7 +2074,7 @@ void SDL_EndGPUComputePass( void *SDL_MapGPUTransferBuffer( SDL_GPUDevice *device, SDL_GPUTransferBuffer *transfer_buffer, - SDL_bool cycle) + bool cycle) { CHECK_DEVICE_MAGIC(device, NULL); if (transfer_buffer == NULL) { @@ -2132,7 +2132,7 @@ void SDL_UploadToGPUTexture( SDL_GPUCopyPass *copy_pass, const SDL_GPUTextureTransferInfo *source, const SDL_GPUTextureRegion *destination, - SDL_bool cycle) + bool cycle) { if (copy_pass == NULL) { SDL_InvalidParamError("copy_pass"); @@ -2170,7 +2170,7 @@ void SDL_UploadToGPUBuffer( SDL_GPUCopyPass *copy_pass, const SDL_GPUTransferBufferLocation *source, const SDL_GPUBufferRegion *destination, - SDL_bool cycle) + bool cycle) { if (copy_pass == NULL) { SDL_InvalidParamError("copy_pass"); @@ -2211,7 +2211,7 @@ void SDL_CopyGPUTextureToTexture( Uint32 w, Uint32 h, Uint32 d, - SDL_bool cycle) + bool cycle) { if (copy_pass == NULL) { SDL_InvalidParamError("copy_pass"); @@ -2253,7 +2253,7 @@ void SDL_CopyGPUBufferToBuffer( const SDL_GPUBufferLocation *source, const SDL_GPUBufferLocation *destination, Uint32 size, - SDL_bool cycle) + bool cycle) { if (copy_pass == NULL) { SDL_InvalidParamError("copy_pass"); @@ -2475,7 +2475,7 @@ void SDL_BlitGPUTexture( // Submission/Presentation -SDL_bool SDL_WindowSupportsGPUSwapchainComposition( +bool SDL_WindowSupportsGPUSwapchainComposition( SDL_GPUDevice *device, SDL_Window *window, SDL_GPUSwapchainComposition swapchain_composition) @@ -2496,7 +2496,7 @@ SDL_bool SDL_WindowSupportsGPUSwapchainComposition( swapchain_composition); } -SDL_bool SDL_WindowSupportsGPUPresentMode( +bool SDL_WindowSupportsGPUPresentMode( SDL_GPUDevice *device, SDL_Window *window, SDL_GPUPresentMode present_mode) @@ -2517,7 +2517,7 @@ SDL_bool SDL_WindowSupportsGPUPresentMode( present_mode); } -SDL_bool SDL_ClaimWindowForGPUDevice( +bool SDL_ClaimWindowForGPUDevice( SDL_GPUDevice *device, SDL_Window *window) { @@ -2547,7 +2547,7 @@ void SDL_ReleaseWindowFromGPUDevice( window); } -SDL_bool SDL_SetGPUSwapchainParameters( +bool SDL_SetGPUSwapchainParameters( SDL_GPUDevice *device, SDL_Window *window, SDL_GPUSwapchainComposition swapchain_composition, @@ -2686,7 +2686,7 @@ void SDL_WaitForGPUIdle( void SDL_WaitForGPUFences( SDL_GPUDevice *device, - SDL_bool wait_all, + bool wait_all, SDL_GPUFence *const *fences, Uint32 num_fences) { @@ -2703,7 +2703,7 @@ void SDL_WaitForGPUFences( num_fences); } -SDL_bool SDL_QueryGPUFence( +bool SDL_QueryGPUFence( SDL_GPUDevice *device, SDL_GPUFence *fence) { diff --git a/src/gpu/d3d11/SDL_gpu_d3d11.c b/src/gpu/d3d11/SDL_gpu_d3d11.c index 8dfaf3efb..25be9a19c 100644 --- a/src/gpu/d3d11/SDL_gpu_d3d11.c +++ b/src/gpu/d3d11/SDL_gpu_d3d11.c @@ -6008,7 +6008,7 @@ static void D3D11_INTERNAL_InitBlitPipelines( blitPipelineCreateInfo.fragment_shader = blitFrom2DPixelShader; blitPipelineCreateInfo.multisample_state.sample_count = SDL_GPU_SAMPLECOUNT_1; - blitPipelineCreateInfo.multisample_state.enable_mask = SDL_FALSE; + blitPipelineCreateInfo.multisample_state.enable_mask = false; blitPipelineCreateInfo.primitive_type = SDL_GPU_PRIMITIVETYPE_TRIANGLELIST; diff --git a/src/gpu/vulkan/SDL_gpu_vulkan.c b/src/gpu/vulkan/SDL_gpu_vulkan.c index ff9237d5d..6e215b908 100644 --- a/src/gpu/vulkan/SDL_gpu_vulkan.c +++ b/src/gpu/vulkan/SDL_gpu_vulkan.c @@ -9355,7 +9355,7 @@ static WindowData *VULKAN_INTERNAL_FetchWindowData( return (WindowData *)SDL_GetPointerProperty(properties, WINDOW_PROPERTY_DATA, NULL); } -static SDL_bool VULKAN_INTERNAL_OnWindowResize(void *userdata, SDL_Event *e) +static bool VULKAN_INTERNAL_OnWindowResize(void *userdata, SDL_Event *e) { SDL_Window *w = (SDL_Window *)userdata; WindowData *data; diff --git a/src/haptic/SDL_haptic.c b/src/haptic/SDL_haptic.c index 2f6ef78ea..8bc0ae860 100644 --- a/src/haptic/SDL_haptic.c +++ b/src/haptic/SDL_haptic.c @@ -185,7 +185,7 @@ const char *SDL_GetHapticName(SDL_Haptic *haptic) return SDL_GetPersistentString(haptic->name); } -SDL_bool SDL_IsMouseHaptic(void) +bool SDL_IsMouseHaptic(void) { if (SDL_SYS_HapticMouse() < 0) { return false; @@ -207,7 +207,7 @@ SDL_Haptic *SDL_OpenHapticFromMouse(void) return SDL_OpenHaptic(device_index); } -SDL_bool SDL_IsJoystickHaptic(SDL_Joystick *joystick) +bool SDL_IsJoystickHaptic(SDL_Joystick *joystick) { bool result = false; @@ -370,7 +370,7 @@ int SDL_GetNumHapticAxes(SDL_Haptic *haptic) return haptic->naxes; } -SDL_bool SDL_HapticEffectSupported(SDL_Haptic *haptic, const SDL_HapticEffect *effect) +bool SDL_HapticEffectSupported(SDL_Haptic *haptic, const SDL_HapticEffect *effect) { CHECK_HAPTIC_MAGIC(haptic, false); @@ -429,7 +429,7 @@ static bool ValidEffect(SDL_Haptic *haptic, int effect) return true; } -SDL_bool SDL_UpdateHapticEffect(SDL_Haptic *haptic, int effect, const SDL_HapticEffect *data) +bool SDL_UpdateHapticEffect(SDL_Haptic *haptic, int effect, const SDL_HapticEffect *data) { CHECK_HAPTIC_MAGIC(haptic, false); @@ -456,7 +456,7 @@ SDL_bool SDL_UpdateHapticEffect(SDL_Haptic *haptic, int effect, const SDL_Haptic return true; } -SDL_bool SDL_RunHapticEffect(SDL_Haptic *haptic, int effect, Uint32 iterations) +bool SDL_RunHapticEffect(SDL_Haptic *haptic, int effect, Uint32 iterations) { CHECK_HAPTIC_MAGIC(haptic, false); @@ -472,7 +472,7 @@ SDL_bool SDL_RunHapticEffect(SDL_Haptic *haptic, int effect, Uint32 iterations) return true; } -SDL_bool SDL_StopHapticEffect(SDL_Haptic *haptic, int effect) +bool SDL_StopHapticEffect(SDL_Haptic *haptic, int effect) { CHECK_HAPTIC_MAGIC(haptic, false); @@ -504,7 +504,7 @@ void SDL_DestroyHapticEffect(SDL_Haptic *haptic, int effect) SDL_SYS_HapticDestroyEffect(haptic, &haptic->effects[effect]); } -SDL_bool SDL_GetHapticEffectStatus(SDL_Haptic *haptic, int effect) +bool SDL_GetHapticEffectStatus(SDL_Haptic *haptic, int effect) { CHECK_HAPTIC_MAGIC(haptic, false); @@ -521,7 +521,7 @@ SDL_bool SDL_GetHapticEffectStatus(SDL_Haptic *haptic, int effect) return SDL_SYS_HapticGetEffectStatus(haptic, &haptic->effects[effect]); } -SDL_bool SDL_SetHapticGain(SDL_Haptic *haptic, int gain) +bool SDL_SetHapticGain(SDL_Haptic *haptic, int gain) { const char *env; int real_gain, max_gain; @@ -557,7 +557,7 @@ SDL_bool SDL_SetHapticGain(SDL_Haptic *haptic, int gain) return SDL_SYS_HapticSetGain(haptic, real_gain); } -SDL_bool SDL_SetHapticAutocenter(SDL_Haptic *haptic, int autocenter) +bool SDL_SetHapticAutocenter(SDL_Haptic *haptic, int autocenter) { CHECK_HAPTIC_MAGIC(haptic, false); @@ -572,7 +572,7 @@ SDL_bool SDL_SetHapticAutocenter(SDL_Haptic *haptic, int autocenter) return SDL_SYS_HapticSetAutocenter(haptic, autocenter); } -SDL_bool SDL_PauseHaptic(SDL_Haptic *haptic) +bool SDL_PauseHaptic(SDL_Haptic *haptic) { CHECK_HAPTIC_MAGIC(haptic, false); @@ -583,7 +583,7 @@ SDL_bool SDL_PauseHaptic(SDL_Haptic *haptic) return SDL_SYS_HapticPause(haptic); } -SDL_bool SDL_ResumeHaptic(SDL_Haptic *haptic) +bool SDL_ResumeHaptic(SDL_Haptic *haptic) { CHECK_HAPTIC_MAGIC(haptic, false); @@ -594,14 +594,14 @@ SDL_bool SDL_ResumeHaptic(SDL_Haptic *haptic) return SDL_SYS_HapticResume(haptic); } -SDL_bool SDL_StopHapticEffects(SDL_Haptic *haptic) +bool SDL_StopHapticEffects(SDL_Haptic *haptic) { CHECK_HAPTIC_MAGIC(haptic, false); return SDL_SYS_HapticStopAll(haptic); } -SDL_bool SDL_HapticRumbleSupported(SDL_Haptic *haptic) +bool SDL_HapticRumbleSupported(SDL_Haptic *haptic) { CHECK_HAPTIC_MAGIC(haptic, false); @@ -609,7 +609,7 @@ SDL_bool SDL_HapticRumbleSupported(SDL_Haptic *haptic) return (haptic->supported & (SDL_HAPTIC_SINE | SDL_HAPTIC_LEFTRIGHT)) != 0; } -SDL_bool SDL_InitHapticRumble(SDL_Haptic *haptic) +bool SDL_InitHapticRumble(SDL_Haptic *haptic) { SDL_HapticEffect *efx = &haptic->rumble_effect; @@ -645,7 +645,7 @@ SDL_bool SDL_InitHapticRumble(SDL_Haptic *haptic) return false; } -SDL_bool SDL_PlayHapticRumble(SDL_Haptic *haptic, float strength, Uint32 length) +bool SDL_PlayHapticRumble(SDL_Haptic *haptic, float strength, Uint32 length) { SDL_HapticEffect *efx; Sint16 magnitude; @@ -682,7 +682,7 @@ SDL_bool SDL_PlayHapticRumble(SDL_Haptic *haptic, float strength, Uint32 length) return SDL_RunHapticEffect(haptic, haptic->rumble_id, 1); } -SDL_bool SDL_StopHapticRumble(SDL_Haptic *haptic) +bool SDL_StopHapticRumble(SDL_Haptic *haptic) { CHECK_HAPTIC_MAGIC(haptic, false); diff --git a/src/hidapi/SDL_hidapi.c b/src/hidapi/SDL_hidapi.c index 88c5092ec..d40e9a928 100644 --- a/src/hidapi/SDL_hidapi.c +++ b/src/hidapi/SDL_hidapi.c @@ -1685,7 +1685,7 @@ int SDL_hid_get_report_descriptor(SDL_hid_device *device, unsigned char *buf, si return device->backend->hid_get_report_descriptor(device->device, buf, buf_size); } -void SDL_hid_ble_scan(SDL_bool active) +void SDL_hid_ble_scan(bool active) { #if !defined(SDL_HIDAPI_DISABLED) && (defined(SDL_PLATFORM_IOS) || defined(SDL_PLATFORM_TVOS)) extern void hid_ble_scan(int bStart); diff --git a/src/hidapi/android/hid.cpp b/src/hidapi/android/hid.cpp index 6713d169d..3b4c9d265 100644 --- a/src/hidapi/android/hid.cpp +++ b/src/hidapi/android/hid.cpp @@ -1030,7 +1030,7 @@ extern "C" { // !!! FIXME: make this non-blocking! -static void SDLCALL RequestAndroidPermissionBlockingCallback(void *userdata, const char *permission, SDL_bool granted) +static void SDLCALL RequestAndroidPermissionBlockingCallback(void *userdata, const char *permission, bool granted) { SDL_SetAtomicInt((SDL_AtomicInt *) userdata, granted ? 1 : -1); } diff --git a/src/joystick/SDL_gamepad.c b/src/joystick/SDL_gamepad.c index f1ed38e95..b6d4c16e9 100644 --- a/src/joystick/SDL_gamepad.c +++ b/src/joystick/SDL_gamepad.c @@ -363,7 +363,7 @@ static void SDL_PrivateGamepadRemapped(SDL_JoystickID instance_id) /* * Event filter to fire gamepad events from joystick ones */ -static SDL_bool SDLCALL SDL_GamepadEventWatcher(void *userdata, SDL_Event *event) +static bool SDLCALL SDL_GamepadEventWatcher(void *userdata, SDL_Event *event) { SDL_Gamepad *gamepad; @@ -1799,7 +1799,7 @@ static GamepadMapping_t *SDL_PrivateGetGamepadMapping(SDL_JoystickID instance_id /* * Add or update an entry into the Mappings Database */ -int SDL_AddGamepadMappingsFromIO(SDL_IOStream *src, SDL_bool closeio) +int SDL_AddGamepadMappingsFromIO(SDL_IOStream *src, bool closeio) { const char *platform = SDL_GetPlatform(); int gamepads = 0; @@ -1859,7 +1859,7 @@ int SDL_AddGamepadMappingsFromFile(const char *file) return SDL_AddGamepadMappingsFromIO(SDL_IOFromFile(file, "rb"), true); } -SDL_bool SDL_ReloadGamepadMappings(void) +bool SDL_ReloadGamepadMappings(void) { SDL_Gamepad *gamepad; @@ -2245,7 +2245,7 @@ char *SDL_GetGamepadMapping(SDL_Gamepad *gamepad) /* * Set the mapping string for this device */ -SDL_bool SDL_SetGamepadMapping(SDL_JoystickID instance_id, const char *mapping) +bool SDL_SetGamepadMapping(SDL_JoystickID instance_id, const char *mapping) { SDL_GUID guid = SDL_GetJoystickGUIDForID(instance_id); bool result = false; @@ -2380,7 +2380,7 @@ bool SDL_InitGamepads(void) return true; } -SDL_bool SDL_HasGamepad(void) +bool SDL_HasGamepad(void) { int num_joysticks = 0; int num_gamepads = 0; @@ -2562,7 +2562,7 @@ bool SDL_IsGamepadNameAndGUID(const char *name, SDL_GUID guid) /* * Return 1 if the joystick at this device index is a supported gamepad */ -SDL_bool SDL_IsGamepad(SDL_JoystickID instance_id) +bool SDL_IsGamepad(SDL_JoystickID instance_id) { bool result; @@ -2751,7 +2751,7 @@ void SDL_UpdateGamepads(void) /** * Return whether a gamepad has a given axis */ -SDL_bool SDL_GamepadHasAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis) +bool SDL_GamepadHasAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis) { bool result = false; @@ -2841,7 +2841,7 @@ Sint16 SDL_GetGamepadAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis) /** * Return whether a gamepad has a given button */ -SDL_bool SDL_GamepadHasButton(SDL_Gamepad *gamepad, SDL_GamepadButton button) +bool SDL_GamepadHasButton(SDL_Gamepad *gamepad, SDL_GamepadButton button) { bool result = false; @@ -2867,7 +2867,7 @@ SDL_bool SDL_GamepadHasButton(SDL_Gamepad *gamepad, SDL_GamepadButton button) /* * Get the current state of a button on a gamepad */ -SDL_bool SDL_GetGamepadButton(SDL_Gamepad *gamepad, SDL_GamepadButton button) +bool SDL_GetGamepadButton(SDL_Gamepad *gamepad, SDL_GamepadButton button) { bool result = false; @@ -3053,7 +3053,7 @@ int SDL_GetNumGamepadTouchpadFingers(SDL_Gamepad *gamepad, int touchpad) /** * Get the current state of a finger on a touchpad on a gamepad. */ -SDL_bool SDL_GetGamepadTouchpadFinger(SDL_Gamepad *gamepad, int touchpad, int finger, SDL_bool *down, float *x, float *y, float *pressure) +bool SDL_GetGamepadTouchpadFinger(SDL_Gamepad *gamepad, int touchpad, int finger, bool *down, float *x, float *y, float *pressure) { bool result = false; @@ -3095,7 +3095,7 @@ SDL_bool SDL_GetGamepadTouchpadFinger(SDL_Gamepad *gamepad, int touchpad, int fi /** * Return whether a gamepad has a particular sensor. */ -SDL_bool SDL_GamepadHasSensor(SDL_Gamepad *gamepad, SDL_SensorType type) +bool SDL_GamepadHasSensor(SDL_Gamepad *gamepad, SDL_SensorType type) { bool result = false; @@ -3120,7 +3120,7 @@ SDL_bool SDL_GamepadHasSensor(SDL_Gamepad *gamepad, SDL_SensorType type) /* * Set whether data reporting for a gamepad sensor is enabled */ -SDL_bool SDL_SetGamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type, SDL_bool enabled) +bool SDL_SetGamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type, bool enabled) { SDL_LockJoysticks(); { @@ -3131,7 +3131,7 @@ SDL_bool SDL_SetGamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type, SDL_JoystickSensorInfo *sensor = &joystick->sensors[i]; if (sensor->type == type) { - if (sensor->enabled == (enabled != SDL_FALSE)) { + if (sensor->enabled == (enabled != false)) { SDL_UnlockJoysticks(); return true; } @@ -3197,7 +3197,7 @@ SDL_bool SDL_SetGamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type, /* * Query whether sensor data reporting is enabled for a gamepad */ -SDL_bool SDL_GamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type) +bool SDL_GamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type) { bool result = false; @@ -3249,7 +3249,7 @@ float SDL_GetGamepadSensorDataRate(SDL_Gamepad *gamepad, SDL_SensorType type) /* * Get the current state of a gamepad sensor. */ -SDL_bool SDL_GetGamepadSensorData(SDL_Gamepad *gamepad, SDL_SensorType type, float *data, int num_values) +bool SDL_GetGamepadSensorData(SDL_Gamepad *gamepad, SDL_SensorType type, float *data, int num_values) { SDL_LockJoysticks(); { @@ -3372,7 +3372,7 @@ int SDL_GetGamepadPlayerIndex(SDL_Gamepad *gamepad) /** * Set the player index of an opened gamepad */ -SDL_bool SDL_SetGamepadPlayerIndex(SDL_Gamepad *gamepad, int player_index) +bool SDL_SetGamepadPlayerIndex(SDL_Gamepad *gamepad, int player_index) { SDL_Joystick *joystick = SDL_GetGamepadJoystick(gamepad); @@ -3476,7 +3476,7 @@ SDL_PowerState SDL_GetGamepadPowerInfo(SDL_Gamepad *gamepad, int *percent) * Return if the gamepad in question is currently attached to the system, * \return 0 if not plugged in, 1 if still present. */ -SDL_bool SDL_GamepadConnected(SDL_Gamepad *gamepad) +bool SDL_GamepadConnected(SDL_Gamepad *gamepad) { SDL_Joystick *joystick = SDL_GetGamepadJoystick(gamepad); @@ -3580,7 +3580,7 @@ SDL_GamepadBinding **SDL_GetGamepadBindings(SDL_Gamepad *gamepad, int *count) return bindings; } -SDL_bool SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms) +bool SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms) { SDL_Joystick *joystick = SDL_GetGamepadJoystick(gamepad); @@ -3590,7 +3590,7 @@ SDL_bool SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uint16 low_frequency_rumble, Ui return SDL_RumbleJoystick(joystick, low_frequency_rumble, high_frequency_rumble, duration_ms); } -SDL_bool SDL_RumbleGamepadTriggers(SDL_Gamepad *gamepad, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms) +bool SDL_RumbleGamepadTriggers(SDL_Gamepad *gamepad, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms) { SDL_Joystick *joystick = SDL_GetGamepadJoystick(gamepad); @@ -3600,7 +3600,7 @@ SDL_bool SDL_RumbleGamepadTriggers(SDL_Gamepad *gamepad, Uint16 left_rumble, Uin return SDL_RumbleJoystickTriggers(joystick, left_rumble, right_rumble, duration_ms); } -SDL_bool SDL_SetGamepadLED(SDL_Gamepad *gamepad, Uint8 red, Uint8 green, Uint8 blue) +bool SDL_SetGamepadLED(SDL_Gamepad *gamepad, Uint8 red, Uint8 green, Uint8 blue) { SDL_Joystick *joystick = SDL_GetGamepadJoystick(gamepad); @@ -3610,7 +3610,7 @@ SDL_bool SDL_SetGamepadLED(SDL_Gamepad *gamepad, Uint8 red, Uint8 green, Uint8 b return SDL_SetJoystickLED(joystick, red, green, blue); } -SDL_bool SDL_SendGamepadEffect(SDL_Gamepad *gamepad, const void *data, int size) +bool SDL_SendGamepadEffect(SDL_Gamepad *gamepad, const void *data, int size) { SDL_Joystick *joystick = SDL_GetGamepadJoystick(gamepad); @@ -3788,7 +3788,7 @@ static const Uint32 SDL_gamepad_event_list[] = { SDL_EVENT_GAMEPAD_SENSOR_UPDATE, }; -void SDL_SetGamepadEventsEnabled(SDL_bool enabled) +void SDL_SetGamepadEventsEnabled(bool enabled) { unsigned int i; @@ -3797,7 +3797,7 @@ void SDL_SetGamepadEventsEnabled(SDL_bool enabled) } } -SDL_bool SDL_GamepadEventsEnabled(void) +bool SDL_GamepadEventsEnabled(void) { bool enabled = false; unsigned int i; diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index 43843e341..2d4177b69 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -696,7 +696,7 @@ bool SDL_JoystickHandledByAnotherDriver(struct SDL_JoystickDriver *driver, Uint1 return result; } -SDL_bool SDL_HasJoystick(void) +bool SDL_HasJoystick(void) { int i; int total_joysticks = 0; @@ -1127,7 +1127,7 @@ SDL_Joystick *SDL_OpenJoystick(SDL_JoystickID instance_id) joystick->hats = (Uint8 *)SDL_calloc(joystick->nhats, sizeof(*joystick->hats)); } if (joystick->nbuttons > 0) { - joystick->buttons = (SDL_bool *)SDL_calloc(joystick->nbuttons, sizeof(*joystick->buttons)); + joystick->buttons = (bool *)SDL_calloc(joystick->nbuttons, sizeof(*joystick->buttons)); } if (((joystick->naxes > 0) && !joystick->axes) || ((joystick->nballs > 0) && !joystick->balls) || @@ -1186,7 +1186,7 @@ SDL_JoystickID SDL_AttachVirtualJoystick(const SDL_VirtualJoystickDesc *desc) #endif } -SDL_bool SDL_DetachVirtualJoystick(SDL_JoystickID instance_id) +bool SDL_DetachVirtualJoystick(SDL_JoystickID instance_id) { #ifdef SDL_JOYSTICK_VIRTUAL bool result; @@ -1200,7 +1200,7 @@ SDL_bool SDL_DetachVirtualJoystick(SDL_JoystickID instance_id) #endif } -SDL_bool SDL_IsJoystickVirtual(SDL_JoystickID instance_id) +bool SDL_IsJoystickVirtual(SDL_JoystickID instance_id) { #ifdef SDL_JOYSTICK_VIRTUAL SDL_JoystickDriver *driver; @@ -1221,7 +1221,7 @@ SDL_bool SDL_IsJoystickVirtual(SDL_JoystickID instance_id) #endif } -SDL_bool SDL_SetJoystickVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value) +bool SDL_SetJoystickVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value) { bool result; @@ -1240,7 +1240,7 @@ SDL_bool SDL_SetJoystickVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 val return result; } -SDL_bool SDL_SetJoystickVirtualBall(SDL_Joystick *joystick, int ball, Sint16 xrel, Sint16 yrel) +bool SDL_SetJoystickVirtualBall(SDL_Joystick *joystick, int ball, Sint16 xrel, Sint16 yrel) { bool result; @@ -1259,7 +1259,7 @@ SDL_bool SDL_SetJoystickVirtualBall(SDL_Joystick *joystick, int ball, Sint16 xre return result; } -SDL_bool SDL_SetJoystickVirtualButton(SDL_Joystick *joystick, int button, SDL_bool down) +bool SDL_SetJoystickVirtualButton(SDL_Joystick *joystick, int button, bool down) { bool result; @@ -1278,7 +1278,7 @@ SDL_bool SDL_SetJoystickVirtualButton(SDL_Joystick *joystick, int button, SDL_bo return result; } -SDL_bool SDL_SetJoystickVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value) +bool SDL_SetJoystickVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value) { bool result; @@ -1297,7 +1297,7 @@ SDL_bool SDL_SetJoystickVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value) return result; } -SDL_bool SDL_SetJoystickVirtualTouchpad(SDL_Joystick *joystick, int touchpad, int finger, SDL_bool down, float x, float y, float pressure) +bool SDL_SetJoystickVirtualTouchpad(SDL_Joystick *joystick, int touchpad, int finger, bool down, float x, float y, float pressure) { bool result; @@ -1316,7 +1316,7 @@ SDL_bool SDL_SetJoystickVirtualTouchpad(SDL_Joystick *joystick, int touchpad, in return result; } -SDL_bool SDL_SendJoystickVirtualSensorData(SDL_Joystick *joystick, SDL_SensorType type, Uint64 sensor_timestamp, const float *data, int num_values) +bool SDL_SendJoystickVirtualSensorData(SDL_Joystick *joystick, SDL_SensorType type, Uint64 sensor_timestamp, const float *data, int num_values) { bool result; @@ -1449,7 +1449,7 @@ Sint16 SDL_GetJoystickAxis(SDL_Joystick *joystick, int axis) /* * Get the initial state of an axis control on a joystick */ -SDL_bool SDL_GetJoystickAxisInitialState(SDL_Joystick *joystick, int axis, Sint16 *state) +bool SDL_GetJoystickAxisInitialState(SDL_Joystick *joystick, int axis, Sint16 *state) { bool result; @@ -1498,7 +1498,7 @@ Uint8 SDL_GetJoystickHat(SDL_Joystick *joystick, int hat) /* * Get the ball axis change since the last poll */ -SDL_bool SDL_GetJoystickBall(SDL_Joystick *joystick, int ball, int *dx, int *dy) +bool SDL_GetJoystickBall(SDL_Joystick *joystick, int ball, int *dx, int *dy) { bool result; @@ -1528,7 +1528,7 @@ SDL_bool SDL_GetJoystickBall(SDL_Joystick *joystick, int ball, int *dx, int *dy) /* * Get the current state of a button on a joystick */ -SDL_bool SDL_GetJoystickButton(SDL_Joystick *joystick, int button) +bool SDL_GetJoystickButton(SDL_Joystick *joystick, int button) { bool down = false; @@ -1551,7 +1551,7 @@ SDL_bool SDL_GetJoystickButton(SDL_Joystick *joystick, int button) * Return if the joystick in question is currently attached to the system, * \return false if not plugged in, true if still present. */ -SDL_bool SDL_JoystickConnected(SDL_Joystick *joystick) +bool SDL_JoystickConnected(SDL_Joystick *joystick) { bool result; @@ -1709,7 +1709,7 @@ int SDL_GetJoystickPlayerIndex(SDL_Joystick *joystick) /** * Set the player index of an opened joystick */ -SDL_bool SDL_SetJoystickPlayerIndex(SDL_Joystick *joystick, int player_index) +bool SDL_SetJoystickPlayerIndex(SDL_Joystick *joystick, int player_index) { bool result; @@ -1724,7 +1724,7 @@ SDL_bool SDL_SetJoystickPlayerIndex(SDL_Joystick *joystick, int player_index) return result; } -SDL_bool SDL_RumbleJoystick(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms) +bool SDL_RumbleJoystick(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms) { bool result; @@ -1768,7 +1768,7 @@ SDL_bool SDL_RumbleJoystick(SDL_Joystick *joystick, Uint16 low_frequency_rumble, return result; } -SDL_bool SDL_RumbleJoystickTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms) +bool SDL_RumbleJoystickTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms) { bool result; @@ -1799,7 +1799,7 @@ SDL_bool SDL_RumbleJoystickTriggers(SDL_Joystick *joystick, Uint16 left_rumble, return result; } -SDL_bool SDL_SetJoystickLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +bool SDL_SetJoystickLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { bool result; bool isfreshvalue; @@ -1830,7 +1830,7 @@ SDL_bool SDL_SetJoystickLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint return result; } -SDL_bool SDL_SendJoystickEffect(SDL_Joystick *joystick, const void *data, int size) +bool SDL_SendJoystickEffect(SDL_Joystick *joystick, const void *data, int size) { bool result; @@ -2463,7 +2463,7 @@ static const Uint32 SDL_joystick_event_list[] = { SDL_EVENT_JOYSTICK_BATTERY_UPDATED }; -void SDL_SetJoystickEventsEnabled(SDL_bool enabled) +void SDL_SetJoystickEventsEnabled(bool enabled) { unsigned int i; @@ -2472,7 +2472,7 @@ void SDL_SetJoystickEventsEnabled(SDL_bool enabled) } } -SDL_bool SDL_JoystickEventsEnabled(void) +bool SDL_JoystickEventsEnabled(void) { bool enabled = false; unsigned int i; diff --git a/src/joystick/virtual/SDL_virtualjoystick.c b/src/joystick/virtual/SDL_virtualjoystick.c index bae4d7cae..2d1b410cf 100644 --- a/src/joystick/virtual/SDL_virtualjoystick.c +++ b/src/joystick/virtual/SDL_virtualjoystick.c @@ -250,7 +250,7 @@ SDL_JoystickID SDL_JoystickAttachVirtualInner(const SDL_VirtualJoystickDesc *des } } if (hwdata->desc.nbuttons > 0) { - hwdata->buttons = (SDL_bool *)SDL_calloc(hwdata->desc.nbuttons, sizeof(*hwdata->buttons)); + hwdata->buttons = (bool *)SDL_calloc(hwdata->desc.nbuttons, sizeof(*hwdata->buttons)); if (!hwdata->buttons) { VIRTUAL_FreeHWData(hwdata); return 0; diff --git a/src/main/SDL_main_callbacks.c b/src/main/SDL_main_callbacks.c index 5801deb9a..ad967ea8f 100644 --- a/src/main/SDL_main_callbacks.c +++ b/src/main/SDL_main_callbacks.c @@ -69,7 +69,7 @@ static void SDL_DispatchMainCallbackEvents(void) } } -static SDL_bool SDLCALL SDL_MainCallbackEventWatcher(void *userdata, SDL_Event *event) +static bool SDLCALL SDL_MainCallbackEventWatcher(void *userdata, SDL_Event *event) { if (ShouldDispatchImmediately(event)) { // Make sure any currently queued events are processed then dispatch this before continuing diff --git a/src/misc/SDL_url.c b/src/misc/SDL_url.c index 74d067144..0e1dd6c7d 100644 --- a/src/misc/SDL_url.c +++ b/src/misc/SDL_url.c @@ -22,7 +22,7 @@ #include "SDL_sysurl.h" -SDL_bool SDL_OpenURL(const char *url) +bool SDL_OpenURL(const char *url) { if (!url) { return SDL_InvalidParamError("url"); diff --git a/src/process/SDL_process.c b/src/process/SDL_process.c index c42b2d21e..5994b30e8 100644 --- a/src/process/SDL_process.c +++ b/src/process/SDL_process.c @@ -23,7 +23,7 @@ #include "SDL_sysprocess.h" -SDL_Process *SDL_CreateProcess(const char * const *args, SDL_bool pipe_stdio) +SDL_Process *SDL_CreateProcess(const char * const *args, bool pipe_stdio) { if (!args || !args[0] || !args[0][0]) { SDL_InvalidParamError("args"); @@ -140,7 +140,7 @@ SDL_IOStream *SDL_GetProcessOutput(SDL_Process *process) return io; } -SDL_bool SDL_KillProcess(SDL_Process *process, SDL_bool force) +bool SDL_KillProcess(SDL_Process *process, bool force) { if (!process) { return SDL_InvalidParamError("process"); @@ -153,7 +153,7 @@ SDL_bool SDL_KillProcess(SDL_Process *process, SDL_bool force) return SDL_SYS_KillProcess(process, force); } -SDL_bool SDL_WaitProcess(SDL_Process *process, SDL_bool block, int *exitcode) +bool SDL_WaitProcess(SDL_Process *process, bool block, int *exitcode) { if (!process) { return SDL_InvalidParamError("process"); diff --git a/src/process/SDL_sysprocess.h b/src/process/SDL_sysprocess.h index fbea4a679..4e417d13e 100644 --- a/src/process/SDL_sysprocess.h +++ b/src/process/SDL_sysprocess.h @@ -32,6 +32,6 @@ struct SDL_Process }; bool SDL_SYS_CreateProcessWithProperties(SDL_Process *process, SDL_PropertiesID props); -bool SDL_SYS_KillProcess(SDL_Process *process, SDL_bool force); -bool SDL_SYS_WaitProcess(SDL_Process *process, SDL_bool block, int *exitcode); +bool SDL_SYS_KillProcess(SDL_Process *process, bool force); +bool SDL_SYS_WaitProcess(SDL_Process *process, bool block, int *exitcode); void SDL_SYS_DestroyProcess(SDL_Process *process); diff --git a/src/process/dummy/SDL_dummyprocess.c b/src/process/dummy/SDL_dummyprocess.c index 6136bb19b..0cd04cc8c 100644 --- a/src/process/dummy/SDL_dummyprocess.c +++ b/src/process/dummy/SDL_dummyprocess.c @@ -30,12 +30,12 @@ bool SDL_SYS_CreateProcessWithProperties(SDL_Process *process, SDL_PropertiesID return SDL_Unsupported(); } -bool SDL_SYS_KillProcess(SDL_Process *process, SDL_bool force) +bool SDL_SYS_KillProcess(SDL_Process *process, bool force) { return SDL_Unsupported(); } -bool SDL_SYS_WaitProcess(SDL_Process *process, SDL_bool block, int *exitcode) +bool SDL_SYS_WaitProcess(SDL_Process *process, bool block, int *exitcode) { return SDL_Unsupported(); } diff --git a/src/process/posix/SDL_posixprocess.c b/src/process/posix/SDL_posixprocess.c index cc9d004a6..a3c3fb387 100644 --- a/src/process/posix/SDL_posixprocess.c +++ b/src/process/posix/SDL_posixprocess.c @@ -441,7 +441,7 @@ posix_spawn_fail_none: return false; } -bool SDL_SYS_KillProcess(SDL_Process *process, SDL_bool force) +bool SDL_SYS_KillProcess(SDL_Process *process, bool force) { int ret = kill(process->internal->pid, force ? SIGKILL : SIGTERM); if (ret == 0) { @@ -451,7 +451,7 @@ bool SDL_SYS_KillProcess(SDL_Process *process, SDL_bool force) } } -bool SDL_SYS_WaitProcess(SDL_Process *process, SDL_bool block, int *exitcode) +bool SDL_SYS_WaitProcess(SDL_Process *process, bool block, int *exitcode) { int wstatus = 0; int ret; diff --git a/src/process/windows/SDL_windowsprocess.c b/src/process/windows/SDL_windowsprocess.c index dae6c8186..6c816d0fd 100644 --- a/src/process/windows/SDL_windowsprocess.c +++ b/src/process/windows/SDL_windowsprocess.c @@ -441,7 +441,7 @@ done: return result; } -bool SDL_SYS_KillProcess(SDL_Process *process, SDL_bool force) +bool SDL_SYS_KillProcess(SDL_Process *process, bool force) { if (!TerminateProcess(process->internal->process_information.hProcess, 1)) { return WIN_SetError("TerminateProcess failed"); @@ -449,7 +449,7 @@ bool SDL_SYS_KillProcess(SDL_Process *process, SDL_bool force) return true; } -bool SDL_SYS_WaitProcess(SDL_Process *process, SDL_bool block, int *exitcode) +bool SDL_SYS_WaitProcess(SDL_Process *process, bool block, int *exitcode) { DWORD result; diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index 72431af41..a17365aa2 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -343,7 +343,7 @@ static bool FlushRenderCommandsIfTextureNeeded(SDL_Texture *texture) return true; } -SDL_bool SDL_FlushRenderer(SDL_Renderer *renderer) +bool SDL_FlushRenderer(SDL_Renderer *renderer) { if (!FlushRenderCommands(renderer)) { return false; @@ -821,7 +821,7 @@ const char *SDL_GetRenderDriver(int index) #endif } -static SDL_bool SDLCALL SDL_RendererEventWatch(void *userdata, SDL_Event *event) +static bool SDLCALL SDL_RendererEventWatch(void *userdata, SDL_Event *event) { SDL_Renderer *renderer = (SDL_Renderer *)userdata; @@ -861,7 +861,7 @@ static SDL_bool SDLCALL SDL_RendererEventWatch(void *userdata, SDL_Event *event) return true; } -SDL_bool SDL_CreateWindowAndRenderer(const char *title, int width, int height, SDL_WindowFlags window_flags, SDL_Window **window, SDL_Renderer **renderer) +bool SDL_CreateWindowAndRenderer(const char *title, int width, int height, SDL_WindowFlags window_flags, SDL_Window **window, SDL_Renderer **renderer) { bool hidden = (window_flags & SDL_WINDOW_HIDDEN) != 0; @@ -1219,7 +1219,7 @@ SDL_PropertiesID SDL_GetRendererProperties(SDL_Renderer *renderer) return renderer->props; } -SDL_bool SDL_GetRenderOutputSize(SDL_Renderer *renderer, int *w, int *h) +bool SDL_GetRenderOutputSize(SDL_Renderer *renderer, int *w, int *h) { if (w) { *w = 0; @@ -1240,7 +1240,7 @@ SDL_bool SDL_GetRenderOutputSize(SDL_Renderer *renderer, int *w, int *h) } } -SDL_bool SDL_GetCurrentRenderOutputSize(SDL_Renderer *renderer, int *w, int *h) +bool SDL_GetCurrentRenderOutputSize(SDL_Renderer *renderer, int *w, int *h) { if (w) { *w = 0; @@ -1753,7 +1753,7 @@ SDL_PropertiesID SDL_GetTextureProperties(SDL_Texture *texture) return texture->props; } -SDL_bool SDL_GetTextureSize(SDL_Texture *texture, float *w, float *h) +bool SDL_GetTextureSize(SDL_Texture *texture, float *w, float *h) { if (w) { *w = 0; @@ -1773,7 +1773,7 @@ SDL_bool SDL_GetTextureSize(SDL_Texture *texture, float *w, float *h) return true; } -SDL_bool SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b) +bool SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b) { const float fR = (float)r / 255.0f; const float fG = (float)g / 255.0f; @@ -1782,7 +1782,7 @@ SDL_bool SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b) return SDL_SetTextureColorModFloat(texture, fR, fG, fB); } -SDL_bool SDL_SetTextureColorModFloat(SDL_Texture *texture, float r, float g, float b) +bool SDL_SetTextureColorModFloat(SDL_Texture *texture, float r, float g, float b) { CHECK_TEXTURE_MAGIC(texture, false); @@ -1795,7 +1795,7 @@ SDL_bool SDL_SetTextureColorModFloat(SDL_Texture *texture, float r, float g, flo return true; } -SDL_bool SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 *b) +bool SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 *b) { float fR = 1.0f, fG = 1.0f, fB = 1.0f; @@ -1824,7 +1824,7 @@ SDL_bool SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 return true; } -SDL_bool SDL_GetTextureColorModFloat(SDL_Texture *texture, float *r, float *g, float *b) +bool SDL_GetTextureColorModFloat(SDL_Texture *texture, float *r, float *g, float *b) { SDL_FColor color; @@ -1854,14 +1854,14 @@ SDL_bool SDL_GetTextureColorModFloat(SDL_Texture *texture, float *r, float *g, f return true; } -SDL_bool SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha) +bool SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha) { const float fA = (float)alpha / 255.0f; return SDL_SetTextureAlphaModFloat(texture, fA); } -SDL_bool SDL_SetTextureAlphaModFloat(SDL_Texture *texture, float alpha) +bool SDL_SetTextureAlphaModFloat(SDL_Texture *texture, float alpha) { CHECK_TEXTURE_MAGIC(texture, false); @@ -1872,7 +1872,7 @@ SDL_bool SDL_SetTextureAlphaModFloat(SDL_Texture *texture, float alpha) return true; } -SDL_bool SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *alpha) +bool SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *alpha) { float fA = 1.0f; @@ -1889,7 +1889,7 @@ SDL_bool SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *alpha) return true; } -SDL_bool SDL_GetTextureAlphaModFloat(SDL_Texture *texture, float *alpha) +bool SDL_GetTextureAlphaModFloat(SDL_Texture *texture, float *alpha) { if (alpha) { *alpha = 1.0f; @@ -1903,7 +1903,7 @@ SDL_bool SDL_GetTextureAlphaModFloat(SDL_Texture *texture, float *alpha) return true; } -SDL_bool SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode) +bool SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode) { SDL_Renderer *renderer; @@ -1924,7 +1924,7 @@ SDL_bool SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode) return true; } -SDL_bool SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode) +bool SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode) { if (blendMode) { *blendMode = SDL_BLENDMODE_INVALID; @@ -1938,7 +1938,7 @@ SDL_bool SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode) return true; } -SDL_bool SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode) +bool SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode) { SDL_Renderer *renderer; @@ -1959,7 +1959,7 @@ SDL_bool SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode) return true; } -SDL_bool SDL_GetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode *scaleMode) +bool SDL_GetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode *scaleMode) { if (scaleMode) { *scaleMode = SDL_SCALEMODE_LINEAR; @@ -2060,7 +2060,7 @@ static bool SDL_UpdateTextureNative(SDL_Texture *texture, const SDL_Rect *rect, return true; } -SDL_bool SDL_UpdateTexture(SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch) +bool SDL_UpdateTexture(SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch) { SDL_Rect real_rect; @@ -2204,7 +2204,7 @@ static bool SDL_UpdateTextureNVPlanar(SDL_Texture *texture, const SDL_Rect *rect #endif // SDL_HAVE_YUV -SDL_bool SDL_UpdateYUVTexture(SDL_Texture *texture, const SDL_Rect *rect, +bool SDL_UpdateYUVTexture(SDL_Texture *texture, const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *Uplane, int Upitch, const Uint8 *Vplane, int Vpitch) @@ -2271,7 +2271,7 @@ SDL_bool SDL_UpdateYUVTexture(SDL_Texture *texture, const SDL_Rect *rect, #endif } -SDL_bool SDL_UpdateNVTexture(SDL_Texture *texture, const SDL_Rect *rect, +bool SDL_UpdateNVTexture(SDL_Texture *texture, const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *UVplane, int UVpitch) { @@ -2350,7 +2350,7 @@ static bool SDL_LockTextureNative(SDL_Texture *texture, const SDL_Rect *rect, return true; } -SDL_bool SDL_LockTexture(SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch) +bool SDL_LockTexture(SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch) { SDL_Rect full_rect; @@ -2388,7 +2388,7 @@ SDL_bool SDL_LockTexture(SDL_Texture *texture, const SDL_Rect *rect, void **pixe } } -SDL_bool SDL_LockTextureToSurface(SDL_Texture *texture, const SDL_Rect *rect, SDL_Surface **surface) +bool SDL_LockTextureToSurface(SDL_Texture *texture, const SDL_Rect *rect, SDL_Surface **surface) { SDL_Rect real_rect; void *pixels = NULL; @@ -2537,7 +2537,7 @@ static bool SDL_SetRenderTargetInternal(SDL_Renderer *renderer, SDL_Texture *tex return true; } -SDL_bool SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) +bool SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) { if (!texture && renderer->logical_target) { return SDL_SetRenderTargetInternal(renderer, renderer->logical_target); @@ -2659,7 +2659,7 @@ error: return false; } -SDL_bool SDL_SetRenderLogicalPresentation(SDL_Renderer *renderer, int w, int h, SDL_RendererLogicalPresentation mode, SDL_ScaleMode scale_mode) +bool SDL_SetRenderLogicalPresentation(SDL_Renderer *renderer, int w, int h, SDL_RendererLogicalPresentation mode, SDL_ScaleMode scale_mode) { CHECK_RENDERER_MAGIC(renderer, false); @@ -2700,7 +2700,7 @@ error: return false; } -SDL_bool SDL_GetRenderLogicalPresentation(SDL_Renderer *renderer, int *w, int *h, SDL_RendererLogicalPresentation *mode, SDL_ScaleMode *scale_mode) +bool SDL_GetRenderLogicalPresentation(SDL_Renderer *renderer, int *w, int *h, SDL_RendererLogicalPresentation *mode, SDL_ScaleMode *scale_mode) { if (w) { *w = 0; @@ -2741,7 +2741,7 @@ SDL_bool SDL_GetRenderLogicalPresentation(SDL_Renderer *renderer, int *w, int *h return true; } -SDL_bool SDL_GetRenderLogicalPresentationRect(SDL_Renderer *renderer, SDL_FRect *rect) +bool SDL_GetRenderLogicalPresentationRect(SDL_Renderer *renderer, SDL_FRect *rect) { if (rect) { SDL_zerop(rect); @@ -2822,7 +2822,7 @@ static void SDL_RenderLogicalPresentation(SDL_Renderer *renderer) SDL_RenderTexture(renderer, renderer->logical_target, &renderer->logical_src_rect, &renderer->logical_dst_rect); } -SDL_bool SDL_RenderCoordinatesFromWindow(SDL_Renderer *renderer, float window_x, float window_y, float *x, float *y) +bool SDL_RenderCoordinatesFromWindow(SDL_Renderer *renderer, float window_x, float window_y, float *x, float *y) { SDL_RenderViewState *view; float render_x, render_y; @@ -2859,7 +2859,7 @@ SDL_bool SDL_RenderCoordinatesFromWindow(SDL_Renderer *renderer, float window_x, return true; } -SDL_bool SDL_RenderCoordinatesToWindow(SDL_Renderer *renderer, float x, float y, float *window_x, float *window_y) +bool SDL_RenderCoordinatesToWindow(SDL_Renderer *renderer, float x, float y, float *window_x, float *window_y) { SDL_RenderViewState *view; @@ -2895,7 +2895,7 @@ SDL_bool SDL_RenderCoordinatesToWindow(SDL_Renderer *renderer, float x, float y, return true; } -SDL_bool SDL_ConvertEventToRenderCoordinates(SDL_Renderer *renderer, SDL_Event *event) +bool SDL_ConvertEventToRenderCoordinates(SDL_Renderer *renderer, SDL_Event *event) { CHECK_RENDERER_MAGIC(renderer, false); @@ -2988,7 +2988,7 @@ SDL_bool SDL_ConvertEventToRenderCoordinates(SDL_Renderer *renderer, SDL_Event * return true; } -SDL_bool SDL_SetRenderViewport(SDL_Renderer *renderer, const SDL_Rect *rect) +bool SDL_SetRenderViewport(SDL_Renderer *renderer, const SDL_Rect *rect) { CHECK_RENDERER_MAGIC(renderer, false); @@ -3005,7 +3005,7 @@ SDL_bool SDL_SetRenderViewport(SDL_Renderer *renderer, const SDL_Rect *rect) return QueueCmdSetViewport(renderer); } -SDL_bool SDL_GetRenderViewport(SDL_Renderer *renderer, SDL_Rect *rect) +bool SDL_GetRenderViewport(SDL_Renderer *renderer, SDL_Rect *rect) { if (rect) { SDL_zerop(rect); @@ -3030,7 +3030,7 @@ SDL_bool SDL_GetRenderViewport(SDL_Renderer *renderer, SDL_Rect *rect) return true; } -SDL_bool SDL_RenderViewportSet(SDL_Renderer *renderer) +bool SDL_RenderViewportSet(SDL_Renderer *renderer) { CHECK_RENDERER_MAGIC(renderer, false); @@ -3057,7 +3057,7 @@ static void GetRenderViewportSize(SDL_Renderer *renderer, SDL_FRect *rect) } } -SDL_bool SDL_GetRenderSafeArea(SDL_Renderer *renderer, SDL_Rect *rect) +bool SDL_GetRenderSafeArea(SDL_Renderer *renderer, SDL_Rect *rect) { if (rect) { SDL_zerop(rect); @@ -3104,7 +3104,7 @@ SDL_bool SDL_GetRenderSafeArea(SDL_Renderer *renderer, SDL_Rect *rect) return true; } -SDL_bool SDL_SetRenderClipRect(SDL_Renderer *renderer, const SDL_Rect *rect) +bool SDL_SetRenderClipRect(SDL_Renderer *renderer, const SDL_Rect *rect) { CHECK_RENDERER_MAGIC(renderer, false) @@ -3120,7 +3120,7 @@ SDL_bool SDL_SetRenderClipRect(SDL_Renderer *renderer, const SDL_Rect *rect) return QueueCmdSetClipRect(renderer); } -SDL_bool SDL_GetRenderClipRect(SDL_Renderer *renderer, SDL_Rect *rect) +bool SDL_GetRenderClipRect(SDL_Renderer *renderer, SDL_Rect *rect) { if (rect) { SDL_zerop(rect); @@ -3134,13 +3134,13 @@ SDL_bool SDL_GetRenderClipRect(SDL_Renderer *renderer, SDL_Rect *rect) return true; } -SDL_bool SDL_RenderClipEnabled(SDL_Renderer *renderer) +bool SDL_RenderClipEnabled(SDL_Renderer *renderer) { CHECK_RENDERER_MAGIC(renderer, false) return renderer->view->clipping_enabled; } -SDL_bool SDL_SetRenderScale(SDL_Renderer *renderer, float scaleX, float scaleY) +bool SDL_SetRenderScale(SDL_Renderer *renderer, float scaleX, float scaleY) { bool result = true; @@ -3162,7 +3162,7 @@ SDL_bool SDL_SetRenderScale(SDL_Renderer *renderer, float scaleX, float scaleY) return result; } -SDL_bool SDL_GetRenderScale(SDL_Renderer *renderer, float *scaleX, float *scaleY) +bool SDL_GetRenderScale(SDL_Renderer *renderer, float *scaleX, float *scaleY) { if (scaleX) { *scaleX = 1.0f; @@ -3182,7 +3182,7 @@ SDL_bool SDL_GetRenderScale(SDL_Renderer *renderer, float *scaleX, float *scaleY return true; } -SDL_bool SDL_SetRenderDrawColor(SDL_Renderer *renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +bool SDL_SetRenderDrawColor(SDL_Renderer *renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { const float fR = (float)r / 255.0f; const float fG = (float)g / 255.0f; @@ -3192,7 +3192,7 @@ SDL_bool SDL_SetRenderDrawColor(SDL_Renderer *renderer, Uint8 r, Uint8 g, Uint8 return SDL_SetRenderDrawColorFloat(renderer, fR, fG, fB, fA); } -SDL_bool SDL_SetRenderDrawColorFloat(SDL_Renderer *renderer, float r, float g, float b, float a) +bool SDL_SetRenderDrawColorFloat(SDL_Renderer *renderer, float r, float g, float b, float a) { CHECK_RENDERER_MAGIC(renderer, false); @@ -3203,7 +3203,7 @@ SDL_bool SDL_SetRenderDrawColorFloat(SDL_Renderer *renderer, float r, float g, f return true; } -SDL_bool SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) +bool SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) { float fR, fG, fB, fA; @@ -3238,7 +3238,7 @@ SDL_bool SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint return true; } -SDL_bool SDL_GetRenderDrawColorFloat(SDL_Renderer *renderer, float *r, float *g, float *b, float *a) +bool SDL_GetRenderDrawColorFloat(SDL_Renderer *renderer, float *r, float *g, float *b, float *a) { SDL_FColor color; @@ -3274,7 +3274,7 @@ SDL_bool SDL_GetRenderDrawColorFloat(SDL_Renderer *renderer, float *r, float *g, return true; } -SDL_bool SDL_SetRenderColorScale(SDL_Renderer *renderer, float scale) +bool SDL_SetRenderColorScale(SDL_Renderer *renderer, float scale) { CHECK_RENDERER_MAGIC(renderer, false); @@ -3283,7 +3283,7 @@ SDL_bool SDL_SetRenderColorScale(SDL_Renderer *renderer, float scale) return true; } -SDL_bool SDL_GetRenderColorScale(SDL_Renderer *renderer, float *scale) +bool SDL_GetRenderColorScale(SDL_Renderer *renderer, float *scale) { if (scale) { *scale = 1.0f; @@ -3297,7 +3297,7 @@ SDL_bool SDL_GetRenderColorScale(SDL_Renderer *renderer, float *scale) return true; } -SDL_bool SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode) +bool SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode) { CHECK_RENDERER_MAGIC(renderer, false); @@ -3317,7 +3317,7 @@ SDL_bool SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendM return true; } -SDL_bool SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode) +bool SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode) { if (blendMode) { *blendMode = SDL_BLENDMODE_INVALID; @@ -3331,14 +3331,14 @@ SDL_bool SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blend return true; } -SDL_bool SDL_RenderClear(SDL_Renderer *renderer) +bool SDL_RenderClear(SDL_Renderer *renderer) { CHECK_RENDERER_MAGIC(renderer, false); return QueueCmdClear(renderer); } -SDL_bool SDL_RenderPoint(SDL_Renderer *renderer, float x, float y) +bool SDL_RenderPoint(SDL_Renderer *renderer, float x, float y) { SDL_FPoint fpoint; fpoint.x = x; @@ -3376,7 +3376,7 @@ static bool RenderPointsWithRects(SDL_Renderer *renderer, const SDL_FPoint *fpoi return result; } -SDL_bool SDL_RenderPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int count) +bool SDL_RenderPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int count) { bool result; @@ -3404,7 +3404,7 @@ SDL_bool SDL_RenderPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int return result; } -SDL_bool SDL_RenderLine(SDL_Renderer *renderer, float x1, float y1, float x2, float y2) +bool SDL_RenderLine(SDL_Renderer *renderer, float x1, float y1, float x2, float y2) { SDL_FPoint points[2]; points[0].x = x1; @@ -3580,7 +3580,7 @@ static bool RenderLinesWithRectsF(SDL_Renderer *renderer, return result; } -SDL_bool SDL_RenderLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count) +bool SDL_RenderLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count) { bool result = true; @@ -3731,7 +3731,7 @@ SDL_bool SDL_RenderLines(SDL_Renderer *renderer, const SDL_FPoint *points, int c return result; } -SDL_bool SDL_RenderRect(SDL_Renderer *renderer, const SDL_FRect *rect) +bool SDL_RenderRect(SDL_Renderer *renderer, const SDL_FRect *rect) { SDL_FRect frect; SDL_FPoint points[5]; @@ -3757,7 +3757,7 @@ SDL_bool SDL_RenderRect(SDL_Renderer *renderer, const SDL_FRect *rect) return SDL_RenderLines(renderer, points, 5); } -SDL_bool SDL_RenderRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count) +bool SDL_RenderRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count) { int i; @@ -3785,7 +3785,7 @@ SDL_bool SDL_RenderRects(SDL_Renderer *renderer, const SDL_FRect *rects, int cou return true; } -SDL_bool SDL_RenderFillRect(SDL_Renderer *renderer, const SDL_FRect *rect) +bool SDL_RenderFillRect(SDL_Renderer *renderer, const SDL_FRect *rect) { SDL_FRect frect; @@ -3799,7 +3799,7 @@ SDL_bool SDL_RenderFillRect(SDL_Renderer *renderer, const SDL_FRect *rect) return SDL_RenderFillRects(renderer, rect, 1); } -SDL_bool SDL_RenderFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count) +bool SDL_RenderFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count) { SDL_FRect *frects; int i; @@ -3904,7 +3904,7 @@ static bool SDL_RenderTextureInternal(SDL_Renderer *renderer, SDL_Texture *textu return result; } -SDL_bool SDL_RenderTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FRect *dstrect) +bool SDL_RenderTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FRect *dstrect) { SDL_FRect real_srcrect; SDL_FRect real_dstrect; @@ -3950,7 +3950,7 @@ SDL_bool SDL_RenderTexture(SDL_Renderer *renderer, SDL_Texture *texture, const S return SDL_RenderTextureInternal(renderer, texture, &real_srcrect, &real_dstrect); } -SDL_bool SDL_RenderTextureRotated(SDL_Renderer *renderer, SDL_Texture *texture, +bool SDL_RenderTextureRotated(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FRect *dstrect, const double angle, const SDL_FPoint *center, const SDL_FlipMode flip) { @@ -4213,7 +4213,7 @@ static bool SDL_RenderTextureTiled_Iterate(SDL_Renderer *renderer, SDL_Texture * return true; } -SDL_bool SDL_RenderTextureTiled(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float scale, const SDL_FRect *dstrect) +bool SDL_RenderTextureTiled(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float scale, const SDL_FRect *dstrect) { SDL_FRect real_srcrect; SDL_FRect real_dstrect; @@ -4271,7 +4271,7 @@ SDL_bool SDL_RenderTextureTiled(SDL_Renderer *renderer, SDL_Texture *texture, co } } -SDL_bool SDL_RenderTexture9Grid(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float left_width, float right_width, float top_height, float bottom_height, float scale, const SDL_FRect *dstrect) +bool SDL_RenderTexture9Grid(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float left_width, float right_width, float top_height, float bottom_height, float scale, const SDL_FRect *dstrect) { SDL_FRect full_src, full_dst; SDL_FRect curr_src, curr_dst; @@ -4406,7 +4406,7 @@ SDL_bool SDL_RenderTexture9Grid(SDL_Renderer *renderer, SDL_Texture *texture, co return true; } -SDL_bool SDL_RenderGeometry(SDL_Renderer *renderer, +bool SDL_RenderGeometry(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Vertex *vertices, int num_vertices, const int *indices, int num_indices) @@ -4796,7 +4796,7 @@ end: } #endif // SDL_VIDEO_RENDER_SW -SDL_bool SDL_RenderGeometryRaw(SDL_Renderer *renderer, +bool SDL_RenderGeometryRaw(SDL_Renderer *renderer, SDL_Texture *texture, const float *xy, int xy_stride, const SDL_FColor *color, int color_stride, @@ -5002,7 +5002,7 @@ static void SDL_SimulateRenderVSync(SDL_Renderer *renderer) } } -SDL_bool SDL_RenderPresent(SDL_Renderer *renderer) +bool SDL_RenderPresent(SDL_Renderer *renderer) { bool presented = true; @@ -5227,7 +5227,7 @@ void *SDL_GetRenderMetalCommandEncoder(SDL_Renderer *renderer) return NULL; } -SDL_bool SDL_AddVulkanRenderSemaphores(SDL_Renderer *renderer, Uint32 wait_stage_mask, Sint64 wait_semaphore, Sint64 signal_semaphore) +bool SDL_AddVulkanRenderSemaphores(SDL_Renderer *renderer, Uint32 wait_stage_mask, Sint64 wait_semaphore, Sint64 signal_semaphore) { CHECK_RENDERER_MAGIC(renderer, false); @@ -5335,7 +5335,7 @@ SDL_BlendOperation SDL_GetBlendModeAlphaOperation(SDL_BlendMode blendMode) return (SDL_BlendOperation)(((Uint32)blendMode >> 16) & 0xF); } -SDL_bool SDL_SetRenderVSync(SDL_Renderer *renderer, int vsync) +bool SDL_SetRenderVSync(SDL_Renderer *renderer, int vsync) { CHECK_RENDERER_MAGIC(renderer, false); @@ -5380,7 +5380,7 @@ SDL_bool SDL_SetRenderVSync(SDL_Renderer *renderer, int vsync) return true; } -SDL_bool SDL_GetRenderVSync(SDL_Renderer *renderer, int *vsync) +bool SDL_GetRenderVSync(SDL_Renderer *renderer, int *vsync) { if (vsync) { *vsync = 0; diff --git a/src/render/gpu/SDL_pipeline_gpu.c b/src/render/gpu/SDL_pipeline_gpu.c index 5e670c143..c8fdcbaf4 100644 --- a/src/render/gpu/SDL_pipeline_gpu.c +++ b/src/render/gpu/SDL_pipeline_gpu.c @@ -119,7 +119,7 @@ static SDL_GPUGraphicsPipeline *MakePipeline(SDL_GPUDevice *device, GPU_Shaders pci.vertex_shader = GPU_GetVertexShader(shaders, params->vert_shader); pci.fragment_shader = GPU_GetFragmentShader(shaders, params->frag_shader); pci.multisample_state.sample_count = SDL_GPU_SAMPLECOUNT_1; - pci.multisample_state.enable_mask = SDL_FALSE; + pci.multisample_state.enable_mask = false; pci.primitive_type = params->primitive_type; pci.rasterizer_state.cull_mode = SDL_GPU_CULLMODE_NONE; diff --git a/src/sensor/SDL_sensor.c b/src/sensor/SDL_sensor.c index d10601f12..0ce5a766f 100644 --- a/src/sensor/SDL_sensor.c +++ b/src/sensor/SDL_sensor.c @@ -472,7 +472,7 @@ SDL_SensorID SDL_GetSensorID(SDL_Sensor *sensor) /* * Get the current state of this sensor */ -SDL_bool SDL_GetSensorData(SDL_Sensor *sensor, float *data, int num_values) +bool SDL_GetSensorData(SDL_Sensor *sensor, float *data, int num_values) { SDL_LockSensors(); { diff --git a/src/stdlib/SDL_getenv.c b/src/stdlib/SDL_getenv.c index c78b95167..98dabe670 100644 --- a/src/stdlib/SDL_getenv.c +++ b/src/stdlib/SDL_getenv.c @@ -66,7 +66,7 @@ SDL_Environment *SDL_GetEnvironment(void) return SDL_environment; } -SDL_bool SDL_InitEnvironment(void) +bool SDL_InitEnvironment(void) { return (SDL_GetEnvironment() != NULL); } @@ -81,7 +81,7 @@ void SDL_QuitEnvironment(void) } } -SDL_Environment *SDL_CreateEnvironment(SDL_bool populated) +SDL_Environment *SDL_CreateEnvironment(bool populated) { SDL_Environment *env = SDL_calloc(1, sizeof(*env)); if (!env) { @@ -221,7 +221,7 @@ char **SDL_GetEnvironmentVariables(SDL_Environment *env) return result; } -SDL_bool SDL_SetEnvironmentVariable(SDL_Environment *env, const char *name, const char *value, SDL_bool overwrite) +bool SDL_SetEnvironmentVariable(SDL_Environment *env, const char *name, const char *value, bool overwrite) { bool result = false; @@ -263,7 +263,7 @@ SDL_bool SDL_SetEnvironmentVariable(SDL_Environment *env, const char *name, cons return result; } -SDL_bool SDL_UnsetEnvironmentVariable(SDL_Environment *env, const char *name) +bool SDL_UnsetEnvironmentVariable(SDL_Environment *env, const char *name) { bool result = false; diff --git a/src/stdlib/SDL_malloc.c b/src/stdlib/SDL_malloc.c index 96c99fcf4..4cdee69f6 100644 --- a/src/stdlib/SDL_malloc.c +++ b/src/stdlib/SDL_malloc.c @@ -6390,7 +6390,7 @@ void SDL_GetMemoryFunctions(SDL_malloc_func *malloc_func, } } -SDL_bool SDL_SetMemoryFunctions(SDL_malloc_func malloc_func, +bool SDL_SetMemoryFunctions(SDL_malloc_func malloc_func, SDL_calloc_func calloc_func, SDL_realloc_func realloc_func, SDL_free_func free_func) diff --git a/src/storage/SDL_storage.c b/src/storage/SDL_storage.c index 069d9af79..6cb4164fb 100644 --- a/src/storage/SDL_storage.c +++ b/src/storage/SDL_storage.c @@ -167,7 +167,7 @@ SDL_Storage *SDL_OpenStorage(const SDL_StorageInterface *iface, void *userdata) return storage; } -SDL_bool SDL_CloseStorage(SDL_Storage *storage) +bool SDL_CloseStorage(SDL_Storage *storage) { bool result = true; @@ -180,7 +180,7 @@ SDL_bool SDL_CloseStorage(SDL_Storage *storage) return result; } -SDL_bool SDL_StorageReady(SDL_Storage *storage) +bool SDL_StorageReady(SDL_Storage *storage) { CHECK_STORAGE_MAGIC_RET(false) @@ -190,7 +190,7 @@ SDL_bool SDL_StorageReady(SDL_Storage *storage) return true; } -SDL_bool SDL_GetStorageFileSize(SDL_Storage *storage, const char *path, Uint64 *length) +bool SDL_GetStorageFileSize(SDL_Storage *storage, const char *path, Uint64 *length) { SDL_PathInfo info; @@ -207,7 +207,7 @@ SDL_bool SDL_GetStorageFileSize(SDL_Storage *storage, const char *path, Uint64 * } } -SDL_bool SDL_ReadStorageFile(SDL_Storage *storage, const char *path, void *destination, Uint64 length) +bool SDL_ReadStorageFile(SDL_Storage *storage, const char *path, void *destination, Uint64 length) { CHECK_STORAGE_MAGIC() @@ -222,7 +222,7 @@ SDL_bool SDL_ReadStorageFile(SDL_Storage *storage, const char *path, void *desti return storage->iface.read_file(storage->userdata, path, destination, length); } -SDL_bool SDL_WriteStorageFile(SDL_Storage *storage, const char *path, const void *source, Uint64 length) +bool SDL_WriteStorageFile(SDL_Storage *storage, const char *path, const void *source, Uint64 length) { CHECK_STORAGE_MAGIC() @@ -237,7 +237,7 @@ SDL_bool SDL_WriteStorageFile(SDL_Storage *storage, const char *path, const void return storage->iface.write_file(storage->userdata, path, source, length); } -SDL_bool SDL_CreateStorageDirectory(SDL_Storage *storage, const char *path) +bool SDL_CreateStorageDirectory(SDL_Storage *storage, const char *path) { CHECK_STORAGE_MAGIC() @@ -252,7 +252,7 @@ SDL_bool SDL_CreateStorageDirectory(SDL_Storage *storage, const char *path) return storage->iface.mkdir(storage->userdata, path); } -SDL_bool SDL_EnumerateStorageDirectory(SDL_Storage *storage, const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata) +bool SDL_EnumerateStorageDirectory(SDL_Storage *storage, const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata) { CHECK_STORAGE_MAGIC() @@ -267,7 +267,7 @@ SDL_bool SDL_EnumerateStorageDirectory(SDL_Storage *storage, const char *path, S return storage->iface.enumerate(storage->userdata, path, callback, userdata); } -SDL_bool SDL_RemoveStoragePath(SDL_Storage *storage, const char *path) +bool SDL_RemoveStoragePath(SDL_Storage *storage, const char *path) { CHECK_STORAGE_MAGIC() @@ -282,7 +282,7 @@ SDL_bool SDL_RemoveStoragePath(SDL_Storage *storage, const char *path) return storage->iface.remove(storage->userdata, path); } -SDL_bool SDL_RenameStoragePath(SDL_Storage *storage, const char *oldpath, const char *newpath) +bool SDL_RenameStoragePath(SDL_Storage *storage, const char *oldpath, const char *newpath) { CHECK_STORAGE_MAGIC() @@ -300,7 +300,7 @@ SDL_bool SDL_RenameStoragePath(SDL_Storage *storage, const char *oldpath, const return storage->iface.rename(storage->userdata, oldpath, newpath); } -SDL_bool SDL_CopyStorageFile(SDL_Storage *storage, const char *oldpath, const char *newpath) +bool SDL_CopyStorageFile(SDL_Storage *storage, const char *oldpath, const char *newpath) { CHECK_STORAGE_MAGIC() @@ -318,7 +318,7 @@ SDL_bool SDL_CopyStorageFile(SDL_Storage *storage, const char *oldpath, const ch return storage->iface.copy(storage->userdata, oldpath, newpath); } -SDL_bool SDL_GetStoragePathInfo(SDL_Storage *storage, const char *path, SDL_PathInfo *info) +bool SDL_GetStoragePathInfo(SDL_Storage *storage, const char *path, SDL_PathInfo *info) { SDL_PathInfo dummy; @@ -352,12 +352,12 @@ Uint64 SDL_GetStorageSpaceRemaining(SDL_Storage *storage) return storage->iface.space_remaining(storage->userdata); } -static SDL_bool GlobStorageDirectoryGetPathInfo(const char *path, SDL_PathInfo *info, void *userdata) +static bool GlobStorageDirectoryGetPathInfo(const char *path, SDL_PathInfo *info, void *userdata) { return SDL_GetStoragePathInfo((SDL_Storage *) userdata, path, info); } -static SDL_bool GlobStorageDirectoryEnumerator(const char *path, SDL_EnumerateDirectoryCallback cb, void *cbuserdata, void *userdata) +static bool GlobStorageDirectoryEnumerator(const char *path, SDL_EnumerateDirectoryCallback cb, void *cbuserdata, void *userdata) { return SDL_EnumerateStorageDirectory((SDL_Storage *) userdata, path, cb, cbuserdata); } diff --git a/src/storage/generic/SDL_genericstorage.c b/src/storage/generic/SDL_genericstorage.c index 4cd856cef..483ca5e28 100644 --- a/src/storage/generic/SDL_genericstorage.c +++ b/src/storage/generic/SDL_genericstorage.c @@ -38,13 +38,13 @@ static char *GENERIC_INTERNAL_CreateFullPath(const char *base, const char *relat return result; } -static SDL_bool GENERIC_CloseStorage(void *userdata) +static bool GENERIC_CloseStorage(void *userdata) { SDL_free(userdata); return true; } -static SDL_bool GENERIC_EnumerateStorageDirectory(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata) +static bool GENERIC_EnumerateStorageDirectory(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata) { bool result = false; @@ -57,7 +57,7 @@ static SDL_bool GENERIC_EnumerateStorageDirectory(void *userdata, const char *pa return result; } -static SDL_bool GENERIC_GetStoragePathInfo(void *userdata, const char *path, SDL_PathInfo *info) +static bool GENERIC_GetStoragePathInfo(void *userdata, const char *path, SDL_PathInfo *info) { bool result = false; @@ -70,7 +70,7 @@ static SDL_bool GENERIC_GetStoragePathInfo(void *userdata, const char *path, SDL return result; } -static SDL_bool GENERIC_ReadStorageFile(void *userdata, const char *path, void *destination, Uint64 length) +static bool GENERIC_ReadStorageFile(void *userdata, const char *path, void *destination, Uint64 length) { bool result = false; @@ -93,7 +93,7 @@ static SDL_bool GENERIC_ReadStorageFile(void *userdata, const char *path, void * return result; } -static SDL_bool GENERIC_WriteStorageFile(void *userdata, const char *path, const void *source, Uint64 length) +static bool GENERIC_WriteStorageFile(void *userdata, const char *path, const void *source, Uint64 length) { // TODO: Recursively create subdirectories with SDL_CreateDirectory bool result = false; @@ -118,7 +118,7 @@ static SDL_bool GENERIC_WriteStorageFile(void *userdata, const char *path, const return result; } -static SDL_bool GENERIC_CreateStorageDirectory(void *userdata, const char *path) +static bool GENERIC_CreateStorageDirectory(void *userdata, const char *path) { // TODO: Recursively create subdirectories with SDL_CreateDirectory bool result = false; @@ -132,7 +132,7 @@ static SDL_bool GENERIC_CreateStorageDirectory(void *userdata, const char *path) return result; } -static SDL_bool GENERIC_RemoveStoragePath(void *userdata, const char *path) +static bool GENERIC_RemoveStoragePath(void *userdata, const char *path) { bool result = false; @@ -145,7 +145,7 @@ static SDL_bool GENERIC_RemoveStoragePath(void *userdata, const char *path) return result; } -static SDL_bool GENERIC_RenameStoragePath(void *userdata, const char *oldpath, const char *newpath) +static bool GENERIC_RenameStoragePath(void *userdata, const char *oldpath, const char *newpath) { bool result = false; @@ -160,7 +160,7 @@ static SDL_bool GENERIC_RenameStoragePath(void *userdata, const char *oldpath, c return result; } -static SDL_bool GENERIC_CopyStorageFile(void *userdata, const char *oldpath, const char *newpath) +static bool GENERIC_CopyStorageFile(void *userdata, const char *oldpath, const char *newpath) { bool result = false; diff --git a/src/storage/steam/SDL_steamstorage.c b/src/storage/steam/SDL_steamstorage.c index 7977ca71a..07e5def83 100644 --- a/src/storage/steam/SDL_steamstorage.c +++ b/src/storage/steam/SDL_steamstorage.c @@ -38,7 +38,7 @@ typedef struct STEAM_RemoteStorage #include "SDL_steamstorage_proc.h" } STEAM_RemoteStorage; -static SDL_bool STEAM_CloseStorage(void *userdata) +static bool STEAM_CloseStorage(void *userdata) { bool result = true; STEAM_RemoteStorage *steam = (STEAM_RemoteStorage*) userdata; @@ -53,12 +53,12 @@ static SDL_bool STEAM_CloseStorage(void *userdata) return result; } -static SDL_bool STEAM_StorageReady(void *userdata) +static bool STEAM_StorageReady(void *userdata) { return true; } -static SDL_bool STEAM_GetStoragePathInfo(void *userdata, const char *path, SDL_PathInfo *info) +static bool STEAM_GetStoragePathInfo(void *userdata, const char *path, SDL_PathInfo *info) { STEAM_RemoteStorage *steam = (STEAM_RemoteStorage*) userdata; void *steamremotestorage = steam->SteamAPI_SteamRemoteStorage_v016(); @@ -74,7 +74,7 @@ static SDL_bool STEAM_GetStoragePathInfo(void *userdata, const char *path, SDL_P return true; } -static SDL_bool STEAM_ReadStorageFile(void *userdata, const char *path, void *destination, Uint64 length) +static bool STEAM_ReadStorageFile(void *userdata, const char *path, void *destination, Uint64 length) { bool result = false; STEAM_RemoteStorage *steam = (STEAM_RemoteStorage*) userdata; @@ -93,7 +93,7 @@ static SDL_bool STEAM_ReadStorageFile(void *userdata, const char *path, void *de return result; } -static SDL_bool STEAM_WriteStorageFile(void *userdata, const char *path, const void *source, Uint64 length) +static bool STEAM_WriteStorageFile(void *userdata, const char *path, const void *source, Uint64 length) { int result = false; STEAM_RemoteStorage *steam = (STEAM_RemoteStorage*) userdata; diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c index 6ce631cc5..6f83cef14 100644 --- a/src/test/SDL_test_common.c +++ b/src/test/SDL_test_common.c @@ -264,13 +264,13 @@ static int SDLCALL SDLTest_CommonStateParseVideoArguments(void *data, char **arg } if (SDL_strcasecmp(argv[index], "--fullscreen") == 0) { state->window_flags |= SDL_WINDOW_FULLSCREEN; - state->fullscreen_exclusive = SDL_TRUE; + state->fullscreen_exclusive = true; state->num_windows = 1; return 1; } if (SDL_strcasecmp(argv[index], "--fullscreen-desktop") == 0) { state->window_flags |= SDL_WINDOW_FULLSCREEN; - state->fullscreen_exclusive = SDL_FALSE; + state->fullscreen_exclusive = false; state->num_windows = 1; return 1; } @@ -344,7 +344,7 @@ static int SDLCALL SDLTest_CommonStateParseVideoArguments(void *data, char **arg return 2; } if (SDL_strcasecmp(argv[index], "--usable-bounds") == 0) { - state->fill_usable_bounds = SDL_TRUE; + state->fill_usable_bounds = true; return 1; } if (SDL_strcasecmp(argv[index], "--geometry") == 0) { @@ -448,7 +448,7 @@ static int SDLCALL SDLTest_CommonStateParseVideoArguments(void *data, char **arg return 1; } if (SDL_strcasecmp(argv[index], "--auto-scale-content") == 0) { - state->auto_scale_content = SDL_TRUE; + state->auto_scale_content = true; if (state->logical_presentation == SDL_LOGICAL_PRESENTATION_DISABLED) { state->logical_presentation = SDL_LOGICAL_PRESENTATION_STRETCH; @@ -562,7 +562,7 @@ static int SDLCALL SDLTest_CommonStateParseVideoArguments(void *data, char **arg return 1; } if (SDL_strcasecmp(argv[index], "--flash-on-focus-loss") == 0) { - state->flash_on_focus_loss = SDL_TRUE; + state->flash_on_focus_loss = true; return 1; } if (SDL_strcasecmp(argv[index], "--grab") == 0) { @@ -578,7 +578,7 @@ static int SDLCALL SDLTest_CommonStateParseVideoArguments(void *data, char **arg return 1; } if (SDL_strcasecmp(argv[index], "--hide-cursor") == 0) { - state->hide_cursor = SDL_TRUE; + state->hide_cursor = true; return 1; } if (SDL_strcasecmp(argv[index], "--gpu") == 0) { @@ -803,18 +803,18 @@ void SDLTest_CommonLogUsage(SDLTest_CommonState *state, const char *argv0, const } } -SDL_bool SDLTest_CommonDefaultArgs(SDLTest_CommonState *state, const int argc, char **argv) +bool SDLTest_CommonDefaultArgs(SDLTest_CommonState *state, const int argc, char **argv) { int i = 1; while (i < argc) { const int consumed = SDLTest_CommonArg(state, i); if (consumed <= 0) { SDLTest_CommonLogUsage(state, argv[0], NULL); - return SDL_FALSE; + return false; } i += consumed; } - return SDL_TRUE; + return true; } static void SDLTest_PrintDisplayOrientation(char *text, size_t maxlen, SDL_DisplayOrientation orientation) @@ -1192,7 +1192,7 @@ static SDL_HitTestResult SDLCALL SDLTest_ExampleHitTestCallback(SDL_Window *win, return SDL_HITTEST_NORMAL; } -SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state) +bool SDLTest_CommonInit(SDLTest_CommonState *state) { int i, j, m, n, w, h; char text[1024]; @@ -1216,7 +1216,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state) if (!SDL_InitSubSystem(SDL_INIT_VIDEO)) { SDL_Log("Couldn't initialize video driver: %s\n", SDL_GetError()); - return SDL_FALSE; + return false; } if (state->verbose & VERBOSE_VIDEO) { SDL_Log("Video driver: %s\n", @@ -1367,9 +1367,9 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state) } { - SDL_bool include_high_density_modes = SDL_FALSE; + bool include_high_density_modes = false; if (state->window_flags & SDL_WINDOW_HIGH_PIXEL_DENSITY) { - include_high_density_modes = SDL_TRUE; + include_high_density_modes = true; } SDL_GetClosestFullscreenDisplayMode(state->displayID, state->window_w, state->window_h, state->refresh_rate, include_high_density_modes, &state->fullscreen_mode); } @@ -1385,7 +1385,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state) sizeof(*state->targets)); if (!state->windows || !state->renderers) { SDL_Log("Out of memory!\n"); - return SDL_FALSE; + return false; } for (i = 0; i < state->num_windows; ++i) { char title[1024]; @@ -1424,7 +1424,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state) if (!state->windows[i]) { SDL_Log("Couldn't create window: %s\n", SDL_GetError()); - return SDL_FALSE; + return false; } if (state->window_minW || state->window_minH) { SDL_SetWindowMinimumSize(state->windows[i], state->window_minW, state->window_minH); @@ -1445,7 +1445,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state) if (state->fullscreen_exclusive) { SDL_SetWindowFullscreenMode(state->windows[i], &state->fullscreen_mode); } - SDL_SetWindowFullscreen(state->windows[i], SDL_TRUE); + SDL_SetWindowFullscreen(state->windows[i], true); } /* Add resize/drag areas for windows that are borderless and resizable */ @@ -1471,7 +1471,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state) if (!state->renderers[i]) { SDL_Log("Couldn't create renderer: %s\n", SDL_GetError()); - return SDL_FALSE; + return false; } if (state->logical_w == 0 || state->logical_h == 0) { state->logical_w = state->window_w; @@ -1482,7 +1482,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state) } if (!SDL_SetRenderLogicalPresentation(state->renderers[i], state->logical_w, state->logical_h, state->logical_presentation, state->logical_scale_mode)) { SDL_Log("Couldn't set logical presentation: %s\n", SDL_GetError()); - return SDL_FALSE; + return false; } if (state->scale != 0.0f) { SDL_SetRenderScale(state->renderers[i], state->scale, state->scale); @@ -1519,7 +1519,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state) if (!SDL_InitSubSystem(SDL_INIT_AUDIO)) { SDL_Log("Couldn't initialize audio driver: %s\n", SDL_GetError()); - return SDL_FALSE; + return false; } if (state->verbose & VERBOSE_AUDIO) { SDL_Log("Audio driver: %s\n", @@ -1530,7 +1530,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state) state->audio_id = SDL_OpenAudioDevice(SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &spec); if (!state->audio_id) { SDL_Log("Couldn't open audio: %s\n", SDL_GetError()); - return SDL_FALSE; + return false; } } @@ -1538,7 +1538,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state) SDL_InitSubSystem(SDL_INIT_CAMERA); } - return SDL_TRUE; + return true; } static const char *SystemThemeName(void) @@ -2108,7 +2108,7 @@ static void FullscreenTo(SDLTest_CommonState *state, int index, int windowId) flags = SDL_GetWindowFlags(window); if (flags & SDL_WINDOW_FULLSCREEN) { - SDL_SetWindowFullscreen(window, SDL_FALSE); + SDL_SetWindowFullscreen(window, false); SDL_Delay(15); } @@ -2121,9 +2121,9 @@ static void FullscreenTo(SDLTest_CommonState *state, int index, int windowId) new_mode.displayID = displays[index]; if (!SDL_SetWindowFullscreenMode(window, &new_mode)) { /* Try again with a default mode */ - SDL_bool include_high_density_modes = SDL_FALSE; + bool include_high_density_modes = false; if (state->window_flags & SDL_WINDOW_HIGH_PIXEL_DENSITY) { - include_high_density_modes = SDL_TRUE; + include_high_density_modes = true; } if (SDL_GetClosestFullscreenDisplayMode(displays[index], state->window_w, state->window_h, state->refresh_rate, include_high_density_modes, &new_mode)) { SDL_SetWindowFullscreenMode(window, &new_mode); @@ -2133,7 +2133,7 @@ static void FullscreenTo(SDLTest_CommonState *state, int index, int windowId) if (!mode) { SDL_SetWindowPosition(window, rect.x, rect.y); } - SDL_SetWindowFullscreen(window, SDL_TRUE); + SDL_SetWindowFullscreen(window, true); } } SDL_free(displays); @@ -2184,9 +2184,9 @@ SDL_AppResult SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const } case SDL_EVENT_KEY_DOWN: { - SDL_bool withControl = !!(event->key.mod & SDL_KMOD_CTRL); - SDL_bool withShift = !!(event->key.mod & SDL_KMOD_SHIFT); - SDL_bool withAlt = !!(event->key.mod & SDL_KMOD_ALT); + bool withControl = !!(event->key.mod & SDL_KMOD_CTRL); + bool withShift = !!(event->key.mod & SDL_KMOD_SHIFT); + bool withAlt = !!(event->key.mod & SDL_KMOD_ALT); switch (event->key.key) { /* Add hotkeys here */ @@ -2404,8 +2404,8 @@ SDL_AppResult SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const if (withShift) { SDL_Window *window = SDL_GetWindowFromEvent(event); if (window) { - const SDL_bool shouldCapture = !(SDL_GetWindowFlags(window) & SDL_WINDOW_MOUSE_CAPTURE); - const SDL_bool rc = SDL_CaptureMouse(shouldCapture); + const bool shouldCapture = !(SDL_GetWindowFlags(window) & SDL_WINDOW_MOUSE_CAPTURE); + const bool rc = SDL_CaptureMouse(shouldCapture); SDL_Log("%sapturing mouse %s!\n", shouldCapture ? "C" : "Unc", rc ? "succeeded" : "failed"); } } @@ -2426,9 +2426,9 @@ SDL_AppResult SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const if (window) { SDL_WindowFlags flags = SDL_GetWindowFlags(window); if (flags & SDL_WINDOW_ALWAYS_ON_TOP) { - SDL_SetWindowAlwaysOnTop(window, SDL_FALSE); + SDL_SetWindowAlwaysOnTop(window, false); } else { - SDL_SetWindowAlwaysOnTop(window, SDL_TRUE); + SDL_SetWindowAlwaysOnTop(window, true); } } } @@ -2451,9 +2451,9 @@ SDL_AppResult SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const if (!(flags & SDL_WINDOW_FULLSCREEN) || !SDL_GetWindowFullscreenMode(window)) { SDL_SetWindowFullscreenMode(window, &state->fullscreen_mode); - SDL_SetWindowFullscreen(window, SDL_TRUE); + SDL_SetWindowFullscreen(window, true); } else { - SDL_SetWindowFullscreen(window, SDL_FALSE); + SDL_SetWindowFullscreen(window, false); } } } else if (withAlt) { @@ -2464,9 +2464,9 @@ SDL_AppResult SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const if (!(flags & SDL_WINDOW_FULLSCREEN) || SDL_GetWindowFullscreenMode(window)) { SDL_SetWindowFullscreenMode(window, NULL); - SDL_SetWindowFullscreen(window, SDL_TRUE); + SDL_SetWindowFullscreen(window, true); } else { - SDL_SetWindowFullscreen(window, SDL_FALSE); + SDL_SetWindowFullscreen(window, false); } } } @@ -2478,7 +2478,7 @@ SDL_AppResult SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Window *window = SDL_GetWindowFromEvent(event); if (window) { const SDL_WindowFlags flags = SDL_GetWindowFlags(window); - const SDL_bool b = (flags & SDL_WINDOW_BORDERLESS) ? SDL_TRUE : SDL_FALSE; + const bool b = (flags & SDL_WINDOW_BORDERLESS) ? true : false; SDL_SetWindowBordered(window, b); } } diff --git a/src/test/SDL_test_crc32.c b/src/test/SDL_test_crc32.c index 0421fac75..e2fd84ed1 100644 --- a/src/test/SDL_test_crc32.c +++ b/src/test/SDL_test_crc32.c @@ -27,7 +27,7 @@ */ #include -SDL_bool SDLTest_Crc32Init(SDLTest_Crc32Context *crcContext) +bool SDLTest_Crc32Init(SDLTest_Crc32Context *crcContext) { int i, j; CrcUint32 c; @@ -61,30 +61,30 @@ SDL_bool SDLTest_Crc32Init(SDLTest_Crc32Context *crcContext) } #endif - return SDL_TRUE; + return true; } /* Complete CRC32 calculation on a memory block */ -SDL_bool SDLTest_Crc32Calc(SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32) +bool SDLTest_Crc32Calc(SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32) { if (!SDLTest_Crc32CalcStart(crcContext, crc32)) { - return SDL_FALSE; + return false; } if (!SDLTest_Crc32CalcBuffer(crcContext, inBuf, inLen, crc32)) { - return SDL_FALSE; + return false; } if (!SDLTest_Crc32CalcEnd(crcContext, crc32)) { - return SDL_FALSE; + return false; } - return SDL_TRUE; + return true; } /* Start crc calculation */ -SDL_bool SDLTest_Crc32CalcStart(SDLTest_Crc32Context *crcContext, CrcUint32 *crc32) +bool SDLTest_Crc32CalcStart(SDLTest_Crc32Context *crcContext, CrcUint32 *crc32) { /* Sanity check pointers */ if (!crcContext) { @@ -97,12 +97,12 @@ SDL_bool SDLTest_Crc32CalcStart(SDLTest_Crc32Context *crcContext, CrcUint32 *crc */ *crc32 = 0xffffffff; - return SDL_TRUE; + return true; } /* Finish crc calculation */ -SDL_bool SDLTest_Crc32CalcEnd(SDLTest_Crc32Context *crcContext, CrcUint32 *crc32) +bool SDLTest_Crc32CalcEnd(SDLTest_Crc32Context *crcContext, CrcUint32 *crc32) { /* Sanity check pointers */ if (!crcContext) { @@ -115,12 +115,12 @@ SDL_bool SDLTest_Crc32CalcEnd(SDLTest_Crc32Context *crcContext, CrcUint32 *crc32 */ *crc32 = (~(*crc32)); - return SDL_TRUE; + return true; } /* Include memory block in crc */ -SDL_bool SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32) +bool SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32) { CrcUint8 *p; register CrcUint32 crc; @@ -147,14 +147,14 @@ SDL_bool SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context *crcContext, CrcUint8 *inB } *crc32 = crc; - return SDL_TRUE; + return true; } -SDL_bool SDLTest_Crc32Done(SDLTest_Crc32Context *crcContext) +bool SDLTest_Crc32Done(SDLTest_Crc32Context *crcContext) { if (!crcContext) { return SDL_InvalidParamError("crcContext"); } - return SDL_TRUE; + return true; } diff --git a/src/test/SDL_test_font.c b/src/test/SDL_test_font.c index 8d5e0a360..160fa7b9a 100644 --- a/src/test/SDL_test_font.c +++ b/src/test/SDL_test_font.c @@ -3142,13 +3142,13 @@ static struct SDLTest_CharTextureCache *SDLTest_CharTextureCacheList; int FONT_CHARACTER_SIZE = 8; -SDL_bool SDLTest_DrawCharacter(SDL_Renderer *renderer, float x, float y, Uint32 c) +bool SDLTest_DrawCharacter(SDL_Renderer *renderer, float x, float y, Uint32 c) { const Uint32 charWidth = FONT_CHARACTER_SIZE; const Uint32 charHeight = FONT_CHARACTER_SIZE; SDL_FRect srect; SDL_FRect drect; - SDL_bool result; + bool result; Uint32 ix, iy; const unsigned char *charpos; Uint32 *curpos; @@ -3205,7 +3205,7 @@ SDL_bool SDLTest_DrawCharacter(SDL_Renderer *renderer, float x, float y, Uint32 */ character = SDL_CreateSurface(charWidth, charHeight, SDL_PIXELFORMAT_RGBA8888); if (!character) { - return SDL_FALSE; + return false; } charpos = SDLTest_FontData + ci * 8; @@ -3237,7 +3237,7 @@ SDL_bool SDLTest_DrawCharacter(SDL_Renderer *renderer, float x, float y, Uint32 * Check pointer */ if (cache->charTextureCache[ci] == NULL) { - return SDL_FALSE; + return false; } SDL_SetTextureScaleMode(cache->charTextureCache[ci], SDL_SCALEMODE_NEAREST); @@ -3246,7 +3246,7 @@ SDL_bool SDLTest_DrawCharacter(SDL_Renderer *renderer, float x, float y, Uint32 /* * Set color */ - result = SDL_TRUE; + result = true; result &= SDL_GetRenderDrawColor(renderer, &r, &g, &b, &a); result &= SDL_SetTextureColorMod(cache->charTextureCache[ci], r, g, b); result &= SDL_SetTextureAlphaMod(cache->charTextureCache[ci], a); @@ -3267,8 +3267,8 @@ static Uint32 UTF8_getch(const char *src, size_t srclen, int *inc) const Uint8 *p = (const Uint8 *)src; size_t left = 0; size_t save_srclen = srclen; - SDL_bool overlong = SDL_FALSE; - SDL_bool underflow = SDL_FALSE; + bool overlong = false; + bool underflow = false; Uint32 ch = UNKNOWN_UNICODE; if (srclen == 0) { @@ -3277,7 +3277,7 @@ static Uint32 UTF8_getch(const char *src, size_t srclen, int *inc) if (p[0] >= 0xFC) { if ((p[0] & 0xFE) == 0xFC) { if (p[0] == 0xFC && (p[1] & 0xFC) == 0x80) { - overlong = SDL_TRUE; + overlong = true; } ch = (Uint32)(p[0] & 0x01); left = 5; @@ -3285,7 +3285,7 @@ static Uint32 UTF8_getch(const char *src, size_t srclen, int *inc) } else if (p[0] >= 0xF8) { if ((p[0] & 0xFC) == 0xF8) { if (p[0] == 0xF8 && (p[1] & 0xF8) == 0x80) { - overlong = SDL_TRUE; + overlong = true; } ch = (Uint32)(p[0] & 0x03); left = 4; @@ -3293,7 +3293,7 @@ static Uint32 UTF8_getch(const char *src, size_t srclen, int *inc) } else if (p[0] >= 0xF0) { if ((p[0] & 0xF8) == 0xF0) { if (p[0] == 0xF0 && (p[1] & 0xF0) == 0x80) { - overlong = SDL_TRUE; + overlong = true; } ch = (Uint32)(p[0] & 0x07); left = 3; @@ -3301,7 +3301,7 @@ static Uint32 UTF8_getch(const char *src, size_t srclen, int *inc) } else if (p[0] >= 0xE0) { if ((p[0] & 0xF0) == 0xE0) { if (p[0] == 0xE0 && (p[1] & 0xE0) == 0x80) { - overlong = SDL_TRUE; + overlong = true; } ch = (Uint32)(p[0] & 0x0F); left = 2; @@ -3309,7 +3309,7 @@ static Uint32 UTF8_getch(const char *src, size_t srclen, int *inc) } else if (p[0] >= 0xC0) { if ((p[0] & 0xE0) == 0xC0) { if ((p[0] & 0xDE) == 0xC0) { - overlong = SDL_TRUE; + overlong = true; } ch = (Uint32)(p[0] & 0x1F); left = 1; @@ -3332,7 +3332,7 @@ static Uint32 UTF8_getch(const char *src, size_t srclen, int *inc) --left; } if (left > 0) { - underflow = SDL_TRUE; + underflow = true; } if (overlong || underflow || @@ -3348,10 +3348,10 @@ static Uint32 UTF8_getch(const char *src, size_t srclen, int *inc) #define UTF8_IsTrailingByte(c) ((c) >= 0x80 && (c) <= 0xBF) -SDL_bool SDLTest_DrawString(SDL_Renderer *renderer, float x, float y, const char *s) +bool SDLTest_DrawString(SDL_Renderer *renderer, float x, float y, const char *s) { const Uint32 charWidth = FONT_CHARACTER_SIZE; - SDL_bool result = SDL_TRUE; + bool result = true; float curx = x; float cury = y; size_t len = SDL_strlen(s); @@ -3417,12 +3417,12 @@ void SDLTest_TextWindowAddText(SDLTest_TextWindow *textwin, const char *fmt, ... void SDLTest_TextWindowAddTextWithLength(SDLTest_TextWindow *textwin, const char *text, size_t len) { size_t existing; - SDL_bool newline = SDL_FALSE; + bool newline = false; char *line; if (len > 0 && text[len - 1] == '\n') { --len; - newline = SDL_TRUE; + newline = true; } if (textwin->lines[textwin->current]) { diff --git a/src/test/SDL_test_fuzzer.c b/src/test/SDL_test_fuzzer.c index 94d08a81f..6820c9cf3 100644 --- a/src/test/SDL_test_fuzzer.c +++ b/src/test/SDL_test_fuzzer.c @@ -170,7 +170,7 @@ Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max) * * \returns Returns a random boundary value for the domain or 0 in case of error */ -static Uint64 SDLTest_GenerateUnsignedBoundaryValues(const Uint64 maxValue, Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain) +static Uint64 SDLTest_GenerateUnsignedBoundaryValues(const Uint64 maxValue, Uint64 boundary1, Uint64 boundary2, bool validDomain) { Uint64 b1, b2; Uint64 delta; @@ -187,7 +187,7 @@ static Uint64 SDLTest_GenerateUnsignedBoundaryValues(const Uint64 maxValue, Uint } index = 0; - if (validDomain == SDL_TRUE) { + if (validDomain == true) { if (b1 == b2) { return b1; } @@ -231,7 +231,7 @@ static Uint64 SDLTest_GenerateUnsignedBoundaryValues(const Uint64 maxValue, Uint return tempBuf[SDLTest_RandomUint8() % index]; } -Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain) +Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, bool validDomain) { /* max value for Uint8 */ const Uint64 maxValue = UCHAR_MAX; @@ -240,7 +240,7 @@ Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_boo validDomain); } -Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain) +Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, bool validDomain) { /* max value for Uint16 */ const Uint64 maxValue = USHRT_MAX; @@ -249,7 +249,7 @@ Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL validDomain); } -Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain) +Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, bool validDomain) { /* max value for Uint32 */ #if ((ULONG_MAX) == (UINT_MAX)) @@ -262,7 +262,7 @@ Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL validDomain); } -Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain) +Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, bool validDomain) { /* max value for Uint64 */ const Uint64 maxValue = UINT64_MAX; @@ -296,7 +296,7 @@ Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL * * \returns Returns a random boundary value for the domain or 0 in case of error */ -static Sint64 SDLTest_GenerateSignedBoundaryValues(const Sint64 minValue, const Sint64 maxValue, Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain) +static Sint64 SDLTest_GenerateSignedBoundaryValues(const Sint64 minValue, const Sint64 maxValue, Sint64 boundary1, Sint64 boundary2, bool validDomain) { Sint64 b1, b2; Sint64 delta; @@ -313,7 +313,7 @@ static Sint64 SDLTest_GenerateSignedBoundaryValues(const Sint64 minValue, const } index = 0; - if (validDomain == SDL_TRUE) { + if (validDomain == true) { if (b1 == b2) { return b1; } @@ -357,7 +357,7 @@ static Sint64 SDLTest_GenerateSignedBoundaryValues(const Sint64 minValue, const return tempBuf[SDLTest_RandomUint8() % index]; } -Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain) +Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, bool validDomain) { /* min & max values for Sint8 */ const Sint64 maxValue = SCHAR_MAX; @@ -367,7 +367,7 @@ Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_boo validDomain); } -Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain) +Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, bool validDomain) { /* min & max values for Sint16 */ const Sint64 maxValue = SHRT_MAX; @@ -377,7 +377,7 @@ Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL validDomain); } -Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain) +Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, bool validDomain) { /* min & max values for Sint32 */ #if ((ULONG_MAX) == (UINT_MAX)) @@ -392,7 +392,7 @@ Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL validDomain); } -Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain) +Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, bool validDomain) { /* min & max values for Sint64 */ const Sint64 maxValue = INT64_MAX; diff --git a/src/test/SDL_test_harness.c b/src/test/SDL_test_harness.c index 2300afc54..4dd651de9 100644 --- a/src/test/SDL_test_harness.c +++ b/src/test/SDL_test_harness.c @@ -55,7 +55,7 @@ struct SDLTest_TestSuiteRunner { Uint64 execKey; char *filter; int testIterations; - SDL_bool randomOrder; + bool randomOrder; } user; SDLTest_ArgumentParser argparser; @@ -229,7 +229,7 @@ static Uint32 SDLCALL SDLTest_BailOut(void *userdata, SDL_TimerID timerID, Uint3 * * \returns Test case result. */ -static int SDLTest_RunTest(SDLTest_TestSuiteReference *testSuite, const SDLTest_TestCaseReference *testCase, Uint64 execKey, SDL_bool forceTestRun) +static int SDLTest_RunTest(SDLTest_TestSuiteReference *testSuite, const SDLTest_TestCaseReference *testCase, Uint64 execKey, bool forceTestRun) { SDL_TimerID timer = 0; int testCaseResult = 0; @@ -242,7 +242,7 @@ static int SDLTest_RunTest(SDLTest_TestSuiteReference *testSuite, const SDLTest_ return TEST_RESULT_SETUP_FAILURE; } - if (!testCase->enabled && forceTestRun == SDL_FALSE) { + if (!testCase->enabled && forceTestRun == false) { SDLTest_Log(SDLTEST_FINAL_RESULT_FORMAT, "Test", testCase->name, "Skipped (Disabled)"); return TEST_RESULT_SKIPPED; } @@ -387,7 +387,7 @@ int SDLTest_ExecuteTestSuiteRunner(SDLTest_TestSuiteRunner *runner) const char *suiteFilterName = NULL; int testFilter = 0; const char *testFilterName = NULL; - SDL_bool forceTestRun = SDL_FALSE; + bool forceTestRun = false; int testResult = 0; int runResult = 0; int totalTestFailedCount = 0; @@ -505,7 +505,7 @@ int SDLTest_ExecuteTestSuiteRunner(SDLTest_TestSuiteRunner *runner) return 2; } - runner->user.randomOrder = SDL_FALSE; + runner->user.randomOrder = false; } /* Number of test suites */ @@ -640,7 +640,7 @@ int SDLTest_ExecuteTestSuiteRunner(SDLTest_TestSuiteRunner *runner) /* Override 'disabled' flag if we specified a test filter (i.e. force run for debugging) */ if (testFilter == 1 && !testCase->enabled) { SDLTest_Log("Force run of disabled test since test filter was set"); - forceTestRun = SDL_TRUE; + forceTestRun = true; } /* Take time - test start */ @@ -812,7 +812,7 @@ static int SDLCALL SDLTest_TestSuiteCommonArg(void *data, char **argv, int index } } else if (SDL_strcasecmp(argv[index], "--random-order") == 0) { - runner->user.randomOrder = SDL_TRUE; + runner->user.randomOrder = true; return 1; } return 0; diff --git a/src/test/SDL_test_memory.c b/src/test/SDL_test_memory.c index cad5c8fab..524404dc5 100644 --- a/src/test/SDL_test_memory.c +++ b/src/test/SDL_test_memory.c @@ -25,7 +25,7 @@ #include #ifndef unw_get_proc_name_by_ip #define SDLTEST_UNWIND_NO_PROC_NAME_BY_IP -static SDL_bool s_unwind_symbol_names = SDL_TRUE; +static bool s_unwind_symbol_names = true; #endif #endif @@ -73,7 +73,7 @@ static SDL_realloc_func SDL_realloc_orig = NULL; static SDL_free_func SDL_free_orig = NULL; static int s_previous_allocations = 0; static SDL_tracked_allocation *s_tracked_allocations[256]; -static SDL_bool s_randfill_allocations = SDL_FALSE; +static bool s_randfill_allocations = false; static SDL_AtomicInt s_lock; #define LOCK_ALLOCATOR() \ @@ -82,7 +82,7 @@ static SDL_AtomicInt s_lock; break; \ } \ SDL_CPUPauseInstruction(); \ - } while (SDL_TRUE) + } while (true) #define UNLOCK_ALLOCATOR() do { SDL_SetAtomicInt(&s_lock, 0); } while (0) static unsigned int get_allocation_bucket(void *mem) @@ -116,7 +116,7 @@ static size_t SDL_GetTrackedAllocationSize(void *mem) return entry ? entry->size : SIZE_MAX; } -static SDL_bool SDL_IsAllocationTracked(void *mem) +static bool SDL_IsAllocationTracked(void *mem) { return SDL_GetTrackedAllocation(mem) != NULL; } @@ -302,9 +302,9 @@ void SDLTest_TrackAllocations(void) const char *env_trackmem = SDL_getenv_unsafe("SDL_TRACKMEM_SYMBOL_NAMES"); if (env_trackmem) { if (SDL_strcasecmp(env_trackmem, "1") == 0 || SDL_strcasecmp(env_trackmem, "yes") == 0 || SDL_strcasecmp(env_trackmem, "true") == 0) { - s_unwind_symbol_names = SDL_TRUE; + s_unwind_symbol_names = true; } else if (SDL_strcasecmp(env_trackmem, "0") == 0 || SDL_strcasecmp(env_trackmem, "no") == 0 || SDL_strcasecmp(env_trackmem, "false") == 0) { - s_unwind_symbol_names = SDL_FALSE; + s_unwind_symbol_names = false; } } } while (0); @@ -348,7 +348,7 @@ void SDLTest_RandFillAllocations(void) { SDLTest_TrackAllocations(); - s_randfill_allocations = SDL_TRUE; + s_randfill_allocations = true; } void SDLTest_LogAllocations(void) diff --git a/src/thread/SDL_thread.c b/src/thread/SDL_thread.c index 895cc847a..5d4550a04 100644 --- a/src/thread/SDL_thread.c +++ b/src/thread/SDL_thread.c @@ -54,7 +54,7 @@ void *SDL_GetTLS(SDL_TLSID *id) return storage->array[storage_index].data; } -SDL_bool SDL_SetTLS(SDL_TLSID *id, const void *value, SDL_TLSDestructorCallback destructor) +bool SDL_SetTLS(SDL_TLSID *id, const void *value, SDL_TLSDestructorCallback destructor) { SDL_TLSData *storage; int storage_index; @@ -439,7 +439,7 @@ const char *SDL_GetThreadName(SDL_Thread *thread) } } -SDL_bool SDL_SetThreadPriority(SDL_ThreadPriority priority) +bool SDL_SetThreadPriority(SDL_ThreadPriority priority) { return SDL_SYS_SetThreadPriority(priority); } @@ -483,12 +483,12 @@ void SDL_WaitSemaphore(SDL_Semaphore *sem) SDL_WaitSemaphoreTimeoutNS(sem, -1); } -SDL_bool SDL_TryWaitSemaphore(SDL_Semaphore *sem) +bool SDL_TryWaitSemaphore(SDL_Semaphore *sem) { return SDL_WaitSemaphoreTimeoutNS(sem, 0); } -SDL_bool SDL_WaitSemaphoreTimeout(SDL_Semaphore *sem, Sint32 timeoutMS) +bool SDL_WaitSemaphoreTimeout(SDL_Semaphore *sem, Sint32 timeoutMS) { Sint64 timeoutNS; @@ -505,7 +505,7 @@ void SDL_WaitCondition(SDL_Condition *cond, SDL_Mutex *mutex) SDL_WaitConditionTimeoutNS(cond, mutex, -1); } -SDL_bool SDL_WaitConditionTimeout(SDL_Condition *cond, SDL_Mutex *mutex, Sint32 timeoutMS) +bool SDL_WaitConditionTimeout(SDL_Condition *cond, SDL_Mutex *mutex, Sint32 timeoutMS) { Sint64 timeoutNS; diff --git a/src/thread/generic/SDL_syscond.c b/src/thread/generic/SDL_syscond.c index 7af2f810b..b5b2b3274 100644 --- a/src/thread/generic/SDL_syscond.c +++ b/src/thread/generic/SDL_syscond.c @@ -219,7 +219,7 @@ bool SDL_WaitConditionTimeoutNS_generic(SDL_Condition *_cond, SDL_Mutex *mutex, } #ifndef SDL_THREAD_GENERIC_COND_SUFFIX -SDL_bool SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS) +bool SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS) { return SDL_WaitConditionTimeoutNS_generic(cond, mutex, timeoutNS); } diff --git a/src/thread/generic/SDL_sysmutex.c b/src/thread/generic/SDL_sysmutex.c index 12801f4a6..be0ad7a86 100644 --- a/src/thread/generic/SDL_sysmutex.c +++ b/src/thread/generic/SDL_sysmutex.c @@ -81,7 +81,7 @@ void SDL_LockMutex(SDL_Mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS // clang doe #endif // SDL_THREADS_DISABLED } -SDL_bool SDL_TryLockMutex(SDL_Mutex *mutex) +bool SDL_TryLockMutex(SDL_Mutex *mutex) { bool result = true; #ifndef SDL_THREADS_DISABLED diff --git a/src/thread/generic/SDL_sysrwlock.c b/src/thread/generic/SDL_sysrwlock.c index 2c3c68fbd..222fb4785 100644 --- a/src/thread/generic/SDL_sysrwlock.c +++ b/src/thread/generic/SDL_sysrwlock.c @@ -139,7 +139,7 @@ bool SDL_TryLockRWLockForReading_generic(SDL_RWLock *rwlock) } #ifndef SDL_THREAD_GENERIC_RWLOCK_SUFFIX -SDL_bool SDL_TryLockRWLockForReading(SDL_RWLock *rwlock) +bool SDL_TryLockRWLockForReading(SDL_RWLock *rwlock) { return SDL_TryLockRWLockForReading_generic(rwlock); } @@ -167,7 +167,7 @@ bool SDL_TryLockRWLockForWriting_generic(SDL_RWLock *rwlock) } #ifndef SDL_THREAD_GENERIC_RWLOCK_SUFFIX -SDL_bool SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock) +bool SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock) { return SDL_TryLockRWLockForWriting_generic(rwlock); } diff --git a/src/thread/generic/SDL_syssem.c b/src/thread/generic/SDL_syssem.c index bfb823cf3..015b4c57f 100644 --- a/src/thread/generic/SDL_syssem.c +++ b/src/thread/generic/SDL_syssem.c @@ -36,7 +36,7 @@ void SDL_DestroySemaphore(SDL_Semaphore *sem) { } -SDL_bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS) +bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS) { return true; } @@ -103,7 +103,7 @@ void SDL_DestroySemaphore(SDL_Semaphore *sem) } } -SDL_bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS) +bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS) { bool result = false; diff --git a/src/thread/n3ds/SDL_syscond.c b/src/thread/n3ds/SDL_syscond.c index 97fa9f09d..8e2e7c988 100644 --- a/src/thread/n3ds/SDL_syscond.c +++ b/src/thread/n3ds/SDL_syscond.c @@ -90,7 +90,7 @@ Thread B: SDL_SignalCondition(cond); SDL_UnlockMutex(lock); */ -SDL_bool SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS) +bool SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS) { Result res; diff --git a/src/thread/n3ds/SDL_sysmutex.c b/src/thread/n3ds/SDL_sysmutex.c index 6ed93d6f7..3be2d0b22 100644 --- a/src/thread/n3ds/SDL_sysmutex.c +++ b/src/thread/n3ds/SDL_sysmutex.c @@ -49,7 +49,7 @@ void SDL_LockMutex(SDL_Mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS // clang doe } } -SDL_bool SDL_TryLockMutex(SDL_Mutex *mutex) +bool SDL_TryLockMutex(SDL_Mutex *mutex) { if (mutex) { return RecursiveLock_TryLock(&mutex->lock); diff --git a/src/thread/n3ds/SDL_syssem.c b/src/thread/n3ds/SDL_syssem.c index 8b6b6d4ef..3505696e8 100644 --- a/src/thread/n3ds/SDL_syssem.c +++ b/src/thread/n3ds/SDL_syssem.c @@ -74,7 +74,7 @@ static bool WaitOnSemaphoreFor(SDL_Semaphore *sem, Sint64 timeoutNS) return false; } -SDL_bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS) +bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS) { if (!sem) { return true; diff --git a/src/thread/ngage/SDL_sysmutex.cpp b/src/thread/ngage/SDL_sysmutex.cpp index 8e2cb4d8f..307896e94 100644 --- a/src/thread/ngage/SDL_sysmutex.cpp +++ b/src/thread/ngage/SDL_sysmutex.cpp @@ -78,7 +78,7 @@ void SDL_LockMutex(SDL_Mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS // clang does // Try to lock the mutex #if 0 -SDL_bool SDL_TryLockMutex(SDL_Mutex *mutex) +bool SDL_TryLockMutex(SDL_Mutex *mutex) { if (mutex) { // Not yet implemented. diff --git a/src/thread/ps2/SDL_syssem.c b/src/thread/ps2/SDL_syssem.c index 9b50219c5..a6ff29918 100644 --- a/src/thread/ps2/SDL_syssem.c +++ b/src/thread/ps2/SDL_syssem.c @@ -72,7 +72,7 @@ void SDL_DestroySemaphore(SDL_Semaphore *sem) } } -SDL_bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS) +bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS) { u64 timeout_usec; u64 *timeout_ptr; diff --git a/src/thread/psp/SDL_sysmutex.c b/src/thread/psp/SDL_sysmutex.c index 9012017b1..45830294d 100644 --- a/src/thread/psp/SDL_sysmutex.c +++ b/src/thread/psp/SDL_sysmutex.c @@ -72,7 +72,7 @@ void SDL_LockMutex(SDL_Mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS // clang doe } } -SDL_bool SDL_TryLockMutex(SDL_Mutex *mutex) +bool SDL_TryLockMutex(SDL_Mutex *mutex) { bool result = true; if (mutex) { diff --git a/src/thread/psp/SDL_syssem.c b/src/thread/psp/SDL_syssem.c index 8870457a6..9f76973f9 100644 --- a/src/thread/psp/SDL_syssem.c +++ b/src/thread/psp/SDL_syssem.c @@ -71,7 +71,7 @@ void SDL_DestroySemaphore(SDL_Semaphore *sem) * If the timeout is 0 then just poll the semaphore; if it's -1, pass * NULL to sceKernelWaitSema() so that it waits indefinitely; and if the timeout * is specified, convert it to microseconds. */ -SDL_bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS) +bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS) { SceUInt timeoutUS; SceUInt *pTimeout = NULL; diff --git a/src/thread/pthread/SDL_syscond.c b/src/thread/pthread/SDL_syscond.c index c1be483c8..6e6f021c4 100644 --- a/src/thread/pthread/SDL_syscond.c +++ b/src/thread/pthread/SDL_syscond.c @@ -78,7 +78,7 @@ void SDL_BroadcastCondition(SDL_Condition *cond) pthread_cond_broadcast(&cond->cond); } -SDL_bool SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS) +bool SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS) { #ifndef HAVE_CLOCK_GETTIME struct timeval delta; diff --git a/src/thread/pthread/SDL_sysmutex.c b/src/thread/pthread/SDL_sysmutex.c index 16a9e6679..4f0ef7b6d 100644 --- a/src/thread/pthread/SDL_sysmutex.c +++ b/src/thread/pthread/SDL_sysmutex.c @@ -82,7 +82,7 @@ void SDL_LockMutex(SDL_Mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS // clang does } } -SDL_bool SDL_TryLockMutex(SDL_Mutex *mutex) +bool SDL_TryLockMutex(SDL_Mutex *mutex) { bool result = true; diff --git a/src/thread/pthread/SDL_sysrwlock.c b/src/thread/pthread/SDL_sysrwlock.c index b0580037c..17895e3e5 100644 --- a/src/thread/pthread/SDL_sysrwlock.c +++ b/src/thread/pthread/SDL_sysrwlock.c @@ -69,7 +69,7 @@ void SDL_LockRWLockForWriting(SDL_RWLock *rwlock) SDL_NO_THREAD_SAFETY_ANALYSIS } } -SDL_bool SDL_TryLockRWLockForReading(SDL_RWLock *rwlock) +bool SDL_TryLockRWLockForReading(SDL_RWLock *rwlock) { bool result = true; @@ -86,7 +86,7 @@ SDL_bool SDL_TryLockRWLockForReading(SDL_RWLock *rwlock) return result; } -SDL_bool SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock) +bool SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock) { bool result = true; diff --git a/src/thread/pthread/SDL_syssem.c b/src/thread/pthread/SDL_syssem.c index 0484518bc..ccfe4c07b 100644 --- a/src/thread/pthread/SDL_syssem.c +++ b/src/thread/pthread/SDL_syssem.c @@ -60,7 +60,7 @@ void SDL_DestroySemaphore(SDL_Semaphore *sem) } } -SDL_bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS) +bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS) { #ifdef HAVE_SEM_TIMEDWAIT #ifndef HAVE_CLOCK_GETTIME diff --git a/src/thread/vita/SDL_sysmutex.c b/src/thread/vita/SDL_sysmutex.c index f332902f7..d88c798c2 100644 --- a/src/thread/vita/SDL_sysmutex.c +++ b/src/thread/vita/SDL_sysmutex.c @@ -68,7 +68,7 @@ void SDL_LockMutex(SDL_Mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS // clang doe } } -SDL_bool SDL_TryLockMutex(SDL_Mutex *mutex) +bool SDL_TryLockMutex(SDL_Mutex *mutex) { bool result = true; diff --git a/src/thread/vita/SDL_syssem.c b/src/thread/vita/SDL_syssem.c index 3e3f27f81..ff005b367 100644 --- a/src/thread/vita/SDL_syssem.c +++ b/src/thread/vita/SDL_syssem.c @@ -72,7 +72,7 @@ void SDL_DestroySemaphore(SDL_Semaphore *sem) * If the timeout is 0 then just poll the semaphore; if it's -1, pass * NULL to sceKernelWaitSema() so that it waits indefinitely; and if the timeout * is specified, convert it to microseconds. */ -SDL_bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS) +bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS) { SceUInt timeoutUS; SceUInt *pTimeout = NULL; diff --git a/src/thread/windows/SDL_syscond_cv.c b/src/thread/windows/SDL_syscond_cv.c index 1291c7e30..c408bc782 100644 --- a/src/thread/windows/SDL_syscond_cv.c +++ b/src/thread/windows/SDL_syscond_cv.c @@ -216,7 +216,7 @@ void SDL_BroadcastCondition(SDL_Condition *cond) SDL_cond_impl_active.Broadcast(cond); } -SDL_bool SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS) +bool SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS) { if (!cond || !mutex) { return true; diff --git a/src/thread/windows/SDL_sysmutex.c b/src/thread/windows/SDL_sysmutex.c index 251f85cf6..da6542507 100644 --- a/src/thread/windows/SDL_sysmutex.c +++ b/src/thread/windows/SDL_sysmutex.c @@ -218,7 +218,7 @@ void SDL_LockMutex(SDL_Mutex *mutex) } } -SDL_bool SDL_TryLockMutex(SDL_Mutex *mutex) +bool SDL_TryLockMutex(SDL_Mutex *mutex) { bool result = true; diff --git a/src/thread/windows/SDL_sysrwlock_srw.c b/src/thread/windows/SDL_sysrwlock_srw.c index 10119520b..025aff4cf 100644 --- a/src/thread/windows/SDL_sysrwlock_srw.c +++ b/src/thread/windows/SDL_sysrwlock_srw.c @@ -204,7 +204,7 @@ void SDL_LockRWLockForWriting(SDL_RWLock *rwlock) SDL_NO_THREAD_SAFETY_ANALYSIS } } -SDL_bool SDL_TryLockRWLockForReading(SDL_RWLock *rwlock) +bool SDL_TryLockRWLockForReading(SDL_RWLock *rwlock) { bool result = true; if (rwlock) { @@ -213,7 +213,7 @@ SDL_bool SDL_TryLockRWLockForReading(SDL_RWLock *rwlock) return result; } -SDL_bool SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock) +bool SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock) { bool result = true; if (rwlock) { diff --git a/src/thread/windows/SDL_syssem.c b/src/thread/windows/SDL_syssem.c index 132e114ad..f3b34b080 100644 --- a/src/thread/windows/SDL_syssem.c +++ b/src/thread/windows/SDL_syssem.c @@ -333,7 +333,7 @@ void SDL_DestroySemaphore(SDL_Semaphore *sem) SDL_sem_impl_active.Destroy(sem); } -SDL_bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS) +bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS) { return SDL_sem_impl_active.WaitTimeoutNS(sem, timeoutNS); } diff --git a/src/time/SDL_time.c b/src/time/SDL_time.c index 07c410fac..d24d1ce40 100644 --- a/src/time/SDL_time.c +++ b/src/time/SDL_time.c @@ -57,7 +57,7 @@ Sint64 SDL_CivilToDays(int year, int month, int day, int *day_of_week, int *day_ return z; } -SDL_bool SDL_GetDateTimeLocalePreferences(SDL_DateFormat *dateFormat, SDL_TimeFormat *timeFormat) +bool SDL_GetDateTimeLocalePreferences(SDL_DateFormat *dateFormat, SDL_TimeFormat *timeFormat) { // Default to ISO 8061 date format, as it is unambiguous, and 24 hour time. if (dateFormat) { @@ -162,7 +162,7 @@ static bool SDL_DateTimeIsValid(const SDL_DateTime *dt) return true; } -SDL_bool SDL_DateTimeToTime(const SDL_DateTime *dt, SDL_Time *ticks) +bool SDL_DateTimeToTime(const SDL_DateTime *dt, SDL_Time *ticks) { static const Sint64 max_seconds = SDL_NS_TO_SECONDS(SDL_MAX_TIME) - 1; static const Sint64 min_seconds = SDL_NS_TO_SECONDS(SDL_MIN_TIME) + 1; diff --git a/src/time/n3ds/SDL_systime.c b/src/time/n3ds/SDL_systime.c index 19b50afa5..139e6865b 100644 --- a/src/time/n3ds/SDL_systime.c +++ b/src/time/n3ds/SDL_systime.c @@ -106,7 +106,7 @@ void SDL_GetSystemTimeLocalePreferences(SDL_DateFormat *df, SDL_TimeFormat *tf) } } -SDL_bool SDL_GetCurrentTime(SDL_Time *ticks) +bool SDL_GetCurrentTime(SDL_Time *ticks) { if (!ticks) { return SDL_InvalidParamError("ticks"); @@ -121,7 +121,7 @@ SDL_bool SDL_GetCurrentTime(SDL_Time *ticks) return true; } -SDL_bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, SDL_bool localTime) +bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, bool localTime) { if (!dt) { return SDL_InvalidParamError("dt"); diff --git a/src/time/ps2/SDL_systime.c b/src/time/ps2/SDL_systime.c index e7786f994..7e9c838e3 100644 --- a/src/time/ps2/SDL_systime.c +++ b/src/time/ps2/SDL_systime.c @@ -32,7 +32,7 @@ void SDL_GetSystemTimeLocalePreferences(SDL_DateFormat *df, SDL_TimeFormat *tf) { } -SDL_bool SDL_GetCurrentTime(SDL_Time *ticks) +bool SDL_GetCurrentTime(SDL_Time *ticks) { if (!ticks) { return SDL_InvalidParamError("ticks"); @@ -43,7 +43,7 @@ SDL_bool SDL_GetCurrentTime(SDL_Time *ticks) return true; } -SDL_bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, SDL_bool localTime) +bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, bool localTime) { if (!dt) { return SDL_InvalidParamError("dt"); diff --git a/src/time/psp/SDL_systime.c b/src/time/psp/SDL_systime.c index 0b51ebb87..4ba4077f1 100644 --- a/src/time/psp/SDL_systime.c +++ b/src/time/psp/SDL_systime.c @@ -65,7 +65,7 @@ void SDL_GetSystemTimeLocalePreferences(SDL_DateFormat *df, SDL_TimeFormat *tf) } } -SDL_bool SDL_GetCurrentTime(SDL_Time *ticks) +bool SDL_GetCurrentTime(SDL_Time *ticks) { u64 sceTicks; @@ -93,7 +93,7 @@ SDL_bool SDL_GetCurrentTime(SDL_Time *ticks) return SDL_SetError("Failed to retrieve system time (%i)", ret); } -SDL_bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, SDL_bool localTime) +bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, bool localTime) { ScePspDateTime t; u64 local; diff --git a/src/time/unix/SDL_systime.c b/src/time/unix/SDL_systime.c index 0ed2107f5..79610558f 100644 --- a/src/time/unix/SDL_systime.c +++ b/src/time/unix/SDL_systime.c @@ -98,7 +98,7 @@ found_date: #endif } -SDL_bool SDL_GetCurrentTime(SDL_Time *ticks) +bool SDL_GetCurrentTime(SDL_Time *ticks) { if (!ticks) { return SDL_InvalidParamError("ticks"); @@ -150,7 +150,7 @@ SDL_bool SDL_GetCurrentTime(SDL_Time *ticks) return false; } -SDL_bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, SDL_bool localTime) +bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, bool localTime) { #if defined (HAVE_GMTIME_R) || defined(HAVE_LOCALTIME_R) struct tm tm_storage; diff --git a/src/time/vita/SDL_systime.c b/src/time/vita/SDL_systime.c index c5ec2eff9..3429a5f26 100644 --- a/src/time/vita/SDL_systime.c +++ b/src/time/vita/SDL_systime.c @@ -71,7 +71,7 @@ void SDL_GetSystemTimeLocalePreferences(SDL_DateFormat *df, SDL_TimeFormat *tf) sceAppUtilShutdown(); } -SDL_bool SDL_GetCurrentTime(SDL_Time *ticks) +bool SDL_GetCurrentTime(SDL_Time *ticks) { SceRtcTick sceTicks; @@ -98,7 +98,7 @@ SDL_bool SDL_GetCurrentTime(SDL_Time *ticks) return SDL_SetError("Failed to retrieve system time (%i)", ret); } -SDL_bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, SDL_bool localTime) +bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, bool localTime) { SceDateTime t; SceRtcTick sceTicks, sceLocalTicks; diff --git a/src/time/windows/SDL_systime.c b/src/time/windows/SDL_systime.c index cf3389561..cf97152ee 100644 --- a/src/time/windows/SDL_systime.c +++ b/src/time/windows/SDL_systime.c @@ -75,7 +75,7 @@ found_date: } } -SDL_bool SDL_GetCurrentTime(SDL_Time *ticks) +bool SDL_GetCurrentTime(SDL_Time *ticks) { FILETIME ft; @@ -108,7 +108,7 @@ SDL_bool SDL_GetCurrentTime(SDL_Time *ticks) return true; } -SDL_bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, SDL_bool localTime) +bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, bool localTime) { FILETIME ft, local_ft; SYSTEMTIME utc_st, local_st; diff --git a/src/timer/SDL_timer.c b/src/timer/SDL_timer.c index 3662d9aba..378832c62 100644 --- a/src/timer/SDL_timer.c +++ b/src/timer/SDL_timer.c @@ -368,7 +368,7 @@ SDL_TimerID SDL_AddTimerNS(Uint64 interval, SDL_NSTimerCallback callback, void * return SDL_CreateTimer(interval, NULL, callback, userdata); } -SDL_bool SDL_RemoveTimer(SDL_TimerID id) +bool SDL_RemoveTimer(SDL_TimerID id) { SDL_TimerData *data = &SDL_timer_data; SDL_TimerMap *prev, *entry; @@ -502,7 +502,7 @@ SDL_TimerID SDL_AddTimerNS(Uint64 interval, SDL_NSTimerCallback callback, void * return SDL_CreateTimer(interval, NULL, callback, userdata); } -SDL_bool SDL_RemoveTimer(SDL_TimerID id) +bool SDL_RemoveTimer(SDL_TimerID id) { SDL_TimerData *data = &SDL_timer_data; SDL_TimerMap *prev, *entry; diff --git a/src/video/SDL_bmp.c b/src/video/SDL_bmp.c index c7d66d7c2..1a7a2acd2 100644 --- a/src/video/SDL_bmp.c +++ b/src/video/SDL_bmp.c @@ -193,7 +193,7 @@ static void CorrectAlphaChannel(SDL_Surface *surface) } } -SDL_Surface *SDL_LoadBMP_IO(SDL_IOStream *src, SDL_bool closeio) +SDL_Surface *SDL_LoadBMP_IO(SDL_IOStream *src, bool closeio) { bool was_error = true; Sint64 fp_offset = 0; @@ -591,7 +591,7 @@ SDL_Surface *SDL_LoadBMP(const char *file) return SDL_LoadBMP_IO(SDL_IOFromFile(file, "rb"), 1); } -SDL_bool SDL_SaveBMP_IO(SDL_Surface *surface, SDL_IOStream *dst, SDL_bool closeio) +bool SDL_SaveBMP_IO(SDL_Surface *surface, SDL_IOStream *dst, bool closeio) { bool was_error = true; Sint64 fp_offset, new_offset; @@ -870,7 +870,7 @@ done: return true; } -SDL_bool SDL_SaveBMP(SDL_Surface *surface, const char *file) +bool SDL_SaveBMP(SDL_Surface *surface, const char *file) { return SDL_SaveBMP_IO(surface, SDL_IOFromFile(file, "wb"), true); } diff --git a/src/video/SDL_clipboard.c b/src/video/SDL_clipboard.c index b67bc51aa..5e6e04229 100644 --- a/src/video/SDL_clipboard.c +++ b/src/video/SDL_clipboard.c @@ -53,7 +53,7 @@ void SDL_CancelClipboardData(Uint32 sequence) _this->clipboard_userdata = NULL; } -SDL_bool SDL_SetClipboardData(SDL_ClipboardDataCallback callback, SDL_ClipboardCleanupCallback cleanup, void *userdata, const char **mime_types, size_t num_mime_types) +bool SDL_SetClipboardData(SDL_ClipboardDataCallback callback, SDL_ClipboardCleanupCallback cleanup, void *userdata, const char **mime_types, size_t num_mime_types) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); size_t i; @@ -139,7 +139,7 @@ SDL_bool SDL_SetClipboardData(SDL_ClipboardDataCallback callback, SDL_ClipboardC return true; } -SDL_bool SDL_ClearClipboardData(void) +bool SDL_ClearClipboardData(void) { return SDL_SetClipboardData(NULL, NULL, NULL, NULL, 0); } @@ -209,7 +209,7 @@ bool SDL_HasInternalClipboardData(SDL_VideoDevice *_this, const char *mime_type) return false; } -SDL_bool SDL_HasClipboardData(const char *mime_type) +bool SDL_HasClipboardData(const char *mime_type) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); @@ -264,7 +264,7 @@ const void * SDLCALL SDL_ClipboardTextCallback(void *userdata, const char *mime_ return text; } -SDL_bool SDL_SetClipboardText(const char *text) +bool SDL_SetClipboardText(const char *text) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); size_t num_mime_types; @@ -310,7 +310,7 @@ char *SDL_GetClipboardText(void) return text; } -SDL_bool SDL_HasClipboardText(void) +bool SDL_HasClipboardText(void) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); size_t i, num_mime_types; @@ -332,7 +332,7 @@ SDL_bool SDL_HasClipboardText(void) // Primary selection text -SDL_bool SDL_SetPrimarySelectionText(const char *text) +bool SDL_SetPrimarySelectionText(const char *text) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); @@ -376,7 +376,7 @@ char *SDL_GetPrimarySelectionText(void) } } -SDL_bool SDL_HasPrimarySelectionText(void) +bool SDL_HasPrimarySelectionText(void) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); diff --git a/src/video/SDL_fillrect.c b/src/video/SDL_fillrect.c index 93891d1cb..12b406db5 100644 --- a/src/video/SDL_fillrect.c +++ b/src/video/SDL_fillrect.c @@ -229,7 +229,7 @@ static void SDL_FillSurfaceRect4(Uint8 *pixels, int pitch, Uint32 color, int w, /* * This function performs a fast fill of the given rectangle with 'color' */ -SDL_bool SDL_FillSurfaceRect(SDL_Surface *dst, const SDL_Rect *rect, Uint32 color) +bool SDL_FillSurfaceRect(SDL_Surface *dst, const SDL_Rect *rect, Uint32 color) { if (!SDL_SurfaceValid(dst)) { return SDL_InvalidParamError("SDL_FillSurfaceRect(): dst"); @@ -247,7 +247,7 @@ SDL_bool SDL_FillSurfaceRect(SDL_Surface *dst, const SDL_Rect *rect, Uint32 colo return SDL_FillSurfaceRects(dst, rect, 1, color); } -SDL_bool SDL_FillSurfaceRects(SDL_Surface *dst, const SDL_Rect *rects, int count, Uint32 color) +bool SDL_FillSurfaceRects(SDL_Surface *dst, const SDL_Rect *rects, int count, Uint32 color) { SDL_Rect clipped; Uint8 *pixels; diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c index eca7c41fc..ccbfff970 100644 --- a/src/video/SDL_pixels.c +++ b/src/video/SDL_pixels.c @@ -165,7 +165,7 @@ const char *SDL_GetPixelFormatName(SDL_PixelFormat format) } #undef CASE -SDL_bool SDL_GetMasksForPixelFormat(SDL_PixelFormat format, int *bpp, Uint32 *Rmask, Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask) +bool SDL_GetMasksForPixelFormat(SDL_PixelFormat format, int *bpp, Uint32 *Rmask, Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask) { Uint32 masks[4]; @@ -1035,7 +1035,7 @@ SDL_Palette *SDL_CreatePalette(int ncolors) return palette; } -SDL_bool SDL_SetPaletteColors(SDL_Palette *palette, const SDL_Color *colors, int firstcolor, int ncolors) +bool SDL_SetPaletteColors(SDL_Palette *palette, const SDL_Color *colors, int firstcolor, int ncolors) { bool result = true; diff --git a/src/video/SDL_rect_impl.h b/src/video/SDL_rect_impl.h index 9d024ef83..8ed8f84e6 100644 --- a/src/video/SDL_rect_impl.h +++ b/src/video/SDL_rect_impl.h @@ -34,7 +34,7 @@ static bool SDL_RECT_CAN_OVERFLOW(const RECTTYPE *rect) return false; } -SDL_bool SDL_HASINTERSECTION(const RECTTYPE *A, const RECTTYPE *B) +bool SDL_HASINTERSECTION(const RECTTYPE *A, const RECTTYPE *B) { SCALARTYPE Amin, Amax, Bmin, Bmax; @@ -83,7 +83,7 @@ SDL_bool SDL_HASINTERSECTION(const RECTTYPE *A, const RECTTYPE *B) return true; } -SDL_bool SDL_INTERSECTRECT(const RECTTYPE *A, const RECTTYPE *B, RECTTYPE *result) +bool SDL_INTERSECTRECT(const RECTTYPE *A, const RECTTYPE *B, RECTTYPE *result) { SCALARTYPE Amin, Amax, Bmin, Bmax; @@ -137,7 +137,7 @@ SDL_bool SDL_INTERSECTRECT(const RECTTYPE *A, const RECTTYPE *B, RECTTYPE *resul return !SDL_RECTEMPTY(result); } -SDL_bool SDL_UNIONRECT(const RECTTYPE *A, const RECTTYPE *B, RECTTYPE *result) +bool SDL_UNIONRECT(const RECTTYPE *A, const RECTTYPE *B, RECTTYPE *result) { SCALARTYPE Amin, Amax, Bmin, Bmax; @@ -192,7 +192,7 @@ SDL_bool SDL_UNIONRECT(const RECTTYPE *A, const RECTTYPE *B, RECTTYPE *result) return true; } -SDL_bool SDL_ENCLOSEPOINTS(const POINTTYPE *points, int count, const RECTTYPE *clip, RECTTYPE *result) +bool SDL_ENCLOSEPOINTS(const POINTTYPE *points, int count, const RECTTYPE *clip, RECTTYPE *result) { SCALARTYPE minx = 0; SCALARTYPE miny = 0; @@ -308,7 +308,7 @@ static int COMPUTEOUTCODE(const RECTTYPE *rect, SCALARTYPE x, SCALARTYPE y) return code; } -SDL_bool SDL_INTERSECTRECTANDLINE(const RECTTYPE *rect, SCALARTYPE *X1, SCALARTYPE *Y1, SCALARTYPE *X2, SCALARTYPE *Y2) +bool SDL_INTERSECTRECTANDLINE(const RECTTYPE *rect, SCALARTYPE *X1, SCALARTYPE *Y1, SCALARTYPE *X2, SCALARTYPE *Y2) { SCALARTYPE x = 0; SCALARTYPE y = 0; diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index 27812af70..26df19a12 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -283,7 +283,7 @@ SDL_PropertiesID SDL_GetSurfaceProperties(SDL_Surface *surface) return surface->internal->props; } -SDL_bool SDL_SetSurfaceColorspace(SDL_Surface *surface, SDL_Colorspace colorspace) +bool SDL_SetSurfaceColorspace(SDL_Surface *surface, SDL_Colorspace colorspace) { if (!SDL_SurfaceValid(surface)) { return SDL_InvalidParamError("surface"); @@ -399,7 +399,7 @@ SDL_Palette *SDL_CreateSurfacePalette(SDL_Surface *surface) return palette; } -SDL_bool SDL_SetSurfacePalette(SDL_Surface *surface, SDL_Palette *palette) +bool SDL_SetSurfacePalette(SDL_Surface *surface, SDL_Palette *palette) { if (!SDL_SurfaceValid(surface)) { return SDL_InvalidParamError("surface"); @@ -435,7 +435,7 @@ SDL_Palette *SDL_GetSurfacePalette(SDL_Surface *surface) return surface->internal->palette; } -SDL_bool SDL_AddSurfaceAlternateImage(SDL_Surface *surface, SDL_Surface *image) +bool SDL_AddSurfaceAlternateImage(SDL_Surface *surface, SDL_Surface *image) { if (!SDL_SurfaceValid(surface)) { return SDL_InvalidParamError("surface"); @@ -456,7 +456,7 @@ SDL_bool SDL_AddSurfaceAlternateImage(SDL_Surface *surface, SDL_Surface *image) return true; } -SDL_bool SDL_SurfaceHasAlternateImages(SDL_Surface *surface) +bool SDL_SurfaceHasAlternateImages(SDL_Surface *surface) { if (!SDL_SurfaceValid(surface)) { return false; @@ -579,7 +579,7 @@ void SDL_RemoveSurfaceAlternateImages(SDL_Surface *surface) } } -SDL_bool SDL_SetSurfaceRLE(SDL_Surface *surface, SDL_bool enabled) +bool SDL_SetSurfaceRLE(SDL_Surface *surface, bool enabled) { int flags; @@ -600,7 +600,7 @@ SDL_bool SDL_SetSurfaceRLE(SDL_Surface *surface, SDL_bool enabled) return true; } -SDL_bool SDL_SurfaceHasRLE(SDL_Surface *surface) +bool SDL_SurfaceHasRLE(SDL_Surface *surface) { if (!SDL_SurfaceValid(surface)) { return false; @@ -613,7 +613,7 @@ SDL_bool SDL_SurfaceHasRLE(SDL_Surface *surface) return true; } -SDL_bool SDL_SetSurfaceColorKey(SDL_Surface *surface, SDL_bool enabled, Uint32 key) +bool SDL_SetSurfaceColorKey(SDL_Surface *surface, bool enabled, Uint32 key) { int flags; @@ -639,7 +639,7 @@ SDL_bool SDL_SetSurfaceColorKey(SDL_Surface *surface, SDL_bool enabled, Uint32 k return true; } -SDL_bool SDL_SurfaceHasColorKey(SDL_Surface *surface) +bool SDL_SurfaceHasColorKey(SDL_Surface *surface) { if (!SDL_SurfaceValid(surface)) { return false; @@ -652,7 +652,7 @@ SDL_bool SDL_SurfaceHasColorKey(SDL_Surface *surface) return true; } -SDL_bool SDL_GetSurfaceColorKey(SDL_Surface *surface, Uint32 *key) +bool SDL_GetSurfaceColorKey(SDL_Surface *surface, Uint32 *key) { if (key) { *key = 0; @@ -763,7 +763,7 @@ static void SDL_ConvertColorkeyToAlpha(SDL_Surface *surface, bool ignore_alpha) SDL_SetSurfaceBlendMode(surface, SDL_BLENDMODE_BLEND); } -SDL_bool SDL_SetSurfaceColorMod(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b) +bool SDL_SetSurfaceColorMod(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b) { int flags; @@ -787,7 +787,7 @@ SDL_bool SDL_SetSurfaceColorMod(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b) return true; } -SDL_bool SDL_GetSurfaceColorMod(SDL_Surface *surface, Uint8 *r, Uint8 *g, Uint8 *b) +bool SDL_GetSurfaceColorMod(SDL_Surface *surface, Uint8 *r, Uint8 *g, Uint8 *b) { if (!SDL_SurfaceValid(surface)) { if (r) { @@ -814,7 +814,7 @@ SDL_bool SDL_GetSurfaceColorMod(SDL_Surface *surface, Uint8 *r, Uint8 *g, Uint8 return true; } -SDL_bool SDL_SetSurfaceAlphaMod(SDL_Surface *surface, Uint8 alpha) +bool SDL_SetSurfaceAlphaMod(SDL_Surface *surface, Uint8 alpha) { int flags; @@ -836,7 +836,7 @@ SDL_bool SDL_SetSurfaceAlphaMod(SDL_Surface *surface, Uint8 alpha) return true; } -SDL_bool SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Uint8 *alpha) +bool SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Uint8 *alpha) { if (!SDL_SurfaceValid(surface)) { if (alpha) { @@ -851,7 +851,7 @@ SDL_bool SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Uint8 *alpha) return true; } -SDL_bool SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode blendMode) +bool SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode blendMode) { int flags; bool result = true; @@ -899,7 +899,7 @@ SDL_bool SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode blendMode) return result; } -SDL_bool SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode) +bool SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode) { if (blendMode) { *blendMode = SDL_BLENDMODE_INVALID; @@ -939,7 +939,7 @@ SDL_bool SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode) return true; } -SDL_bool SDL_SetSurfaceClipRect(SDL_Surface *surface, const SDL_Rect *rect) +bool SDL_SetSurfaceClipRect(SDL_Surface *surface, const SDL_Rect *rect) { SDL_Rect full_rect; @@ -962,7 +962,7 @@ SDL_bool SDL_SetSurfaceClipRect(SDL_Surface *surface, const SDL_Rect *rect) return SDL_GetRectIntersection(rect, &full_rect, &surface->internal->clip_rect); } -SDL_bool SDL_GetSurfaceClipRect(SDL_Surface *surface, SDL_Rect *rect) +bool SDL_GetSurfaceClipRect(SDL_Surface *surface, SDL_Rect *rect) { if (!SDL_SurfaceValid(surface)) { if (rect) { @@ -988,7 +988,7 @@ SDL_bool SDL_GetSurfaceClipRect(SDL_Surface *surface, SDL_Rect *rect) * you know exactly what you are doing, you can optimize your code * by calling the one(s) you need. */ -SDL_bool SDL_BlitSurfaceUnchecked(SDL_Surface *src, const SDL_Rect *srcrect, +bool SDL_BlitSurfaceUnchecked(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect) { // Check to make sure the blit mapping is valid @@ -998,7 +998,7 @@ SDL_bool SDL_BlitSurfaceUnchecked(SDL_Surface *src, const SDL_Rect *srcrect, return src->internal->map.blit(src, srcrect, dst, dstrect); } -SDL_bool SDL_BlitSurface(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect) +bool SDL_BlitSurface(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect) { SDL_Rect r_src, r_dst; @@ -1075,7 +1075,7 @@ SDL_bool SDL_BlitSurface(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface return SDL_BlitSurfaceUnchecked(src, &r_src, dst, &r_dst); } -SDL_bool SDL_BlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode) +bool SDL_BlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode) { SDL_Rect *clip_rect; double src_x0, src_y0, src_x1, src_y1; @@ -1238,7 +1238,7 @@ SDL_bool SDL_BlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Su * This is a semi-private blit function and it performs low-level surface * scaled blitting only. */ -SDL_bool SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode) +bool SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode) { static const Uint32 complex_copy_flags = (SDL_COPY_MODULATE_MASK | SDL_COPY_BLEND_MASK | SDL_COPY_COLORKEY); @@ -1357,7 +1357,7 @@ SDL_bool SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrec } } -SDL_bool SDL_BlitSurfaceTiled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect) +bool SDL_BlitSurfaceTiled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect) { SDL_Rect r_src, r_dst; @@ -1462,7 +1462,7 @@ SDL_bool SDL_BlitSurfaceTiled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Sur return true; } -SDL_bool SDL_BlitSurfaceTiledWithScale(SDL_Surface *src, const SDL_Rect *srcrect, float scale, SDL_ScaleMode scaleMode, SDL_Surface *dst, const SDL_Rect *dstrect) +bool SDL_BlitSurfaceTiledWithScale(SDL_Surface *src, const SDL_Rect *srcrect, float scale, SDL_ScaleMode scaleMode, SDL_Surface *dst, const SDL_Rect *dstrect) { SDL_Rect r_src, r_dst; @@ -1575,7 +1575,7 @@ SDL_bool SDL_BlitSurfaceTiledWithScale(SDL_Surface *src, const SDL_Rect *srcrect return true; } -SDL_bool SDL_BlitSurface9Grid(SDL_Surface *src, const SDL_Rect *srcrect, int left_width, int right_width, int top_height, int bottom_height, float scale, SDL_ScaleMode scaleMode, SDL_Surface *dst, const SDL_Rect *dstrect) +bool SDL_BlitSurface9Grid(SDL_Surface *src, const SDL_Rect *srcrect, int left_width, int right_width, int top_height, int bottom_height, float scale, SDL_ScaleMode scaleMode, SDL_Surface *dst, const SDL_Rect *dstrect) { SDL_Rect full_src, full_dst; SDL_Rect curr_src, curr_dst; @@ -1716,7 +1716,7 @@ SDL_bool SDL_BlitSurface9Grid(SDL_Surface *src, const SDL_Rect *srcrect, int lef /* * Lock a surface to directly access the pixels */ -SDL_bool SDL_LockSurface(SDL_Surface *surface) +bool SDL_LockSurface(SDL_Surface *surface) { if (!SDL_SurfaceValid(surface)) { return SDL_InvalidParamError("surface"); @@ -1827,7 +1827,7 @@ static bool SDL_FlipSurfaceVertical(SDL_Surface *surface) return true; } -SDL_bool SDL_FlipSurface(SDL_Surface *surface, SDL_FlipMode flip) +bool SDL_FlipSurface(SDL_Surface *surface, SDL_FlipMode flip) { if (!SDL_SurfaceValid(surface)) { return SDL_InvalidParamError("surface"); @@ -2241,7 +2241,7 @@ SDL_Surface *SDL_DuplicatePixels(int width, int height, SDL_PixelFormat format, return surface; } -SDL_bool SDL_ConvertPixelsAndColorspace(int width, int height, +bool SDL_ConvertPixelsAndColorspace(int width, int height, SDL_PixelFormat src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, const void *src, int src_pitch, SDL_PixelFormat dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, void *dst, int dst_pitch) { @@ -2323,7 +2323,7 @@ SDL_bool SDL_ConvertPixelsAndColorspace(int width, int height, return result; } -SDL_bool SDL_ConvertPixels(int width, int height, SDL_PixelFormat src_format, const void *src, int src_pitch, SDL_PixelFormat dst_format, void *dst, int dst_pitch) +bool SDL_ConvertPixels(int width, int height, SDL_PixelFormat src_format, const void *src, int src_pitch, SDL_PixelFormat dst_format, void *dst, int dst_pitch) { return SDL_ConvertPixelsAndColorspace(width, height, src_format, SDL_COLORSPACE_UNKNOWN, 0, src, src_pitch, @@ -2532,9 +2532,9 @@ done: return result; } -SDL_bool SDL_PremultiplyAlpha(int width, int height, +bool SDL_PremultiplyAlpha(int width, int height, SDL_PixelFormat src_format, const void *src, int src_pitch, - SDL_PixelFormat dst_format, void *dst, int dst_pitch, SDL_bool linear) + SDL_PixelFormat dst_format, void *dst, int dst_pitch, bool linear) { SDL_Colorspace src_colorspace = SDL_GetDefaultColorspaceForFormat(src_format); SDL_Colorspace dst_colorspace = SDL_GetDefaultColorspaceForFormat(dst_format); @@ -2542,7 +2542,7 @@ SDL_bool SDL_PremultiplyAlpha(int width, int height, return SDL_PremultiplyAlphaPixelsAndColorspace(width, height, src_format, src_colorspace, 0, src, src_pitch, dst_format, dst_colorspace, 0, dst, dst_pitch, linear); } -SDL_bool SDL_PremultiplySurfaceAlpha(SDL_Surface *surface, SDL_bool linear) +bool SDL_PremultiplySurfaceAlpha(SDL_Surface *surface, bool linear) { SDL_Colorspace colorspace; @@ -2555,7 +2555,7 @@ SDL_bool SDL_PremultiplySurfaceAlpha(SDL_Surface *surface, SDL_bool linear) return SDL_PremultiplyAlphaPixelsAndColorspace(surface->w, surface->h, surface->format, colorspace, surface->internal->props, surface->pixels, surface->pitch, surface->format, colorspace, surface->internal->props, surface->pixels, surface->pitch, linear); } -SDL_bool SDL_ClearSurface(SDL_Surface *surface, float r, float g, float b, float a) +bool SDL_ClearSurface(SDL_Surface *surface, float r, float g, float b, float a) { SDL_Rect clip_rect; bool result = false; @@ -2627,7 +2627,7 @@ Uint32 SDL_MapSurfaceRGBA(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b, Uint8 } // This function Copyright 2023 Collabora Ltd., contributed to SDL under the ZLib license -SDL_bool SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) +bool SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) { Uint32 pixel = 0; size_t bytes_per_pixel; @@ -2717,7 +2717,7 @@ SDL_bool SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint return result; } -SDL_bool SDL_ReadSurfacePixelFloat(SDL_Surface *surface, int x, int y, float *r, float *g, float *b, float *a) +bool SDL_ReadSurfacePixelFloat(SDL_Surface *surface, int x, int y, float *r, float *g, float *b, float *a) { float unused; bool result = false; @@ -2814,7 +2814,7 @@ SDL_bool SDL_ReadSurfacePixelFloat(SDL_Surface *surface, int x, int y, float *r, return result; } -SDL_bool SDL_WriteSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +bool SDL_WriteSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { Uint32 pixel = 0; size_t bytes_per_pixel; @@ -2870,7 +2870,7 @@ SDL_bool SDL_WriteSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 r, Uint return result; } -SDL_bool SDL_WriteSurfacePixelFloat(SDL_Surface *surface, int x, int y, float r, float g, float b, float a) +bool SDL_WriteSurfacePixelFloat(SDL_Surface *surface, int x, int y, float r, float g, float b, float a) { bool result = false; diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index c215806e4..cd5a4803b 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -995,7 +995,7 @@ const char *SDL_GetDisplayName(SDL_DisplayID displayID) return display->name; } -SDL_bool SDL_GetDisplayBounds(SDL_DisplayID displayID, SDL_Rect *rect) +bool SDL_GetDisplayBounds(SDL_DisplayID displayID, SDL_Rect *rect) { SDL_VideoDisplay *display = SDL_GetVideoDisplay(displayID); @@ -1030,7 +1030,7 @@ static int ParseDisplayUsableBoundsHint(SDL_Rect *rect) return hint && (SDL_sscanf(hint, "%d,%d,%d,%d", &rect->x, &rect->y, &rect->w, &rect->h) == 4); } -SDL_bool SDL_GetDisplayUsableBounds(SDL_DisplayID displayID, SDL_Rect *rect) +bool SDL_GetDisplayUsableBounds(SDL_DisplayID displayID, SDL_Rect *rect) { SDL_VideoDisplay *display = SDL_GetVideoDisplay(displayID); @@ -1302,7 +1302,7 @@ SDL_DisplayMode **SDL_GetFullscreenDisplayModes(SDL_DisplayID displayID, int *co return result; } -SDL_bool SDL_GetClosestFullscreenDisplayMode(SDL_DisplayID displayID, int w, int h, float refresh_rate, SDL_bool include_high_density_modes, SDL_DisplayMode *result) +bool SDL_GetClosestFullscreenDisplayMode(SDL_DisplayID displayID, int w, int h, float refresh_rate, bool include_high_density_modes, SDL_DisplayMode *result) { const SDL_DisplayMode *mode, *closest = NULL; float aspect_ratio; @@ -1983,7 +1983,7 @@ error: return false; } -SDL_bool SDL_SetWindowFullscreenMode(SDL_Window *window, const SDL_DisplayMode *mode) +bool SDL_SetWindowFullscreenMode(SDL_Window *window, const SDL_DisplayMode *mode) { CHECK_WINDOW_MAGIC(window, false); CHECK_WINDOW_NOT_POPUP(window, false); @@ -2676,7 +2676,7 @@ SDL_WindowFlags SDL_GetWindowFlags(SDL_Window *window) return window->flags | window->pending_flags; } -SDL_bool SDL_SetWindowTitle(SDL_Window *window, const char *title) +bool SDL_SetWindowTitle(SDL_Window *window, const char *title) { CHECK_WINDOW_MAGIC(window, false); CHECK_WINDOW_NOT_POPUP(window, false); @@ -2701,7 +2701,7 @@ const char *SDL_GetWindowTitle(SDL_Window *window) return window->title ? window->title : ""; } -SDL_bool SDL_SetWindowIcon(SDL_Window *window, SDL_Surface *icon) +bool SDL_SetWindowIcon(SDL_Window *window, SDL_Surface *icon) { CHECK_WINDOW_MAGIC(window, false); @@ -2724,7 +2724,7 @@ SDL_bool SDL_SetWindowIcon(SDL_Window *window, SDL_Surface *icon) return _this->SetWindowIcon(_this, window, window->icon); } -SDL_bool SDL_SetWindowPosition(SDL_Window *window, int x, int y) +bool SDL_SetWindowPosition(SDL_Window *window, int x, int y) { SDL_DisplayID original_displayID; @@ -2785,7 +2785,7 @@ SDL_bool SDL_SetWindowPosition(SDL_Window *window, int x, int y) return SDL_Unsupported(); } -SDL_bool SDL_GetWindowPosition(SDL_Window *window, int *x, int *y) +bool SDL_GetWindowPosition(SDL_Window *window, int *x, int *y) { CHECK_WINDOW_MAGIC(window, false); @@ -2827,7 +2827,7 @@ SDL_bool SDL_GetWindowPosition(SDL_Window *window, int *x, int *y) return true; } -SDL_bool SDL_SetWindowBordered(SDL_Window *window, SDL_bool bordered) +bool SDL_SetWindowBordered(SDL_Window *window, bool bordered) { CHECK_WINDOW_MAGIC(window, false); CHECK_WINDOW_NOT_POPUP(window, false); @@ -2846,7 +2846,7 @@ SDL_bool SDL_SetWindowBordered(SDL_Window *window, SDL_bool bordered) return true; } -SDL_bool SDL_SetWindowResizable(SDL_Window *window, SDL_bool resizable) +bool SDL_SetWindowResizable(SDL_Window *window, bool resizable) { CHECK_WINDOW_MAGIC(window, false); CHECK_WINDOW_NOT_POPUP(window, false); @@ -2866,7 +2866,7 @@ SDL_bool SDL_SetWindowResizable(SDL_Window *window, SDL_bool resizable) return true; } -SDL_bool SDL_SetWindowAlwaysOnTop(SDL_Window *window, SDL_bool on_top) +bool SDL_SetWindowAlwaysOnTop(SDL_Window *window, bool on_top) { CHECK_WINDOW_MAGIC(window, false); CHECK_WINDOW_NOT_POPUP(window, false); @@ -2885,7 +2885,7 @@ SDL_bool SDL_SetWindowAlwaysOnTop(SDL_Window *window, SDL_bool on_top) return true; } -SDL_bool SDL_SetWindowSize(SDL_Window *window, int w, int h) +bool SDL_SetWindowSize(SDL_Window *window, int w, int h) { CHECK_WINDOW_MAGIC(window, false); @@ -2932,7 +2932,7 @@ SDL_bool SDL_SetWindowSize(SDL_Window *window, int w, int h) return true; } -SDL_bool SDL_GetWindowSize(SDL_Window *window, int *w, int *h) +bool SDL_GetWindowSize(SDL_Window *window, int *w, int *h) { CHECK_WINDOW_MAGIC(window, false); if (w) { @@ -2944,7 +2944,7 @@ SDL_bool SDL_GetWindowSize(SDL_Window *window, int *w, int *h) return true; } -SDL_bool SDL_SetWindowAspectRatio(SDL_Window *window, float min_aspect, float max_aspect) +bool SDL_SetWindowAspectRatio(SDL_Window *window, float min_aspect, float max_aspect) { CHECK_WINDOW_MAGIC(window, false); @@ -2956,7 +2956,7 @@ SDL_bool SDL_SetWindowAspectRatio(SDL_Window *window, float min_aspect, float ma return SDL_SetWindowSize(window, window->floating.w, window->floating.h); } -SDL_bool SDL_GetWindowAspectRatio(SDL_Window *window, float *min_aspect, float *max_aspect) +bool SDL_GetWindowAspectRatio(SDL_Window *window, float *min_aspect, float *max_aspect) { CHECK_WINDOW_MAGIC(window, false); @@ -2969,7 +2969,7 @@ SDL_bool SDL_GetWindowAspectRatio(SDL_Window *window, float *min_aspect, float * return true; } -SDL_bool SDL_GetWindowBordersSize(SDL_Window *window, int *top, int *left, int *bottom, int *right) +bool SDL_GetWindowBordersSize(SDL_Window *window, int *top, int *left, int *bottom, int *right) { int dummy = 0; @@ -2998,7 +2998,7 @@ SDL_bool SDL_GetWindowBordersSize(SDL_Window *window, int *top, int *left, int * return _this->GetWindowBordersSize(_this, window, top, left, bottom, right); } -SDL_bool SDL_GetWindowSizeInPixels(SDL_Window *window, int *w, int *h) +bool SDL_GetWindowSizeInPixels(SDL_Window *window, int *w, int *h) { int filter; @@ -3033,7 +3033,7 @@ SDL_bool SDL_GetWindowSizeInPixels(SDL_Window *window, int *w, int *h) return true; } -SDL_bool SDL_SetWindowMinimumSize(SDL_Window *window, int min_w, int min_h) +bool SDL_SetWindowMinimumSize(SDL_Window *window, int min_w, int min_h) { int w, h; @@ -3063,7 +3063,7 @@ SDL_bool SDL_SetWindowMinimumSize(SDL_Window *window, int min_w, int min_h) return SDL_SetWindowSize(window, w, h); } -SDL_bool SDL_GetWindowMinimumSize(SDL_Window *window, int *min_w, int *min_h) +bool SDL_GetWindowMinimumSize(SDL_Window *window, int *min_w, int *min_h) { CHECK_WINDOW_MAGIC(window, false); if (min_w) { @@ -3075,7 +3075,7 @@ SDL_bool SDL_GetWindowMinimumSize(SDL_Window *window, int *min_w, int *min_h) return true; } -SDL_bool SDL_SetWindowMaximumSize(SDL_Window *window, int max_w, int max_h) +bool SDL_SetWindowMaximumSize(SDL_Window *window, int max_w, int max_h) { int w, h; @@ -3104,7 +3104,7 @@ SDL_bool SDL_SetWindowMaximumSize(SDL_Window *window, int max_w, int max_h) return SDL_SetWindowSize(window, w, h); } -SDL_bool SDL_GetWindowMaximumSize(SDL_Window *window, int *max_w, int *max_h) +bool SDL_GetWindowMaximumSize(SDL_Window *window, int *max_w, int *max_h) { CHECK_WINDOW_MAGIC(window, false); if (max_w) { @@ -3116,7 +3116,7 @@ SDL_bool SDL_GetWindowMaximumSize(SDL_Window *window, int *max_w, int *max_h) return true; } -SDL_bool SDL_ShowWindow(SDL_Window *window) +bool SDL_ShowWindow(SDL_Window *window) { SDL_Window *child; CHECK_WINDOW_MAGIC(window, false); @@ -3150,7 +3150,7 @@ SDL_bool SDL_ShowWindow(SDL_Window *window) return true; } -SDL_bool SDL_HideWindow(SDL_Window *window) +bool SDL_HideWindow(SDL_Window *window) { SDL_Window *child; CHECK_WINDOW_MAGIC(window, false); @@ -3184,7 +3184,7 @@ SDL_bool SDL_HideWindow(SDL_Window *window) return true; } -SDL_bool SDL_RaiseWindow(SDL_Window *window) +bool SDL_RaiseWindow(SDL_Window *window) { CHECK_WINDOW_MAGIC(window, false); @@ -3197,7 +3197,7 @@ SDL_bool SDL_RaiseWindow(SDL_Window *window) return true; } -SDL_bool SDL_MaximizeWindow(SDL_Window *window) +bool SDL_MaximizeWindow(SDL_Window *window) { CHECK_WINDOW_MAGIC(window, false); CHECK_WINDOW_NOT_POPUP(window, false); @@ -3220,7 +3220,7 @@ SDL_bool SDL_MaximizeWindow(SDL_Window *window) return true; } -SDL_bool SDL_MinimizeWindow(SDL_Window *window) +bool SDL_MinimizeWindow(SDL_Window *window) { CHECK_WINDOW_MAGIC(window, false); CHECK_WINDOW_NOT_POPUP(window, false); @@ -3239,7 +3239,7 @@ SDL_bool SDL_MinimizeWindow(SDL_Window *window) return true; } -SDL_bool SDL_RestoreWindow(SDL_Window *window) +bool SDL_RestoreWindow(SDL_Window *window) { CHECK_WINDOW_MAGIC(window, false); CHECK_WINDOW_NOT_POPUP(window, false); @@ -3258,7 +3258,7 @@ SDL_bool SDL_RestoreWindow(SDL_Window *window) return true; } -SDL_bool SDL_SetWindowFullscreen(SDL_Window *window, SDL_bool fullscreen) +bool SDL_SetWindowFullscreen(SDL_Window *window, bool fullscreen) { bool result; @@ -3293,7 +3293,7 @@ SDL_bool SDL_SetWindowFullscreen(SDL_Window *window, SDL_bool fullscreen) return result; } -SDL_bool SDL_SyncWindow(SDL_Window *window) +bool SDL_SyncWindow(SDL_Window *window) { CHECK_WINDOW_MAGIC(window, false) @@ -3401,7 +3401,7 @@ static SDL_Surface *SDL_CreateWindowFramebuffer(SDL_Window *window) return SDL_CreateSurfaceFrom(w, h, format, pixels, pitch); } -SDL_bool SDL_WindowHasSurface(SDL_Window *window) +bool SDL_WindowHasSurface(SDL_Window *window) { CHECK_WINDOW_MAGIC(window, false); @@ -3428,7 +3428,7 @@ SDL_Surface *SDL_GetWindowSurface(SDL_Window *window) return window->surface; } -SDL_bool SDL_SetWindowSurfaceVSync(SDL_Window *window, int vsync) +bool SDL_SetWindowSurfaceVSync(SDL_Window *window, int vsync) { CHECK_WINDOW_MAGIC(window, false); @@ -3438,7 +3438,7 @@ SDL_bool SDL_SetWindowSurfaceVSync(SDL_Window *window, int vsync) return _this->SetWindowFramebufferVSync(_this, window, vsync); } -SDL_bool SDL_GetWindowSurfaceVSync(SDL_Window *window, int *vsync) +bool SDL_GetWindowSurfaceVSync(SDL_Window *window, int *vsync) { CHECK_WINDOW_MAGIC(window, false); @@ -3448,7 +3448,7 @@ SDL_bool SDL_GetWindowSurfaceVSync(SDL_Window *window, int *vsync) return _this->GetWindowFramebufferVSync(_this, window, vsync); } -SDL_bool SDL_UpdateWindowSurface(SDL_Window *window) +bool SDL_UpdateWindowSurface(SDL_Window *window) { SDL_Rect full_rect; @@ -3461,7 +3461,7 @@ SDL_bool SDL_UpdateWindowSurface(SDL_Window *window) return SDL_UpdateWindowSurfaceRects(window, &full_rect, 1); } -SDL_bool SDL_UpdateWindowSurfaceRects(SDL_Window *window, const SDL_Rect *rects, +bool SDL_UpdateWindowSurfaceRects(SDL_Window *window, const SDL_Rect *rects, int numrects) { CHECK_WINDOW_MAGIC(window, false); @@ -3475,7 +3475,7 @@ SDL_bool SDL_UpdateWindowSurfaceRects(SDL_Window *window, const SDL_Rect *rects, return _this->UpdateWindowFramebuffer(_this, window, rects, numrects); } -SDL_bool SDL_DestroyWindowSurface(SDL_Window *window) +bool SDL_DestroyWindowSurface(SDL_Window *window) { CHECK_WINDOW_MAGIC(window, false); @@ -3494,7 +3494,7 @@ SDL_bool SDL_DestroyWindowSurface(SDL_Window *window) return true; } -SDL_bool SDL_SetWindowOpacity(SDL_Window *window, float opacity) +bool SDL_SetWindowOpacity(SDL_Window *window, float opacity) { bool result; @@ -3525,7 +3525,7 @@ float SDL_GetWindowOpacity(SDL_Window *window) return window->opacity; } -SDL_bool SDL_SetWindowParent(SDL_Window *window, SDL_Window *parent) +bool SDL_SetWindowParent(SDL_Window *window, SDL_Window *parent) { CHECK_WINDOW_MAGIC(window, false); CHECK_WINDOW_NOT_POPUP(window, false); @@ -3547,13 +3547,13 @@ SDL_bool SDL_SetWindowParent(SDL_Window *window, SDL_Window *parent) return true; } - const SDL_bool ret = _this->SetWindowParent(_this, window, parent); + const bool ret = _this->SetWindowParent(_this, window, parent); SDL_UpdateWindowHierarchy(window, ret ? parent : NULL); return ret; } -SDL_bool SDL_SetWindowModal(SDL_Window *window, SDL_bool modal) +bool SDL_SetWindowModal(SDL_Window *window, bool modal) { CHECK_WINDOW_MAGIC(window, false); CHECK_WINDOW_NOT_POPUP(window, false); @@ -3580,7 +3580,7 @@ SDL_bool SDL_SetWindowModal(SDL_Window *window, SDL_bool modal) return _this->SetWindowModal(_this, window, modal); } -SDL_bool SDL_SetWindowFocusable(SDL_Window *window, SDL_bool focusable) +bool SDL_SetWindowFocusable(SDL_Window *window, bool focusable) { CHECK_WINDOW_MAGIC(window, false); @@ -3653,7 +3653,7 @@ void SDL_UpdateWindowGrab(SDL_Window *window) } } -SDL_bool SDL_SetWindowKeyboardGrab(SDL_Window *window, SDL_bool grabbed) +bool SDL_SetWindowKeyboardGrab(SDL_Window *window, bool grabbed) { CHECK_WINDOW_MAGIC(window, false); CHECK_WINDOW_NOT_POPUP(window, false); @@ -3683,7 +3683,7 @@ SDL_bool SDL_SetWindowKeyboardGrab(SDL_Window *window, SDL_bool grabbed) return true; } -SDL_bool SDL_SetWindowMouseGrab(SDL_Window *window, SDL_bool grabbed) +bool SDL_SetWindowMouseGrab(SDL_Window *window, bool grabbed) { CHECK_WINDOW_MAGIC(window, false); CHECK_WINDOW_NOT_POPUP(window, false); @@ -3713,13 +3713,13 @@ SDL_bool SDL_SetWindowMouseGrab(SDL_Window *window, SDL_bool grabbed) return true; } -SDL_bool SDL_GetWindowKeyboardGrab(SDL_Window *window) +bool SDL_GetWindowKeyboardGrab(SDL_Window *window) { CHECK_WINDOW_MAGIC(window, false); return window == _this->grabbed_window && (_this->grabbed_window->flags & SDL_WINDOW_KEYBOARD_GRABBED); } -SDL_bool SDL_GetWindowMouseGrab(SDL_Window *window) +bool SDL_GetWindowMouseGrab(SDL_Window *window) { CHECK_WINDOW_MAGIC(window, false); return window == _this->grabbed_window && (_this->grabbed_window->flags & SDL_WINDOW_MOUSE_GRABBED); @@ -3735,7 +3735,7 @@ SDL_Window *SDL_GetGrabbedWindow(void) } } -SDL_bool SDL_SetWindowMouseRect(SDL_Window *window, const SDL_Rect *rect) +bool SDL_SetWindowMouseRect(SDL_Window *window, const SDL_Rect *rect) { CHECK_WINDOW_MAGIC(window, false); @@ -3762,7 +3762,7 @@ const SDL_Rect *SDL_GetWindowMouseRect(SDL_Window *window) } } -SDL_bool SDL_SetWindowRelativeMouseMode(SDL_Window *window, SDL_bool enabled) +bool SDL_SetWindowRelativeMouseMode(SDL_Window *window, bool enabled) { CHECK_WINDOW_MAGIC(window, false); @@ -3786,7 +3786,7 @@ SDL_bool SDL_SetWindowRelativeMouseMode(SDL_Window *window, SDL_bool enabled) return true; } -SDL_bool SDL_GetWindowRelativeMouseMode(SDL_Window *window) +bool SDL_GetWindowRelativeMouseMode(SDL_Window *window) { CHECK_WINDOW_MAGIC(window, false); @@ -3797,7 +3797,7 @@ SDL_bool SDL_GetWindowRelativeMouseMode(SDL_Window *window) } } -SDL_bool SDL_FlashWindow(SDL_Window *window, SDL_FlashOperation operation) +bool SDL_FlashWindow(SDL_Window *window, SDL_FlashOperation operation) { CHECK_WINDOW_MAGIC(window, false); CHECK_WINDOW_NOT_POPUP(window, false); @@ -3909,7 +3909,7 @@ void SDL_SetWindowSafeAreaInsets(SDL_Window *window, int left, int right, int to SDL_CheckWindowSafeAreaChanged(window); } -SDL_bool SDL_GetWindowSafeArea(SDL_Window *window, SDL_Rect *rect) +bool SDL_GetWindowSafeArea(SDL_Window *window, SDL_Rect *rect) { if (rect) { SDL_zerop(rect); @@ -4148,7 +4148,7 @@ void SDL_DestroyWindow(SDL_Window *window) SDL_free(window); } -SDL_bool SDL_ScreenSaverEnabled(void) +bool SDL_ScreenSaverEnabled(void) { if (!_this) { return true; @@ -4156,7 +4156,7 @@ SDL_bool SDL_ScreenSaverEnabled(void) return !_this->suspend_screensaver; } -SDL_bool SDL_EnableScreenSaver(void) +bool SDL_EnableScreenSaver(void) { if (!_this) { return SDL_UninitializedVideo(); @@ -4172,7 +4172,7 @@ SDL_bool SDL_EnableScreenSaver(void) return SDL_Unsupported(); } -SDL_bool SDL_DisableScreenSaver(void) +bool SDL_DisableScreenSaver(void) { if (!_this) { return SDL_UninitializedVideo(); @@ -4228,7 +4228,7 @@ void SDL_VideoQuit(void) _this = NULL; } -SDL_bool SDL_GL_LoadLibrary(const char *path) +bool SDL_GL_LoadLibrary(const char *path) { bool result; @@ -4331,7 +4331,7 @@ static SDL_INLINE bool isAtLeastGL3(const char *verstr) } #endif // SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 -SDL_bool SDL_GL_ExtensionSupported(const char *extension) +bool SDL_GL_ExtensionSupported(const char *extension) { #if defined(SDL_VIDEO_OPENGL) || defined(SDL_VIDEO_OPENGL_ES) || defined(SDL_VIDEO_OPENGL_ES2) PFNGLGETSTRINGPROC glGetStringFunc; @@ -4519,7 +4519,7 @@ void SDL_GL_ResetAttributes(void) _this->gl_config.egl_platform = 0; } -SDL_bool SDL_GL_SetAttribute(SDL_GLattr attr, int value) +bool SDL_GL_SetAttribute(SDL_GLattr attr, int value) { #if defined(SDL_VIDEO_OPENGL) || defined(SDL_VIDEO_OPENGL_ES) || defined(SDL_VIDEO_OPENGL_ES2) bool result; @@ -4637,7 +4637,7 @@ SDL_bool SDL_GL_SetAttribute(SDL_GLattr attr, int value) #endif // SDL_VIDEO_OPENGL } -SDL_bool SDL_GL_GetAttribute(SDL_GLattr attr, int *value) +bool SDL_GL_GetAttribute(SDL_GLattr attr, int *value) { #if defined(SDL_VIDEO_OPENGL) || defined(SDL_VIDEO_OPENGL_ES) || defined(SDL_VIDEO_OPENGL_ES2) PFNGLGETERRORPROC glGetErrorFunc; @@ -4915,7 +4915,7 @@ SDL_GLContext SDL_GL_CreateContext(SDL_Window *window) return ctx; } -SDL_bool SDL_GL_MakeCurrent(SDL_Window *window, SDL_GLContext context) +bool SDL_GL_MakeCurrent(SDL_Window *window, SDL_GLContext context) { bool result; @@ -5026,7 +5026,7 @@ SDL_EGLConfig SDL_EGL_GetWindowSurface(SDL_Window *window) #endif } -SDL_bool SDL_GL_SetSwapInterval(int interval) +bool SDL_GL_SetSwapInterval(int interval) { if (!_this) { return SDL_UninitializedVideo(); @@ -5039,7 +5039,7 @@ SDL_bool SDL_GL_SetSwapInterval(int interval) } } -SDL_bool SDL_GL_GetSwapInterval(int *interval) +bool SDL_GL_GetSwapInterval(int *interval) { if (!interval) { return SDL_InvalidParamError("interval"); @@ -5058,7 +5058,7 @@ SDL_bool SDL_GL_GetSwapInterval(int *interval) } } -SDL_bool SDL_GL_SwapWindow(SDL_Window *window) +bool SDL_GL_SwapWindow(SDL_Window *window) { CHECK_WINDOW_MAGIC(window, false); @@ -5073,7 +5073,7 @@ SDL_bool SDL_GL_SwapWindow(SDL_Window *window) return _this->GL_SwapWindow(_this, window); } -SDL_bool SDL_GL_DestroyContext(SDL_GLContext context) +bool SDL_GL_DestroyContext(SDL_GLContext context) { if (!_this) { return SDL_UninitializedVideo(); \ @@ -5236,12 +5236,12 @@ static bool AutoShowingScreenKeyboard(void) } } -SDL_bool SDL_StartTextInput(SDL_Window *window) +bool SDL_StartTextInput(SDL_Window *window) { return SDL_StartTextInputWithProperties(window, 0); } -SDL_bool SDL_StartTextInputWithProperties(SDL_Window *window, SDL_PropertiesID props) +bool SDL_StartTextInputWithProperties(SDL_Window *window, SDL_PropertiesID props) { CHECK_WINDOW_MAGIC(window, false); @@ -5279,14 +5279,14 @@ SDL_bool SDL_StartTextInputWithProperties(SDL_Window *window, SDL_PropertiesID p return true; } -SDL_bool SDL_TextInputActive(SDL_Window *window) +bool SDL_TextInputActive(SDL_Window *window) { CHECK_WINDOW_MAGIC(window, false); return window->text_input_active; } -SDL_bool SDL_StopTextInput(SDL_Window *window) +bool SDL_StopTextInput(SDL_Window *window) { CHECK_WINDOW_MAGIC(window, false); @@ -5307,7 +5307,7 @@ SDL_bool SDL_StopTextInput(SDL_Window *window) return true; } -SDL_bool SDL_SetTextInputArea(SDL_Window *window, const SDL_Rect *rect, int cursor) +bool SDL_SetTextInputArea(SDL_Window *window, const SDL_Rect *rect, int cursor) { CHECK_WINDOW_MAGIC(window, false); @@ -5327,7 +5327,7 @@ SDL_bool SDL_SetTextInputArea(SDL_Window *window, const SDL_Rect *rect, int curs return true; } -SDL_bool SDL_GetTextInputArea(SDL_Window *window, SDL_Rect *rect, int *cursor) +bool SDL_GetTextInputArea(SDL_Window *window, SDL_Rect *rect, int *cursor) { CHECK_WINDOW_MAGIC(window, false); @@ -5340,7 +5340,7 @@ SDL_bool SDL_GetTextInputArea(SDL_Window *window, SDL_Rect *rect, int *cursor) return true; } -SDL_bool SDL_ClearComposition(SDL_Window *window) +bool SDL_ClearComposition(SDL_Window *window) { CHECK_WINDOW_MAGIC(window, false); @@ -5350,7 +5350,7 @@ SDL_bool SDL_ClearComposition(SDL_Window *window) return true; } -SDL_bool SDL_HasScreenKeyboardSupport(void) +bool SDL_HasScreenKeyboardSupport(void) { if (_this && _this->HasScreenKeyboardSupport) { return _this->HasScreenKeyboardSupport(_this); @@ -5358,7 +5358,7 @@ SDL_bool SDL_HasScreenKeyboardSupport(void) return false; } -SDL_bool SDL_ScreenKeyboardShown(SDL_Window *window) +bool SDL_ScreenKeyboardShown(SDL_Window *window) { CHECK_WINDOW_MAGIC(window, false); @@ -5401,7 +5401,7 @@ int SDL_GetMessageBoxCount(void) #include "vita/SDL_vitamessagebox.h" #endif -SDL_bool SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonID) +bool SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonID) { int dummybutton; bool result = false; @@ -5497,7 +5497,7 @@ SDL_bool SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *butto return result; } -SDL_bool SDL_ShowSimpleMessageBox(SDL_MessageBoxFlags flags, const char *title, const char *message, SDL_Window *window) +bool SDL_ShowSimpleMessageBox(SDL_MessageBoxFlags flags, const char *title, const char *message, SDL_Window *window) { #ifdef SDL_PLATFORM_EMSCRIPTEN // !!! FIXME: propose a browser API for this, get this #ifdef out of here? @@ -5541,7 +5541,7 @@ bool SDL_ShouldAllowTopmost(void) return SDL_GetHintBoolean(SDL_HINT_WINDOW_ALLOW_TOPMOST, true); } -SDL_bool SDL_ShowWindowSystemMenu(SDL_Window *window, int x, int y) +bool SDL_ShowWindowSystemMenu(SDL_Window *window, int x, int y) { CHECK_WINDOW_MAGIC(window, false) CHECK_WINDOW_NOT_POPUP(window, false) @@ -5554,7 +5554,7 @@ SDL_bool SDL_ShowWindowSystemMenu(SDL_Window *window, int x, int y) return SDL_Unsupported(); } -SDL_bool SDL_SetWindowHitTest(SDL_Window *window, SDL_HitTest callback, void *callback_data) +bool SDL_SetWindowHitTest(SDL_Window *window, SDL_HitTest callback, void *callback_data) { CHECK_WINDOW_MAGIC(window, false); @@ -5568,7 +5568,7 @@ SDL_bool SDL_SetWindowHitTest(SDL_Window *window, SDL_HitTest callback, void *ca return _this->SetWindowHitTest(window, callback != NULL); } -SDL_bool SDL_SetWindowShape(SDL_Window *window, SDL_Surface *shape) +bool SDL_SetWindowShape(SDL_Window *window, SDL_Surface *shape) { SDL_PropertiesID props; SDL_Surface *surface; @@ -5651,7 +5651,7 @@ void SDL_OnApplicationDidEnterForeground(void) #define NOT_A_VULKAN_WINDOW "The specified window isn't a Vulkan window" -SDL_bool SDL_Vulkan_LoadLibrary(const char *path) +bool SDL_Vulkan_LoadLibrary(const char *path) { bool result; @@ -5709,7 +5709,7 @@ char const* const* SDL_Vulkan_GetInstanceExtensions(Uint32 *count) return _this->Vulkan_GetInstanceExtensions(_this, count); } -SDL_bool SDL_Vulkan_CreateSurface(SDL_Window *window, +bool SDL_Vulkan_CreateSurface(SDL_Window *window, VkInstance instance, const struct VkAllocationCallbacks *allocator, VkSurfaceKHR *surface) @@ -5740,7 +5740,7 @@ void SDL_Vulkan_DestroySurface(VkInstance instance, } } -SDL_bool SDL_Vulkan_GetPresentationSupport(VkInstance instance, +bool SDL_Vulkan_GetPresentationSupport(VkInstance instance, VkPhysicalDevice physicalDevice, Uint32 queueFamilyIndex) { diff --git a/src/video/SDL_video_unsupported.c b/src/video/SDL_video_unsupported.c index 212907e18..a4f1ec8ff 100644 --- a/src/video/SDL_video_unsupported.c +++ b/src/video/SDL_video_unsupported.c @@ -24,7 +24,7 @@ #if defined(SDL_PLATFORM_WINDOWS) -SDL_bool SDL_RegisterApp(const char *name, Uint32 style, void *hInst) +bool SDL_RegisterApp(const char *name, Uint32 style, void *hInst) { (void)name; (void)style; @@ -42,8 +42,8 @@ void SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata) #endif // defined(SDL_PLATFORM_WINDOWS) -SDL_DECLSPEC SDL_bool SDLCALL SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex); -SDL_bool SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex) +SDL_DECLSPEC bool SDLCALL SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex); +bool SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex) { (void)displayID; (void)adapterIndex; @@ -95,8 +95,8 @@ void SDL_OnApplicationDidChangeStatusBarOrientation(void) #ifndef SDL_VIDEO_DRIVER_UIKIT typedef void (SDLCALL *SDL_iOSAnimationCallback)(void *userdata); -SDL_DECLSPEC SDL_bool SDLCALL SDL_SetiOSAnimationCallback(SDL_Window *window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam); -SDL_bool SDL_SetiOSAnimationCallback(SDL_Window *window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam) +SDL_DECLSPEC bool SDLCALL SDL_SetiOSAnimationCallback(SDL_Window *window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam); +bool SDL_SetiOSAnimationCallback(SDL_Window *window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam) { (void)window; (void)interval; @@ -105,8 +105,8 @@ SDL_bool SDL_SetiOSAnimationCallback(SDL_Window *window, int interval, SDL_iOSAn return SDL_Unsupported(); } -SDL_DECLSPEC void SDLCALL SDL_SetiOSEventPump(SDL_bool enabled); -void SDL_SetiOSEventPump(SDL_bool enabled) +SDL_DECLSPEC void SDLCALL SDL_SetiOSEventPump(bool enabled); +void SDL_SetiOSEventPump(bool enabled) { (void)enabled; SDL_Unsupported(); diff --git a/src/video/cocoa/SDL_cocoametalview.m b/src/video/cocoa/SDL_cocoametalview.m index 548c84150..2f85a2d29 100644 --- a/src/video/cocoa/SDL_cocoametalview.m +++ b/src/video/cocoa/SDL_cocoametalview.m @@ -30,7 +30,7 @@ #if defined(SDL_VIDEO_DRIVER_COCOA) && (defined(SDL_VIDEO_VULKAN) || defined(SDL_VIDEO_METAL)) -static SDL_bool SDLCALL SDL_MetalViewEventWatch(void *userdata, SDL_Event *event) +static bool SDLCALL SDL_MetalViewEventWatch(void *userdata, SDL_Event *event) { /* Update the drawable size when SDL receives a size changed event for * the window that contains the metal view. It would be nice to use diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m index 41aaee32b..f41f532e2 100644 --- a/src/video/cocoa/SDL_cocoawindow.m +++ b/src/video/cocoa/SDL_cocoawindow.m @@ -1538,7 +1538,7 @@ static NSCursor *Cocoa_GetDesiredCursor(void) return NO; // not a special area, carry on. } -static void Cocoa_SendMouseButtonClicks(SDL_Mouse *mouse, NSEvent *theEvent, SDL_Window *window, Uint8 button, SDL_bool down) +static void Cocoa_SendMouseButtonClicks(SDL_Mouse *mouse, NSEvent *theEvent, SDL_Window *window, Uint8 button, bool down) { SDL_MouseID mouseID = SDL_DEFAULT_MOUSE_ID; const int clicks = (int)[theEvent clickCount]; diff --git a/src/video/psp/SDL_pspevents.c b/src/video/psp/SDL_pspevents.c index e8ccd4074..336b7d6e8 100644 --- a/src/video/psp/SDL_pspevents.c +++ b/src/video/psp/SDL_pspevents.c @@ -107,7 +107,7 @@ void PSP_PumpEvents(SDL_VideoDevice *_this) count = length / sizeof(SIrKeybScanCodeData); for (i = 0; i < count; i++) { unsigned char raw; - SDL_bool down; + bool down; scanData = (SIrKeybScanCodeData *)buffer + i; raw = scanData->raw; down = (scanData->pressed != 0); diff --git a/src/video/uikit/SDL_uikitevents.m b/src/video/uikit/SDL_uikitevents.m index ce72170bf..e3f9450d8 100644 --- a/src/video/uikit/SDL_uikitevents.m +++ b/src/video/uikit/SDL_uikitevents.m @@ -119,7 +119,7 @@ void SDL_UpdateLifecycleObserver(void) [lifecycleObserver update]; } -void SDL_SetiOSEventPump(SDL_bool enabled) +void SDL_SetiOSEventPump(bool enabled) { UIKit_EventPumpEnabled = enabled; diff --git a/src/video/uikit/SDL_uikitwindow.m b/src/video/uikit/SDL_uikitwindow.m index 00563f0d4..1d6e7f884 100644 --- a/src/video/uikit/SDL_uikitwindow.m +++ b/src/video/uikit/SDL_uikitwindow.m @@ -452,7 +452,7 @@ UIKit_GetSupportedOrientations(SDL_Window *window) } #endif // !SDL_PLATFORM_TVOS -SDL_bool SDL_SetiOSAnimationCallback(SDL_Window *window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam) +bool SDL_SetiOSAnimationCallback(SDL_Window *window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam) { if (!window || !window->internal) { return SDL_SetError("Invalid window"); diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c index 81bc563d4..e685689be 100644 --- a/src/video/wayland/SDL_waylandwindow.c +++ b/src/video/wayland/SDL_waylandwindow.c @@ -1587,11 +1587,11 @@ bool Wayland_SetWindowParent(SDL_VideoDevice *_this, SDL_Window *window, SDL_Win SDL_WindowData *child_data = window->internal; SDL_WindowData *parent_data = parent_window ? parent_window->internal : NULL; - child_data->reparenting_required = SDL_FALSE; + child_data->reparenting_required = false; if (parent_data && parent_data->surface_status != WAYLAND_SURFACE_STATUS_SHOWN) { // Need to wait for the parent to become mapped, or it's the same as setting a null parent. - child_data->reparenting_required = SDL_TRUE; + child_data->reparenting_required = true; return true; } @@ -2719,7 +2719,7 @@ bool Wayland_SetWindowIcon(SDL_VideoDevice *_this, SDL_Window *window, SDL_Surfa return SDL_SetError("wayland: failed to allocate SHM buffer for the icon"); } - SDL_PremultiplyAlpha(icon->w, icon->h, icon->format, icon->pixels, icon->pitch, SDL_PIXELFORMAT_ARGB8888, wind->icon.shm_data, icon->w * 4, SDL_TRUE); + SDL_PremultiplyAlpha(icon->w, icon->h, icon->format, icon->pixels, icon->pitch, SDL_PIXELFORMAT_ARGB8888, wind->icon.shm_data, icon->w * 4, true); wind->xdg_toplevel_icon_v1 = xdg_toplevel_icon_manager_v1_create_icon(_this->internal->xdg_toplevel_icon_manager_v1); xdg_toplevel_icon_v1_add_buffer(wind->xdg_toplevel_icon_v1, wind->icon.wl_buffer, 1); diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index bb61a9f9d..26e9fcfe8 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -1278,7 +1278,7 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara bool virtual_key = false; Uint16 rawcode = 0; SDL_Scancode code = WindowsScanCodeToSDLScanCode(lParam, wParam, &rawcode, &virtual_key); - const SDL_bool *keyboardState = SDL_GetKeyboardState(NULL); + const bool *keyboardState = SDL_GetKeyboardState(NULL); if (virtual_key || !data->videodata->raw_keyboard_enabled || data->window->text_input_active) { if (code == SDL_SCANCODE_PRINTSCREEN && !keyboardState[code]) { @@ -2236,7 +2236,7 @@ void WIN_PumpEvents(SDL_VideoDevice *_this) #endif int new_messages = 0; #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) - const SDL_bool *keystate; + const bool *keystate; SDL_Window *focusWindow; #endif @@ -2370,7 +2370,7 @@ static BOOL CALLBACK WIN_ResourceNameCallback(HMODULE hModule, LPCTSTR lpType, L #endif // !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) // Register the class for this application -SDL_bool SDL_RegisterApp(const char *name, Uint32 style, void *hInst) +bool SDL_RegisterApp(const char *name, Uint32 style, void *hInst) { WNDCLASSEX wcex; #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) diff --git a/src/video/windows/SDL_windowsgameinput.c b/src/video/windows/SDL_windowsgameinput.c index 6dfd1c087..df6829bb7 100644 --- a/src/video/windows/SDL_windowsgameinput.c +++ b/src/video/windows/SDL_windowsgameinput.c @@ -371,7 +371,7 @@ static void GAMEINPUT_InitialKeyboardReading(WIN_GameInputData *data, SDL_Window // Go through and send key up events for any key that's not held down int num_scancodes; - const SDL_bool *keyboard_state = SDL_GetKeyboardState(&num_scancodes); + const bool *keyboard_state = SDL_GetKeyboardState(&num_scancodes); for (int i = 0; i < num_scancodes; ++i) { if (keyboard_state[i] && !KeysHaveScancode(keys, num_keys, (SDL_Scancode)i)) { SDL_SendKeyboardKey(timestamp, keyboardID, keys[i].scanCode, (SDL_Scancode)i, false); diff --git a/src/video/windows/SDL_windowsvideo.c b/src/video/windows/SDL_windowsvideo.c index b9e3a9961..92418e738 100644 --- a/src/video/windows/SDL_windowsvideo.c +++ b/src/video/windows/SDL_windowsvideo.c @@ -666,7 +666,7 @@ int SDL_GetDirect3D9AdapterIndex(SDL_DisplayID displayID) } #endif // !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) -SDL_bool SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex) +bool SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex) { #ifndef HAVE_DXGI_H if (adapterIndex) { diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index ae15e2d37..66f0401e3 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -304,7 +304,7 @@ void X11_ReconcileKeyboardState(SDL_VideoDevice *_this) Window junk_window; int x, y; unsigned int mask; - const SDL_bool *keyboardState; + const bool *keyboardState; X11_XQueryKeymap(display, keys); diff --git a/test/checkkeys.c b/test/checkkeys.c index bc9191ac7..c81f9aa83 100644 --- a/test/checkkeys.c +++ b/test/checkkeys.c @@ -38,8 +38,8 @@ typedef struct static SDLTest_CommonState *state; static TextWindowState *windowstates; -static SDL_bool escape_pressed; -static SDL_bool cursor_visible; +static bool escape_pressed; +static bool cursor_visible; static Uint64 last_cursor_change; static int done; @@ -234,7 +234,7 @@ static void PrintText(const char *eventtype, const char *text) static void CountKeysDown(void) { int i, count = 0, max_keys = 0; - const SDL_bool *keystate = SDL_GetKeyboardState(&max_keys); + const bool *keystate = SDL_GetKeyboardState(&max_keys); for (i = 0; i < max_keys; ++i) { if (keystate[i]) { @@ -336,10 +336,10 @@ static void loop(void) if (escape_pressed) { done = 1; } else { - escape_pressed = SDL_TRUE; + escape_pressed = true; } } else { - escape_pressed = SDL_TRUE; + escape_pressed = true; } } CountKeysDown(); diff --git a/test/childprocess.c b/test/childprocess.c index d66bf9516..bed765dc0 100644 --- a/test/childprocess.c +++ b/test/childprocess.c @@ -10,11 +10,11 @@ int main(int argc, char *argv[]) { SDLTest_CommonState *state; int i; const char *expect_environment = NULL; - SDL_bool expect_environment_match = SDL_FALSE; - SDL_bool print_arguments = SDL_FALSE; - SDL_bool print_environment = SDL_FALSE; - SDL_bool stdin_to_stdout = SDL_FALSE; - SDL_bool stdin_to_stderr = SDL_FALSE; + bool expect_environment_match = false; + bool print_arguments = false; + bool print_environment = false; + bool stdin_to_stdout = false; + bool stdin_to_stderr = false; int exit_code = 0; state = SDLTest_CommonCreateState(argv, 0); @@ -22,10 +22,10 @@ int main(int argc, char *argv[]) { for (i = 1; i < argc;) { int consumed = SDLTest_CommonArg(state, i); if (SDL_strcmp(argv[i], "--print-arguments") == 0) { - print_arguments = SDL_TRUE; + print_arguments = true; consumed = 1; } else if (SDL_strcmp(argv[i], "--print-environment") == 0) { - print_environment = SDL_TRUE; + print_environment = true; consumed = 1; } else if (SDL_strcmp(argv[i], "--expect-env") == 0) { if (i + 1 < argc) { @@ -33,10 +33,10 @@ int main(int argc, char *argv[]) { consumed = 2; } } else if (SDL_strcmp(argv[i], "--stdin-to-stdout") == 0) { - stdin_to_stdout = SDL_TRUE; + stdin_to_stdout = true; consumed = 1; } else if (SDL_strcmp(argv[i], "--stdin-to-stderr") == 0) { - stdin_to_stderr = SDL_TRUE; + stdin_to_stderr = true; consumed = 1; } else if (SDL_strcmp(argv[i], "--stdout") == 0) { if (i + 1 < argc) { diff --git a/test/gamepadutils.c b/test/gamepadutils.c index c9b691769..978d86ed5 100644 --- a/test/gamepadutils.c +++ b/test/gamepadutils.c @@ -81,7 +81,7 @@ static SDL_FRect touchpad_area = { typedef struct { - SDL_bool down; + bool down; float x; float y; float pressure; @@ -114,12 +114,12 @@ struct GamepadImage float x; float y; - SDL_bool showing_front; - SDL_bool showing_touchpad; + bool showing_front; + bool showing_touchpad; SDL_GamepadType type; ControllerDisplayMode display_mode; - SDL_bool elements[SDL_GAMEPAD_ELEMENT_MAX]; + bool elements[SDL_GAMEPAD_ELEMENT_MAX]; SDL_PowerState battery_state; int battery_percent; @@ -134,7 +134,7 @@ static SDL_Texture *CreateTexture(SDL_Renderer *renderer, unsigned char *data, u SDL_Surface *surface; SDL_IOStream *src = SDL_IOFromConstMem(data, len); if (src) { - surface = SDL_LoadBMP_IO(src, SDL_TRUE); + surface = SDL_LoadBMP_IO(src, true); if (surface) { texture = SDL_CreateTextureFromSurface(renderer, surface); SDL_DestroySurface(surface); @@ -172,7 +172,7 @@ GamepadImage *CreateGamepadImage(SDL_Renderer *renderer) SDL_GetTextureSize(ctx->axis_texture, &ctx->axis_width, &ctx->axis_height); SDL_SetTextureColorMod(ctx->axis_texture, 10, 255, 21); - ctx->showing_front = SDL_TRUE; + ctx->showing_front = true; } return ctx; } @@ -216,7 +216,7 @@ void GetGamepadTouchpadArea(GamepadImage *ctx, SDL_FRect *area) area->h = touchpad_area.h; } -void SetGamepadImageShowingFront(GamepadImage *ctx, SDL_bool showing_front) +void SetGamepadImageShowingFront(GamepadImage *ctx, bool showing_front) { if (!ctx) { return; @@ -370,10 +370,10 @@ int GetGamepadImageElementAt(GamepadImage *ctx, float x, float y) } for (i = 0; i < SDL_arraysize(button_positions); ++i) { - SDL_bool on_front = SDL_TRUE; + bool on_front = true; if (i >= SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1 && i <= SDL_GAMEPAD_BUTTON_LEFT_PADDLE2) { - on_front = SDL_FALSE; + on_front = false; } if (on_front == ctx->showing_front) { SDL_FRect rect; @@ -398,7 +398,7 @@ void ClearGamepadImage(GamepadImage *ctx) SDL_zeroa(ctx->elements); } -void SetGamepadImageElement(GamepadImage *ctx, int element, SDL_bool active) +void SetGamepadImageElement(GamepadImage *ctx, int element, bool active) { if (!ctx) { return; @@ -481,14 +481,14 @@ void UpdateGamepadImageFromGamepad(GamepadImage *ctx, SDL_Gamepad *gamepad) SDL_GetGamepadTouchpadFinger(gamepad, 0, i, &finger->down, &finger->x, &finger->y, &finger->pressure); } - ctx->showing_touchpad = SDL_TRUE; + ctx->showing_touchpad = true; } else { if (ctx->fingers) { SDL_free(ctx->fingers); ctx->fingers = NULL; ctx->num_fingers = 0; } - ctx->showing_touchpad = SDL_FALSE; + ctx->showing_touchpad = false; } } @@ -515,10 +515,10 @@ void RenderGamepadImage(GamepadImage *ctx) for (i = 0; i < SDL_arraysize(button_positions); ++i) { if (ctx->elements[i]) { SDL_GamepadButton button_position = (SDL_GamepadButton)i; - SDL_bool on_front = SDL_TRUE; + bool on_front = true; if (i >= SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1 && i <= SDL_GAMEPAD_BUTTON_LEFT_PADDLE2) { - on_front = SDL_FALSE; + on_front = false; } if (on_front == ctx->showing_front) { dst.w = ctx->button_width; @@ -704,7 +704,7 @@ struct GamepadDisplay ControllerDisplayMode display_mode; int element_highlighted; - SDL_bool element_pressed; + bool element_pressed; int element_selected; SDL_FRect area; @@ -746,17 +746,17 @@ void SetGamepadDisplayArea(GamepadDisplay *ctx, const SDL_FRect *area) SDL_copyp(&ctx->area, area); } -static SDL_bool GetBindingString(const char *label, const char *mapping, char *text, size_t size) +static bool GetBindingString(const char *label, const char *mapping, char *text, size_t size) { char *key; char *value, *end; size_t length; - SDL_bool found = SDL_FALSE; + bool found = false; *text = '\0'; if (!mapping) { - return SDL_FALSE; + return false; } key = SDL_strstr(mapping, label); @@ -766,7 +766,7 @@ static SDL_bool GetBindingString(const char *label, const char *mapping, char *t *text = '\0'; --size; } else { - found = SDL_TRUE; + found = true; } value = key + SDL_strlen(label); end = SDL_strchr(value, ','); @@ -787,23 +787,23 @@ static SDL_bool GetBindingString(const char *label, const char *mapping, char *t return found; } -static SDL_bool GetButtonBindingString(SDL_GamepadButton button, const char *mapping, char *text, size_t size) +static bool GetButtonBindingString(SDL_GamepadButton button, const char *mapping, char *text, size_t size) { char label[32]; - SDL_bool baxy_mapping = SDL_FALSE; + bool baxy_mapping = false; if (!mapping) { - return SDL_FALSE; + return false; } SDL_snprintf(label, sizeof(label), ",%s:", SDL_GetGamepadStringForButton(button)); if (GetBindingString(label, mapping, text, size)) { - return SDL_TRUE; + return true; } /* Try the legacy button names */ if (SDL_strstr(mapping, ",hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1") != NULL) { - baxy_mapping = SDL_TRUE; + baxy_mapping = true; } switch (button) { case SDL_GAMEPAD_BUTTON_SOUTH: @@ -831,11 +831,11 @@ static SDL_bool GetButtonBindingString(SDL_GamepadButton button, const char *map return GetBindingString(",y:", mapping, text, size); } default: - return SDL_FALSE; + return false; } } -static SDL_bool GetAxisBindingString(SDL_GamepadAxis axis, int direction, const char *mapping, char *text, size_t size) +static bool GetAxisBindingString(SDL_GamepadAxis axis, int direction, const char *mapping, char *text, size_t size) { char label[32]; @@ -846,13 +846,13 @@ static SDL_bool GetAxisBindingString(SDL_GamepadAxis axis, int direction, const SDL_snprintf(label, sizeof(label), ",+%s:", SDL_GetGamepadStringForAxis(axis)); } if (GetBindingString(label, mapping, text, size)) { - return SDL_TRUE; + return true; } /* Get the binding for the whole axis and split it if necessary */ SDL_snprintf(label, sizeof(label), ",%s:", SDL_GetGamepadStringForAxis(axis)); if (!GetBindingString(label, mapping, text, size)) { - return SDL_FALSE; + return false; } if (axis != SDL_GAMEPAD_AXIS_LEFT_TRIGGER && axis != SDL_GAMEPAD_AXIS_RIGHT_TRIGGER) { if (*text == 'a') { @@ -872,10 +872,10 @@ static SDL_bool GetAxisBindingString(SDL_GamepadAxis axis, int direction, const } } } - return SDL_TRUE; + return true; } -void SetGamepadDisplayHighlight(GamepadDisplay *ctx, int element, SDL_bool pressed) +void SetGamepadDisplayHighlight(GamepadDisplay *ctx, int element, bool pressed) { if (!ctx) { return; @@ -1019,8 +1019,8 @@ void RenderGamepadDisplay(GamepadDisplay *ctx, SDL_Gamepad *gamepad) SDL_FRect dst, rect, highlight; Uint8 r, g, b, a; char *mapping; - SDL_bool has_accel; - SDL_bool has_gyro; + bool has_accel; + bool has_gyro; if (!ctx) { return; @@ -1074,7 +1074,7 @@ void RenderGamepadDisplay(GamepadDisplay *ctx, SDL_Gamepad *gamepad) for (i = 0; i < SDL_GAMEPAD_AXIS_COUNT; ++i) { SDL_GamepadAxis axis = (SDL_GamepadAxis)i; - SDL_bool has_negative = (axis != SDL_GAMEPAD_AXIS_LEFT_TRIGGER && axis != SDL_GAMEPAD_AXIS_RIGHT_TRIGGER); + bool has_negative = (axis != SDL_GAMEPAD_AXIS_LEFT_TRIGGER && axis != SDL_GAMEPAD_AXIS_RIGHT_TRIGGER); Sint16 value; if (ctx->display_mode == CONTROLLER_MODE_TESTING && @@ -1216,7 +1216,7 @@ void RenderGamepadDisplay(GamepadDisplay *ctx, SDL_Gamepad *gamepad) if (SDL_GetNumGamepadTouchpads(gamepad) > 0) { int num_fingers = SDL_GetNumGamepadTouchpadFingers(gamepad, 0); for (i = 0; i < num_fingers; ++i) { - SDL_bool down; + bool down; float finger_x, finger_y, finger_pressure; if (!SDL_GetGamepadTouchpadFinger(gamepad, 0, i, &down, &finger_x, &finger_y, &finger_pressure)) { @@ -1301,7 +1301,7 @@ struct GamepadTypeDisplay SDL_Renderer *renderer; int type_highlighted; - SDL_bool type_pressed; + bool type_pressed; int type_selected; SDL_GamepadType real_type; @@ -1330,7 +1330,7 @@ void SetGamepadTypeDisplayArea(GamepadTypeDisplay *ctx, const SDL_FRect *area) SDL_copyp(&ctx->area, area); } -void SetGamepadTypeDisplayHighlight(GamepadTypeDisplay *ctx, int type, SDL_bool pressed) +void SetGamepadTypeDisplayHighlight(GamepadTypeDisplay *ctx, int type, bool pressed) { if (!ctx) { return; @@ -1481,7 +1481,7 @@ struct JoystickDisplay SDL_FRect area; char *element_highlighted; - SDL_bool element_pressed; + bool element_pressed; }; JoystickDisplay *CreateJoystickDisplay(SDL_Renderer *renderer) @@ -1620,12 +1620,12 @@ char *GetJoystickDisplayElementAt(JoystickDisplay *ctx, SDL_Joystick *joystick, return NULL; } -void SetJoystickDisplayHighlight(JoystickDisplay *ctx, const char *element, SDL_bool pressed) +void SetJoystickDisplayHighlight(JoystickDisplay *ctx, const char *element, bool pressed) { if (ctx->element_highlighted) { SDL_free(ctx->element_highlighted); ctx->element_highlighted = NULL; - ctx->element_pressed = SDL_FALSE; + ctx->element_pressed = false; } if (element) { @@ -1682,10 +1682,10 @@ static void RenderJoystickAxisHighlight(JoystickDisplay *ctx, int axis, int dire } } -static SDL_bool SetupJoystickHatHighlight(JoystickDisplay *ctx, int hat, int direction) +static bool SetupJoystickHatHighlight(JoystickDisplay *ctx, int hat, int direction) { if (!ctx->element_highlighted || *ctx->element_highlighted != 'h') { - return SDL_FALSE; + return false; } if (SDL_atoi(ctx->element_highlighted + 1) == hat && @@ -1696,9 +1696,9 @@ static SDL_bool SetupJoystickHatHighlight(JoystickDisplay *ctx, int hat, int dir } else { SDL_SetTextureColorMod(ctx->button_texture, HIGHLIGHT_TEXTURE_MOD); } - return SDL_TRUE; + return true; } - return SDL_FALSE; + return false; } void RenderJoystickDisplay(JoystickDisplay *ctx, SDL_Joystick *joystick) @@ -1916,8 +1916,8 @@ struct GamepadButton float label_width; float label_height; - SDL_bool highlight; - SDL_bool pressed; + bool highlight; + bool pressed; }; GamepadButton *CreateGamepadButton(SDL_Renderer *renderer, const char *label) @@ -1955,7 +1955,7 @@ void GetGamepadButtonArea(GamepadButton *ctx, SDL_FRect *area) SDL_copyp(area, &ctx->area); } -void SetGamepadButtonHighlight(GamepadButton *ctx, SDL_bool highlight, SDL_bool pressed) +void SetGamepadButtonHighlight(GamepadButton *ctx, bool highlight, bool pressed) { if (!ctx) { return; @@ -1965,7 +1965,7 @@ void SetGamepadButtonHighlight(GamepadButton *ctx, SDL_bool highlight, SDL_bool if (highlight) { ctx->pressed = pressed; } else { - ctx->pressed = SDL_FALSE; + ctx->pressed = false; } } @@ -1987,12 +1987,12 @@ float GetGamepadButtonLabelHeight(GamepadButton *ctx) return ctx->label_height; } -SDL_bool GamepadButtonContains(GamepadButton *ctx, float x, float y) +bool GamepadButtonContains(GamepadButton *ctx, float x, float y) { SDL_FPoint point; if (!ctx) { - return SDL_FALSE; + return false; } point.x = x; @@ -2111,14 +2111,14 @@ typedef struct char **values; } MappingParts; -static SDL_bool AddMappingKeyValue(MappingParts *parts, char *key, char *value); +static bool AddMappingKeyValue(MappingParts *parts, char *key, char *value); -static SDL_bool AddMappingHalfAxisValue(MappingParts *parts, const char *key, const char *value, char sign) +static bool AddMappingHalfAxisValue(MappingParts *parts, const char *key, const char *value, char sign) { char *new_key, *new_value; if (SDL_asprintf(&new_key, "%c%s", sign, key) < 0) { - return SDL_FALSE; + return false; } if (*value && value[SDL_strlen(value) - 1] == '~') { @@ -2132,7 +2132,7 @@ static SDL_bool AddMappingHalfAxisValue(MappingParts *parts, const char *key, co if (SDL_asprintf(&new_value, "%c%s", sign, value) < 0) { SDL_free(new_key); - return SDL_FALSE; + return false; } if (new_value[SDL_strlen(new_value) - 1] == '~') { new_value[SDL_strlen(new_value) - 1] = '\0'; @@ -2141,7 +2141,7 @@ static SDL_bool AddMappingHalfAxisValue(MappingParts *parts, const char *key, co return AddMappingKeyValue(parts, new_key, new_value); } -static SDL_bool AddMappingKeyValue(MappingParts *parts, char *key, char *value) +static bool AddMappingKeyValue(MappingParts *parts, char *key, char *value) { int axis; char **new_keys, **new_values; @@ -2149,13 +2149,13 @@ static SDL_bool AddMappingKeyValue(MappingParts *parts, char *key, char *value) if (!key || !value) { SDL_free(key); SDL_free(value); - return SDL_FALSE; + return false; } /* Split axis values for easy binding purposes */ for (axis = 0; axis < SDL_GAMEPAD_AXIS_LEFT_TRIGGER; ++axis) { if (SDL_strcmp(key, SDL_GetGamepadStringForAxis((SDL_GamepadAxis)axis)) == 0) { - SDL_bool result; + bool result; result = AddMappingHalfAxisValue(parts, key, value, '-') && AddMappingHalfAxisValue(parts, key, value, '+'); @@ -2167,20 +2167,20 @@ static SDL_bool AddMappingKeyValue(MappingParts *parts, char *key, char *value) new_keys = (char **)SDL_realloc(parts->keys, (parts->num_elements + 1) * sizeof(*new_keys)); if (!new_keys) { - return SDL_FALSE; + return false; } parts->keys = new_keys; new_values = (char **)SDL_realloc(parts->values, (parts->num_elements + 1) * sizeof(*new_values)); if (!new_values) { - return SDL_FALSE; + return false; } parts->values = new_values; new_keys[parts->num_elements] = key; new_values[parts->num_elements] = value; ++parts->num_elements; - return SDL_TRUE; + return true; } static void SplitMapping(const char *mapping, MappingParts *parts) @@ -2271,7 +2271,7 @@ static void RemoveMappingValueAt(MappingParts *parts, int index) static void ConvertBAXYMapping(MappingParts *parts) { int i; - SDL_bool baxy_mapping = SDL_FALSE; + bool baxy_mapping = false; for (i = 0; i < parts->num_elements; ++i) { const char *key = parts->keys[i]; @@ -2279,7 +2279,7 @@ static void ConvertBAXYMapping(MappingParts *parts) if (SDL_strcmp(key, "hint") == 0 && SDL_strcmp(value, "SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1") == 0) { - baxy_mapping = SDL_TRUE; + baxy_mapping = true; } } @@ -2317,7 +2317,7 @@ static void UpdateLegacyElements(MappingParts *parts) ConvertBAXYMapping(parts); } -static SDL_bool CombineMappingAxes(MappingParts *parts) +static bool CombineMappingAxes(MappingParts *parts) { int i, matching, axis; @@ -2335,7 +2335,7 @@ static SDL_bool CombineMappingAxes(MappingParts *parts) if (SDL_strcmp(key + 1, SDL_GetGamepadStringForAxis((SDL_GamepadAxis)axis)) == 0) { /* Look for a matching axis with the opposite sign */ if (SDL_asprintf(&matching_key, "%c%s", (*key == '-' ? '+' : '-'), key + 1) < 0) { - return SDL_FALSE; + return false; } matching = FindMappingKey(parts, matching_key); if (matching >= 0) { @@ -2362,7 +2362,7 @@ static SDL_bool CombineMappingAxes(MappingParts *parts) } } } - return SDL_TRUE; + return true; } typedef struct @@ -2381,7 +2381,7 @@ static int SDLCALL SortMapping(const void *a, const void *b) return SDL_strcmp(keyA, keyB); } -static void MoveSortedEntry(const char *key, MappingSortEntry *sort_order, int num_elements, SDL_bool front) +static void MoveSortedEntry(const char *key, MappingSortEntry *sort_order, int num_elements, bool front) { int i; @@ -2438,12 +2438,12 @@ static char *JoinMapping(MappingParts *parts) sort_order[i].index = i; } SDL_qsort(sort_order, parts->num_elements, sizeof(*sort_order), SortMapping); - MoveSortedEntry("type", sort_order, parts->num_elements, SDL_TRUE); - MoveSortedEntry("platform", sort_order, parts->num_elements, SDL_TRUE); - MoveSortedEntry("crc", sort_order, parts->num_elements, SDL_TRUE); - MoveSortedEntry("sdk>=", sort_order, parts->num_elements, SDL_FALSE); - MoveSortedEntry("sdk<=", sort_order, parts->num_elements, SDL_FALSE); - MoveSortedEntry("hint", sort_order, parts->num_elements, SDL_FALSE); + MoveSortedEntry("type", sort_order, parts->num_elements, true); + MoveSortedEntry("platform", sort_order, parts->num_elements, true); + MoveSortedEntry("crc", sort_order, parts->num_elements, true); + MoveSortedEntry("sdk>=", sort_order, parts->num_elements, false); + MoveSortedEntry("sdk<=", sort_order, parts->num_elements, false); + MoveSortedEntry("hint", sort_order, parts->num_elements, false); /* Move platform to the front */ @@ -2495,7 +2495,7 @@ static char *RecreateMapping(MappingParts *parts, char *mapping) return mapping; } -static const char *GetLegacyKey(const char *key, SDL_bool baxy) +static const char *GetLegacyKey(const char *key, bool baxy) { if (SDL_strcmp(key, SDL_GetGamepadStringForButton(SDL_GAMEPAD_BUTTON_SOUTH)) == 0) { if (baxy) { @@ -2532,24 +2532,24 @@ static const char *GetLegacyKey(const char *key, SDL_bool baxy) return key; } -static SDL_bool MappingHasKey(const char *mapping, const char *key) +static bool MappingHasKey(const char *mapping, const char *key) { int i; MappingParts parts; - SDL_bool result = SDL_FALSE; + bool result = false; SplitMapping(mapping, &parts); i = FindMappingKey(&parts, key); if (i < 0) { - SDL_bool baxy_mapping = SDL_FALSE; + bool baxy_mapping = false; if (mapping && SDL_strstr(mapping, ",hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1") != NULL) { - baxy_mapping = SDL_TRUE; + baxy_mapping = true; } i = FindMappingKey(&parts, GetLegacyKey(key, baxy_mapping)); } if (i >= 0) { - result = SDL_TRUE; + result = true; } FreeMappingParts(&parts); @@ -2565,10 +2565,10 @@ static char *GetMappingValue(const char *mapping, const char *key) SplitMapping(mapping, &parts); i = FindMappingKey(&parts, key); if (i < 0) { - SDL_bool baxy_mapping = SDL_FALSE; + bool baxy_mapping = false; if (mapping && SDL_strstr(mapping, ",hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1") != NULL) { - baxy_mapping = SDL_TRUE; + baxy_mapping = true; } i = FindMappingKey(&parts, GetLegacyKey(key, baxy_mapping)); } @@ -2589,7 +2589,7 @@ static char *SetMappingValue(char *mapping, const char *key, const char *value) char *new_value = NULL; char **new_keys = NULL; char **new_values = NULL; - SDL_bool result = SDL_FALSE; + bool result = false; if (!key) { return mapping; @@ -2602,7 +2602,7 @@ static char *SetMappingValue(char *mapping, const char *key, const char *value) if (new_value) { SDL_free(parts.values[i]); parts.values[i] = new_value; - result = SDL_TRUE; + result = true; } } else { int count = parts.num_elements; @@ -2620,7 +2620,7 @@ static char *SetMappingValue(char *mapping, const char *key, const char *value) parts.num_elements = (count + 1); parts.keys = new_keys; parts.values = new_values; - result = SDL_TRUE; + result = true; } } } @@ -2651,27 +2651,27 @@ static char *RemoveMappingValue(char *mapping, const char *key) return RecreateMapping(&parts, mapping); } -SDL_bool MappingHasBindings(const char *mapping) +bool MappingHasBindings(const char *mapping) { MappingParts parts; int i; - SDL_bool result = SDL_FALSE; + bool result = false; if (!mapping || !*mapping) { - return SDL_FALSE; + return false; } SplitMapping(mapping, &parts); for (i = 0; i < SDL_GAMEPAD_BUTTON_COUNT; ++i) { if (FindMappingKey(&parts, SDL_GetGamepadStringForButton((SDL_GamepadButton)i)) >= 0) { - result = SDL_TRUE; + result = true; break; } } if (!result) { for (i = 0; i < SDL_GAMEPAD_AXIS_COUNT; ++i) { if (FindMappingKey(&parts, SDL_GetGamepadStringForAxis((SDL_GamepadAxis)i)) >= 0) { - result = SDL_TRUE; + result = true; break; } } @@ -2681,13 +2681,13 @@ SDL_bool MappingHasBindings(const char *mapping) return result; } -SDL_bool MappingHasName(const char *mapping) +bool MappingHasName(const char *mapping) { MappingParts parts; - SDL_bool result; + bool result; SplitMapping(mapping, &parts); - result = parts.name ? SDL_TRUE : SDL_FALSE; + result = parts.name ? true : false; FreeMappingParts(&parts); return result; } @@ -2836,13 +2836,13 @@ static const char *GetElementKey(int element) } } -SDL_bool MappingHasElement(const char *mapping, int element) +bool MappingHasElement(const char *mapping, int element) { const char *key; key = GetElementKey(element); if (!key) { - return SDL_FALSE; + return false; } return MappingHasKey(mapping, key); } @@ -2895,20 +2895,20 @@ int GetElementForBinding(char *mapping, const char *binding) return result; } -SDL_bool MappingHasBinding(const char *mapping, const char *binding) +bool MappingHasBinding(const char *mapping, const char *binding) { MappingParts parts; int i; - SDL_bool result = SDL_FALSE; + bool result = false; if (!binding) { - return SDL_FALSE; + return false; } SplitMapping(mapping, &parts); for (i = 0; i < parts.num_elements; ++i) { if (SDL_strcmp(binding, parts.values[i]) == 0) { - result = SDL_TRUE; + result = true; break; } } @@ -2921,7 +2921,7 @@ char *ClearMappingBinding(char *mapping, const char *binding) { MappingParts parts; int i; - SDL_bool modified = SDL_FALSE; + bool modified = false; if (!binding) { return mapping; @@ -2931,7 +2931,7 @@ char *ClearMappingBinding(char *mapping, const char *binding) for (i = parts.num_elements - 1; i >= 0; --i) { if (SDL_strcmp(binding, parts.values[i]) == 0) { RemoveMappingValueAt(&parts, i); - modified = SDL_TRUE; + modified = true; } } if (modified) { diff --git a/test/gamepadutils.h b/test/gamepadutils.h index 46de3afa6..5c54ef51a 100644 --- a/test/gamepadutils.h +++ b/test/gamepadutils.h @@ -55,7 +55,7 @@ extern GamepadImage *CreateGamepadImage(SDL_Renderer *renderer); extern void SetGamepadImagePosition(GamepadImage *ctx, float x, float y); extern void GetGamepadImageArea(GamepadImage *ctx, SDL_FRect *area); extern void GetGamepadTouchpadArea(GamepadImage *ctx, SDL_FRect *area); -extern void SetGamepadImageShowingFront(GamepadImage *ctx, SDL_bool showing_front); +extern void SetGamepadImageShowingFront(GamepadImage *ctx, bool showing_front); extern SDL_GamepadType GetGamepadImageType(GamepadImage *ctx); extern void SetGamepadImageDisplayMode(GamepadImage *ctx, ControllerDisplayMode display_mode); extern float GetGamepadImageButtonWidth(GamepadImage *ctx); @@ -65,7 +65,7 @@ extern float GetGamepadImageAxisHeight(GamepadImage *ctx); extern int GetGamepadImageElementAt(GamepadImage *ctx, float x, float y); extern void ClearGamepadImage(GamepadImage *ctx); -extern void SetGamepadImageElement(GamepadImage *ctx, int element, SDL_bool active); +extern void SetGamepadImageElement(GamepadImage *ctx, int element, bool active); extern void UpdateGamepadImageFromGamepad(GamepadImage *ctx, SDL_Gamepad *gamepad); extern void RenderGamepadImage(GamepadImage *ctx); @@ -79,7 +79,7 @@ extern GamepadDisplay *CreateGamepadDisplay(SDL_Renderer *renderer); extern void SetGamepadDisplayDisplayMode(GamepadDisplay *ctx, ControllerDisplayMode display_mode); extern void SetGamepadDisplayArea(GamepadDisplay *ctx, const SDL_FRect *area); extern int GetGamepadDisplayElementAt(GamepadDisplay *ctx, SDL_Gamepad *gamepad, float x, float y); -extern void SetGamepadDisplayHighlight(GamepadDisplay *ctx, int element, SDL_bool pressed); +extern void SetGamepadDisplayHighlight(GamepadDisplay *ctx, int element, bool pressed); extern void SetGamepadDisplaySelected(GamepadDisplay *ctx, int element); extern void RenderGamepadDisplay(GamepadDisplay *ctx, SDL_Gamepad *gamepad); extern void DestroyGamepadDisplay(GamepadDisplay *ctx); @@ -96,7 +96,7 @@ typedef struct GamepadTypeDisplay GamepadTypeDisplay; extern GamepadTypeDisplay *CreateGamepadTypeDisplay(SDL_Renderer *renderer); extern void SetGamepadTypeDisplayArea(GamepadTypeDisplay *ctx, const SDL_FRect *area); extern int GetGamepadTypeDisplayAt(GamepadTypeDisplay *ctx, float x, float y); -extern void SetGamepadTypeDisplayHighlight(GamepadTypeDisplay *ctx, int type, SDL_bool pressed); +extern void SetGamepadTypeDisplayHighlight(GamepadTypeDisplay *ctx, int type, bool pressed); extern void SetGamepadTypeDisplaySelected(GamepadTypeDisplay *ctx, int type); extern void SetGamepadTypeDisplayRealType(GamepadTypeDisplay *ctx, SDL_GamepadType type); extern void RenderGamepadTypeDisplay(GamepadTypeDisplay *ctx); @@ -109,7 +109,7 @@ typedef struct JoystickDisplay JoystickDisplay; extern JoystickDisplay *CreateJoystickDisplay(SDL_Renderer *renderer); extern void SetJoystickDisplayArea(JoystickDisplay *ctx, const SDL_FRect *area); extern char *GetJoystickDisplayElementAt(JoystickDisplay *ctx, SDL_Joystick *joystick, float x, float y); -extern void SetJoystickDisplayHighlight(JoystickDisplay *ctx, const char *element, SDL_bool pressed); +extern void SetJoystickDisplayHighlight(JoystickDisplay *ctx, const char *element, bool pressed); extern void RenderJoystickDisplay(JoystickDisplay *ctx, SDL_Joystick *joystick); extern void DestroyJoystickDisplay(JoystickDisplay *ctx); @@ -120,20 +120,20 @@ typedef struct GamepadButton GamepadButton; extern GamepadButton *CreateGamepadButton(SDL_Renderer *renderer, const char *label); extern void SetGamepadButtonArea(GamepadButton *ctx, const SDL_FRect *area); extern void GetGamepadButtonArea(GamepadButton *ctx, SDL_FRect *area); -extern void SetGamepadButtonHighlight(GamepadButton *ctx, SDL_bool highlight, SDL_bool pressed); +extern void SetGamepadButtonHighlight(GamepadButton *ctx, bool highlight, bool pressed); extern float GetGamepadButtonLabelWidth(GamepadButton *ctx); extern float GetGamepadButtonLabelHeight(GamepadButton *ctx); -extern SDL_bool GamepadButtonContains(GamepadButton *ctx, float x, float y); +extern bool GamepadButtonContains(GamepadButton *ctx, float x, float y); extern void RenderGamepadButton(GamepadButton *ctx); extern void DestroyGamepadButton(GamepadButton *ctx); /* Working with mappings and bindings */ /* Return whether a mapping has any bindings */ -extern SDL_bool MappingHasBindings(const char *mapping); +extern bool MappingHasBindings(const char *mapping); /* Return true if the mapping has a controller name */ -extern SDL_bool MappingHasName(const char *mapping); +extern bool MappingHasName(const char *mapping); /* Return the name from a mapping, which should be freed using SDL_free(), or NULL if there is no name specified */ extern char *GetMappingName(const char *mapping); @@ -151,7 +151,7 @@ extern SDL_GamepadType GetMappingType(const char *mapping); extern char *SetMappingType(char *mapping, SDL_GamepadType type); /* Return true if a mapping has this element bound */ -extern SDL_bool MappingHasElement(const char *mapping, int element); +extern bool MappingHasElement(const char *mapping, int element); /* Get the binding for an element, which should be freed using SDL_free(), or NULL if the element isn't bound */ extern char *GetElementBinding(const char *mapping, int element); @@ -163,7 +163,7 @@ extern char *SetElementBinding(char *mapping, int element, const char *binding); extern int GetElementForBinding(char *mapping, const char *binding); /* Return true if a mapping contains this binding */ -extern SDL_bool MappingHasBinding(const char *mapping, const char *binding); +extern bool MappingHasBinding(const char *mapping, const char *binding); /* Clear any previous binding */ extern char *ClearMappingBinding(char *mapping, const char *binding); diff --git a/test/relative_mode.markdown b/test/relative_mode.markdown index bd99c9f01..0a43b6bce 100644 --- a/test/relative_mode.markdown +++ b/test/relative_mode.markdown @@ -42,7 +42,7 @@ Code SDL_Init(SDL_INIT_VIDEO); win = SDL_CreateWindow("Test", 800, 600, 0); - SDL_SetWindowRelativeMouseMode(win, SDL_TRUE); + SDL_SetWindowRelativeMouseMode(win, true); while (1) { diff --git a/test/testatomic.c b/test/testatomic.c index 570ee82be..bf45317f0 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -20,7 +20,7 @@ */ static const char * -tf(SDL_bool _tf) +tf(bool _tf) { static const char *t = "TRUE"; static const char *f = "FALSE"; @@ -38,7 +38,7 @@ static void RunBasicTest(void) SDL_SpinLock lock = 0; SDL_AtomicInt v; - SDL_bool tfret = SDL_FALSE; + bool tfret = false; SDL_Log("\nspin lock---------------------------------------\n\n"); @@ -62,16 +62,16 @@ static void RunBasicTest(void) SDL_AtomicIncRef(&v); tfret = (SDL_GetAtomicInt(&v) == 2); SDL_Log("AtomicIncRef() tfret=%s val=%d\n", tf(tfret), SDL_GetAtomicInt(&v)); - tfret = (SDL_AtomicDecRef(&v) == SDL_FALSE); + tfret = (SDL_AtomicDecRef(&v) == false); SDL_Log("AtomicDecRef() tfret=%s val=%d\n", tf(tfret), SDL_GetAtomicInt(&v)); - tfret = (SDL_AtomicDecRef(&v) == SDL_TRUE); + tfret = (SDL_AtomicDecRef(&v) == true); SDL_Log("AtomicDecRef() tfret=%s val=%d\n", tf(tfret), SDL_GetAtomicInt(&v)); SDL_SetAtomicInt(&v, 10); - tfret = (SDL_CompareAndSwapAtomicInt(&v, 0, 20) == SDL_FALSE); + tfret = (SDL_CompareAndSwapAtomicInt(&v, 0, 20) == false); SDL_Log("AtomicCAS() tfret=%s val=%d\n", tf(tfret), SDL_GetAtomicInt(&v)); value = SDL_GetAtomicInt(&v); - tfret = (SDL_CompareAndSwapAtomicInt(&v, value, 20) == SDL_TRUE); + tfret = (SDL_CompareAndSwapAtomicInt(&v, value, 20) == true); SDL_Log("AtomicCAS() tfret=%s val=%d\n", tf(tfret), SDL_GetAtomicInt(&v)); } @@ -312,13 +312,13 @@ static void InitEventQueue(SDL_EventQueue *queue) SDL_SetAtomicInt(&queue->active, 1); } -static SDL_bool EnqueueEvent_LockFree(SDL_EventQueue *queue, const SDL_Event *event) +static bool EnqueueEvent_LockFree(SDL_EventQueue *queue, const SDL_Event *event) { SDL_EventQueueEntry *entry; unsigned queue_pos; unsigned entry_seq; int delta; - SDL_bool status; + bool status; #ifdef TEST_SPINLOCK_FIFO /* This is a gate so an external thread can lock the queue */ @@ -340,12 +340,12 @@ static SDL_bool EnqueueEvent_LockFree(SDL_EventQueue *queue, const SDL_Event *ev /* We own the object, fill it! */ entry->event = *event; SDL_SetAtomicInt(&entry->sequence, (int)(queue_pos + 1)); - status = SDL_TRUE; + status = true; break; } } else if (delta < 0) { /* We ran into an old queue entry, which means it still needs to be dequeued */ - status = SDL_FALSE; + status = false; break; } else { /* We ran into a new queue entry, get the new queue position */ @@ -359,13 +359,13 @@ static SDL_bool EnqueueEvent_LockFree(SDL_EventQueue *queue, const SDL_Event *ev return status; } -static SDL_bool DequeueEvent_LockFree(SDL_EventQueue *queue, SDL_Event *event) +static bool DequeueEvent_LockFree(SDL_EventQueue *queue, SDL_Event *event) { SDL_EventQueueEntry *entry; unsigned queue_pos; unsigned entry_seq; int delta; - SDL_bool status; + bool status; #ifdef TEST_SPINLOCK_FIFO /* This is a gate so an external thread can lock the queue */ @@ -387,12 +387,12 @@ static SDL_bool DequeueEvent_LockFree(SDL_EventQueue *queue, SDL_Event *event) /* We own the object, fill it! */ *event = entry->event; SDL_SetAtomicInt(&entry->sequence, (int)(queue_pos + MAX_ENTRIES)); - status = SDL_TRUE; + status = true; break; } } else if (delta < 0) { /* We ran into an old queue entry, which means we've hit empty */ - status = SDL_FALSE; + status = false; break; } else { /* We ran into a new queue entry, get the new queue position */ @@ -406,13 +406,13 @@ static SDL_bool DequeueEvent_LockFree(SDL_EventQueue *queue, SDL_Event *event) return status; } -static SDL_bool EnqueueEvent_Mutex(SDL_EventQueue *queue, const SDL_Event *event) +static bool EnqueueEvent_Mutex(SDL_EventQueue *queue, const SDL_Event *event) { SDL_EventQueueEntry *entry; unsigned queue_pos; unsigned entry_seq; int delta; - SDL_bool status = SDL_FALSE; + bool status = false; SDL_LockMutex(queue->mutex); @@ -427,7 +427,7 @@ static SDL_bool EnqueueEvent_Mutex(SDL_EventQueue *queue, const SDL_Event *event /* We own the object, fill it! */ entry->event = *event; entry->sequence.value = (int)(queue_pos + 1); - status = SDL_TRUE; + status = true; } else if (delta < 0) { /* We ran into an old queue entry, which means it still needs to be dequeued */ } else { @@ -439,13 +439,13 @@ static SDL_bool EnqueueEvent_Mutex(SDL_EventQueue *queue, const SDL_Event *event return status; } -static SDL_bool DequeueEvent_Mutex(SDL_EventQueue *queue, SDL_Event *event) +static bool DequeueEvent_Mutex(SDL_EventQueue *queue, SDL_Event *event) { SDL_EventQueueEntry *entry; unsigned queue_pos; unsigned entry_seq; int delta; - SDL_bool status = SDL_FALSE; + bool status = false; SDL_LockMutex(queue->mutex); @@ -460,7 +460,7 @@ static SDL_bool DequeueEvent_Mutex(SDL_EventQueue *queue, SDL_Event *event) /* We own the object, fill it! */ *event = entry->event; entry->sequence.value = (int)(queue_pos + MAX_ENTRIES); - status = SDL_TRUE; + status = true; } else if (delta < 0) { /* We ran into an old queue entry, which means we've hit empty */ } else { @@ -478,8 +478,8 @@ typedef struct int index; char padding1[SDL_CACHELINE_SIZE - (sizeof(SDL_EventQueue *) + sizeof(int)) % SDL_CACHELINE_SIZE]; int waits; - SDL_bool lock_free; - char padding2[SDL_CACHELINE_SIZE - sizeof(int) - sizeof(SDL_bool)]; + bool lock_free; + char padding2[SDL_CACHELINE_SIZE - sizeof(int) - sizeof(bool)]; SDL_Thread *thread; } WriterData; @@ -488,8 +488,8 @@ typedef struct SDL_EventQueue *queue; int counters[NUM_WRITERS]; int waits; - SDL_bool lock_free; - char padding[SDL_CACHELINE_SIZE - (sizeof(SDL_EventQueue *) + sizeof(int) * NUM_WRITERS + sizeof(int) + sizeof(SDL_bool)) % SDL_CACHELINE_SIZE]; + bool lock_free; + char padding[SDL_CACHELINE_SIZE - (sizeof(SDL_EventQueue *) + sizeof(int) * NUM_WRITERS + sizeof(int) + sizeof(bool)) % SDL_CACHELINE_SIZE]; SDL_Thread *thread; } ReaderData; @@ -585,7 +585,7 @@ static int SDLCALL FIFO_Watcher(void *_data) } #endif /* TEST_SPINLOCK_FIFO */ -static void RunFIFOTest(SDL_bool lock_free) +static void RunFIFOTest(bool lock_free) { SDL_EventQueue queue; SDL_Thread *fifo_thread = NULL; @@ -704,7 +704,7 @@ int main(int argc, char *argv[]) { SDLTest_CommonState *state; int i; - SDL_bool enable_threads = SDL_TRUE; + bool enable_threads = true; /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, 0); @@ -720,7 +720,7 @@ int main(int argc, char *argv[]) if (consumed == 0) { consumed = -1; if (SDL_strcasecmp(argv[i], "--no-threads") == 0) { - enable_threads = SDL_FALSE; + enable_threads = false; consumed = 1; } } @@ -747,9 +747,9 @@ int main(int argc, char *argv[]) } /* This test is really slow, so don't run it by default */ #if 0 - RunFIFOTest(SDL_FALSE); + RunFIFOTest(false); #endif - RunFIFOTest(SDL_TRUE); + RunFIFOTest(true); SDL_Quit(); SDLTest_CommonDestroyState(state); return 0; diff --git a/test/testaudio.c b/test/testaudio.c index e78d4cca5..60089ad59 100644 --- a/test/testaudio.c +++ b/test/testaudio.c @@ -50,17 +50,17 @@ struct Thing union { struct { SDL_AudioDeviceID devid; - SDL_bool recording; + bool recording; SDL_AudioSpec spec; char *name; } physdev; struct { SDL_AudioDeviceID devid; - SDL_bool recording; + bool recording; SDL_AudioSpec spec; Thing *physdev; - SDL_bool visualizer_enabled; - SDL_bool visualizer_updated; + bool visualizer_enabled; + bool visualizer_updated; SDL_Texture *visualizer; SDL_Mutex *postmix_lock; float *postmix_buffer; @@ -121,8 +121,8 @@ static Thing *droppable_highlighted_thing = NULL; static Thing *dragging_thing = NULL; static int dragging_button = -1; static int dragging_button_real = -1; -static SDL_bool ctrl_held = SDL_FALSE; -static SDL_bool alt_held = SDL_FALSE; +static bool ctrl_held = false; +static bool alt_held = false; static Texture *physdev_texture = NULL; static Texture *logdev_texture = NULL; @@ -718,7 +718,7 @@ static Texture *CreateTexture(const char *fname) SDL_Log("Out of memory!"); } else { int texw, texh; - tex->texture = LoadTexture(state->renderers[0], fname, SDL_TRUE, &texw, &texh); + tex->texture = LoadTexture(state->renderers[0], fname, true, &texw, &texh); if (!tex->texture) { SDL_Log("Failed to load '%s': %s", fname, SDL_GetError()); SDL_free(tex); @@ -843,7 +843,7 @@ static void UpdateVisualizer(SDL_Renderer *renderer, SDL_Texture *visualizer, co static void LogicalDeviceThing_ontick(Thing *thing, Uint64 now) { - const SDL_bool ismousedover = (thing == mouseover_thing); + const bool ismousedover = (thing == mouseover_thing); if (!thing->data.logdev.visualizer || !thing->data.logdev.postmix_lock) { /* need these to work, skip if they failed. */ return; @@ -907,7 +907,7 @@ static Thing *CreateLogicalDeviceThing(Thing *parent, const SDL_AudioDeviceID wh { static const ThingType can_be_dropped_onto[] = { THING_TRASHCAN, THING_NULL }; Thing *physthing = ((parent->what == THING_LOGDEV) || (parent->what == THING_LOGDEV_RECORDING)) ? parent->data.logdev.physdev : parent; - const SDL_bool recording = physthing->data.physdev.recording; + const bool recording = physthing->data.physdev.recording; Thing *thing; SDL_Log("Adding logical audio device %u", (unsigned int) which); @@ -975,7 +975,7 @@ static void PhysicalDeviceThing_ontick(Thing *thing, Uint64 now) } -static Thing *CreatePhysicalDeviceThing(const SDL_AudioDeviceID which, const SDL_bool recording) +static Thing *CreatePhysicalDeviceThing(const SDL_AudioDeviceID which, const bool recording) { static const ThingType can_be_dropped_onto[] = { THING_TRASHCAN, THING_NULL }; static float next_physdev_x = 0; @@ -1019,7 +1019,7 @@ static Thing *CreateTrashcanThing(void) return CreateThing(THING_TRASHCAN, winw - trashcan_texture->w, winh - trashcan_texture->h, 10, -1, -1, trashcan_texture, "Drag things here to remove them."); } -static Thing *CreateDefaultPhysicalDevice(const SDL_bool recording) +static Thing *CreateDefaultPhysicalDevice(const bool recording) { return CreatePhysicalDeviceThing(recording ? SDL_AUDIO_DEVICE_DEFAULT_RECORDING : SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, recording); } @@ -1105,20 +1105,20 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[]) LoadStockWavThings(); CreateTrashcanThing(); - CreateDefaultPhysicalDevice(SDL_FALSE); - CreateDefaultPhysicalDevice(SDL_TRUE); + CreateDefaultPhysicalDevice(false); + CreateDefaultPhysicalDevice(true); return SDL_APP_CONTINUE; } -static SDL_bool saw_event = SDL_FALSE; +static bool saw_event = false; SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event) { Thing *thing = NULL; - saw_event = SDL_TRUE; + saw_event = true; switch (event->type) { case SDL_EVENT_MOUSE_MOTION: @@ -1247,7 +1247,7 @@ SDL_AppResult SDL_AppIterate(void *appstate) Draw(); if (saw_event) { - saw_event = SDL_FALSE; /* reset this so we know when SDL_AppEvent() runs again */ + saw_event = false; /* reset this so we know when SDL_AppEvent() runs again */ } else { SDL_Delay(10); } diff --git a/test/testaudiohotplug.c b/test/testaudiohotplug.c index 93aa404f8..7331405fc 100644 --- a/test/testaudiohotplug.c +++ b/test/testaudiohotplug.c @@ -70,7 +70,7 @@ static void iteration(void) } } else if (e.type == SDL_EVENT_AUDIO_DEVICE_ADDED) { const SDL_AudioDeviceID which = (SDL_AudioDeviceID) e.adevice.which; - const SDL_bool recording = e.adevice.recording ? SDL_TRUE : SDL_FALSE; + const bool recording = e.adevice.recording ? true : false; const char *name = SDL_GetAudioDeviceName(which); if (name) { SDL_Log("New %s audio device at id %u: %s", devtypestr(recording), (unsigned int)which, name); diff --git a/test/testaudioinfo.c b/test/testaudioinfo.c index 4628ede22..d2425c67d 100644 --- a/test/testaudioinfo.c +++ b/test/testaudioinfo.c @@ -14,7 +14,7 @@ #include static void -print_devices(SDL_bool recording) +print_devices(bool recording) { SDL_AudioSpec spec; const char *typestr = (recording ? "recording" : "playback"); @@ -88,8 +88,8 @@ int main(int argc, char **argv) SDL_Log("Using audio driver: %s\n\n", SDL_GetCurrentAudioDriver()); - print_devices(SDL_FALSE); - print_devices(SDL_TRUE); + print_devices(false); + print_devices(true); if (SDL_GetAudioDeviceFormat(SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &spec, &frames)) { SDL_Log("Default Playback Device:\n"); diff --git a/test/testaudiostreamdynamicresample.c b/test/testaudiostreamdynamicresample.c index 6420e0439..1e13fe1c9 100644 --- a/test/testaudiostreamdynamicresample.c +++ b/test/testaudiostreamdynamicresample.c @@ -32,8 +32,8 @@ static SDL_AudioStream *stream; static Uint8 *audio_buf = NULL; static Uint32 audio_len = 0; -static SDL_bool auto_loop = SDL_TRUE; -static SDL_bool auto_flush = SDL_FALSE; +static bool auto_loop = true; +static bool auto_flush = false; static Uint64 last_get_callback = 0; static int last_get_amount_additional = 0; @@ -42,7 +42,7 @@ static int last_get_amount_total = 0; typedef struct Slider { SDL_FRect area; - SDL_bool changed; + bool changed; char fmtlabel[64]; float pos; int flags; @@ -64,7 +64,7 @@ static void init_slider(int index, const char* fmtlabel, int flags, float value, slider->area.y = state->window_h * (0.2f + (index * SLIDER_HEIGHT_PERC * 1.4f)); slider->area.w = SLIDER_WIDTH_PERC * state->window_w; slider->area.h = SLIDER_HEIGHT_PERC * state->window_h; - slider->changed = SDL_TRUE; + slider->changed = true; SDL_strlcpy(slider->fmtlabel, fmtlabel, SDL_arraysize(slider->fmtlabel)); slider->flags = flags; slider->min = min; @@ -106,7 +106,7 @@ static void queue_audio(void) { Uint8* new_data = NULL; int new_len = 0; - SDL_bool result = SDL_TRUE; + bool result = true; SDL_AudioSpec new_spec; SDL_zero(new_spec); @@ -259,12 +259,12 @@ static void loop(void) if (value != slider->value) { slider->value = value; - slider->changed = SDL_TRUE; + slider->changed = true; } } if (sliders[0].changed) { - sliders[0].changed = SDL_FALSE; + sliders[0].changed = false; SDL_SetAudioStreamFrequencyRatio(stream, sliders[0].value); } diff --git a/test/testautomation_audio.c b/test/testautomation_audio.c index bda55c651..d99eb0515 100644 --- a/test/testautomation_audio.c +++ b/test/testautomation_audio.c @@ -22,9 +22,9 @@ static void SDLCALL audioSetUp(void **arg) { /* Start SDL audio subsystem */ - SDL_bool ret = SDL_InitSubSystem(SDL_INIT_AUDIO); + bool ret = SDL_InitSubSystem(SDL_INIT_AUDIO); SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_AUDIO)"); - SDLTest_AssertCheck(ret == SDL_TRUE, "Check result from SDL_InitSubSystem(SDL_INIT_AUDIO)"); + SDLTest_AssertCheck(ret == true, "Check result from SDL_InitSubSystem(SDL_INIT_AUDIO)"); if (!ret) { SDLTest_LogError("%s", SDL_GetError()); } @@ -111,7 +111,7 @@ static int SDLCALL audio_initQuitAudio(void *arg) SDL_SetHint(SDL_HINT_AUDIO_DRIVER, audioDriver); result = SDL_InitSubSystem(SDL_INIT_AUDIO); SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_AUDIO) with driver='%s'", audioDriver); - SDLTest_AssertCheck(result == SDL_TRUE, "Validate result value; expected: SDL_TRUE got: %d", result); + SDLTest_AssertCheck(result == true, "Validate result value; expected: true got: %d", result); /* Call Quit */ SDL_QuitSubSystem(SDL_INIT_AUDIO); @@ -125,7 +125,7 @@ static int SDLCALL audio_initQuitAudio(void *arg) SDL_SetHint(SDL_HINT_AUDIO_DRIVER, audioDriver); result = SDL_InitSubSystem(SDL_INIT_AUDIO); SDLTest_AssertPass("Call to SDL_AudioInit(NULL)"); - SDLTest_AssertCheck(result == SDL_TRUE, "Validate result value; expected: SDL_TRUE got: %d", result); + SDLTest_AssertCheck(result == true, "Validate result value; expected: true got: %d", result); /* Call Quit */ SDL_QuitSubSystem(SDL_INIT_AUDIO); @@ -178,7 +178,7 @@ static int SDLCALL audio_initOpenCloseQuitAudio(void *arg) SDL_SetHint(SDL_HINT_AUDIO_DRIVER, audioDriver); result = SDL_InitSubSystem(SDL_INIT_AUDIO); SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_AUDIO) with driver='%s'", audioDriver); - SDLTest_AssertCheck(result == SDL_TRUE, "Validate result value; expected: SDL_TRUE got: %d", result); + SDLTest_AssertCheck(result == true, "Validate result value; expected: true got: %d", result); /* Set spec */ SDL_zero(desired); @@ -269,7 +269,7 @@ static int SDLCALL audio_pauseUnpauseAudio(void *arg) SDL_SetHint(SDL_HINT_AUDIO_DRIVER, audioDriver); result = SDL_InitSubSystem(SDL_INIT_AUDIO); SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_AUDIO) with driver='%s'", audioDriver); - SDLTest_AssertCheck(result == SDL_TRUE, "Validate result value; expected: SDL_TRUE got: %d", result); + SDLTest_AssertCheck(result == true, "Validate result value; expected: true got: %d", result); /* Set spec */ SDL_zero(desired); @@ -1248,7 +1248,7 @@ static int SDLCALL audio_convertAccuracy(void *arg) tmp_data = NULL; tmp_len = 0; ret = SDL_ConvertAudioSamples(&src_spec, (const Uint8*) src_data, src_len, &tmp_spec, &tmp_data, &tmp_len); - SDLTest_AssertCheck(ret == SDL_TRUE, "Expected SDL_ConvertAudioSamples(F32->%s) to succeed", format_name); + SDLTest_AssertCheck(ret == true, "Expected SDL_ConvertAudioSamples(F32->%s) to succeed", format_name); if (!ret) { SDL_free(src_data); return TEST_ABORTED; @@ -1257,7 +1257,7 @@ static int SDLCALL audio_convertAccuracy(void *arg) dst_data = NULL; dst_len = 0; ret = SDL_ConvertAudioSamples(&tmp_spec, tmp_data, tmp_len, &src_spec, &dst_data, &dst_len); - SDLTest_AssertCheck(ret == SDL_TRUE, "Expected SDL_ConvertAudioSamples(%s->F32) to succeed", format_name); + SDLTest_AssertCheck(ret == true, "Expected SDL_ConvertAudioSamples(%s->F32) to succeed", format_name); if (!ret) { SDL_free(tmp_data); SDL_free(src_data); @@ -1366,7 +1366,7 @@ static int SDLCALL audio_formatChange(void *arg) } result = SDL_SetAudioStreamFormat(stream, &spec1, &spec3); - if (!SDLTest_AssertCheck(result == SDL_TRUE, "Expected SDL_SetAudioStreamFormat(spec1, spec3) to succeed")) { + if (!SDLTest_AssertCheck(result == true, "Expected SDL_SetAudioStreamFormat(spec1, spec3) to succeed")) { goto cleanup; } @@ -1376,27 +1376,27 @@ static int SDLCALL audio_formatChange(void *arg) } result = SDL_PutAudioStreamData(stream, buffer_1, length_1); - if (!SDLTest_AssertCheck(result == SDL_TRUE, "Expected SDL_PutAudioStreamData(buffer_1) to succeed")) { + if (!SDLTest_AssertCheck(result == true, "Expected SDL_PutAudioStreamData(buffer_1) to succeed")) { goto cleanup; } result = SDL_FlushAudioStream(stream); - if (!SDLTest_AssertCheck(result == SDL_TRUE, "Expected SDL_FlushAudioStream to succeed")) { + if (!SDLTest_AssertCheck(result == true, "Expected SDL_FlushAudioStream to succeed")) { goto cleanup; } result = SDL_SetAudioStreamFormat(stream, &spec2, &spec3); - if (!SDLTest_AssertCheck(result == SDL_TRUE, "Expected SDL_SetAudioStreamFormat(spec2, spec3) to succeed")) { + if (!SDLTest_AssertCheck(result == true, "Expected SDL_SetAudioStreamFormat(spec2, spec3) to succeed")) { goto cleanup; } result = SDL_PutAudioStreamData(stream, buffer_2, length_2); - if (!SDLTest_AssertCheck(result == SDL_TRUE, "Expected SDL_PutAudioStreamData(buffer_1) to succeed")) { + if (!SDLTest_AssertCheck(result == true, "Expected SDL_PutAudioStreamData(buffer_1) to succeed")) { goto cleanup; } result = SDL_FlushAudioStream(stream); - if (!SDLTest_AssertCheck(result == SDL_TRUE, "Expected SDL_FlushAudioStream to succeed")) { + if (!SDLTest_AssertCheck(result == true, "Expected SDL_FlushAudioStream to succeed")) { goto cleanup; } diff --git a/test/testautomation_clipboard.c b/test/testautomation_clipboard.c index 916ef2682..b986ec9e6 100644 --- a/test/testautomation_clipboard.c +++ b/test/testautomation_clipboard.c @@ -9,12 +9,12 @@ static int clipboard_update_count; -static SDL_bool SDLCALL ClipboardEventWatch(void *userdata, SDL_Event *event) +static bool SDLCALL ClipboardEventWatch(void *userdata, SDL_Event *event) { if (event->type == SDL_EVENT_CLIPBOARD_UPDATE) { ++clipboard_update_count; } - return SDL_TRUE; + return true; } enum @@ -82,7 +82,7 @@ static void SDLCALL ClipboardCleanupCallback(void *userdata) static int SDLCALL clipboard_testClipboardDataFunctions(void *arg) { int result = -1; - SDL_bool boolResult; + bool boolResult; int last_clipboard_update_count; int last_clipboard_callback_count; int last_clipboard_cleanup_count; @@ -105,16 +105,16 @@ static int SDLCALL clipboard_testClipboardDataFunctions(void *arg) /* Test clearing clipboard data */ result = SDL_ClearClipboardData(); SDLTest_AssertCheck( - result == SDL_TRUE, - "Validate SDL_ClearClipboardData result, expected SDL_TRUE, got %i", + result == true, + "Validate SDL_ClearClipboardData result, expected true, got %i", result); /* Test clearing clipboard data when it's already clear */ last_clipboard_update_count = clipboard_update_count; result = SDL_ClearClipboardData(); SDLTest_AssertCheck( - result == SDL_TRUE, - "Validate SDL_ClearClipboardData result, expected SDL_TRUE, got %i", + result == true, + "Validate SDL_ClearClipboardData result, expected true, got %i", result); SDLTest_AssertCheck( clipboard_update_count == last_clipboard_update_count, @@ -125,8 +125,8 @@ static int SDLCALL clipboard_testClipboardDataFunctions(void *arg) last_clipboard_update_count = clipboard_update_count; result = SDL_SetClipboardData(NULL, NULL, NULL, test_mime_types, SDL_arraysize(test_mime_types)); SDLTest_AssertCheck( - result == SDL_FALSE, - "Validate SDL_SetClipboardData(invalid) result, expected SDL_FALSE, got %i", + result == false, + "Validate SDL_SetClipboardData(invalid) result, expected false, got %i", result); SDLTest_AssertCheck( clipboard_update_count == last_clipboard_update_count, @@ -136,8 +136,8 @@ static int SDLCALL clipboard_testClipboardDataFunctions(void *arg) last_clipboard_update_count = clipboard_update_count; result = SDL_SetClipboardData(ClipboardDataCallback, ClipboardCleanupCallback, NULL, NULL, 0); SDLTest_AssertCheck( - result == SDL_FALSE, - "Validate SDL_SetClipboardData(invalid) result, expected SDL_FALSE, got %i", + result == false, + "Validate SDL_SetClipboardData(invalid) result, expected false, got %i", result); SDLTest_AssertCheck( clipboard_update_count == last_clipboard_update_count, @@ -150,8 +150,8 @@ static int SDLCALL clipboard_testClipboardDataFunctions(void *arg) last_clipboard_cleanup_count = clipboard_cleanup_count; result = SDL_SetClipboardData(ClipboardDataCallback, ClipboardCleanupCallback, &test_data1, test_mime_types, SDL_arraysize(test_mime_types)); SDLTest_AssertCheck( - result == SDL_TRUE, - "Validate SDL_SetClipboardData(test_data1) result, expected SDL_TRUE, got %i", + result == true, + "Validate SDL_SetClipboardData(test_data1) result, expected true, got %i", result); SDLTest_AssertCheck( clipboard_update_count == last_clipboard_update_count + 1, @@ -173,7 +173,7 @@ static int SDLCALL clipboard_testClipboardDataFunctions(void *arg) boolResult = SDL_HasClipboardData(test_mime_types[TEST_MIME_TYPE_TEXT]); SDLTest_AssertCheck( boolResult, - "Verify has test text data, expected SDL_TRUE, got SDL_FALSE"); + "Verify has test text data, expected true, got false"); text = SDL_GetClipboardData(test_mime_types[TEST_MIME_TYPE_TEXT], &size); SDLTest_AssertCheck( text != NULL, @@ -198,7 +198,7 @@ static int SDLCALL clipboard_testClipboardDataFunctions(void *arg) boolResult = SDL_HasClipboardData(test_mime_types[TEST_MIME_TYPE_CUSTOM_TEXT]); SDLTest_AssertCheck( boolResult, - "Verify has test text data, expected SDL_TRUE, got SDL_FALSE"); + "Verify has test text data, expected true, got false"); text = SDL_GetClipboardData(test_mime_types[TEST_MIME_TYPE_CUSTOM_TEXT], &size); SDLTest_AssertCheck( text != NULL, @@ -222,7 +222,7 @@ static int SDLCALL clipboard_testClipboardDataFunctions(void *arg) boolResult = SDL_HasClipboardData(test_mime_types[TEST_MIME_TYPE_DATA]); SDLTest_AssertCheck( boolResult, - "Verify has test text data, expected SDL_TRUE, got SDL_FALSE"); + "Verify has test text data, expected true, got false"); data = SDL_GetClipboardData(test_mime_types[TEST_MIME_TYPE_DATA], &size); SDLTest_AssertCheck( data && SDL_memcmp(data, test_data1.data, test_data1.data_size) == 0, @@ -236,7 +236,7 @@ static int SDLCALL clipboard_testClipboardDataFunctions(void *arg) boolResult = SDL_HasClipboardData("test/invalid"); SDLTest_AssertCheck( !boolResult, - "Verify has test text data, expected SDL_FALSE, got SDL_TRUE"); + "Verify has test text data, expected false, got true"); data = SDL_GetClipboardData("test/invalid", &size); SDLTest_AssertCheck( data == NULL, @@ -262,8 +262,8 @@ static int SDLCALL clipboard_testClipboardDataFunctions(void *arg) last_clipboard_cleanup_count = clipboard_cleanup_count; result = SDL_SetClipboardData(ClipboardDataCallback, ClipboardCleanupCallback, &test_data2, test_mime_types, SDL_arraysize(test_mime_types)); SDLTest_AssertCheck( - result == SDL_TRUE, - "Validate SDL_SetClipboardData(test_data2) result, expected SDL_TRUE, got %i", + result == true, + "Validate SDL_SetClipboardData(test_data2) result, expected true, got %i", result); SDLTest_AssertCheck( clipboard_update_count == last_clipboard_update_count + 1, @@ -285,7 +285,7 @@ static int SDLCALL clipboard_testClipboardDataFunctions(void *arg) boolResult = SDL_HasClipboardData(test_mime_types[TEST_MIME_TYPE_TEXT]); SDLTest_AssertCheck( boolResult, - "Verify has test text data, expected SDL_TRUE, got SDL_FALSE"); + "Verify has test text data, expected true, got false"); text = SDL_GetClipboardData(test_mime_types[TEST_MIME_TYPE_TEXT], &size); SDLTest_AssertCheck( text != NULL, @@ -310,7 +310,7 @@ static int SDLCALL clipboard_testClipboardDataFunctions(void *arg) boolResult = SDL_HasClipboardData(test_mime_types[TEST_MIME_TYPE_CUSTOM_TEXT]); SDLTest_AssertCheck( boolResult, - "Verify has test text data, expected SDL_TRUE, got SDL_FALSE"); + "Verify has test text data, expected true, got false"); text = SDL_GetClipboardData(test_mime_types[TEST_MIME_TYPE_CUSTOM_TEXT], &size); SDLTest_AssertCheck( text != NULL, @@ -365,8 +365,8 @@ static int SDLCALL clipboard_testClipboardDataFunctions(void *arg) last_clipboard_cleanup_count = clipboard_cleanup_count; result = SDL_ClearClipboardData(); SDLTest_AssertCheck( - result == SDL_TRUE, - "Validate SDL_ClearClipboardData result, expected SDL_TRUE, got %i", + result == true, + "Validate SDL_ClearClipboardData result, expected true, got %i", result); SDLTest_AssertCheck( clipboard_update_count == last_clipboard_update_count + 1, @@ -379,15 +379,15 @@ static int SDLCALL clipboard_testClipboardDataFunctions(void *arg) boolResult = SDL_HasClipboardData(test_mime_types[TEST_MIME_TYPE_TEXT]); SDLTest_AssertCheck( !boolResult, - "Verify has test text data, expected SDL_FALSE, got SDL_TRUE"); + "Verify has test text data, expected false, got true"); boolResult = SDL_HasClipboardData(test_mime_types[TEST_MIME_TYPE_DATA]); SDLTest_AssertCheck( !boolResult, - "Verify has test text data, expected SDL_FALSE, got SDL_TRUE"); + "Verify has test text data, expected false, got true"); boolResult = SDL_HasClipboardData("test/invalid"); SDLTest_AssertCheck( !boolResult, - "Verify has test text data, expected SDL_FALSE, got SDL_TRUE"); + "Verify has test text data, expected false, got true"); SDL_RemoveEventWatch(ClipboardEventWatch, NULL); @@ -404,7 +404,7 @@ static int SDLCALL clipboard_testClipboardTextFunctions(void *arg) { char *textRef = SDLTest_RandomAsciiString(); char *text = SDL_strdup(textRef); - SDL_bool boolResult; + bool boolResult; int intResult; char *charResult; int last_clipboard_update_count; @@ -415,8 +415,8 @@ static int SDLCALL clipboard_testClipboardTextFunctions(void *arg) last_clipboard_update_count = clipboard_update_count; intResult = SDL_SetClipboardText(NULL); SDLTest_AssertCheck( - intResult == SDL_TRUE, - "Verify result from SDL_SetClipboardText(NULL), expected SDL_TRUE, got %i", + intResult == true, + "Verify result from SDL_SetClipboardText(NULL), expected true, got %i", intResult); charResult = SDL_GetClipboardText(); SDLTest_AssertCheck( @@ -426,9 +426,9 @@ static int SDLCALL clipboard_testClipboardTextFunctions(void *arg) SDL_free(charResult); boolResult = SDL_HasClipboardText(); SDLTest_AssertCheck( - boolResult == SDL_FALSE, - "Verify SDL_HasClipboardText returned SDL_FALSE, got %s", - (boolResult) ? "SDL_TRUE" : "SDL_FALSE"); + boolResult == false, + "Verify SDL_HasClipboardText returned false, got %s", + (boolResult) ? "true" : "false"); SDLTest_AssertCheck( clipboard_update_count == last_clipboard_update_count, "Verify clipboard update unchanged, got %d", @@ -439,8 +439,8 @@ static int SDLCALL clipboard_testClipboardTextFunctions(void *arg) last_clipboard_update_count = clipboard_update_count; intResult = SDL_SetClipboardText(text); SDLTest_AssertCheck( - intResult == SDL_TRUE, - "Verify result from SDL_SetClipboardText(%s), expected SDL_TRUE, got %i", text, + intResult == true, + "Verify result from SDL_SetClipboardText(%s), expected true, got %i", text, intResult); SDLTest_AssertCheck( SDL_strcmp(textRef, text) == 0, @@ -448,9 +448,9 @@ static int SDLCALL clipboard_testClipboardTextFunctions(void *arg) textRef, text); boolResult = SDL_HasClipboardText(); SDLTest_AssertCheck( - boolResult == SDL_TRUE, - "Verify SDL_HasClipboardText returned SDL_TRUE, got %s", - (boolResult) ? "SDL_TRUE" : "SDL_FALSE"); + boolResult == true, + "Verify SDL_HasClipboardText returned true, got %s", + (boolResult) ? "true" : "false"); charResult = SDL_GetClipboardText(); SDLTest_AssertCheck( charResult && SDL_strcmp(textRef, charResult) == 0, @@ -465,8 +465,8 @@ static int SDLCALL clipboard_testClipboardTextFunctions(void *arg) /* Reset clipboard text */ intResult = SDL_SetClipboardText(NULL); SDLTest_AssertCheck( - intResult == SDL_TRUE, - "Verify result from SDL_SetClipboardText(NULL), expected SDL_TRUE, got %i", + intResult == true, + "Verify result from SDL_SetClipboardText(NULL), expected true, got %i", intResult); /* Cleanup */ @@ -488,7 +488,7 @@ static int SDLCALL clipboard_testPrimarySelectionTextFunctions(void *arg) { char *textRef = SDLTest_RandomAsciiString(); char *text = SDL_strdup(textRef); - SDL_bool boolResult; + bool boolResult; int intResult; char *charResult; int last_clipboard_update_count; @@ -499,8 +499,8 @@ static int SDLCALL clipboard_testPrimarySelectionTextFunctions(void *arg) last_clipboard_update_count = clipboard_update_count; intResult = SDL_SetPrimarySelectionText(NULL); SDLTest_AssertCheck( - intResult == SDL_TRUE, - "Verify result from SDL_SetPrimarySelectionText(NULL), expected SDL_TRUE, got %i", + intResult == true, + "Verify result from SDL_SetPrimarySelectionText(NULL), expected true, got %i", intResult); charResult = SDL_GetPrimarySelectionText(); SDLTest_AssertCheck( @@ -510,9 +510,9 @@ static int SDLCALL clipboard_testPrimarySelectionTextFunctions(void *arg) SDL_free(charResult); boolResult = SDL_HasPrimarySelectionText(); SDLTest_AssertCheck( - boolResult == SDL_FALSE, - "Verify SDL_HasPrimarySelectionText returned SDL_FALSE, got %s", - (boolResult) ? "SDL_TRUE" : "SDL_FALSE"); + boolResult == false, + "Verify SDL_HasPrimarySelectionText returned false, got %s", + (boolResult) ? "true" : "false"); SDLTest_AssertCheck( clipboard_update_count == last_clipboard_update_count + 1, "Verify clipboard update count incremented by 1, got %d", @@ -522,8 +522,8 @@ static int SDLCALL clipboard_testPrimarySelectionTextFunctions(void *arg) last_clipboard_update_count = clipboard_update_count; intResult = SDL_SetPrimarySelectionText(text); SDLTest_AssertCheck( - intResult == SDL_TRUE, - "Verify result from SDL_SetPrimarySelectionText(%s), expected SDL_TRUE, got %i", text, + intResult == true, + "Verify result from SDL_SetPrimarySelectionText(%s), expected true, got %i", text, intResult); SDLTest_AssertCheck( SDL_strcmp(textRef, text) == 0, @@ -531,9 +531,9 @@ static int SDLCALL clipboard_testPrimarySelectionTextFunctions(void *arg) textRef, text); boolResult = SDL_HasPrimarySelectionText(); SDLTest_AssertCheck( - boolResult == SDL_TRUE, - "Verify SDL_HasPrimarySelectionText returned SDL_TRUE, got %s", - (boolResult) ? "SDL_TRUE" : "SDL_FALSE"); + boolResult == true, + "Verify SDL_HasPrimarySelectionText returned true, got %s", + (boolResult) ? "true" : "false"); charResult = SDL_GetPrimarySelectionText(); SDLTest_AssertCheck( charResult && SDL_strcmp(textRef, charResult) == 0, @@ -548,8 +548,8 @@ static int SDLCALL clipboard_testPrimarySelectionTextFunctions(void *arg) /* Reset primary selection */ intResult = SDL_SetPrimarySelectionText(NULL); SDLTest_AssertCheck( - intResult == SDL_TRUE, - "Verify result from SDL_SetPrimarySelectionText(NULL), expected SDL_TRUE, got %i", + intResult == true, + "Verify result from SDL_SetPrimarySelectionText(NULL), expected true, got %i", intResult); /* Cleanup */ diff --git a/test/testautomation_events.c b/test/testautomation_events.c index a8567c7a2..ae47df090 100644 --- a/test/testautomation_events.c +++ b/test/testautomation_events.c @@ -25,7 +25,7 @@ static int g_userdataValue2 = 2; #define MAX_ITERATIONS 100 /* Event filter that sets some flags and optionally checks userdata */ -static SDL_bool SDLCALL events_sampleNullEventFilter(void *userdata, SDL_Event *event) +static bool SDLCALL events_sampleNullEventFilter(void *userdata, SDL_Event *event) { g_eventFilterCalled = 1; @@ -36,7 +36,7 @@ static SDL_bool SDLCALL events_sampleNullEventFilter(void *userdata, SDL_Event * } } - return SDL_TRUE; + return true; } /** diff --git a/test/testautomation_hints.c b/test/testautomation_hints.c index 41ed3ce9c..e5b682fd4 100644 --- a/test/testautomation_hints.c +++ b/test/testautomation_hints.c @@ -86,7 +86,7 @@ static int SDLCALL hints_setHint(void *arg) char *value; const char *testValue; char *callbackValue; - SDL_bool result; + bool result; int i, j; /* Create random values to set */ @@ -105,7 +105,7 @@ static int SDLCALL hints_setHint(void *arg) result = SDL_SetHint(HintsEnum[i], value); SDLTest_AssertPass("Call to SDL_SetHint(%s, %s) (iteration %i)", HintsEnum[i], value, j); SDLTest_AssertCheck( - result == SDL_TRUE || result == SDL_FALSE, + result == true || result == false, "Verify valid result was returned, got: %i", (int)result); testValue = SDL_GetHint(HintsEnum[i]); @@ -121,7 +121,7 @@ static int SDLCALL hints_setHint(void *arg) result = SDL_SetHint(HintsEnum[i], originalValue); SDLTest_AssertPass("Call to SDL_SetHint(%s, originalValue)", HintsEnum[i]); SDLTest_AssertCheck( - result == SDL_TRUE || result == SDL_FALSE, + result == true || result == false, "Verify valid result was returned, got: %i", (int)result); SDL_free((void *)originalValue); diff --git a/test/testautomation_intrinsics.c b/test/testautomation_intrinsics.c index f1a84abf5..9aba459c4 100644 --- a/test/testautomation_intrinsics.c +++ b/test/testautomation_intrinsics.c @@ -28,7 +28,7 @@ static int allocate_random_int_arrays(Sint32 **dest, Sint32 **a, Sint32 **b, siz *b = SDL_malloc(sizeof(Sint32) * *size); if (!*dest || !*a || !*b) { - SDLTest_AssertCheck(SDL_FALSE, "SDL_malloc failed"); + SDLTest_AssertCheck(false, "SDL_malloc failed"); return -1; } @@ -48,7 +48,7 @@ static int allocate_random_float_arrays(float **dest, float **a, float **b, size *b = SDL_malloc(sizeof(float) * *size); if (!*dest || !*a || !*b) { - SDLTest_AssertCheck(SDL_FALSE, "SDL_malloc failed"); + SDLTest_AssertCheck(false, "SDL_malloc failed"); return -1; } @@ -69,7 +69,7 @@ static int allocate_random_double_arrays(double **dest, double **a, double **b, *b = SDL_malloc(sizeof(double) * *size); if (!*dest || !*a || !*b) { - SDLTest_AssertCheck(SDL_FALSE, "SDL_malloc failed"); + SDLTest_AssertCheck(false, "SDL_malloc failed"); return -1; } @@ -97,13 +97,13 @@ static void verify_ints_addition(const Sint32 *dest, const Sint32 *a, const Sint for (i = 0; i < size; ++i) { Sint32 expected = a[i] + b[i]; if (dest[i] != expected) { - SDLTest_AssertCheck(SDL_FALSE, "%" SDL_PRIs32 " + %" SDL_PRIs32 " = %" SDL_PRIs32 ", expected %" SDL_PRIs32 " ([%" SDL_PRIu32 "/%" SDL_PRIu32 "] %s)", + SDLTest_AssertCheck(false, "%" SDL_PRIs32 " + %" SDL_PRIs32 " = %" SDL_PRIs32 ", expected %" SDL_PRIs32 " ([%" SDL_PRIu32 "/%" SDL_PRIu32 "] %s)", a[i], b[i], dest[i], expected, (Uint32)i, (Uint32)size, desc); all_good = 0; } } if (all_good) { - SDLTest_AssertCheck(SDL_TRUE, "All int additions were correct (%s)", desc); + SDLTest_AssertCheck(true, "All int additions were correct (%s)", desc); } } @@ -117,13 +117,13 @@ static void verify_ints_multiplication(const Sint32 *dest, const Sint32 *a, cons for (i = 0; i < size; ++i) { Sint32 expected = a[i] * b[i]; if (dest[i] != expected) { - SDLTest_AssertCheck(SDL_FALSE, "%" SDL_PRIs32 " * %" SDL_PRIs32 " = %" SDL_PRIs32 ", expected %" SDL_PRIs32 " ([%" SDL_PRIu32 "/%" SDL_PRIu32 "] %s)", + SDLTest_AssertCheck(false, "%" SDL_PRIs32 " * %" SDL_PRIs32 " = %" SDL_PRIs32 ", expected %" SDL_PRIs32 " ([%" SDL_PRIu32 "/%" SDL_PRIu32 "] %s)", a[i], b[i], dest[i], expected, (Uint32)i, (Uint32)size, desc); all_good = 0; } } if (all_good) { - SDLTest_AssertCheck(SDL_TRUE, "All int multiplication were correct (%s)", desc); + SDLTest_AssertCheck(true, "All int multiplication were correct (%s)", desc); } } @@ -138,13 +138,13 @@ static void verify_floats_addition(const float *dest, const float *a, const floa float expected = a[i] + b[i]; float abs_error = SDL_fabsf(dest[i] - expected); if (abs_error > 1.0e-5f) { - SDLTest_AssertCheck(SDL_FALSE, "%g + %g = %g, expected %g (error = %g) ([%" SDL_PRIu32 "/%" SDL_PRIu32 "] %s)", + SDLTest_AssertCheck(false, "%g + %g = %g, expected %g (error = %g) ([%" SDL_PRIu32 "/%" SDL_PRIu32 "] %s)", a[i], b[i], dest[i], expected, abs_error, (Uint32) i, (Uint32) size, desc); all_good = 0; } } if (all_good) { - SDLTest_AssertCheck(SDL_TRUE, "All float additions were correct (%s)", desc); + SDLTest_AssertCheck(true, "All float additions were correct (%s)", desc); } } @@ -161,11 +161,11 @@ static void verify_doubles_addition(const double *dest, const double *a, const d if (abs_error > 1.0e-5) { SDLTest_AssertCheck(abs_error < 1.0e-5f, "%g + %g = %g, expected %g (error = %g) ([%" SDL_PRIu32 "/%" SDL_PRIu32 "] %s)", a[i], b[i], dest[i], expected, abs_error, (Uint32) i, (Uint32) size, desc); - all_good = SDL_FALSE; + all_good = false; } } if (all_good) { - SDLTest_AssertCheck(SDL_TRUE, "All double additions were correct (%s)", desc); + SDLTest_AssertCheck(true, "All double additions were correct (%s)", desc); } } @@ -365,13 +365,13 @@ static int SDLCALL intrinsics_selftest(void *arg) static int SDLCALL intrinsics_testMMX(void *arg) { if (SDL_HasMMX()) { - SDLTest_AssertCheck(SDL_TRUE, "CPU of test machine has MMX support."); + SDLTest_AssertCheck(true, "CPU of test machine has MMX support."); #ifdef SDL_MMX_INTRINSICS { size_t size; Sint32 *dest, *a, *b; - SDLTest_AssertCheck(SDL_TRUE, "Test executable uses MMX intrinsics."); + SDLTest_AssertCheck(true, "Test executable uses MMX intrinsics."); if (allocate_random_int_arrays(&dest, &a, &b, &size) < 0) { return TEST_ABORTED; } @@ -382,10 +382,10 @@ static int SDLCALL intrinsics_testMMX(void *arg) return TEST_COMPLETED; } #else - SDLTest_AssertCheck(SDL_TRUE, "Test executable does NOT use MMX intrinsics."); + SDLTest_AssertCheck(true, "Test executable does NOT use MMX intrinsics."); #endif } else { - SDLTest_AssertCheck(SDL_TRUE, "CPU of test machine has NO MMX support."); + SDLTest_AssertCheck(true, "CPU of test machine has NO MMX support."); } return TEST_SKIPPED; } @@ -393,13 +393,13 @@ static int SDLCALL intrinsics_testMMX(void *arg) static int SDLCALL intrinsics_testSSE(void *arg) { if (SDL_HasSSE()) { - SDLTest_AssertCheck(SDL_TRUE, "CPU of test machine has SSE support."); + SDLTest_AssertCheck(true, "CPU of test machine has SSE support."); #ifdef SDL_SSE_INTRINSICS { size_t size; float *dest, *a, *b; - SDLTest_AssertCheck(SDL_TRUE, "Test executable uses SSE intrinsics."); + SDLTest_AssertCheck(true, "Test executable uses SSE intrinsics."); if (allocate_random_float_arrays(&dest, &a, &b, &size) < 0) { return TEST_ABORTED; } @@ -410,10 +410,10 @@ static int SDLCALL intrinsics_testSSE(void *arg) return TEST_COMPLETED; } #else - SDLTest_AssertCheck(SDL_TRUE, "Test executable does NOT use SSE intrinsics."); + SDLTest_AssertCheck(true, "Test executable does NOT use SSE intrinsics."); #endif } else { - SDLTest_AssertCheck(SDL_TRUE, "CPU of test machine has NO SSE support."); + SDLTest_AssertCheck(true, "CPU of test machine has NO SSE support."); } return TEST_SKIPPED; } @@ -421,13 +421,13 @@ static int SDLCALL intrinsics_testSSE(void *arg) static int SDLCALL intrinsics_testSSE2(void *arg) { if (SDL_HasSSE2()) { - SDLTest_AssertCheck(SDL_TRUE, "CPU of test machine has SSE2 support."); + SDLTest_AssertCheck(true, "CPU of test machine has SSE2 support."); #ifdef SDL_SSE2_INTRINSICS { size_t size; double *dest, *a, *b; - SDLTest_AssertCheck(SDL_TRUE, "Test executable uses SSE2 intrinsics."); + SDLTest_AssertCheck(true, "Test executable uses SSE2 intrinsics."); if (allocate_random_double_arrays(&dest, &a, &b, &size) < 0) { return TEST_ABORTED; } @@ -438,10 +438,10 @@ static int SDLCALL intrinsics_testSSE2(void *arg) return TEST_COMPLETED; } #else - SDLTest_AssertCheck(SDL_TRUE, "Test executable does NOT use SSE2 intrinsics."); + SDLTest_AssertCheck(true, "Test executable does NOT use SSE2 intrinsics."); #endif } else { - SDLTest_AssertCheck(SDL_TRUE, "CPU of test machine has NO SSE2 support."); + SDLTest_AssertCheck(true, "CPU of test machine has NO SSE2 support."); } return TEST_SKIPPED; } @@ -449,13 +449,13 @@ static int SDLCALL intrinsics_testSSE2(void *arg) static int SDLCALL intrinsics_testSSE3(void *arg) { if (SDL_HasSSE3()) { - SDLTest_AssertCheck(SDL_TRUE, "CPU of test machine has SSE3 support."); + SDLTest_AssertCheck(true, "CPU of test machine has SSE3 support."); #ifdef SDL_SSE3_INTRINSICS { size_t size; Sint32 *dest, *a, *b; - SDLTest_AssertCheck(SDL_TRUE, "Test executable uses SSE3 intrinsics."); + SDLTest_AssertCheck(true, "Test executable uses SSE3 intrinsics."); if (allocate_random_int_arrays(&dest, &a, &b, &size) < 0) { return TEST_ABORTED; } @@ -466,10 +466,10 @@ static int SDLCALL intrinsics_testSSE3(void *arg) return TEST_COMPLETED; } #else - SDLTest_AssertCheck(SDL_TRUE, "Test executable does NOT use SSE3 intrinsics."); + SDLTest_AssertCheck(true, "Test executable does NOT use SSE3 intrinsics."); #endif } else { - SDLTest_AssertCheck(SDL_TRUE, "CPU of test machine has NO SSE3 support."); + SDLTest_AssertCheck(true, "CPU of test machine has NO SSE3 support."); } return TEST_SKIPPED; } @@ -477,13 +477,13 @@ static int SDLCALL intrinsics_testSSE3(void *arg) static int SDLCALL intrinsics_testSSE4_1(void *arg) { if (SDL_HasSSE41()) { - SDLTest_AssertCheck(SDL_TRUE, "CPU of test machine has SSE4.1 support."); + SDLTest_AssertCheck(true, "CPU of test machine has SSE4.1 support."); #ifdef SDL_SSE4_1_INTRINSICS { size_t size; Sint32 *dest, *a, *b; - SDLTest_AssertCheck(SDL_TRUE, "Test executable uses SSE4.1 intrinsics."); + SDLTest_AssertCheck(true, "Test executable uses SSE4.1 intrinsics."); if (allocate_random_int_arrays(&dest, &a, &b, &size) < 0) { return TEST_ABORTED; } @@ -494,10 +494,10 @@ static int SDLCALL intrinsics_testSSE4_1(void *arg) return TEST_COMPLETED; } #else - SDLTest_AssertCheck(SDL_TRUE, "Test executable does NOT use SSE4.1 intrinsics."); + SDLTest_AssertCheck(true, "Test executable does NOT use SSE4.1 intrinsics."); #endif } else { - SDLTest_AssertCheck(SDL_TRUE, "CPU of test machine has NO SSE4.1 support."); + SDLTest_AssertCheck(true, "CPU of test machine has NO SSE4.1 support."); } return TEST_SKIPPED; } @@ -505,7 +505,7 @@ static int SDLCALL intrinsics_testSSE4_1(void *arg) static int SDLCALL intrinsics_testSSE4_2(void *arg) { if (SDL_HasSSE42()) { - SDLTest_AssertCheck(SDL_TRUE, "CPU of test machine has SSE4.2 support."); + SDLTest_AssertCheck(true, "CPU of test machine has SSE4.2 support."); #ifdef SDL_SSE4_2_INTRINSICS { struct { @@ -518,7 +518,7 @@ static int SDLCALL intrinsics_testSSE4_2(void *arg) }; size_t i; - SDLTest_AssertCheck(SDL_TRUE, "Test executable uses SSE4.2 intrinsics."); + SDLTest_AssertCheck(true, "Test executable uses SSE4.2 intrinsics."); for (i = 0; i < SDL_arraysize(references); ++i) { Uint32 actual = calculate_crc32c_sse4_2(references[i].input); @@ -529,10 +529,10 @@ static int SDLCALL intrinsics_testSSE4_2(void *arg) return TEST_COMPLETED; } #else - SDLTest_AssertCheck(SDL_TRUE, "Test executable does NOT use SSE4.2 intrinsics."); + SDLTest_AssertCheck(true, "Test executable does NOT use SSE4.2 intrinsics."); #endif } else { - SDLTest_AssertCheck(SDL_TRUE, "CPU of test machine has NO SSE4.2 support."); + SDLTest_AssertCheck(true, "CPU of test machine has NO SSE4.2 support."); } return TEST_SKIPPED; } @@ -540,13 +540,13 @@ static int SDLCALL intrinsics_testSSE4_2(void *arg) static int SDLCALL intrinsics_testAVX(void *arg) { if (SDL_HasAVX()) { - SDLTest_AssertCheck(SDL_TRUE, "CPU of test machine has AVX support."); + SDLTest_AssertCheck(true, "CPU of test machine has AVX support."); #ifdef SDL_AVX_INTRINSICS { size_t size; float *dest, *a, *b; - SDLTest_AssertCheck(SDL_TRUE, "Test executable uses AVX intrinsics."); + SDLTest_AssertCheck(true, "Test executable uses AVX intrinsics."); if (allocate_random_float_arrays(&dest, &a, &b, &size) < 0) { return TEST_ABORTED; } @@ -557,10 +557,10 @@ static int SDLCALL intrinsics_testAVX(void *arg) return TEST_COMPLETED; } #else - SDLTest_AssertCheck(SDL_TRUE, "Test executable does NOT use AVX intrinsics."); + SDLTest_AssertCheck(true, "Test executable does NOT use AVX intrinsics."); #endif } else { - SDLTest_AssertCheck(SDL_TRUE, "CPU of test machine has NO AVX support."); + SDLTest_AssertCheck(true, "CPU of test machine has NO AVX support."); } return TEST_SKIPPED; } @@ -568,13 +568,13 @@ static int SDLCALL intrinsics_testAVX(void *arg) static int SDLCALL intrinsics_testAVX2(void *arg) { if (SDL_HasAVX2()) { - SDLTest_AssertCheck(SDL_TRUE, "CPU of test machine has AVX2 support."); + SDLTest_AssertCheck(true, "CPU of test machine has AVX2 support."); #ifdef SDL_AVX2_INTRINSICS { size_t size; Sint32 *dest, *a, *b; - SDLTest_AssertCheck(SDL_TRUE, "Test executable uses AVX2 intrinsics."); + SDLTest_AssertCheck(true, "Test executable uses AVX2 intrinsics."); if (allocate_random_int_arrays(&dest, &a, &b, &size) < 0) { return TEST_ABORTED; } @@ -585,10 +585,10 @@ static int SDLCALL intrinsics_testAVX2(void *arg) return TEST_COMPLETED; } #else - SDLTest_AssertCheck(SDL_TRUE, "Test executable does NOT use AVX2 intrinsics."); + SDLTest_AssertCheck(true, "Test executable does NOT use AVX2 intrinsics."); #endif } else { - SDLTest_AssertCheck(SDL_TRUE, "CPU of test machine has NO AVX2 support."); + SDLTest_AssertCheck(true, "CPU of test machine has NO AVX2 support."); } return TEST_SKIPPED; } @@ -596,13 +596,13 @@ static int SDLCALL intrinsics_testAVX2(void *arg) static int SDLCALL intrinsics_testAVX512F(void *arg) { if (SDL_HasAVX512F()) { - SDLTest_AssertCheck(SDL_TRUE, "CPU of test machine has AVX512F support."); + SDLTest_AssertCheck(true, "CPU of test machine has AVX512F support."); #ifdef SDL_AVX512F_INTRINSICS { size_t size; float *dest, *a, *b; - SDLTest_AssertCheck(SDL_TRUE, "Test executable uses AVX512F intrinsics."); + SDLTest_AssertCheck(true, "Test executable uses AVX512F intrinsics."); if (allocate_random_float_arrays(&dest, &a, &b, &size) < 0) { return TEST_ABORTED; } @@ -613,10 +613,10 @@ static int SDLCALL intrinsics_testAVX512F(void *arg) return TEST_COMPLETED; } #else - SDLTest_AssertCheck(SDL_TRUE, "Test executable does NOT use AVX512F intrinsics."); + SDLTest_AssertCheck(true, "Test executable does NOT use AVX512F intrinsics."); #endif } else { - SDLTest_AssertCheck(SDL_TRUE, "CPU of test machine has NO AVX512F support."); + SDLTest_AssertCheck(true, "CPU of test machine has NO AVX512F support."); } return TEST_SKIPPED; diff --git a/test/testautomation_iostream.c b/test/testautomation_iostream.c index 37525dbed..d1e587711 100644 --- a/test/testautomation_iostream.c +++ b/test/testautomation_iostream.c @@ -95,7 +95,7 @@ static void SDLCALL IOStreamTearDown(void *arg) * \sa SDL_SeekIO * \sa SDL_ReadIO */ -static void testGenericIOStreamValidations(SDL_IOStream *rw, SDL_bool write) +static void testGenericIOStreamValidations(SDL_IOStream *rw, bool write) { char buf[sizeof(IOStreamHelloWorldTestString)]; Sint64 i; @@ -270,12 +270,12 @@ static int SDLCALL iostrm_testMem(void *arg) } /* Run generic tests */ - testGenericIOStreamValidations(rw, SDL_TRUE); + testGenericIOStreamValidations(rw, true); /* Close */ result = SDL_CloseIO(rw); SDLTest_AssertPass("Call to SDL_CloseIO() succeeded"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify result value is SDL_TRUE; got: %d", result); + SDLTest_AssertCheck(result == true, "Verify result value is true; got: %d", result); return TEST_COMPLETED; } @@ -302,12 +302,12 @@ static int SDLCALL iostrm_testConstMem(void *arg) } /* Run generic tests */ - testGenericIOStreamValidations(rw, SDL_FALSE); + testGenericIOStreamValidations(rw, false); /* Close handle */ result = SDL_CloseIO(rw); SDLTest_AssertPass("Call to SDL_CloseIO() succeeded"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify result value is SDL_TRUE; got: %d", result); + SDLTest_AssertCheck(result == true, "Verify result value is true; got: %d", result); return TEST_COMPLETED; } @@ -340,7 +340,7 @@ static int SDLCALL iostrm_testDynamicMem(void *arg) SDL_SetNumberProperty(props, SDL_PROP_IOSTREAM_DYNAMIC_CHUNKSIZE_NUMBER, 1); /* Run generic tests */ - testGenericIOStreamValidations(rw, SDL_TRUE); + testGenericIOStreamValidations(rw, true); /* Get the dynamic memory and verify it */ mem = (char *)SDL_GetPointerProperty(props, SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL); @@ -356,7 +356,7 @@ static int SDLCALL iostrm_testDynamicMem(void *arg) /* Close */ result = SDL_CloseIO(rw); SDLTest_AssertPass("Call to SDL_CloseIO() succeeded"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify result value is SDL_TRUE; got: %d", result); + SDLTest_AssertCheck(result == true, "Verify result value is true; got: %d", result); return TEST_COMPLETED; } @@ -383,12 +383,12 @@ static int SDLCALL iostrm_testFileRead(void *arg) } /* Run generic tests */ - testGenericIOStreamValidations(rw, SDL_FALSE); + testGenericIOStreamValidations(rw, false); /* Close handle */ result = SDL_CloseIO(rw); SDLTest_AssertPass("Call to SDL_CloseIO() succeeded"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify result value is SDL_TRUE; got: %d", result); + SDLTest_AssertCheck(result == true, "Verify result value is true; got: %d", result); return TEST_COMPLETED; } @@ -415,12 +415,12 @@ static int SDLCALL iostrm_testFileWrite(void *arg) } /* Run generic tests */ - testGenericIOStreamValidations(rw, SDL_TRUE); + testGenericIOStreamValidations(rw, true); /* Close handle */ result = SDL_CloseIO(rw); SDLTest_AssertPass("Call to SDL_CloseIO() succeeded"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify result value is SDL_TRUE; got: %d", result); + SDLTest_AssertCheck(result == true, "Verify result value is true; got: %d", result); return TEST_COMPLETED; } @@ -486,7 +486,7 @@ static int SDLCALL iostrm_testCompareRWFromMemWithRWFromFile(void *arg) SDLTest_AssertPass("Call to SDL_SeekIO(mem,SEEK_END)"); result = SDL_CloseIO(iostrm_mem); SDLTest_AssertPass("Call to SDL_CloseIO(mem)"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify result value is SDL_TRUE; got: %d", result); + SDLTest_AssertCheck(result == true, "Verify result value is true; got: %d", result); /* Read/see from file */ iostrm_file = SDL_IOFromFile(IOStreamAlphabetFilename, "r"); @@ -497,7 +497,7 @@ static int SDLCALL iostrm_testCompareRWFromMemWithRWFromFile(void *arg) SDLTest_AssertPass("Call to SDL_SeekIO(file,SEEK_END)"); result = SDL_CloseIO(iostrm_file); SDLTest_AssertPass("Call to SDL_CloseIO(file)"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify result value is SDL_TRUE; got: %d", result); + SDLTest_AssertCheck(result == true, "Verify result value is true; got: %d", result); /* Compare */ SDLTest_AssertCheck(rv_mem == rv_file, "Verify returned read blocks matches for mem and file reads; got: rv_mem=%d rv_file=%d", (int)rv_mem, (int)rv_file); @@ -540,7 +540,7 @@ static int SDLCALL iostrm_testFileWriteReadEndian(void *arg) Uint16 LE16test; Uint32 LE32test; Uint64 LE64test; - SDL_bool bresult; + bool bresult; int cresult; for (mode = 0; mode < 3; mode++) { @@ -590,22 +590,22 @@ static int SDLCALL iostrm_testFileWriteReadEndian(void *arg) /* Write test data */ bresult = SDL_WriteU16BE(rw, BE16value); SDLTest_AssertPass("Call to SDL_WriteU16BE()"); - SDLTest_AssertCheck(bresult == SDL_TRUE, "Validate object written, expected: SDL_TRUE, got: SDL_FALSE"); + SDLTest_AssertCheck(bresult == true, "Validate object written, expected: true, got: false"); bresult = SDL_WriteU32BE(rw, BE32value); SDLTest_AssertPass("Call to SDL_WriteU32BE()"); - SDLTest_AssertCheck(bresult == SDL_TRUE, "Validate object written, expected: SDL_TRUE, got: SDL_FALSE"); + SDLTest_AssertCheck(bresult == true, "Validate object written, expected: true, got: false"); bresult = SDL_WriteU64BE(rw, BE64value); SDLTest_AssertPass("Call to SDL_WriteU64BE()"); - SDLTest_AssertCheck(bresult == SDL_TRUE, "Validate object written, expected: SDL_TRUE, got: SDL_FALSE"); + SDLTest_AssertCheck(bresult == true, "Validate object written, expected: true, got: false"); bresult = SDL_WriteU16LE(rw, LE16value); SDLTest_AssertPass("Call to SDL_WriteU16LE()"); - SDLTest_AssertCheck(bresult == SDL_TRUE, "Validate object written, expected: SDL_TRUE, got: SDL_FALSE"); + SDLTest_AssertCheck(bresult == true, "Validate object written, expected: true, got: false"); bresult = SDL_WriteU32LE(rw, LE32value); SDLTest_AssertPass("Call to SDL_WriteU32LE()"); - SDLTest_AssertCheck(bresult == SDL_TRUE, "Validate object written, expected: SDL_TRUE, got: SDL_FALSE"); + SDLTest_AssertCheck(bresult == true, "Validate object written, expected: true, got: false"); bresult = SDL_WriteU64LE(rw, LE64value); SDLTest_AssertPass("Call to SDL_WriteU64LE()"); - SDLTest_AssertCheck(bresult == SDL_TRUE, "Validate object written, expected: SDL_TRUE, got: SDL_FALSE"); + SDLTest_AssertCheck(bresult == true, "Validate object written, expected: true, got: false"); /* Test seek to start */ result = SDL_SeekIO(rw, 0, SDL_IO_SEEK_SET); @@ -615,33 +615,33 @@ static int SDLCALL iostrm_testFileWriteReadEndian(void *arg) /* Read test data */ bresult = SDL_ReadU16BE(rw, &BE16test); SDLTest_AssertPass("Call to SDL_ReadU16BE()"); - SDLTest_AssertCheck(bresult == SDL_TRUE, "Validate object read, expected: SDL_TRUE, got: SDL_FALSE"); + SDLTest_AssertCheck(bresult == true, "Validate object read, expected: true, got: false"); SDLTest_AssertCheck(BE16test == BE16value, "Validate object read from SDL_ReadU16BE, expected: %hu, got: %hu", BE16value, BE16test); bresult = SDL_ReadU32BE(rw, &BE32test); SDLTest_AssertPass("Call to SDL_ReadU32BE()"); - SDLTest_AssertCheck(bresult == SDL_TRUE, "Validate object read, expected: SDL_TRUE, got: SDL_FALSE"); + SDLTest_AssertCheck(bresult == true, "Validate object read, expected: true, got: false"); SDLTest_AssertCheck(BE32test == BE32value, "Validate object read from SDL_ReadU32BE, expected: %" SDL_PRIu32 ", got: %" SDL_PRIu32, BE32value, BE32test); bresult = SDL_ReadU64BE(rw, &BE64test); SDLTest_AssertPass("Call to SDL_ReadU64BE()"); - SDLTest_AssertCheck(bresult == SDL_TRUE, "Validate object read, expected: SDL_TRUE, got: SDL_FALSE"); + SDLTest_AssertCheck(bresult == true, "Validate object read, expected: true, got: false"); SDLTest_AssertCheck(BE64test == BE64value, "Validate object read from SDL_ReadU64BE, expected: %" SDL_PRIu64 ", got: %" SDL_PRIu64, BE64value, BE64test); bresult = SDL_ReadU16LE(rw, &LE16test); SDLTest_AssertPass("Call to SDL_ReadU16LE()"); - SDLTest_AssertCheck(bresult == SDL_TRUE, "Validate object read, expected: SDL_TRUE, got: SDL_FALSE"); + SDLTest_AssertCheck(bresult == true, "Validate object read, expected: true, got: false"); SDLTest_AssertCheck(LE16test == LE16value, "Validate object read from SDL_ReadU16LE, expected: %hu, got: %hu", LE16value, LE16test); bresult = SDL_ReadU32LE(rw, &LE32test); SDLTest_AssertPass("Call to SDL_ReadU32LE()"); - SDLTest_AssertCheck(bresult == SDL_TRUE, "Validate object read, expected: SDL_TRUE, got: SDL_FALSE"); + SDLTest_AssertCheck(bresult == true, "Validate object read, expected: true, got: false"); SDLTest_AssertCheck(LE32test == LE32value, "Validate object read from SDL_ReadU32LE, expected: %" SDL_PRIu32 ", got: %" SDL_PRIu32, LE32value, LE32test); bresult = SDL_ReadU64LE(rw, &LE64test); SDLTest_AssertPass("Call to SDL_ReadU64LE()"); - SDLTest_AssertCheck(bresult == SDL_TRUE, "Validate object read, expected: SDL_TRUE, got: SDL_FALSE"); + SDLTest_AssertCheck(bresult == true, "Validate object read, expected: true, got: false"); SDLTest_AssertCheck(LE64test == LE64value, "Validate object read from SDL_ReadU64LE, expected: %" SDL_PRIu64 ", got: %" SDL_PRIu64, LE64value, LE64test); /* Close handle */ cresult = SDL_CloseIO(rw); SDLTest_AssertPass("Call to SDL_CloseIO() succeeded"); - SDLTest_AssertCheck(cresult == SDL_TRUE, "Verify result value is SDL_TRUE; got: %d", cresult); + SDLTest_AssertCheck(cresult == true, "Verify result value is true; got: %d", cresult); } return TEST_COMPLETED; diff --git a/test/testautomation_joystick.c b/test/testautomation_joystick.c index e85065d98..274ba79f6 100644 --- a/test/testautomation_joystick.c +++ b/test/testautomation_joystick.c @@ -86,13 +86,13 @@ static int SDLCALL TestVirtualJoystick(void *arg) SDLTest_AssertCheck(nbuttons == desc.nbuttons, "SDL_GetNumJoystickButtons() -> %d (expected %d)", nbuttons, desc.nbuttons); } - SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH, SDL_TRUE), "SDL_SetJoystickVirtualButton(SDL_GAMEPAD_BUTTON_SOUTH, SDL_TRUE)"); + SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH, true), "SDL_SetJoystickVirtualButton(SDL_GAMEPAD_BUTTON_SOUTH, true)"); SDL_UpdateJoysticks(); - SDLTest_AssertCheck(SDL_GetJoystickButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH) == SDL_TRUE, "SDL_GetJoystickButton(SDL_GAMEPAD_BUTTON_SOUTH) == SDL_TRUE"); + SDLTest_AssertCheck(SDL_GetJoystickButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH) == true, "SDL_GetJoystickButton(SDL_GAMEPAD_BUTTON_SOUTH) == true"); - SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH, SDL_FALSE), "SDL_SetJoystickVirtualButton(SDL_GAMEPAD_BUTTON_SOUTH, SDL_FALSE)"); + SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH, false), "SDL_SetJoystickVirtualButton(SDL_GAMEPAD_BUTTON_SOUTH, false)"); SDL_UpdateJoysticks(); - SDLTest_AssertCheck(SDL_GetJoystickButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH) == SDL_FALSE, "SDL_GetJoystickButton(SDL_GAMEPAD_BUTTON_SOUTH) == SDL_FALSE"); + SDLTest_AssertCheck(SDL_GetJoystickButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH) == false, "SDL_GetJoystickButton(SDL_GAMEPAD_BUTTON_SOUTH) == false"); gamepad = SDL_OpenGamepad(SDL_GetJoystickID(joystick)); SDLTest_AssertCheck(gamepad != NULL, "SDL_OpenGamepad() succeeded"); @@ -124,13 +124,13 @@ static int SDLCALL TestVirtualJoystick(void *arg) SDLTest_AssertCheck(SDL_GetGamepadButtonLabel(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == SDL_GAMEPAD_BUTTON_LABEL_A, "SDL_GetGamepadButtonLabel(SDL_GAMEPAD_BUTTON_SOUTH) == SDL_GAMEPAD_BUTTON_LABEL_A"); /* Set the south button and verify that the gamepad responds */ - SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH, SDL_TRUE), "SDL_SetJoystickVirtualButton(SDL_GAMEPAD_BUTTON_SOUTH, SDL_TRUE)"); + SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH, true), "SDL_SetJoystickVirtualButton(SDL_GAMEPAD_BUTTON_SOUTH, true)"); SDL_UpdateJoysticks(); - SDLTest_AssertCheck(SDL_GetGamepadButton(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == SDL_TRUE, "SDL_GetGamepadButton(SDL_GAMEPAD_BUTTON_SOUTH) == SDL_TRUE"); + SDLTest_AssertCheck(SDL_GetGamepadButton(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == true, "SDL_GetGamepadButton(SDL_GAMEPAD_BUTTON_SOUTH) == true"); - SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH, SDL_FALSE), "SDL_SetJoystickVirtualButton(SDL_GAMEPAD_BUTTON_SOUTH, SDL_FALSE)"); + SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH, false), "SDL_SetJoystickVirtualButton(SDL_GAMEPAD_BUTTON_SOUTH, false)"); SDL_UpdateJoysticks(); - SDLTest_AssertCheck(SDL_GetGamepadButton(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == SDL_FALSE, "SDL_GetGamepadButton(SDL_GAMEPAD_BUTTON_SOUTH) == SDL_FALSE"); + SDLTest_AssertCheck(SDL_GetGamepadButton(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == false, "SDL_GetGamepadButton(SDL_GAMEPAD_BUTTON_SOUTH) == false"); /* Set an explicit mapping with legacy Nintendo style buttons */ SDL_SetGamepadMapping(SDL_GetJoystickID(joystick), "ff0013db5669727475616c2043007601,Virtual Nintendo Gamepad,a:b1,b:b0,x:b3,y:b2,back:b4,guide:b5,start:b6,leftstick:b7,rightstick:b8,leftshoulder:b9,rightshoulder:b10,dpup:b11,dpdown:b12,dpleft:b13,dpright:b14,misc1:b15,paddle1:b16,paddle2:b17,paddle3:b18,paddle4:b19,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,"); @@ -141,13 +141,13 @@ static int SDLCALL TestVirtualJoystick(void *arg) SDLTest_AssertCheck(SDL_GetGamepadButtonLabel(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == SDL_GAMEPAD_BUTTON_LABEL_B, "SDL_GetGamepadButtonLabel(SDL_GAMEPAD_BUTTON_SOUTH) == SDL_GAMEPAD_BUTTON_LABEL_B"); /* Set the south button and verify that the gamepad responds */ - SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH, SDL_TRUE), "SDL_SetJoystickVirtualButton(SDL_GAMEPAD_BUTTON_SOUTH, SDL_TRUE)"); + SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH, true), "SDL_SetJoystickVirtualButton(SDL_GAMEPAD_BUTTON_SOUTH, true)"); SDL_UpdateJoysticks(); - SDLTest_AssertCheck(SDL_GetGamepadButton(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == SDL_TRUE, "SDL_GetGamepadButton(SDL_GAMEPAD_BUTTON_SOUTH) == SDL_TRUE"); + SDLTest_AssertCheck(SDL_GetGamepadButton(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == true, "SDL_GetGamepadButton(SDL_GAMEPAD_BUTTON_SOUTH) == true"); - SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH, SDL_FALSE), "SDL_SetJoystickVirtualButton(SDL_GAMEPAD_BUTTON_SOUTH, SDL_FALSE)"); + SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH, false), "SDL_SetJoystickVirtualButton(SDL_GAMEPAD_BUTTON_SOUTH, false)"); SDL_UpdateJoysticks(); - SDLTest_AssertCheck(SDL_GetGamepadButton(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == SDL_FALSE, "SDL_GetGamepadButton(SDL_GAMEPAD_BUTTON_SOUTH) == SDL_FALSE"); + SDLTest_AssertCheck(SDL_GetGamepadButton(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == false, "SDL_GetGamepadButton(SDL_GAMEPAD_BUTTON_SOUTH) == false"); /* Set an explicit mapping with PS4 style buttons */ SDL_SetGamepadMapping(SDL_GetJoystickID(joystick), "ff0013db5669727475616c2043007601,Virtual PS4 Gamepad,type:ps4,a:b0,b:b1,x:b2,y:b3,back:b4,guide:b5,start:b6,leftstick:b7,rightstick:b8,leftshoulder:b9,rightshoulder:b10,dpup:b11,dpdown:b12,dpleft:b13,dpright:b14,misc1:b15,paddle1:b16,paddle2:b17,paddle3:b18,paddle4:b19,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,"); @@ -158,13 +158,13 @@ static int SDLCALL TestVirtualJoystick(void *arg) SDLTest_AssertCheck(SDL_GetGamepadButtonLabel(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == SDL_GAMEPAD_BUTTON_LABEL_CROSS, "SDL_GetGamepadButtonLabel(SDL_GAMEPAD_BUTTON_SOUTH) == SDL_GAMEPAD_BUTTON_LABEL_CROSS"); /* Set the south button and verify that the gamepad responds */ - SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH, SDL_TRUE), "SDL_SetJoystickVirtualButton(SDL_GAMEPAD_BUTTON_SOUTH, SDL_TRUE)"); + SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH, true), "SDL_SetJoystickVirtualButton(SDL_GAMEPAD_BUTTON_SOUTH, true)"); SDL_UpdateJoysticks(); - SDLTest_AssertCheck(SDL_GetGamepadButton(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == SDL_TRUE, "SDL_GetGamepadButton(SDL_GAMEPAD_BUTTON_SOUTH) == SDL_TRUE"); + SDLTest_AssertCheck(SDL_GetGamepadButton(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == true, "SDL_GetGamepadButton(SDL_GAMEPAD_BUTTON_SOUTH) == true"); - SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH, SDL_FALSE), "SDL_SetJoystickVirtualButton(SDL_GAMEPAD_BUTTON_SOUTH, SDL_FALSE)"); + SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH, false), "SDL_SetJoystickVirtualButton(SDL_GAMEPAD_BUTTON_SOUTH, false)"); SDL_UpdateJoysticks(); - SDLTest_AssertCheck(SDL_GetGamepadButton(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == SDL_FALSE, "SDL_GetGamepadButton(SDL_GAMEPAD_BUTTON_SOUTH) == SDL_FALSE"); + SDLTest_AssertCheck(SDL_GetGamepadButton(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == false, "SDL_GetGamepadButton(SDL_GAMEPAD_BUTTON_SOUTH) == false"); SDL_CloseGamepad(gamepad); } diff --git a/test/testautomation_keyboard.c b/test/testautomation_keyboard.c index be4f1be9d..62f2aefdd 100644 --- a/test/testautomation_keyboard.c +++ b/test/testautomation_keyboard.c @@ -18,7 +18,7 @@ static int SDLCALL keyboard_getKeyboardState(void *arg) { int numkeys; - const SDL_bool *state; + const bool *state; /* Case where numkeys pointer is NULL */ state = SDL_GetKeyboardState(NULL); @@ -60,7 +60,7 @@ static int SDLCALL keyboard_getKeyFromName(void *arg) /* Case where Key is known, 1 character input */ result = SDL_GetKeyFromName("A"); - SDLTest_AssertPass("Call to SDL_GetKeyFromName('A', SDL_TRUE)"); + SDLTest_AssertPass("Call to SDL_GetKeyFromName('A', true)"); SDLTest_AssertCheck(result == SDLK_A, "Verify result from call, expected: %d, got: %" SDL_PRIu32, SDLK_A, result); /* Case where Key is known, 2 character input */ @@ -124,12 +124,12 @@ static int SDLCALL keyboard_getKeyFromScancode(void *arg) SDL_Keycode result; /* Case where input is valid */ - result = SDL_GetKeyFromScancode(SDL_SCANCODE_A, SDL_KMOD_NONE, SDL_FALSE); + result = SDL_GetKeyFromScancode(SDL_SCANCODE_A, SDL_KMOD_NONE, false); SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(valid)"); SDLTest_AssertCheck(result == SDLK_A, "Verify result from call, expected: %d, got: %" SDL_PRIu32, SDLK_A, result); /* Case where input is zero */ - result = SDL_GetKeyFromScancode(SDL_SCANCODE_UNKNOWN, SDL_KMOD_NONE, SDL_FALSE); + result = SDL_GetKeyFromScancode(SDL_SCANCODE_UNKNOWN, SDL_KMOD_NONE, false); SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(0)"); SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %d, got: %" SDL_PRIu32, SDLK_UNKNOWN, result); @@ -138,13 +138,13 @@ static int SDLCALL keyboard_getKeyFromScancode(void *arg) SDLTest_AssertPass("Call to SDL_ClearError()"); /* Case where input is invalid (too small) */ - result = SDL_GetKeyFromScancode((SDL_Scancode)-999, SDL_KMOD_NONE, SDL_FALSE); + result = SDL_GetKeyFromScancode((SDL_Scancode)-999, SDL_KMOD_NONE, false); SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(-999)"); SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %d, got: %" SDL_PRIu32, SDLK_UNKNOWN, result); checkInvalidScancodeError(); /* Case where input is invalid (too big) */ - result = SDL_GetKeyFromScancode((SDL_Scancode)999, SDL_KMOD_NONE, SDL_FALSE); + result = SDL_GetKeyFromScancode((SDL_Scancode)999, SDL_KMOD_NONE, false); SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(999)"); SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %d, got: %" SDL_PRIu32, SDLK_UNKNOWN, result); checkInvalidScancodeError(); diff --git a/test/testautomation_main.c b/test/testautomation_main.c index a42a25fd6..3699d7ce1 100644 --- a/test/testautomation_main.c +++ b/test/testautomation_main.c @@ -101,13 +101,13 @@ main_testSetError(void *arg) SDLTest_AssertPass("SDL_SetError(NULL)"); result = SDL_SetError(NULL); - SDLTest_AssertCheck(result == SDL_FALSE, "SDL_SetError(NULL) -> %d (expected %d)", result, SDL_FALSE); + SDLTest_AssertCheck(result == false, "SDL_SetError(NULL) -> %d (expected %d)", result, false); error = SDL_GetError(); SDLTest_AssertCheck(SDL_strcmp(error, "") == 0, "SDL_GetError() -> \"%s\" (expected \"%s\")", error, ""); SDLTest_AssertPass("SDL_SetError(\"\")"); result = SDL_SetError(""); - SDLTest_AssertCheck(result == SDL_FALSE, "SDL_SetError(\"\") -> %d (expected %d)", result, SDL_FALSE); + SDLTest_AssertCheck(result == false, "SDL_SetError(\"\") -> %d (expected %d)", result, false); error = SDL_GetError(); SDLTest_AssertCheck(SDL_strcmp(error, "") == 0, "SDL_GetError() -> \"%s\" (expected \"%s\")", error, ""); @@ -118,7 +118,7 @@ main_testSetError(void *arg) error_input[i] = '\0'; SDLTest_AssertPass("SDL_SetError(\"abc...\")"); result = SDL_SetError("%s", error_input); - SDLTest_AssertCheck(result == SDL_FALSE, "SDL_SetError(\"abc...\") -> %d (expected %d)", result, SDL_FALSE); + SDLTest_AssertCheck(result == false, "SDL_SetError(\"abc...\") -> %d (expected %d)", result, false); error = SDL_GetError(); #ifdef SDL_THREADS_DISABLED diff --git a/test/testautomation_math.c b/test/testautomation_math.c index b2d316b10..f9e40a3e8 100644 --- a/test/testautomation_math.c +++ b/test/testautomation_math.c @@ -213,7 +213,7 @@ helper_range(const char *func_name, d_to_d_func func) result = func(test_value); if (result != test_value) { /* Only log failures to save performances */ - SDLTest_AssertCheck(SDL_FALSE, + SDLTest_AssertCheck(false, "%s(%.1f), expected %.1f, got %.1f", func_name, test_value, test_value, result); @@ -800,7 +800,7 @@ copysign_rangeTest(void *args) /* Only log failures to save performances */ result = SDL_copysign(test_value, 1.0); if (result != test_value) { - SDLTest_AssertCheck(SDL_FALSE, + SDLTest_AssertCheck(false, "Copysign(%.1f,%.1f), expected %.1f, got %.1f", test_value, 1.0, test_value, result); return TEST_ABORTED; @@ -808,7 +808,7 @@ copysign_rangeTest(void *args) result = SDL_copysign(test_value, -1.0); if (result != -test_value) { - SDLTest_AssertCheck(SDL_FALSE, + SDLTest_AssertCheck(false, "Copysign(%.1f,%.1f), expected %.1f, got %.1f", test_value, -1.0, -test_value, result); return TEST_ABORTED; @@ -1003,7 +1003,7 @@ fmod_rangeTest(void *args) /* Only log failures to save performances */ result = SDL_fmod(test_value, 1.0); if (0.0 != result) { - SDLTest_AssertCheck(SDL_FALSE, + SDLTest_AssertCheck(false, "Fmod(%.1f,%.1f), expected %.1f, got %.1f", test_value, 1.0, 0.0, result); return TEST_ABORTED; @@ -1734,7 +1734,7 @@ pow_rangeTest(void *args) /* Only log failures to save performances */ result = SDL_pow(test_value, 0.0); if (result != 1.0) { - SDLTest_AssertCheck(SDL_FALSE, + SDLTest_AssertCheck(false, "Pow(%.1f,%.1f), expected %.1f, got %.1f", test_value, 1.0, 1.0, result); return TEST_ABORTED; @@ -1742,7 +1742,7 @@ pow_rangeTest(void *args) result = SDL_pow(test_value, -0.0); if (result != 1.0) { - SDLTest_AssertCheck(SDL_FALSE, + SDLTest_AssertCheck(false, "Pow(%.1f,%.1f), expected %.1f, got %.1f", test_value, -0.0, 1.0, result); return TEST_ABORTED; @@ -2061,7 +2061,7 @@ cos_rangeTest(void *args) /* Only log failures to save performances */ result = SDL_cos(test_value); if (result < -1.0 || result > 1.0) { - SDLTest_AssertCheck(SDL_FALSE, + SDLTest_AssertCheck(false, "Cos(%.1f), expected [%.1f,%.1f], got %.1f", test_value, -1.0, 1.0, result); return TEST_ABORTED; @@ -2179,7 +2179,7 @@ sin_rangeTest(void *args) /* Only log failures to save performances */ result = SDL_sin(test_value); if (result < -1.0 || result > 1.0) { - SDLTest_AssertCheck(SDL_FALSE, + SDLTest_AssertCheck(false, "Sin(%.1f), expected [%.1f,%.1f], got %.1f", test_value, -1.0, 1.0, result); return TEST_ABORTED; diff --git a/test/testautomation_mouse.c b/test/testautomation_mouse.c index bdf4f6d3c..cf9ef4625 100644 --- a/test/testautomation_mouse.c +++ b/test/testautomation_mouse.c @@ -252,9 +252,9 @@ static int SDLCALL mouse_createFreeColorCursor(void *arg) } /* Helper that changes cursor visibility */ -static void changeCursorVisibility(SDL_bool state) +static void changeCursorVisibility(bool state) { - SDL_bool newState; + bool newState; if (state) { SDL_ShowCursor(); @@ -266,8 +266,8 @@ static void changeCursorVisibility(SDL_bool state) newState = SDL_CursorVisible(); SDLTest_AssertPass("Call to SDL_CursorVisible()"); SDLTest_AssertCheck(state == newState, "Validate new state, expected: %s, got: %s", - state ? "SDL_TRUE" : "SDL_FALSE", - newState ? "SDL_TRUE" : "SDL_FALSE"); + state ? "true" : "false", + newState ? "true" : "false"); } /** @@ -277,19 +277,19 @@ static void changeCursorVisibility(SDL_bool state) */ static int SDLCALL mouse_showCursor(void *arg) { - SDL_bool currentState; + bool currentState; /* Get current state */ currentState = SDL_CursorVisible(); SDLTest_AssertPass("Call to SDL_CursorVisible()"); if (currentState) { /* Hide the cursor, then show it again */ - changeCursorVisibility(SDL_FALSE); - changeCursorVisibility(SDL_TRUE); + changeCursorVisibility(false); + changeCursorVisibility(true); } else { /* Show the cursor, then hide it again */ - changeCursorVisibility(SDL_TRUE); - changeCursorVisibility(SDL_FALSE); + changeCursorVisibility(true); + changeCursorVisibility(false); } return TEST_COMPLETED; @@ -384,8 +384,8 @@ static int SDLCALL mouse_getSetRelativeMouseMode(void *arg) SDL_Window *window; int result; int i; - SDL_bool initialState; - SDL_bool currentState; + bool initialState; + bool currentState; /* Create test window */ window = createMouseSuiteTestWindow(); @@ -400,34 +400,34 @@ static int SDLCALL mouse_getSetRelativeMouseMode(void *arg) /* Repeat twice to check D->D transition */ for (i = 0; i < 2; i++) { /* Disable - should always be supported */ - result = SDL_SetWindowRelativeMouseMode(window, SDL_FALSE); + result = SDL_SetWindowRelativeMouseMode(window, false); SDLTest_AssertPass("Call to SDL_SetWindowRelativeMouseMode(window, FALSE)"); - SDLTest_AssertCheck(result == SDL_TRUE, "Validate result value from SDL_SetWindowRelativeMouseMode, expected: SDL_TRUE, got: %i", result); + SDLTest_AssertCheck(result == true, "Validate result value from SDL_SetWindowRelativeMouseMode, expected: true, got: %i", result); currentState = SDL_GetWindowRelativeMouseMode(window); SDLTest_AssertPass("Call to SDL_GetWindowRelativeMouseMode(window)"); - SDLTest_AssertCheck(currentState == SDL_FALSE, "Validate current state is FALSE, got: %i", currentState); + SDLTest_AssertCheck(currentState == false, "Validate current state is FALSE, got: %i", currentState); } /* Repeat twice to check D->E->E transition */ for (i = 0; i < 2; i++) { /* Enable - may not be supported */ - result = SDL_SetWindowRelativeMouseMode(window, SDL_TRUE); + result = SDL_SetWindowRelativeMouseMode(window, true); SDLTest_AssertPass("Call to SDL_SetWindowRelativeMouseMode(window, TRUE)"); if (result != -1) { - SDLTest_AssertCheck(result == SDL_TRUE, "Validate result value from SDL_SetWindowRelativeMouseMode, expected: SDL_TRUE, got: %i", result); + SDLTest_AssertCheck(result == true, "Validate result value from SDL_SetWindowRelativeMouseMode, expected: true, got: %i", result); currentState = SDL_GetWindowRelativeMouseMode(window); SDLTest_AssertPass("Call to SDL_GetWindowRelativeMouseMode(window)"); - SDLTest_AssertCheck(currentState == SDL_TRUE, "Validate current state is TRUE, got: %i", currentState); + SDLTest_AssertCheck(currentState == true, "Validate current state is TRUE, got: %i", currentState); } } /* Disable to check E->D transition */ - result = SDL_SetWindowRelativeMouseMode(window, SDL_FALSE); + result = SDL_SetWindowRelativeMouseMode(window, false); SDLTest_AssertPass("Call to SDL_SetWindowRelativeMouseMode(window, FALSE)"); - SDLTest_AssertCheck(result == SDL_TRUE, "Validate result value from SDL_SetWindowRelativeMouseMode, expected: SDL_TRUE, got: %i", result); + SDLTest_AssertCheck(result == true, "Validate result value from SDL_SetWindowRelativeMouseMode, expected: true, got: %i", result); currentState = SDL_GetWindowRelativeMouseMode(window); SDLTest_AssertPass("Call to SDL_GetWindowRelativeMouseMode(window)"); - SDLTest_AssertCheck(currentState == SDL_FALSE, "Validate current state is FALSE, got: %i", currentState); + SDLTest_AssertCheck(currentState == false, "Validate current state is FALSE, got: %i", currentState); /* Revert to original state - ignore result */ result = SDL_SetWindowRelativeMouseMode(window, initialState); @@ -512,7 +512,7 @@ static int SDLCALL mouse_getMouseFocus(void *arg) float x, y; SDL_Window *window; SDL_Window *focusWindow; - const SDL_bool video_driver_is_wayland = !SDL_strcmp(SDL_GetCurrentVideoDriver(), "wayland"); + const bool video_driver_is_wayland = !SDL_strcmp(SDL_GetCurrentVideoDriver(), "wayland"); /* Get focus - focus non-deterministic */ focusWindow = SDL_GetMouseFocus(); diff --git a/test/testautomation_platform.c b/test/testautomation_platform.c index d19314c8c..2a70e757a 100644 --- a/test/testautomation_platform.c +++ b/test/testautomation_platform.c @@ -223,7 +223,7 @@ static int SDLCALL platform_testGetVersion(void *arg) */ static int SDLCALL platform_testDefaultInit(void *arg) { - SDL_bool ret; + bool ret; int subsystem; subsystem = SDL_WasInit(0); @@ -232,8 +232,8 @@ static int SDLCALL platform_testDefaultInit(void *arg) subsystem); ret = SDL_Init(0); - SDLTest_AssertCheck(ret == SDL_TRUE, - "SDL_Init(0): returned %i, expected SDL_TRUE, error: %s", + SDLTest_AssertCheck(ret == true, + "SDL_Init(0): returned %i, expected true, error: %s", ret, SDL_GetError()); @@ -268,7 +268,7 @@ static int SDLCALL platform_testGetSetClearError(void *arg) result = SDL_SetError("%s", testError); SDLTest_AssertPass("SDL_SetError()"); - SDLTest_AssertCheck(result == SDL_FALSE, "SDL_SetError: expected SDL_FALSE, got: %i", result); + SDLTest_AssertCheck(result == false, "SDL_SetError: expected false, got: %i", result); lastError = SDL_GetError(); SDLTest_AssertCheck(lastError != NULL, "SDL_GetError() != NULL"); @@ -304,7 +304,7 @@ static int SDLCALL platform_testSetErrorEmptyInput(void *arg) result = SDL_SetError("%s", testError); SDLTest_AssertPass("SDL_SetError()"); - SDLTest_AssertCheck(result == SDL_FALSE, "SDL_SetError: expected SDL_FALSE, got: %i", result); + SDLTest_AssertCheck(result == false, "SDL_SetError: expected false, got: %i", result); lastError = SDL_GetError(); SDLTest_AssertCheck(lastError != NULL, "SDL_GetError() != NULL"); @@ -351,7 +351,7 @@ static int SDLCALL platform_testSetErrorInvalidInput(void *arg) /* Check for no-op */ result = SDL_SetError("%s", invalidError); SDLTest_AssertPass("SDL_SetError()"); - SDLTest_AssertCheck(result == SDL_FALSE, "SDL_SetError: expected SDL_FALSE, got: %i", result); + SDLTest_AssertCheck(result == false, "SDL_SetError: expected false, got: %i", result); lastError = SDL_GetError(); SDLTest_AssertCheck(lastError != NULL, "SDL_GetError() != NULL"); @@ -365,12 +365,12 @@ static int SDLCALL platform_testSetErrorInvalidInput(void *arg) /* Set */ result = SDL_SetError("%s", probeError); SDLTest_AssertPass("SDL_SetError('%s')", probeError); - SDLTest_AssertCheck(result == SDL_FALSE, "SDL_SetError: expected SDL_FALSE, got: %i", result); + SDLTest_AssertCheck(result == false, "SDL_SetError: expected false, got: %i", result); /* Check for no-op */ result = SDL_SetError("%s", invalidError); SDLTest_AssertPass("SDL_SetError(NULL)"); - SDLTest_AssertCheck(result == SDL_FALSE, "SDL_SetError: expected SDL_FALSE, got: %i", result); + SDLTest_AssertCheck(result == false, "SDL_SetError: expected false, got: %i", result); lastError = SDL_GetError(); SDLTest_AssertCheck(lastError != NULL, "SDL_GetError() != NULL"); @@ -388,7 +388,7 @@ static int SDLCALL platform_testSetErrorInvalidInput(void *arg) /* Set and check */ result = SDL_SetError("%s", probeError); SDLTest_AssertPass("SDL_SetError()"); - SDLTest_AssertCheck(result == SDL_FALSE, "SDL_SetError: expected SDL_FALSE, got: %i", result); + SDLTest_AssertCheck(result == false, "SDL_SetError: expected false, got: %i", result); lastError = SDL_GetError(); SDLTest_AssertCheck(lastError != NULL, "SDL_GetError() != NULL"); diff --git a/test/testautomation_properties.c b/test/testautomation_properties.c index f2671a13f..851386d85 100644 --- a/test/testautomation_properties.c +++ b/test/testautomation_properties.c @@ -32,7 +32,7 @@ static int SDLCALL properties_testBasic(void *arg) const char *value_string; Sint64 value_number; float value_float; - SDL_bool value_bool; + bool value_bool; int i, result, count; props = SDL_CreateProperties(); @@ -45,7 +45,7 @@ static int SDLCALL properties_testBasic(void *arg) SDL_snprintf(expected_value, SDL_arraysize(expected_value), "%c", 'a' + i); result = SDL_SetPointerProperty(props, key, expected_value); SDLTest_AssertPass("Call to SDL_SetPointerProperty()"); - SDLTest_AssertCheck(result == SDL_TRUE, + SDLTest_AssertCheck(result == true, "Verify property value was set, got: %d", result); value = SDL_GetPointerProperty(props, key, NULL); SDLTest_AssertPass("Call to SDL_GetPointerProperty()"); @@ -62,7 +62,7 @@ static int SDLCALL properties_testBasic(void *arg) SDL_snprintf(key, SDL_arraysize(key), "%c", 'a' + i); result = SDL_SetPointerProperty(props, key, NULL); SDLTest_AssertPass("Call to SDL_SetPointerProperty(NULL)"); - SDLTest_AssertCheck(result == SDL_TRUE, + SDLTest_AssertCheck(result == true, "Verify property value was set, got: %d", result); value = SDL_GetPointerProperty(props, key, NULL); SDLTest_AssertPass("Call to SDL_GetPointerProperty()"); @@ -88,9 +88,9 @@ static int SDLCALL properties_testBasic(void *arg) value_float = SDL_GetFloatProperty(props, "foo", 1234.0f); SDLTest_AssertCheck(value_float == 1234.0f, "Verify float property, expected 1234, got: %f", value_float); - value_bool = SDL_GetBooleanProperty(props, "foo", SDL_TRUE); - SDLTest_AssertCheck(value_bool == SDL_TRUE, - "Verify boolean property, expected SDL_TRUE, got: %s", value_bool ? "SDL_TRUE" : "SDL_FALSE"); + value_bool = SDL_GetBooleanProperty(props, "foo", true); + SDLTest_AssertCheck(value_bool == true, + "Verify boolean property, expected true, got: %s", value_bool ? "true" : "false"); /* Check data value */ SDLTest_AssertPass("Call to SDL_SetPointerProperty(\"foo\", 0x01)"); @@ -110,9 +110,9 @@ static int SDLCALL properties_testBasic(void *arg) value_float = SDL_GetFloatProperty(props, "foo", 0.0f); SDLTest_AssertCheck(value_float == 0.0f, "Verify float property, expected 0, got: %f", value_float); - value_bool = SDL_GetBooleanProperty(props, "foo", SDL_FALSE); - SDLTest_AssertCheck(value_bool == SDL_FALSE, - "Verify boolean property, expected SDL_FALSE, got: %s", value_bool ? "SDL_TRUE" : "SDL_FALSE"); + value_bool = SDL_GetBooleanProperty(props, "foo", false); + SDLTest_AssertCheck(value_bool == false, + "Verify boolean property, expected false, got: %s", value_bool ? "true" : "false"); /* Check string value */ SDLTest_AssertPass("Call to SDL_SetStringProperty(\"foo\", \"bar\")"); @@ -132,9 +132,9 @@ static int SDLCALL properties_testBasic(void *arg) value_float = SDL_GetFloatProperty(props, "foo", 0.0f); SDLTest_AssertCheck(value_float == 0.0f, "Verify float property, expected 0, got: %f", value_float); - value_bool = SDL_GetBooleanProperty(props, "foo", SDL_FALSE); - SDLTest_AssertCheck(value_bool == SDL_TRUE, - "Verify boolean property, expected SDL_TRUE, got: %s", value_bool ? "SDL_TRUE" : "SDL_FALSE"); + value_bool = SDL_GetBooleanProperty(props, "foo", false); + SDLTest_AssertCheck(value_bool == true, + "Verify boolean property, expected true, got: %s", value_bool ? "true" : "false"); /* Check number value */ SDLTest_AssertPass("Call to SDL_SetNumberProperty(\"foo\", 1)"); @@ -154,9 +154,9 @@ static int SDLCALL properties_testBasic(void *arg) value_float = SDL_GetFloatProperty(props, "foo", 0.0f); SDLTest_AssertCheck(value_float == 1.0f, "Verify float property, expected 1, got: %f", value_float); - value_bool = SDL_GetBooleanProperty(props, "foo", SDL_FALSE); - SDLTest_AssertCheck(value_bool == SDL_TRUE, - "Verify boolean property, expected SDL_TRUE, got: %s", value_bool ? "SDL_TRUE" : "SDL_FALSE"); + value_bool = SDL_GetBooleanProperty(props, "foo", false); + SDLTest_AssertCheck(value_bool == true, + "Verify boolean property, expected true, got: %s", value_bool ? "true" : "false"); /* Check float value */ SDLTest_AssertPass("Call to SDL_SetFloatProperty(\"foo\", 1)"); @@ -176,12 +176,12 @@ static int SDLCALL properties_testBasic(void *arg) value_float = SDL_GetFloatProperty(props, "foo", 0.0f); SDLTest_AssertCheck(value_float == 1.75f, "Verify float property, expected 1.75, got: %f", value_float); - value_bool = SDL_GetBooleanProperty(props, "foo", SDL_FALSE); - SDLTest_AssertCheck(value_bool == SDL_TRUE, - "Verify boolean property, expected SDL_TRUE, got: %s", value_bool ? "SDL_TRUE" : "SDL_FALSE"); + value_bool = SDL_GetBooleanProperty(props, "foo", false); + SDLTest_AssertCheck(value_bool == true, + "Verify boolean property, expected true, got: %s", value_bool ? "true" : "false"); /* Check boolean value */ - SDLTest_AssertPass("Call to SDL_SetBooleanProperty(\"foo\", SDL_TRUE)"); + SDLTest_AssertPass("Call to SDL_SetBooleanProperty(\"foo\", true)"); SDL_SetBooleanProperty(props, "foo", 3); /* Note we're testing non-true/false value here */ type = SDL_GetPropertyType(props, "foo"); SDLTest_AssertCheck(type == SDL_PROPERTY_TYPE_BOOLEAN, @@ -198,9 +198,9 @@ static int SDLCALL properties_testBasic(void *arg) value_float = SDL_GetFloatProperty(props, "foo", 0.0f); SDLTest_AssertCheck(value_float == 1.0f, "Verify float property, expected 1, got: %f", value_float); - value_bool = SDL_GetBooleanProperty(props, "foo", SDL_FALSE); - SDLTest_AssertCheck(value_bool == SDL_TRUE, - "Verify boolean property, expected SDL_TRUE, got: %s", value_bool ? "SDL_TRUE" : "SDL_FALSE"); + value_bool = SDL_GetBooleanProperty(props, "foo", false); + SDLTest_AssertCheck(value_bool == true, + "Verify boolean property, expected true, got: %s", value_bool ? "true" : "false"); /* Make sure we have exactly one property named foo */ count = 0; @@ -238,18 +238,18 @@ static int SDLCALL properties_testCopy(void *arg) SDLTest_AssertPass("Call to SDL_CopyProperties(a, 0)"); result = SDL_CopyProperties(a, 0); - SDLTest_AssertCheck(result == SDL_FALSE, - "SDL_CopyProperties() result, got %d, expected SDL_FALSE", result); + SDLTest_AssertCheck(result == false, + "SDL_CopyProperties() result, got %d, expected false", result); SDLTest_AssertPass("Call to SDL_CopyProperties(0, b)"); result = SDL_CopyProperties(0, b); - SDLTest_AssertCheck(result == SDL_FALSE, - "SDL_CopyProperties() result, got %d, expected SDL_FALSE", result); + SDLTest_AssertCheck(result == false, + "SDL_CopyProperties() result, got %d, expected false", result); SDLTest_AssertPass("Call to SDL_CopyProperties(a, b)"); result = SDL_CopyProperties(a, b); - SDLTest_AssertCheck(result == SDL_TRUE, - "SDL_CopyProperties() result, got %d, expected SDL_TRUE", result); + SDLTest_AssertCheck(result == true, + "SDL_CopyProperties() result, got %d, expected true", result); SDL_DestroyProperties(a); @@ -316,7 +316,7 @@ static int SDLCALL properties_testCleanup(void *arg) */ struct properties_thread_data { - SDL_bool done; + bool done; SDL_PropertiesID props; }; static int SDLCALL properties_thread(void *arg) @@ -340,7 +340,7 @@ static int SDLCALL properties_testLocking(void *arg) void *value; SDLTest_AssertPass("Testing property locking"); - data.done = SDL_FALSE; + data.done = false; data.props = SDL_CreateProperties(); SDLTest_AssertPass("Setting property to 'init'"); SDL_SetPointerProperty(data.props, "a", "init"); @@ -370,7 +370,7 @@ static int SDLCALL properties_testLocking(void *arg) "After 100ms sleep, property is %s, expected 'main'", value ? (const char *)value : "NULL"); SDL_UnlockProperties(data.props); - data.done = SDL_TRUE; + data.done = true; SDL_WaitThread(thread, NULL); value = SDL_GetPointerProperty(data.props, "a", NULL); diff --git a/test/testautomation_rect.c b/test/testautomation_rect.c index 7a3c57829..5c278e295 100644 --- a/test/testautomation_rect.c +++ b/test/testautomation_rect.c @@ -15,15 +15,15 @@ * Private helper to check SDL_GetRectAndLineIntersectionFloat results */ static void validateIntersectRectAndLineFloatResults( - SDL_bool intersection, SDL_bool expectedIntersection, + bool intersection, bool expectedIntersection, SDL_FRect *rect, float x1, float y1, float x2, float y2, float x1Ref, float y1Ref, float x2Ref, float y2Ref) { SDLTest_AssertCheck(intersection == expectedIntersection, "Check for correct intersection result: expected %s, got %s intersecting rect (%.2f,%.2f,%.2f,%.2f) with line (%.2f,%.2f - %.2f,%.2f)", - (expectedIntersection == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - (intersection == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", + (expectedIntersection == true) ? "true" : "false", + (intersection == true) ? "true" : "false", rect->x, rect->y, rect->w, rect->h, x1Ref, y1Ref, x2Ref, y2Ref); SDLTest_AssertCheck(x1 == x1Ref && y1 == y1Ref && x2 == x2Ref && y2 == y2Ref, @@ -36,15 +36,15 @@ static void validateIntersectRectAndLineFloatResults( * Private helper to check SDL_GetRectAndLineIntersection results */ static void validateIntersectRectAndLineResults( - SDL_bool intersection, SDL_bool expectedIntersection, + bool intersection, bool expectedIntersection, SDL_Rect *rect, SDL_Rect *refRect, int x1, int y1, int x2, int y2, int x1Ref, int y1Ref, int x2Ref, int y2Ref) { SDLTest_AssertCheck(intersection == expectedIntersection, "Check for correct intersection result: expected %s, got %s intersecting rect (%d,%d,%d,%d) with line (%d,%d - %d,%d)", - (expectedIntersection == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - (intersection == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", + (expectedIntersection == true) ? "true" : "false", + (intersection == true) ? "true" : "false", refRect->x, refRect->y, refRect->w, refRect->h, x1Ref, y1Ref, x2Ref, y2Ref); SDLTest_AssertCheck(rect->x == refRect->x && rect->y == refRect->y && rect->w == refRect->w && rect->h == refRect->h, @@ -69,7 +69,7 @@ static int SDLCALL rect_testIntersectRectAndLineFloat(void *arg) SDL_FRect rect; float x1, y1; float x2, y2; - SDL_bool intersected; + bool intersected; x1 = 5.0f; y1 = 6.0f; @@ -80,7 +80,7 @@ static int SDLCALL rect_testIntersectRectAndLineFloat(void *arg) rect.w = 15.25f; rect.h = 12.0f; intersected = SDL_GetRectAndLineIntersectionFloat(&rect, &x1, &y1, &x2, &y2); - validateIntersectRectAndLineFloatResults(intersected, SDL_TRUE, &rect, x1, y1, x2, y2, 5.0f, 6.0f, 17.75f, 6.0f); + validateIntersectRectAndLineFloatResults(intersected, true, &rect, x1, y1, x2, y2, 5.0f, 6.0f, 17.75f, 6.0f); x1 = 0.0f; y1 = 6.0f; @@ -91,7 +91,7 @@ static int SDLCALL rect_testIntersectRectAndLineFloat(void *arg) rect.w = 0.25f; rect.h = 12.0f; intersected = SDL_GetRectAndLineIntersectionFloat(&rect, &x1, &y1, &x2, &y2); - validateIntersectRectAndLineFloatResults(intersected, SDL_TRUE, &rect, x1, y1, x2, y2, 2.5f, 6.0f, 2.75f, 6.0f); + validateIntersectRectAndLineFloatResults(intersected, true, &rect, x1, y1, x2, y2, 2.5f, 6.0f, 2.75f, 6.0f); return TEST_COMPLETED; } @@ -107,7 +107,7 @@ static int SDLCALL rect_testIntersectRectAndLine(void *arg) SDL_Rect rect; int x1, y1; int x2, y2; - SDL_bool intersected; + bool intersected; int xLeft = -SDLTest_RandomIntegerInRange(1, refRect.w); int xRight = refRect.w + SDLTest_RandomIntegerInRange(1, refRect.w); @@ -120,7 +120,7 @@ static int SDLCALL rect_testIntersectRectAndLine(void *arg) y2 = 15; rect = refRect; intersected = SDL_GetRectAndLineIntersection(&rect, &x1, &y1, &x2, &y2); - validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, 0, 15, 31, 15); + validateIntersectRectAndLineResults(intersected, true, &rect, &refRect, x1, y1, x2, y2, 0, 15, 31, 15); x1 = 15; y1 = yTop; @@ -128,7 +128,7 @@ static int SDLCALL rect_testIntersectRectAndLine(void *arg) y2 = yBottom; rect = refRect; intersected = SDL_GetRectAndLineIntersection(&rect, &x1, &y1, &x2, &y2); - validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, 15, 0, 15, 31); + validateIntersectRectAndLineResults(intersected, true, &rect, &refRect, x1, y1, x2, y2, 15, 0, 15, 31); x1 = -refRect.w; y1 = -refRect.h; @@ -136,7 +136,7 @@ static int SDLCALL rect_testIntersectRectAndLine(void *arg) y2 = 2 * refRect.h; rect = refRect; intersected = SDL_GetRectAndLineIntersection(&rect, &x1, &y1, &x2, &y2); - validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, 0, 0, 31, 31); + validateIntersectRectAndLineResults(intersected, true, &rect, &refRect, x1, y1, x2, y2, 0, 0, 31, 31); x1 = 2 * refRect.w; y1 = 2 * refRect.h; @@ -144,7 +144,7 @@ static int SDLCALL rect_testIntersectRectAndLine(void *arg) y2 = -refRect.h; rect = refRect; intersected = SDL_GetRectAndLineIntersection(&rect, &x1, &y1, &x2, &y2); - validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, 31, 31, 0, 0); + validateIntersectRectAndLineResults(intersected, true, &rect, &refRect, x1, y1, x2, y2, 31, 31, 0, 0); x1 = -1; y1 = 32; @@ -152,7 +152,7 @@ static int SDLCALL rect_testIntersectRectAndLine(void *arg) y2 = -1; rect = refRect; intersected = SDL_GetRectAndLineIntersection(&rect, &x1, &y1, &x2, &y2); - validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, 0, 31, 31, 0); + validateIntersectRectAndLineResults(intersected, true, &rect, &refRect, x1, y1, x2, y2, 0, 31, 31, 0); x1 = 32; y1 = -1; @@ -160,7 +160,7 @@ static int SDLCALL rect_testIntersectRectAndLine(void *arg) y2 = 32; rect = refRect; intersected = SDL_GetRectAndLineIntersection(&rect, &x1, &y1, &x2, &y2); - validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, 31, 0, 0, 31); + validateIntersectRectAndLineResults(intersected, true, &rect, &refRect, x1, y1, x2, y2, 31, 0, 0, 31); /* Test some overflow cases */ refRect.x = INT_MAX - 4; @@ -171,7 +171,7 @@ static int SDLCALL rect_testIntersectRectAndLine(void *arg) y2 = INT_MAX; rect = refRect; intersected = SDL_GetRectAndLineIntersection(&rect, &x1, &y1, &x2, &y2); - validateIntersectRectAndLineResults(intersected, SDL_FALSE, &rect, &refRect, x1, y1, x2, y2, x1, y1, x2, y2); + validateIntersectRectAndLineResults(intersected, false, &rect, &refRect, x1, y1, x2, y2, x1, y1, x2, y2); return TEST_COMPLETED; } @@ -187,7 +187,7 @@ static int SDLCALL rect_testIntersectRectAndLineInside(void *arg) SDL_Rect rect; int x1, y1; int x2, y2; - SDL_bool intersected; + bool intersected; int xmin = refRect.x; int xmax = refRect.x + refRect.w - 1; @@ -204,7 +204,7 @@ static int SDLCALL rect_testIntersectRectAndLineInside(void *arg) y2 = y2Ref; rect = refRect; intersected = SDL_GetRectAndLineIntersection(&rect, &x1, &y1, &x2, &y2); - validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, x1Ref, y1Ref, x2Ref, y2Ref); + validateIntersectRectAndLineResults(intersected, true, &rect, &refRect, x1, y1, x2, y2, x1Ref, y1Ref, x2Ref, y2Ref); x1 = x1Ref; y1 = y1Ref; @@ -212,7 +212,7 @@ static int SDLCALL rect_testIntersectRectAndLineInside(void *arg) y2 = ymax; rect = refRect; intersected = SDL_GetRectAndLineIntersection(&rect, &x1, &y1, &x2, &y2); - validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, x1Ref, y1Ref, xmax, ymax); + validateIntersectRectAndLineResults(intersected, true, &rect, &refRect, x1, y1, x2, y2, x1Ref, y1Ref, xmax, ymax); x1 = xmin; y1 = ymin; @@ -220,7 +220,7 @@ static int SDLCALL rect_testIntersectRectAndLineInside(void *arg) y2 = y2Ref; rect = refRect; intersected = SDL_GetRectAndLineIntersection(&rect, &x1, &y1, &x2, &y2); - validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, xmin, ymin, x2Ref, y2Ref); + validateIntersectRectAndLineResults(intersected, true, &rect, &refRect, x1, y1, x2, y2, xmin, ymin, x2Ref, y2Ref); x1 = xmin; y1 = ymin; @@ -228,7 +228,7 @@ static int SDLCALL rect_testIntersectRectAndLineInside(void *arg) y2 = ymax; rect = refRect; intersected = SDL_GetRectAndLineIntersection(&rect, &x1, &y1, &x2, &y2); - validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, xmin, ymin, xmax, ymax); + validateIntersectRectAndLineResults(intersected, true, &rect, &refRect, x1, y1, x2, y2, xmin, ymin, xmax, ymax); x1 = xmin; y1 = ymax; @@ -236,7 +236,7 @@ static int SDLCALL rect_testIntersectRectAndLineInside(void *arg) y2 = ymin; rect = refRect; intersected = SDL_GetRectAndLineIntersection(&rect, &x1, &y1, &x2, &y2); - validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, xmin, ymax, xmax, ymin); + validateIntersectRectAndLineResults(intersected, true, &rect, &refRect, x1, y1, x2, y2, xmin, ymax, xmax, ymin); return TEST_COMPLETED; } @@ -252,7 +252,7 @@ static int SDLCALL rect_testIntersectRectAndLineOutside(void *arg) SDL_Rect rect; int x1, y1; int x2, y2; - SDL_bool intersected; + bool intersected; int xLeft = -SDLTest_RandomIntegerInRange(1, refRect.w); int xRight = refRect.w + SDLTest_RandomIntegerInRange(1, refRect.w); @@ -265,7 +265,7 @@ static int SDLCALL rect_testIntersectRectAndLineOutside(void *arg) y2 = 31; rect = refRect; intersected = SDL_GetRectAndLineIntersection(&rect, &x1, &y1, &x2, &y2); - validateIntersectRectAndLineResults(intersected, SDL_FALSE, &rect, &refRect, x1, y1, x2, y2, xLeft, 0, xLeft, 31); + validateIntersectRectAndLineResults(intersected, false, &rect, &refRect, x1, y1, x2, y2, xLeft, 0, xLeft, 31); x1 = xRight; y1 = 0; @@ -273,7 +273,7 @@ static int SDLCALL rect_testIntersectRectAndLineOutside(void *arg) y2 = 31; rect = refRect; intersected = SDL_GetRectAndLineIntersection(&rect, &x1, &y1, &x2, &y2); - validateIntersectRectAndLineResults(intersected, SDL_FALSE, &rect, &refRect, x1, y1, x2, y2, xRight, 0, xRight, 31); + validateIntersectRectAndLineResults(intersected, false, &rect, &refRect, x1, y1, x2, y2, xRight, 0, xRight, 31); x1 = 0; y1 = yTop; @@ -281,7 +281,7 @@ static int SDLCALL rect_testIntersectRectAndLineOutside(void *arg) y2 = yTop; rect = refRect; intersected = SDL_GetRectAndLineIntersection(&rect, &x1, &y1, &x2, &y2); - validateIntersectRectAndLineResults(intersected, SDL_FALSE, &rect, &refRect, x1, y1, x2, y2, 0, yTop, 31, yTop); + validateIntersectRectAndLineResults(intersected, false, &rect, &refRect, x1, y1, x2, y2, 0, yTop, 31, yTop); x1 = 0; y1 = yBottom; @@ -289,7 +289,7 @@ static int SDLCALL rect_testIntersectRectAndLineOutside(void *arg) y2 = yBottom; rect = refRect; intersected = SDL_GetRectAndLineIntersection(&rect, &x1, &y1, &x2, &y2); - validateIntersectRectAndLineResults(intersected, SDL_FALSE, &rect, &refRect, x1, y1, x2, y2, 0, yBottom, 31, yBottom); + validateIntersectRectAndLineResults(intersected, false, &rect, &refRect, x1, y1, x2, y2, 0, yBottom, 31, yBottom); return TEST_COMPLETED; } @@ -305,7 +305,7 @@ static int SDLCALL rect_testIntersectRectAndLineEmpty(void *arg) SDL_Rect rect; int x1, y1, x1Ref, y1Ref; int x2, y2, x2Ref, y2Ref; - SDL_bool intersected; + bool intersected; refRect.x = SDLTest_RandomIntegerInRange(1, 1024); refRect.y = SDLTest_RandomIntegerInRange(1, 1024); @@ -322,7 +322,7 @@ static int SDLCALL rect_testIntersectRectAndLineEmpty(void *arg) y2 = y2Ref; rect = refRect; intersected = SDL_GetRectAndLineIntersection(&rect, &x1, &y1, &x2, &y2); - validateIntersectRectAndLineResults(intersected, SDL_FALSE, &rect, &refRect, x1, y1, x2, y2, x1Ref, y1Ref, x2Ref, y2Ref); + validateIntersectRectAndLineResults(intersected, false, &rect, &refRect, x1, y1, x2, y2, x1Ref, y1Ref, x2Ref, y2Ref); return TEST_COMPLETED; } @@ -339,23 +339,23 @@ static int SDLCALL rect_testIntersectRectAndLineParam(void *arg) int y1 = rect.h / 2; int x2 = x1; int y2 = 2 * rect.h; - SDL_bool intersected; + bool intersected; intersected = SDL_GetRectAndLineIntersection(&rect, &x1, &y1, &x2, &y2); - SDLTest_AssertCheck(intersected == SDL_TRUE, "Check that intersection result was SDL_TRUE"); + SDLTest_AssertCheck(intersected == true, "Check that intersection result was true"); intersected = SDL_GetRectAndLineIntersection((SDL_Rect *)NULL, &x1, &y1, &x2, &y2); - SDLTest_AssertCheck(intersected == SDL_FALSE, "Check that function returns SDL_FALSE when 1st parameter is NULL"); + SDLTest_AssertCheck(intersected == false, "Check that function returns false when 1st parameter is NULL"); intersected = SDL_GetRectAndLineIntersection(&rect, (int *)NULL, &y1, &x2, &y2); - SDLTest_AssertCheck(intersected == SDL_FALSE, "Check that function returns SDL_FALSE when 2nd parameter is NULL"); + SDLTest_AssertCheck(intersected == false, "Check that function returns false when 2nd parameter is NULL"); intersected = SDL_GetRectAndLineIntersection(&rect, &x1, (int *)NULL, &x2, &y2); - SDLTest_AssertCheck(intersected == SDL_FALSE, "Check that function returns SDL_FALSE when 3rd parameter is NULL"); + SDLTest_AssertCheck(intersected == false, "Check that function returns false when 3rd parameter is NULL"); intersected = SDL_GetRectAndLineIntersection(&rect, &x1, &y1, (int *)NULL, &y2); - SDLTest_AssertCheck(intersected == SDL_FALSE, "Check that function returns SDL_FALSE when 4th parameter is NULL"); + SDLTest_AssertCheck(intersected == false, "Check that function returns false when 4th parameter is NULL"); intersected = SDL_GetRectAndLineIntersection(&rect, &x1, &y1, &x2, (int *)NULL); - SDLTest_AssertCheck(intersected == SDL_FALSE, "Check that function returns SDL_FALSE when 5th parameter is NULL"); + SDLTest_AssertCheck(intersected == false, "Check that function returns false when 5th parameter is NULL"); intersected = SDL_GetRectAndLineIntersection((SDL_Rect *)NULL, (int *)NULL, (int *)NULL, (int *)NULL, (int *)NULL); - SDLTest_AssertCheck(intersected == SDL_FALSE, "Check that function returns SDL_FALSE when all parameters are NULL"); + SDLTest_AssertCheck(intersected == false, "Check that function returns false when all parameters are NULL"); return TEST_COMPLETED; } @@ -364,13 +364,13 @@ static int SDLCALL rect_testIntersectRectAndLineParam(void *arg) * Private helper to check SDL_HasRectIntersectionFloat results */ static void validateHasIntersectionFloatResults( - SDL_bool intersection, SDL_bool expectedIntersection, + bool intersection, bool expectedIntersection, SDL_FRect *rectA, SDL_FRect *rectB) { SDLTest_AssertCheck(intersection == expectedIntersection, "Check intersection result: expected %s, got %s intersecting A (%.2f,%.2f,%.2f,%.2f) with B (%.2f,%.2f,%.2f,%.2f)", - (expectedIntersection == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - (intersection == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", + (expectedIntersection == true) ? "true" : "false", + (intersection == true) ? "true" : "false", rectA->x, rectA->y, rectA->w, rectA->h, rectB->x, rectB->y, rectB->w, rectB->h); } @@ -379,13 +379,13 @@ static void validateHasIntersectionFloatResults( * Private helper to check SDL_HasRectIntersection results */ static void validateHasIntersectionResults( - SDL_bool intersection, SDL_bool expectedIntersection, + bool intersection, bool expectedIntersection, SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB) { SDLTest_AssertCheck(intersection == expectedIntersection, "Check intersection result: expected %s, got %s intersecting A (%d,%d,%d,%d) with B (%d,%d,%d,%d)", - (expectedIntersection == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - (intersection == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", + (expectedIntersection == true) ? "true" : "false", + (intersection == true) ? "true" : "false", rectA->x, rectA->y, rectA->w, rectA->h, rectB->x, rectB->y, rectB->w, rectB->h); SDLTest_AssertCheck(rectA->x == refRectA->x && rectA->y == refRectA->y && rectA->w == refRectA->w && rectA->h == refRectA->h, @@ -402,7 +402,7 @@ static void validateHasIntersectionResults( * Private helper to check SDL_GetRectIntersection results */ static void validateIntersectRectFloatResults( - SDL_bool intersection, SDL_bool expectedIntersection, + bool intersection, bool expectedIntersection, SDL_FRect *rectA, SDL_FRect *rectB, SDL_FRect *result, SDL_FRect *expectedResult) { @@ -417,15 +417,15 @@ static void validateIntersectRectFloatResults( } SDLTest_AssertCheck(intersection == SDL_HasRectIntersectionFloat(rectA, rectB), "Check that intersection (%s) matches SDL_HasRectIntersectionFloat() result (%s)", - intersection ? "SDL_TRUE" : "SDL_FALSE", - SDL_HasRectIntersectionFloat(rectA, rectB) ? "SDL_TRUE" : "SDL_FALSE"); + intersection ? "true" : "false", + SDL_HasRectIntersectionFloat(rectA, rectB) ? "true" : "false"); } /** * Private helper to check SDL_GetRectIntersection results */ static void validateIntersectRectResults( - SDL_bool intersection, SDL_bool expectedIntersection, + bool intersection, bool expectedIntersection, SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB, SDL_Rect *result, SDL_Rect *expectedResult) { @@ -467,13 +467,13 @@ static void validateUnionRectResults( * Private helper to check SDL_RectEmptyFloat results */ static void validateRectEmptyFloatResults( - SDL_bool empty, SDL_bool expectedEmpty, + bool empty, bool expectedEmpty, SDL_FRect *rect) { SDLTest_AssertCheck(empty == expectedEmpty, "Check for correct empty result: expected %s, got %s testing (%.2f,%.2f,%.2f,%.2f)", - (expectedEmpty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - (empty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", + (expectedEmpty == true) ? "true" : "false", + (empty == true) ? "true" : "false", rect->x, rect->y, rect->w, rect->h); } @@ -481,13 +481,13 @@ static void validateRectEmptyFloatResults( * Private helper to check SDL_RectEmpty results */ static void validateRectEmptyResults( - SDL_bool empty, SDL_bool expectedEmpty, + bool empty, bool expectedEmpty, SDL_Rect *rect, SDL_Rect *refRect) { SDLTest_AssertCheck(empty == expectedEmpty, "Check for correct empty result: expected %s, got %s testing (%d,%d,%d,%d)", - (expectedEmpty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - (empty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", + (expectedEmpty == true) ? "true" : "false", + (empty == true) ? "true" : "false", rect->x, rect->y, rect->w, rect->h); SDLTest_AssertCheck(rect->x == refRect->x && rect->y == refRect->y && rect->w == refRect->w && rect->h == refRect->h, "Check that source rectangle was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", @@ -499,13 +499,13 @@ static void validateRectEmptyResults( * Private helper to check SDL_RectsEqual results */ static void validateRectEqualsResults( - SDL_bool equals, SDL_bool expectedEquals, + bool equals, bool expectedEquals, SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB) { SDLTest_AssertCheck(equals == expectedEquals, "Check for correct equals result: expected %s, got %s testing (%d,%d,%d,%d) and (%d,%d,%d,%d)", - (expectedEquals == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - (equals == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", + (expectedEquals == true) ? "true" : "false", + (equals == true) ? "true" : "false", rectA->x, rectA->y, rectA->w, rectA->h, rectB->x, rectB->y, rectB->w, rectB->h); SDLTest_AssertCheck(rectA->x == refRectA->x && rectA->y == refRectA->y && rectA->w == refRectA->w && rectA->h == refRectA->h, @@ -522,14 +522,14 @@ static void validateRectEqualsResults( * Private helper to check SDL_RectsEqualFloat results */ static void validateFRectEqualsResults( - SDL_bool equals, SDL_bool expectedEquals, + bool equals, bool expectedEquals, SDL_FRect *rectA, SDL_FRect *rectB, SDL_FRect *refRectA, SDL_FRect *refRectB) { int cmpRes; SDLTest_AssertCheck(equals == expectedEquals, "Check for correct equals result: expected %s, got %s testing (%f,%f,%f,%f) and (%f,%f,%f,%f)", - (expectedEquals == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - (equals == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", + (expectedEquals == true) ? "true" : "false", + (equals == true) ? "true" : "false", rectA->x, rectA->y, rectA->w, rectA->h, rectB->x, rectB->y, rectB->w, rectB->h); cmpRes = SDL_memcmp(rectA, refRectA, sizeof(*rectA)); @@ -555,7 +555,7 @@ static int SDLCALL rect_testIntersectRectFloat(void *arg) SDL_FRect rectB; SDL_FRect result; SDL_FRect expectedResult; - SDL_bool intersection; + bool intersection; rectA.x = 0.0f; rectA.y = 0.0f; @@ -567,7 +567,7 @@ static int SDLCALL rect_testIntersectRectFloat(void *arg) rectB.h = 1.0f; expectedResult = rectA; intersection = SDL_GetRectIntersectionFloat(&rectA, &rectB, &result); - validateIntersectRectFloatResults(intersection, SDL_TRUE, &rectA, &rectB, &result, &expectedResult); + validateIntersectRectFloatResults(intersection, true, &rectA, &rectB, &result, &expectedResult); rectA.x = 0.0f; rectA.y = 0.0f; @@ -580,7 +580,7 @@ static int SDLCALL rect_testIntersectRectFloat(void *arg) expectedResult = rectB; expectedResult.w = 0.0f; intersection = SDL_GetRectIntersectionFloat(&rectA, &rectB, &result); - validateIntersectRectFloatResults(intersection, SDL_TRUE, &rectA, &rectB, &result, &expectedResult); + validateIntersectRectFloatResults(intersection, true, &rectA, &rectB, &result, &expectedResult); rectA.x = 0.0f; rectA.y = 0.0f; @@ -594,7 +594,7 @@ static int SDLCALL rect_testIntersectRectFloat(void *arg) expectedResult.w = 0.0f; expectedResult.h = 0.0f; intersection = SDL_GetRectIntersectionFloat(&rectA, &rectB, &result); - validateIntersectRectFloatResults(intersection, SDL_TRUE, &rectA, &rectB, &result, &expectedResult); + validateIntersectRectFloatResults(intersection, true, &rectA, &rectB, &result, &expectedResult); rectA.x = 0.0f; rectA.y = 0.0f; @@ -607,7 +607,7 @@ static int SDLCALL rect_testIntersectRectFloat(void *arg) expectedResult = rectB; expectedResult.w = -1.0f; intersection = SDL_GetRectIntersectionFloat(&rectA, &rectB, &result); - validateIntersectRectFloatResults(intersection, SDL_FALSE, &rectA, &rectB, &result, &expectedResult); + validateIntersectRectFloatResults(intersection, false, &rectA, &rectB, &result, &expectedResult); return TEST_COMPLETED; } @@ -624,7 +624,7 @@ static int SDLCALL rect_testIntersectRectInside(void *arg) SDL_Rect rectA; SDL_Rect rectB; SDL_Rect result; - SDL_bool intersection; + bool intersection; /* rectB fully contained in rectA */ refRectB.x = 0; @@ -634,7 +634,7 @@ static int SDLCALL rect_testIntersectRectInside(void *arg) rectA = refRectA; rectB = refRectB; intersection = SDL_GetRectIntersection(&rectA, &rectB, &result); - validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &refRectB); + validateIntersectRectResults(intersection, true, &rectA, &rectB, &refRectA, &refRectB, &result, &refRectB); return TEST_COMPLETED; } @@ -651,7 +651,7 @@ static int SDLCALL rect_testIntersectRectOutside(void *arg) SDL_Rect rectA; SDL_Rect rectB; SDL_Rect result; - SDL_bool intersection; + bool intersection; /* rectB fully outside of rectA */ refRectB.x = refRectA.x + refRectA.w + SDLTest_RandomIntegerInRange(1, 10); @@ -661,7 +661,7 @@ static int SDLCALL rect_testIntersectRectOutside(void *arg) rectA = refRectA; rectB = refRectB; intersection = SDL_GetRectIntersection(&rectA, &rectB, &result); - validateIntersectRectResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL); + validateIntersectRectResults(intersection, false, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL); return TEST_COMPLETED; } @@ -679,7 +679,7 @@ static int SDLCALL rect_testIntersectRectPartial(void *arg) SDL_Rect rectB; SDL_Rect result; SDL_Rect expectedResult; - SDL_bool intersection; + bool intersection; /* rectB partially contained in rectA */ refRectB.x = SDLTest_RandomIntegerInRange(refRectA.x + 1, refRectA.x + refRectA.w - 1); @@ -693,7 +693,7 @@ static int SDLCALL rect_testIntersectRectPartial(void *arg) expectedResult.w = refRectA.w - refRectB.x; expectedResult.h = refRectA.h - refRectB.y; intersection = SDL_GetRectIntersection(&rectA, &rectB, &result); - validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); + validateIntersectRectResults(intersection, true, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); /* rectB right edge */ refRectB.x = rectA.w - 1; @@ -707,7 +707,7 @@ static int SDLCALL rect_testIntersectRectPartial(void *arg) expectedResult.w = 1; expectedResult.h = refRectB.h; intersection = SDL_GetRectIntersection(&rectA, &rectB, &result); - validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); + validateIntersectRectResults(intersection, true, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); /* rectB left edge */ refRectB.x = 1 - rectA.w; @@ -721,7 +721,7 @@ static int SDLCALL rect_testIntersectRectPartial(void *arg) expectedResult.w = 1; expectedResult.h = refRectB.h; intersection = SDL_GetRectIntersection(&rectA, &rectB, &result); - validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); + validateIntersectRectResults(intersection, true, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); /* rectB bottom edge */ refRectB.x = rectA.x; @@ -735,7 +735,7 @@ static int SDLCALL rect_testIntersectRectPartial(void *arg) expectedResult.w = refRectB.w; expectedResult.h = 1; intersection = SDL_GetRectIntersection(&rectA, &rectB, &result); - validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); + validateIntersectRectResults(intersection, true, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); /* rectB top edge */ refRectB.x = rectA.x; @@ -749,7 +749,7 @@ static int SDLCALL rect_testIntersectRectPartial(void *arg) expectedResult.w = refRectB.w; expectedResult.h = 1; intersection = SDL_GetRectIntersection(&rectA, &rectB, &result); - validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); + validateIntersectRectResults(intersection, true, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); return TEST_COMPLETED; } @@ -766,7 +766,7 @@ static int SDLCALL rect_testIntersectRectPoint(void *arg) SDL_Rect rectA; SDL_Rect rectB; SDL_Rect result; - SDL_bool intersection; + bool intersection; int offsetX, offsetY; /* intersecting pixels */ @@ -777,7 +777,7 @@ static int SDLCALL rect_testIntersectRectPoint(void *arg) rectA = refRectA; rectB = refRectB; intersection = SDL_GetRectIntersection(&rectA, &rectB, &result); - validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &refRectA); + validateIntersectRectResults(intersection, true, &rectA, &rectB, &refRectA, &refRectB, &result, &refRectA); /* non-intersecting pixels cases */ for (offsetX = -1; offsetX <= 1; offsetX++) { @@ -792,7 +792,7 @@ static int SDLCALL rect_testIntersectRectPoint(void *arg) rectA = refRectA; rectB = refRectB; intersection = SDL_GetRectIntersection(&rectA, &rectB, &result); - validateIntersectRectResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL); + validateIntersectRectResults(intersection, false, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL); } } } @@ -812,8 +812,8 @@ static int SDLCALL rect_testIntersectRectEmpty(void *arg) SDL_Rect rectA; SDL_Rect rectB; SDL_Rect result; - SDL_bool intersection; - SDL_bool empty; + bool intersection; + bool empty; /* Rect A empty */ result.w = SDLTest_RandomIntegerInRange(1, 100); @@ -828,9 +828,9 @@ static int SDLCALL rect_testIntersectRectEmpty(void *arg) rectA = refRectA; rectB = refRectB; intersection = SDL_GetRectIntersection(&rectA, &rectB, &result); - validateIntersectRectResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL); + validateIntersectRectResults(intersection, false, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL); empty = SDL_RectEmpty(&result); - SDLTest_AssertCheck(empty == SDL_TRUE, "Validate result is empty Rect; got: %s", (empty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE"); + SDLTest_AssertCheck(empty == true, "Validate result is empty Rect; got: %s", (empty == true) ? "true" : "false"); /* Rect B empty */ result.w = SDLTest_RandomIntegerInRange(1, 100); @@ -845,9 +845,9 @@ static int SDLCALL rect_testIntersectRectEmpty(void *arg) rectA = refRectA; rectB = refRectB; intersection = SDL_GetRectIntersection(&rectA, &rectB, &result); - validateIntersectRectResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL); + validateIntersectRectResults(intersection, false, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL); empty = SDL_RectEmpty(&result); - SDLTest_AssertCheck(empty == SDL_TRUE, "Validate result is empty Rect; got: %s", (empty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE"); + SDLTest_AssertCheck(empty == true, "Validate result is empty Rect; got: %s", (empty == true) ? "true" : "false"); /* Rect A and B empty */ result.w = SDLTest_RandomIntegerInRange(1, 100); @@ -864,9 +864,9 @@ static int SDLCALL rect_testIntersectRectEmpty(void *arg) rectA = refRectA; rectB = refRectB; intersection = SDL_GetRectIntersection(&rectA, &rectB, &result); - validateIntersectRectResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL); + validateIntersectRectResults(intersection, false, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL); empty = SDL_RectEmpty(&result); - SDLTest_AssertCheck(empty == SDL_TRUE, "Validate result is empty Rect; got: %s", (empty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE"); + SDLTest_AssertCheck(empty == true, "Validate result is empty Rect; got: %s", (empty == true) ? "true" : "false"); return TEST_COMPLETED; } @@ -881,21 +881,21 @@ static int SDLCALL rect_testIntersectRectParam(void *arg) SDL_Rect rectA; SDL_Rect rectB = { 0 }; SDL_Rect result; - SDL_bool intersection; + bool intersection; /* invalid parameter combinations */ intersection = SDL_GetRectIntersection((SDL_Rect *)NULL, &rectB, &result); - SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 1st parameter is NULL"); + SDLTest_AssertCheck(intersection == false, "Check that function returns false when 1st parameter is NULL"); intersection = SDL_GetRectIntersection(&rectA, (SDL_Rect *)NULL, &result); - SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 2nd parameter is NULL"); + SDLTest_AssertCheck(intersection == false, "Check that function returns false when 2nd parameter is NULL"); intersection = SDL_GetRectIntersection(&rectA, &rectB, (SDL_Rect *)NULL); - SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 3rd parameter is NULL"); + SDLTest_AssertCheck(intersection == false, "Check that function returns false when 3rd parameter is NULL"); intersection = SDL_GetRectIntersection((SDL_Rect *)NULL, (SDL_Rect *)NULL, &result); - SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 1st and 2nd parameters are NULL"); + SDLTest_AssertCheck(intersection == false, "Check that function returns false when 1st and 2nd parameters are NULL"); intersection = SDL_GetRectIntersection((SDL_Rect *)NULL, &rectB, (SDL_Rect *)NULL); - SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 1st and 3rd parameters are NULL "); + SDLTest_AssertCheck(intersection == false, "Check that function returns false when 1st and 3rd parameters are NULL "); intersection = SDL_GetRectIntersection((SDL_Rect *)NULL, (SDL_Rect *)NULL, (SDL_Rect *)NULL); - SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when all parameters are NULL"); + SDLTest_AssertCheck(intersection == false, "Check that function returns false when all parameters are NULL"); return TEST_COMPLETED; } @@ -911,7 +911,7 @@ static int SDLCALL rect_testHasIntersectionInside(void *arg) SDL_Rect refRectB; SDL_Rect rectA; SDL_Rect rectB; - SDL_bool intersection; + bool intersection; /* rectB fully contained in rectA */ refRectB.x = 0; @@ -921,7 +921,7 @@ static int SDLCALL rect_testHasIntersectionInside(void *arg) rectA = refRectA; rectB = refRectB; intersection = SDL_HasRectIntersection(&rectA, &rectB); - validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB); + validateHasIntersectionResults(intersection, true, &rectA, &rectB, &refRectA, &refRectB); return TEST_COMPLETED; } @@ -937,7 +937,7 @@ static int SDLCALL rect_testHasIntersectionOutside(void *arg) SDL_Rect refRectB; SDL_Rect rectA; SDL_Rect rectB; - SDL_bool intersection; + bool intersection; /* rectB fully outside of rectA */ refRectB.x = refRectA.x + refRectA.w + SDLTest_RandomIntegerInRange(1, 10); @@ -947,7 +947,7 @@ static int SDLCALL rect_testHasIntersectionOutside(void *arg) rectA = refRectA; rectB = refRectB; intersection = SDL_HasRectIntersection(&rectA, &rectB); - validateHasIntersectionResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB); + validateHasIntersectionResults(intersection, false, &rectA, &rectB, &refRectA, &refRectB); return TEST_COMPLETED; } @@ -963,7 +963,7 @@ static int SDLCALL rect_testHasIntersectionPartial(void *arg) SDL_Rect refRectB; SDL_Rect rectA; SDL_Rect rectB; - SDL_bool intersection; + bool intersection; /* rectB partially contained in rectA */ refRectB.x = SDLTest_RandomIntegerInRange(refRectA.x + 1, refRectA.x + refRectA.w - 1); @@ -973,7 +973,7 @@ static int SDLCALL rect_testHasIntersectionPartial(void *arg) rectA = refRectA; rectB = refRectB; intersection = SDL_HasRectIntersection(&rectA, &rectB); - validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB); + validateHasIntersectionResults(intersection, true, &rectA, &rectB, &refRectA, &refRectB); /* rectB right edge */ refRectB.x = rectA.w - 1; @@ -983,7 +983,7 @@ static int SDLCALL rect_testHasIntersectionPartial(void *arg) rectA = refRectA; rectB = refRectB; intersection = SDL_HasRectIntersection(&rectA, &rectB); - validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB); + validateHasIntersectionResults(intersection, true, &rectA, &rectB, &refRectA, &refRectB); /* rectB left edge */ refRectB.x = 1 - rectA.w; @@ -993,7 +993,7 @@ static int SDLCALL rect_testHasIntersectionPartial(void *arg) rectA = refRectA; rectB = refRectB; intersection = SDL_HasRectIntersection(&rectA, &rectB); - validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB); + validateHasIntersectionResults(intersection, true, &rectA, &rectB, &refRectA, &refRectB); /* rectB bottom edge */ refRectB.x = rectA.x; @@ -1003,7 +1003,7 @@ static int SDLCALL rect_testHasIntersectionPartial(void *arg) rectA = refRectA; rectB = refRectB; intersection = SDL_HasRectIntersection(&rectA, &rectB); - validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB); + validateHasIntersectionResults(intersection, true, &rectA, &rectB, &refRectA, &refRectB); /* rectB top edge */ refRectB.x = rectA.x; @@ -1013,7 +1013,7 @@ static int SDLCALL rect_testHasIntersectionPartial(void *arg) rectA = refRectA; rectB = refRectB; intersection = SDL_HasRectIntersection(&rectA, &rectB); - validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB); + validateHasIntersectionResults(intersection, true, &rectA, &rectB, &refRectA, &refRectB); return TEST_COMPLETED; } @@ -1029,7 +1029,7 @@ static int SDLCALL rect_testHasIntersectionPoint(void *arg) SDL_Rect refRectB = { 0, 0, 1, 1 }; SDL_Rect rectA; SDL_Rect rectB; - SDL_bool intersection; + bool intersection; int offsetX, offsetY; /* intersecting pixels */ @@ -1040,7 +1040,7 @@ static int SDLCALL rect_testHasIntersectionPoint(void *arg) rectA = refRectA; rectB = refRectB; intersection = SDL_HasRectIntersection(&rectA, &rectB); - validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB); + validateHasIntersectionResults(intersection, true, &rectA, &rectB, &refRectA, &refRectB); /* non-intersecting pixels cases */ for (offsetX = -1; offsetX <= 1; offsetX++) { @@ -1055,7 +1055,7 @@ static int SDLCALL rect_testHasIntersectionPoint(void *arg) rectA = refRectA; rectB = refRectB; intersection = SDL_HasRectIntersection(&rectA, &rectB); - validateHasIntersectionResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB); + validateHasIntersectionResults(intersection, false, &rectA, &rectB, &refRectA, &refRectB); } } } @@ -1074,7 +1074,7 @@ static int SDLCALL rect_testHasIntersectionEmpty(void *arg) SDL_Rect refRectB; SDL_Rect rectA; SDL_Rect rectB; - SDL_bool intersection; + bool intersection; /* Rect A empty */ refRectA.x = SDLTest_RandomIntegerInRange(1, 100); @@ -1087,7 +1087,7 @@ static int SDLCALL rect_testHasIntersectionEmpty(void *arg) rectA = refRectA; rectB = refRectB; intersection = SDL_HasRectIntersection(&rectA, &rectB); - validateHasIntersectionResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB); + validateHasIntersectionResults(intersection, false, &rectA, &rectB, &refRectA, &refRectB); /* Rect B empty */ refRectA.x = SDLTest_RandomIntegerInRange(1, 100); @@ -1100,7 +1100,7 @@ static int SDLCALL rect_testHasIntersectionEmpty(void *arg) rectA = refRectA; rectB = refRectB; intersection = SDL_HasRectIntersection(&rectA, &rectB); - validateHasIntersectionResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB); + validateHasIntersectionResults(intersection, false, &rectA, &rectB, &refRectA, &refRectB); /* Rect A and B empty */ refRectA.x = SDLTest_RandomIntegerInRange(1, 100); @@ -1115,7 +1115,7 @@ static int SDLCALL rect_testHasIntersectionEmpty(void *arg) rectA = refRectA; rectB = refRectB; intersection = SDL_HasRectIntersection(&rectA, &rectB); - validateHasIntersectionResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB); + validateHasIntersectionResults(intersection, false, &rectA, &rectB, &refRectA, &refRectB); return TEST_COMPLETED; } @@ -1129,15 +1129,15 @@ static int SDLCALL rect_testHasIntersectionParam(void *arg) { SDL_Rect rectA; SDL_Rect rectB = { 0 }; - SDL_bool intersection; + bool intersection; /* invalid parameter combinations */ intersection = SDL_HasRectIntersection((SDL_Rect *)NULL, &rectB); - SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 1st parameter is NULL"); + SDLTest_AssertCheck(intersection == false, "Check that function returns false when 1st parameter is NULL"); intersection = SDL_HasRectIntersection(&rectA, (SDL_Rect *)NULL); - SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 2nd parameter is NULL"); + SDLTest_AssertCheck(intersection == false, "Check that function returns false when 2nd parameter is NULL"); intersection = SDL_HasRectIntersection((SDL_Rect *)NULL, (SDL_Rect *)NULL); - SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when all parameters are NULL"); + SDLTest_AssertCheck(intersection == false, "Check that function returns false when all parameters are NULL"); return TEST_COMPLETED; } @@ -1159,7 +1159,7 @@ static int SDLCALL rect_testEnclosePointsFloat(void *arg) "Resulting enclosing rectangle incorrect: expected (%.2f,%.2f - %.2fx%.2f), actual (%.2f,%.2f - %.2fx%.2f)", 1.25f, 2.5f, 2.25f, 1.25f, result.x, result.y, result.w, result.h); for (i = 0; i != count; i++) { - SDL_bool inside; + bool inside; inside = SDL_PointInRectFloat(&fpts[i], &clip); SDLTest_AssertCheck(inside, @@ -1186,9 +1186,9 @@ static int SDLCALL rect_testEnclosePoints(void *arg) SDL_Point refPoints[16]; SDL_Point points[16]; SDL_Rect result; - SDL_bool anyEnclosed; - SDL_bool anyEnclosedNoResult; - SDL_bool expectedEnclosed = SDL_TRUE; + bool anyEnclosed; + bool anyEnclosedNoResult; + bool expectedEnclosed = true; int newx, newy; int minx = 0, maxx = 0, miny = 0, maxy = 0; int i; @@ -1226,8 +1226,8 @@ static int SDLCALL rect_testEnclosePoints(void *arg) anyEnclosedNoResult = SDL_GetRectEnclosingPoints(points, numPoints, NULL, (SDL_Rect *)NULL); SDLTest_AssertCheck(expectedEnclosed == anyEnclosedNoResult, "Check expected return value %s, got %s", - (expectedEnclosed == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - (anyEnclosedNoResult == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE"); + (expectedEnclosed == true) ? "true" : "false", + (anyEnclosedNoResult == true) ? "true" : "false"); for (i = 0; i < numPoints; i++) { SDLTest_AssertCheck(refPoints[i].x == points[i].x && refPoints[i].y == points[i].y, "Check that source point %i was not modified: expected (%i,%i) actual (%i,%i)", @@ -1238,8 +1238,8 @@ static int SDLCALL rect_testEnclosePoints(void *arg) anyEnclosed = SDL_GetRectEnclosingPoints(points, numPoints, NULL, &result); SDLTest_AssertCheck(expectedEnclosed == anyEnclosed, "Check return value %s, got %s", - (expectedEnclosed == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - (anyEnclosed == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE"); + (expectedEnclosed == true) ? "true" : "false", + (anyEnclosed == true) ? "true" : "false"); for (i = 0; i < numPoints; i++) { SDLTest_AssertCheck(refPoints[i].x == points[i].x && refPoints[i].y == points[i].y, "Check that source point %i was not modified: expected (%i,%i) actual (%i,%i)", @@ -1264,9 +1264,9 @@ static int SDLCALL rect_testEnclosePointsRepeatedInput(void *arg) SDL_Point refPoints[8]; SDL_Point points[8]; SDL_Rect result; - SDL_bool anyEnclosed; - SDL_bool anyEnclosedNoResult; - SDL_bool expectedEnclosed = SDL_TRUE; + bool anyEnclosed; + bool anyEnclosedNoResult; + bool expectedEnclosed = true; int newx, newy; int minx = 0, maxx = 0, miny = 0, maxy = 0; int i; @@ -1309,8 +1309,8 @@ static int SDLCALL rect_testEnclosePointsRepeatedInput(void *arg) anyEnclosedNoResult = SDL_GetRectEnclosingPoints(points, numPoints, NULL, (SDL_Rect *)NULL); SDLTest_AssertCheck(expectedEnclosed == anyEnclosedNoResult, "Check return value %s, got %s", - (expectedEnclosed == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - (anyEnclosedNoResult == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE"); + (expectedEnclosed == true) ? "true" : "false", + (anyEnclosedNoResult == true) ? "true" : "false"); for (i = 0; i < numPoints; i++) { SDLTest_AssertCheck(refPoints[i].x == points[i].x && refPoints[i].y == points[i].y, "Check that source point %i was not modified: expected (%i,%i) actual (%i,%i)", @@ -1321,8 +1321,8 @@ static int SDLCALL rect_testEnclosePointsRepeatedInput(void *arg) anyEnclosed = SDL_GetRectEnclosingPoints(points, numPoints, NULL, &result); SDLTest_AssertCheck(expectedEnclosed == anyEnclosed, "Check return value %s, got %s", - (expectedEnclosed == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - (anyEnclosed == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE"); + (expectedEnclosed == true) ? "true" : "false", + (anyEnclosed == true) ? "true" : "false"); for (i = 0; i < numPoints; i++) { SDLTest_AssertCheck(refPoints[i].x == points[i].x && refPoints[i].y == points[i].y, "Check that source point %i was not modified: expected (%i,%i) actual (%i,%i)", @@ -1348,9 +1348,9 @@ static int SDLCALL rect_testEnclosePointsWithClipping(void *arg) SDL_Rect refClip; SDL_Rect clip; SDL_Rect result; - SDL_bool anyEnclosed; - SDL_bool anyEnclosedNoResult; - SDL_bool expectedEnclosed = SDL_FALSE; + bool anyEnclosed; + bool anyEnclosedNoResult; + bool expectedEnclosed = false; int newx, newy; int minx = 0, maxx = 0, miny = 0, maxy = 0; int i; @@ -1371,7 +1371,7 @@ static int SDLCALL rect_testEnclosePointsWithClipping(void *arg) points[i].y = newy; if ((newx >= refClip.x) && (newx < (refClip.x + refClip.w)) && (newy >= refClip.y) && (newy < (refClip.y + refClip.h))) { - if (expectedEnclosed == SDL_FALSE) { + if (expectedEnclosed == false) { minx = newx; maxx = newx; miny = newy; @@ -1390,7 +1390,7 @@ static int SDLCALL rect_testEnclosePointsWithClipping(void *arg) maxy = newy; } } - expectedEnclosed = SDL_TRUE; + expectedEnclosed = true; } } @@ -1399,8 +1399,8 @@ static int SDLCALL rect_testEnclosePointsWithClipping(void *arg) anyEnclosedNoResult = SDL_GetRectEnclosingPoints(points, numPoints, &clip, NULL); SDLTest_AssertCheck(expectedEnclosed == anyEnclosedNoResult, "Expected return value %s, got %s", - (expectedEnclosed == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - (anyEnclosedNoResult == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE"); + (expectedEnclosed == true) ? "true" : "false", + (anyEnclosedNoResult == true) ? "true" : "false"); for (i = 0; i < numPoints; i++) { SDLTest_AssertCheck(refPoints[i].x == points[i].x && refPoints[i].y == points[i].y, "Check that source point %i was not modified: expected (%i,%i) actual (%i,%i)", @@ -1413,8 +1413,8 @@ static int SDLCALL rect_testEnclosePointsWithClipping(void *arg) anyEnclosed = SDL_GetRectEnclosingPoints(points, numPoints, &clip, &result); SDLTest_AssertCheck(expectedEnclosed == anyEnclosed, "Check return value %s, got %s", - (expectedEnclosed == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - (anyEnclosed == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE"); + (expectedEnclosed == true) ? "true" : "false", + (anyEnclosed == true) ? "true" : "false"); for (i = 0; i < numPoints; i++) { SDLTest_AssertCheck(refPoints[i].x == points[i].x && refPoints[i].y == points[i].y, "Check that source point %i was not modified: expected (%i,%i) actual (%i,%i)", @@ -1422,7 +1422,7 @@ static int SDLCALL rect_testEnclosePointsWithClipping(void *arg) } SDLTest_AssertCheck(refClip.x == clip.x && refClip.y == clip.y && refClip.w == clip.w && refClip.h == clip.h, "Check that source clipping rectangle was not modified"); - if (expectedEnclosed == SDL_TRUE) { + if (expectedEnclosed == true) { SDLTest_AssertCheck(result.x == minx && result.y == miny && result.w == (maxx - minx + 1) && result.h == (maxy - miny + 1), "Check resulting enclosing rectangle: expected (%i,%i - %i,%i), actual (%i,%i - %i,%i)", minx, miny, maxx, maxy, result.x, result.y, result.x + result.w - 1, result.y + result.h - 1); @@ -1431,12 +1431,12 @@ static int SDLCALL rect_testEnclosePointsWithClipping(void *arg) /* Empty clipping rectangle */ clip.w = 0; clip.h = 0; - expectedEnclosed = SDL_FALSE; + expectedEnclosed = false; anyEnclosed = SDL_GetRectEnclosingPoints(points, numPoints, &clip, &result); SDLTest_AssertCheck(expectedEnclosed == anyEnclosed, "Check return value %s, got %s", - (expectedEnclosed == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - (anyEnclosed == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE"); + (expectedEnclosed == true) ? "true" : "false", + (anyEnclosed == true) ? "true" : "false"); return TEST_COMPLETED; } @@ -1452,18 +1452,18 @@ static int SDLCALL rect_testEnclosePointsParam(void *arg) int count; SDL_Rect clip = { 0 }; SDL_Rect result; - SDL_bool anyEnclosed; + bool anyEnclosed; /* invalid parameter combinations */ anyEnclosed = SDL_GetRectEnclosingPoints((SDL_Point *)NULL, 1, &clip, &result); - SDLTest_AssertCheck(anyEnclosed == SDL_FALSE, "Check that functions returns SDL_FALSE when 1st parameter is NULL"); + SDLTest_AssertCheck(anyEnclosed == false, "Check that functions returns false when 1st parameter is NULL"); anyEnclosed = SDL_GetRectEnclosingPoints(points, 0, &clip, &result); - SDLTest_AssertCheck(anyEnclosed == SDL_FALSE, "Check that functions returns SDL_FALSE when 2nd parameter is 0"); + SDLTest_AssertCheck(anyEnclosed == false, "Check that functions returns false when 2nd parameter is 0"); count = SDLTest_RandomIntegerInRange(-100, -1); anyEnclosed = SDL_GetRectEnclosingPoints(points, count, &clip, &result); - SDLTest_AssertCheck(anyEnclosed == SDL_FALSE, "Check that functions returns SDL_FALSE when 2nd parameter is %i (negative)", count); + SDLTest_AssertCheck(anyEnclosed == false, "Check that functions returns false when 2nd parameter is %i (negative)", count); anyEnclosed = SDL_GetRectEnclosingPoints((SDL_Point *)NULL, 0, &clip, &result); - SDLTest_AssertCheck(anyEnclosed == SDL_FALSE, "Check that functions returns SDL_FALSE when 1st parameter is NULL and 2nd parameter was 0"); + SDLTest_AssertCheck(anyEnclosed == false, "Check that functions returns false when 1st parameter is NULL and 2nd parameter was 0"); return TEST_COMPLETED; } @@ -1716,35 +1716,35 @@ static int SDLCALL rect_testUnionRectParam(void *arg) static int SDLCALL rect_testRectEmptyFloat(void *arg) { SDL_FRect rect; - SDL_bool result; + bool result; rect.x = 0.0f; rect.y = 0.0f; rect.w = 1.0f; rect.h = 1.0f; result = SDL_RectEmptyFloat(&rect); - validateRectEmptyFloatResults(result, SDL_FALSE, &rect); + validateRectEmptyFloatResults(result, false, &rect); rect.x = 0.0f; rect.y = 0.0f; rect.w = 0.0f; rect.h = 0.0f; result = SDL_RectEmptyFloat(&rect); - validateRectEmptyFloatResults(result, SDL_FALSE, &rect); + validateRectEmptyFloatResults(result, false, &rect); rect.x = 0.0f; rect.y = 0.0f; rect.w = -1.0f; rect.h = 1.0f; result = SDL_RectEmptyFloat(&rect); - validateRectEmptyFloatResults(result, SDL_TRUE, &rect); + validateRectEmptyFloatResults(result, true, &rect); rect.x = 0.0f; rect.y = 0.0f; rect.w = 1.0f; rect.h = -1.0f; result = SDL_RectEmptyFloat(&rect); - validateRectEmptyFloatResults(result, SDL_TRUE, &rect); + validateRectEmptyFloatResults(result, true, &rect); return TEST_COMPLETED; @@ -1759,8 +1759,8 @@ static int SDLCALL rect_testRectEmpty(void *arg) { SDL_Rect refRect; SDL_Rect rect; - SDL_bool expectedResult; - SDL_bool result; + bool expectedResult; + bool result; int w, h; /* Non-empty case */ @@ -1768,7 +1768,7 @@ static int SDLCALL rect_testRectEmpty(void *arg) refRect.y = SDLTest_RandomIntegerInRange(-1024, 1024); refRect.w = SDLTest_RandomIntegerInRange(256, 1024); refRect.h = SDLTest_RandomIntegerInRange(256, 1024); - expectedResult = SDL_FALSE; + expectedResult = false; rect = refRect; result = SDL_RectEmpty(&rect); validateRectEmptyResults(result, expectedResult, &rect, &refRect); @@ -1781,7 +1781,7 @@ static int SDLCALL rect_testRectEmpty(void *arg) refRect.y = SDLTest_RandomIntegerInRange(-1024, 1024); refRect.w = w; refRect.h = h; - expectedResult = SDL_TRUE; + expectedResult = true; rect = refRect; result = SDL_RectEmpty(&rect); validateRectEmptyResults(result, expectedResult, &rect, &refRect); @@ -1799,11 +1799,11 @@ static int SDLCALL rect_testRectEmpty(void *arg) */ static int SDLCALL rect_testRectEmptyParam(void *arg) { - SDL_bool result; + bool result; /* invalid parameter combinations */ result = SDL_RectEmpty(NULL); - SDLTest_AssertCheck(result == SDL_TRUE, "Check that function returns TRUE when 1st parameter is NULL"); + SDLTest_AssertCheck(result == true, "Check that function returns TRUE when 1st parameter is NULL"); return TEST_COMPLETED; } @@ -1819,8 +1819,8 @@ static int SDLCALL rect_testRectEquals(void *arg) SDL_Rect refRectB; SDL_Rect rectA; SDL_Rect rectB; - SDL_bool expectedResult; - SDL_bool result; + bool expectedResult; + bool result; /* Equals */ refRectA.x = SDLTest_RandomIntegerInRange(-1024, 1024); @@ -1828,7 +1828,7 @@ static int SDLCALL rect_testRectEquals(void *arg) refRectA.w = SDLTest_RandomIntegerInRange(1, 1024); refRectA.h = SDLTest_RandomIntegerInRange(1, 1024); refRectB = refRectA; - expectedResult = SDL_TRUE; + expectedResult = true; rectA = refRectA; rectB = refRectB; result = SDL_RectsEqual(&rectA, &rectB); @@ -1846,7 +1846,7 @@ static int SDLCALL rect_testRectEqualsParam(void *arg) { SDL_Rect rectA; SDL_Rect rectB; - SDL_bool result; + bool result; /* data setup */ rectA.x = SDLTest_RandomIntegerInRange(-1024, 1024); @@ -1860,11 +1860,11 @@ static int SDLCALL rect_testRectEqualsParam(void *arg) /* invalid parameter combinations */ result = SDL_RectsEqual(NULL, &rectB); - SDLTest_AssertCheck(result == SDL_FALSE, "Check that function returns SDL_FALSE when 1st parameter is NULL"); + SDLTest_AssertCheck(result == false, "Check that function returns false when 1st parameter is NULL"); result = SDL_RectsEqual(&rectA, NULL); - SDLTest_AssertCheck(result == SDL_FALSE, "Check that function returns SDL_FALSE when 2nd parameter is NULL"); + SDLTest_AssertCheck(result == false, "Check that function returns false when 2nd parameter is NULL"); result = SDL_RectsEqual(NULL, NULL); - SDLTest_AssertCheck(result == SDL_FALSE, "Check that function returns SDL_FALSE when 1st and 2nd parameter are NULL"); + SDLTest_AssertCheck(result == false, "Check that function returns false when 1st and 2nd parameter are NULL"); return TEST_COMPLETED; } @@ -1880,8 +1880,8 @@ static int SDLCALL rect_testFRectEquals(void *arg) SDL_FRect refRectB; SDL_FRect rectA; SDL_FRect rectB; - SDL_bool expectedResult; - SDL_bool result; + bool expectedResult; + bool result; /* Equals */ refRectA.x = (float)SDLTest_RandomIntegerInRange(-1024, 1024); @@ -1889,7 +1889,7 @@ static int SDLCALL rect_testFRectEquals(void *arg) refRectA.w = (float)SDLTest_RandomIntegerInRange(1, 1024); refRectA.h = (float)SDLTest_RandomIntegerInRange(1, 1024); refRectB = refRectA; - expectedResult = SDL_TRUE; + expectedResult = true; rectA = refRectA; rectB = refRectB; result = SDL_RectsEqualFloat(&rectA, &rectB); @@ -1907,7 +1907,7 @@ static int SDLCALL rect_testFRectEqualsParam(void *arg) { SDL_FRect rectA; SDL_FRect rectB; - SDL_bool result; + bool result; /* data setup -- For the purpose of this test, the values don't matter. */ rectA.x = SDLTest_RandomFloat(); @@ -1921,11 +1921,11 @@ static int SDLCALL rect_testFRectEqualsParam(void *arg) /* invalid parameter combinations */ result = SDL_RectsEqualFloat(NULL, &rectB); - SDLTest_AssertCheck(result == SDL_FALSE, "Check that function returns SDL_FALSE when 1st parameter is NULL"); + SDLTest_AssertCheck(result == false, "Check that function returns false when 1st parameter is NULL"); result = SDL_RectsEqualFloat(&rectA, NULL); - SDLTest_AssertCheck(result == SDL_FALSE, "Check that function returns SDL_FALSE when 2nd parameter is NULL"); + SDLTest_AssertCheck(result == false, "Check that function returns false when 2nd parameter is NULL"); result = SDL_RectsEqualFloat(NULL, NULL); - SDLTest_AssertCheck(result == SDL_FALSE, "Check that function returns SDL_FALSE when 1st and 2nd parameter are NULL"); + SDLTest_AssertCheck(result == false, "Check that function returns false when 1st and 2nd parameter are NULL"); return TEST_COMPLETED; } diff --git a/test/testautomation_render.c b/test/testautomation_render.c index 2d13fe1f6..e39004117 100644 --- a/test/testautomation_render.c +++ b/test/testautomation_render.c @@ -22,9 +22,9 @@ #define CHECK_FUNC(FUNC, PARAMS) \ { \ - SDL_bool result = FUNC PARAMS; \ + bool result = FUNC PARAMS; \ if (!result) { \ - SDLTest_AssertCheck(result, "Validate result from %s, expected: SDL_TRUE, got: SDL_FALSE, %s", #FUNC, SDL_GetError()); \ + SDLTest_AssertCheck(result, "Validate result from %s, expected: true, got: false, %s", #FUNC, SDL_GetError()); \ } \ } @@ -38,8 +38,8 @@ static int clearScreen(void); static void compare(SDL_Surface *reference, int allowable_error); static void compare2x(SDL_Surface *reference, int allowable_error); static SDL_Texture *loadTestFace(void); -static SDL_bool isSupported(int code); -static SDL_bool hasDrawColor(void); +static bool isSupported(int code); +static bool hasDrawColor(void); /** * Create software renderer for tests @@ -323,7 +323,7 @@ static int SDLCALL render_testBlitTiled(void *arg) rect.w = (float)TESTRENDER_SCREEN_W; rect.h = (float)TESTRENDER_SCREEN_H; ret = SDL_RenderTextureTiled(renderer, tface, NULL, 1.0f, &rect); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate results from call to SDL_RenderTextureTiled, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Validate results from call to SDL_RenderTextureTiled, expected: true, got: %i", ret); /* See if it's the same */ referenceSurface = SDLTest_ImageBlitTiled(); @@ -344,12 +344,12 @@ static int SDLCALL render_testBlitTiled(void *arg) rect.w = (float)TESTRENDER_SCREEN_W * 2; rect.h = (float)TESTRENDER_SCREEN_H * 2; ret = SDL_RenderTextureTiled(renderer, tface, NULL, 2.0f, &rect); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate results from call to SDL_RenderTextureTiled, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Validate results from call to SDL_RenderTextureTiled, expected: true, got: %i", ret); /* See if it's the same */ referenceSurface2x = SDL_CreateSurface(referenceSurface->w * 2, referenceSurface->h * 2, referenceSurface->format); SDL_BlitSurfaceScaled(referenceSurface, NULL, referenceSurface2x, NULL, SDL_SCALEMODE_NEAREST); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate results from call to SDL_BlitSurfaceScaled, expected: 0, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Validate results from call to SDL_BlitSurfaceScaled, expected: 0, got: %i", ret); compare2x(referenceSurface2x, ALLOWABLE_ERROR_OPAQUE); /* Make current */ @@ -458,7 +458,7 @@ static int SDLCALL render_testBlit9Grid(void *arg) texture = SDL_CreateTextureFromSurface(renderer, source); SDLTest_AssertCheck(texture != NULL, "Verify source texture is not NULL"); ret = SDL_SetTextureScaleMode(texture, SDL_SCALEMODE_NEAREST); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate results from call to SDL_SetTextureScaleMode, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Validate results from call to SDL_SetTextureScaleMode, expected: true, got: %i", ret); /* 9-grid blit - 1.0 scale */ { @@ -478,7 +478,7 @@ static int SDLCALL render_testBlit9Grid(void *arg) rect.w = (float)TESTRENDER_SCREEN_W; rect.h = (float)TESTRENDER_SCREEN_H; ret = SDL_RenderTexture9Grid(renderer, texture, NULL, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, &rect); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate results from call to SDL_RenderTexture9Grid, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Validate results from call to SDL_RenderTexture9Grid, expected: true, got: %i", ret); /* See if it's the same */ compare(referenceSurface, ALLOWABLE_ERROR_OPAQUE); @@ -505,7 +505,7 @@ static int SDLCALL render_testBlit9Grid(void *arg) rect.w = (float)TESTRENDER_SCREEN_W; rect.h = (float)TESTRENDER_SCREEN_H; ret = SDL_RenderTexture9Grid(renderer, texture, NULL, 1.0f, 1.0f, 1.0f, 1.0f, 2.0f, &rect); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate results from call to SDL_RenderTexture9Grid, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Validate results from call to SDL_RenderTexture9Grid, expected: true, got: %i", ret); /* See if it's the same */ compare(referenceSurface, ALLOWABLE_ERROR_OPAQUE); @@ -554,7 +554,7 @@ static int SDLCALL render_testBlit9Grid(void *arg) texture = SDL_CreateTextureFromSurface(renderer, source); SDLTest_AssertCheck(texture != NULL, "Verify source texture is not NULL"); ret = SDL_SetTextureScaleMode(texture, SDL_SCALEMODE_NEAREST); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate results from call to SDL_SetTextureScaleMode, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Validate results from call to SDL_SetTextureScaleMode, expected: true, got: %i", ret); /* complex 9-grid blit - 1.0 scale */ { @@ -574,7 +574,7 @@ static int SDLCALL render_testBlit9Grid(void *arg) rect.w = (float)TESTRENDER_SCREEN_W; rect.h = (float)TESTRENDER_SCREEN_H; ret = SDL_RenderTexture9Grid(renderer, texture, NULL, 1.0f, 2.0f, 1.0f, 2.0f, 1.0f, &rect); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate results from call to SDL_RenderTexture9Grid, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Validate results from call to SDL_RenderTexture9Grid, expected: true, got: %i", ret); /* See if it's the same */ compare(referenceSurface, ALLOWABLE_ERROR_OPAQUE); @@ -601,7 +601,7 @@ static int SDLCALL render_testBlit9Grid(void *arg) rect.w = (float)TESTRENDER_SCREEN_W; rect.h = (float)TESTRENDER_SCREEN_H; ret = SDL_RenderTexture9Grid(renderer, texture, NULL, 1.0f, 2.0f, 1.0f, 2.0f, 2.0f, &rect); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate results from call to SDL_RenderTexture9Grid, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Validate results from call to SDL_RenderTexture9Grid, expected: true, got: %i", ret); /* See if it's the same */ compare(referenceSurface, ALLOWABLE_ERROR_OPAQUE); @@ -730,7 +730,7 @@ static void testBlendModeOperation(TestRenderOperation op, int mode, SDL_PixelFo if (SDL_ISPIXELFORMAT_ALPHA(dst_format)) { SDL_BlendMode blendMode = SDL_BLENDMODE_NONE; ret = SDL_GetTextureBlendMode(dst, &blendMode); - SDLTest_AssertCheck(ret == SDL_TRUE, "Verify result from SDL_GetTextureBlendMode(), expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Verify result from SDL_GetTextureBlendMode(), expected: true, got: %i", ret); SDLTest_AssertCheck(blendMode == SDL_BLENDMODE_BLEND, "Verify alpha texture blend mode, expected %d, got %" SDL_PRIu32, SDL_BLENDMODE_BLEND, blendMode); } @@ -742,10 +742,10 @@ static void testBlendModeOperation(TestRenderOperation op, int mode, SDL_PixelFo dstA = 255; } ret = SDL_SetRenderDrawColor(renderer, dstR, dstG, dstB, dstA); - SDLTest_AssertCheck(ret == SDL_TRUE, "Verify result from SDL_SetRenderDrawColor(), expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Verify result from SDL_SetRenderDrawColor(), expected: true, got: %i", ret); ret = SDL_RenderClear(renderer); SDLTest_AssertPass("Call to SDL_RenderClear()"); - SDLTest_AssertCheck(ret == SDL_TRUE, "Verify result from SDL_RenderClear, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Verify result from SDL_RenderClear, expected: true, got: %i", ret); if (op == TEST_RENDER_COPY_XRGB || op == TEST_RENDER_COPY_ARGB) { Uint8 pixels[4]; @@ -771,26 +771,26 @@ static void testBlendModeOperation(TestRenderOperation op, int mode, SDL_PixelFo if (mode >= 0) { ret = SDL_SetTextureBlendMode(src, (SDL_BlendMode)mode); SDLTest_AssertPass("Call to SDL_SetTextureBlendMode()"); - SDLTest_AssertCheck(ret == SDL_TRUE, "Verify result from SDL_SetTextureBlendMode(..., %i), expected: SDL_TRUE, got: %i", mode, ret); + SDLTest_AssertCheck(ret == true, "Verify result from SDL_SetTextureBlendMode(..., %i), expected: true, got: %i", mode, ret); } else { ret = SDL_SetTextureBlendMode(src, SDL_BLENDMODE_BLEND); SDLTest_AssertPass("Call to SDL_SetTextureBlendMode()"); - SDLTest_AssertCheck(ret == SDL_TRUE, "Verify result from SDL_SetTextureBlendMode(..., %i), expected: SDL_TRUE, got: %i", mode, ret); + SDLTest_AssertCheck(ret == true, "Verify result from SDL_SetTextureBlendMode(..., %i), expected: true, got: %i", mode, ret); } } else { /* Set draw color */ ret = SDL_SetRenderDrawColor(renderer, srcR, srcG, srcB, srcA); - SDLTest_AssertCheck(ret == SDL_TRUE, "Verify result from SDL_SetRenderDrawColor(), expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Verify result from SDL_SetRenderDrawColor(), expected: true, got: %i", ret); /* Set blend mode. */ if (mode >= 0) { ret = SDL_SetRenderDrawBlendMode(renderer, (SDL_BlendMode)mode); SDLTest_AssertPass("Call to SDL_SetRenderDrawBlendMode()"); - SDLTest_AssertCheck(ret == SDL_TRUE, "Verify result from SDL_SetRenderDrawBlendMode(..., %i), expected: SDL_TRUE, got: %i", mode, ret); + SDLTest_AssertCheck(ret == true, "Verify result from SDL_SetRenderDrawBlendMode(..., %i), expected: true, got: %i", mode, ret); } else { ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND); SDLTest_AssertPass("Call to SDL_SetRenderDrawBlendMode()"); - SDLTest_AssertCheck(ret == SDL_TRUE, "Verify result from SDL_SetRenderDrawBlendMode(..., %i), expected: SDL_TRUE, got: %i", mode, ret); + SDLTest_AssertCheck(ret == true, "Verify result from SDL_SetRenderDrawBlendMode(..., %i), expected: true, got: %i", mode, ret); } } @@ -800,7 +800,7 @@ static void testBlendModeOperation(TestRenderOperation op, int mode, SDL_PixelFo case -1: mode_name = "color modulation"; ret = SDL_SetTextureColorMod(src, srcR, srcG, srcB); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate results from calls to SDL_SetTextureColorMod, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Validate results from calls to SDL_SetTextureColorMod, expected: true, got: %i", ret); expectedR = (Uint8)SDL_roundf(SDL_clamp((FLOAT(srcR) * FLOAT(srcR)) * FLOAT(srcA) + FLOAT(dstR) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); expectedG = (Uint8)SDL_roundf(SDL_clamp((FLOAT(srcG) * FLOAT(srcG)) * FLOAT(srcA) + FLOAT(dstG) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); expectedB = (Uint8)SDL_roundf(SDL_clamp((FLOAT(srcB) * FLOAT(srcB)) * FLOAT(srcA) + FLOAT(dstB) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); @@ -809,7 +809,7 @@ static void testBlendModeOperation(TestRenderOperation op, int mode, SDL_PixelFo case -2: mode_name = "alpha modulation"; ret = SDL_SetTextureAlphaMod(src, srcA); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate results from calls to SDL_SetTextureAlphaMod, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Validate results from calls to SDL_SetTextureAlphaMod, expected: true, got: %i", ret); expectedR = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcR) * (FLOAT(srcA) * FLOAT(srcA)) + FLOAT(dstR) * (1.0f - (FLOAT(srcA) * FLOAT(srcA))), 0.0f, 1.0f) * 255.0f); expectedG = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcG) * (FLOAT(srcA) * FLOAT(srcA)) + FLOAT(dstG) * (1.0f - (FLOAT(srcA) * FLOAT(srcA))), 0.0f, 1.0f) * 255.0f); expectedB = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcB) * (FLOAT(srcA) * FLOAT(srcA)) + FLOAT(dstB) * (1.0f - (FLOAT(srcA) * FLOAT(srcA))), 0.0f, 1.0f) * 255.0f); @@ -873,23 +873,23 @@ static void testBlendModeOperation(TestRenderOperation op, int mode, SDL_PixelFo case TEST_RENDER_POINT: operation = "render point"; ret = SDL_RenderPoint(renderer, 0.0f, 0.0f); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate results from calls to SDL_RenderPoint, expected: 0, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Validate results from calls to SDL_RenderPoint, expected: 0, got: %i", ret); break; case TEST_RENDER_LINE: operation = "render line"; ret = SDL_RenderLine(renderer, 0.0f, 0.0f, 2.0f, 2.0f); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate results from calls to SDL_RenderLine, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Validate results from calls to SDL_RenderLine, expected: true, got: %i", ret); break; case TEST_RENDER_RECT: operation = "render rect"; ret = SDL_RenderFillRect(renderer, NULL); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate results from calls to SDL_RenderFillRect, expected: 0, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Validate results from calls to SDL_RenderFillRect, expected: 0, got: %i", ret); break; case TEST_RENDER_COPY_XRGB: case TEST_RENDER_COPY_ARGB: operation = (op == TEST_RENDER_COPY_XRGB) ? "render XRGB" : "render ARGB"; ret = SDL_RenderTexture(renderer, src, NULL, NULL); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate results from calls to SDL_RenderTexture, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Validate results from calls to SDL_RenderTexture, expected: true, got: %i", ret); break; default: SDLTest_LogError("Invalid blending operation: %d", op); @@ -1251,9 +1251,9 @@ static int SDLCALL render_testLogicalSize(void *arg) /** * Checks to see if functionality is supported. Helper function. */ -static SDL_bool isSupported(int code) +static bool isSupported(int code) { - return (code != SDL_FALSE); + return (code != false); } /** @@ -1262,7 +1262,7 @@ static SDL_bool isSupported(int code) * \sa SDL_SetRenderDrawColor * \sa SDL_GetRenderDrawColor */ -static SDL_bool hasDrawColor(void) +static bool hasDrawColor(void) { int ret, fail; Uint8 r, g, b, a; @@ -1287,13 +1287,13 @@ static SDL_bool hasDrawColor(void) /* Something failed, consider not available. */ if (fail) { - return SDL_FALSE; + return false; } /* Not set properly, consider failed. */ else if ((r != 100) || (g != 100) || (b != 100) || (a != 100)) { - return SDL_FALSE; + return false; } - return SDL_TRUE; + return true; } /** @@ -1415,18 +1415,18 @@ clearScreen(void) /* Set color. */ ret = SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate result from SDL_SetRenderDrawColor, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Validate result from SDL_SetRenderDrawColor, expected: true, got: %i", ret); /* Clear screen. */ ret = SDL_RenderClear(renderer); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate result from SDL_RenderClear, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Validate result from SDL_RenderClear, expected: true, got: %i", ret); /* Set defaults. */ ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate result from SDL_SetRenderDrawBlendMode, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Validate result from SDL_SetRenderDrawBlendMode, expected: true, got: %i", ret); ret = SDL_SetRenderDrawColor(renderer, 255, 255, 255, SDL_ALPHA_OPAQUE); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate result from SDL_SetRenderDrawColor, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Validate result from SDL_SetRenderDrawColor, expected: true, got: %i", ret); return 0; } diff --git a/test/testautomation_sdltest.c b/test/testautomation_sdltest.c index ebf2d643d..9a07b024d 100644 --- a/test/testautomation_sdltest.c +++ b/test/testautomation_sdltest.c @@ -147,88 +147,88 @@ static int SDLCALL sdltest_randomBoundaryNumberUint8(void *arg) SDL_ClearError(); SDLTest_AssertPass("SDL_ClearError()"); - /* RandomUintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ - uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 10, SDL_TRUE); + /* RandomUintXBoundaryValue(10, 10, true) returns 10 */ + uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 10, true); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (10,10,true); expected: 10, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ - uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 11, SDL_TRUE); + /* RandomUintXBoundaryValue(10, 11, true) returns 10, 11 */ + uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 11, true); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (10,11,true); expected: 10|11, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ - uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 12, SDL_TRUE); + /* RandomUintXBoundaryValue(10, 12, true) returns 10, 11, 12 */ + uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 12, true); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (10,12,true); expected: 10|11|12, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ - uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 13, SDL_TRUE); + /* RandomUintXBoundaryValue(10, 13, true) returns 10, 11, 12, 13 */ + uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 13, true); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (10,13,true); expected: 10|11|12|13, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ - uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 20, SDL_TRUE); + /* RandomUintXBoundaryValue(10, 20, true) returns 10, 11, 19 or 20 */ + uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 20, true); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (10,20,true); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ - uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(20, 10, SDL_TRUE); + /* RandomUintXBoundaryValue(20, 10, true) returns 10, 11, 19 or 20 */ + uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(20, 10, true); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (20,10,true); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ - uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(1, 20, SDL_FALSE); + /* RandomUintXBoundaryValue(1, 20, false) returns 0, 21 */ + uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(1, 20, false); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 0 || uresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (1,20,false); expected: 0|21, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */ - uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(0, 99, SDL_FALSE); + /* RandomUintXBoundaryValue(0, 99, false) returns 100 */ + uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(0, 99, false); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 100, - "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (0,99,false); expected: 100, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(1, 0xff, SDL_FALSE) returns 0 (no error) */ - uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(1, 255, SDL_FALSE); + /* RandomUintXBoundaryValue(1, 0xff, false) returns 0 (no error) */ + uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(1, 255, false); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 0, - "Validate result value for parameters (1,255,SDL_FALSE); expected: 0, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (1,255,false); expected: 0, got: %" SDL_PRIs64, uresult); lastError = SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - /* RandomUintXBoundaryValue(0, 0xfe, SDL_FALSE) returns 0xff (no error) */ - uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(0, 254, SDL_FALSE); + /* RandomUintXBoundaryValue(0, 0xfe, false) returns 0xff (no error) */ + uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(0, 254, false); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 0xff, - "Validate result value for parameters (0,254,SDL_FALSE); expected: 0xff, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (0,254,false); expected: 0xff, got: %" SDL_PRIs64, uresult); lastError = SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - /* RandomUintXBoundaryValue(0, 0xff, SDL_FALSE) returns 0 (sets error) */ - uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(0, 255, SDL_FALSE); + /* RandomUintXBoundaryValue(0, 0xff, false) returns 0 (sets error) */ + uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(0, 255, false); SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); SDLTest_AssertCheck( uresult == 0, - "Validate result value for parameters(0,255,SDL_FALSE); expected: 0, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters(0,255,false); expected: 0, got: %" SDL_PRIs64, uresult); lastError = SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, @@ -256,88 +256,88 @@ static int SDLCALL sdltest_randomBoundaryNumberUint16(void *arg) SDL_ClearError(); SDLTest_AssertPass("SDL_ClearError()"); - /* RandomUintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ - uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 10, SDL_TRUE); + /* RandomUintXBoundaryValue(10, 10, true) returns 10 */ + uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 10, true); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (10,10,true); expected: 10, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ - uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 11, SDL_TRUE); + /* RandomUintXBoundaryValue(10, 11, true) returns 10, 11 */ + uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 11, true); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (10,11,true); expected: 10|11, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ - uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 12, SDL_TRUE); + /* RandomUintXBoundaryValue(10, 12, true) returns 10, 11, 12 */ + uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 12, true); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (10,12,true); expected: 10|11|12, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ - uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 13, SDL_TRUE); + /* RandomUintXBoundaryValue(10, 13, true) returns 10, 11, 12, 13 */ + uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 13, true); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (10,13,true); expected: 10|11|12|13, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ - uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 20, SDL_TRUE); + /* RandomUintXBoundaryValue(10, 20, true) returns 10, 11, 19 or 20 */ + uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 20, true); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (10,20,true); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ - uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(20, 10, SDL_TRUE); + /* RandomUintXBoundaryValue(20, 10, true) returns 10, 11, 19 or 20 */ + uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(20, 10, true); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (20,10,true); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ - uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(1, 20, SDL_FALSE); + /* RandomUintXBoundaryValue(1, 20, false) returns 0, 21 */ + uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(1, 20, false); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 0 || uresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (1,20,false); expected: 0|21, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */ - uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(0, 99, SDL_FALSE); + /* RandomUintXBoundaryValue(0, 99, false) returns 100 */ + uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(0, 99, false); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 100, - "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (0,99,false); expected: 100, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(1, 0xffff, SDL_FALSE) returns 0 (no error) */ - uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(1, 0xffff, SDL_FALSE); + /* RandomUintXBoundaryValue(1, 0xffff, false) returns 0 (no error) */ + uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(1, 0xffff, false); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 0, - "Validate result value for parameters (1,0xffff,SDL_FALSE); expected: 0, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (1,0xffff,false); expected: 0, got: %" SDL_PRIs64, uresult); lastError = SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - /* RandomUintXBoundaryValue(0, 0xfffe, SDL_FALSE) returns 0xffff (no error) */ - uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(0, 0xfffe, SDL_FALSE); + /* RandomUintXBoundaryValue(0, 0xfffe, false) returns 0xffff (no error) */ + uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(0, 0xfffe, false); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 0xffff, - "Validate result value for parameters (0,0xfffe,SDL_FALSE); expected: 0xffff, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (0,0xfffe,false); expected: 0xffff, got: %" SDL_PRIs64, uresult); lastError = SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - /* RandomUintXBoundaryValue(0, 0xffff, SDL_FALSE) returns 0 (sets error) */ - uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(0, 0xffff, SDL_FALSE); + /* RandomUintXBoundaryValue(0, 0xffff, false) returns 0 (sets error) */ + uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(0, 0xffff, false); SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); SDLTest_AssertCheck( uresult == 0, - "Validate result value for parameters(0,0xffff,SDL_FALSE); expected: 0, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters(0,0xffff,false); expected: 0, got: %" SDL_PRIs64, uresult); lastError = SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, @@ -365,88 +365,88 @@ static int SDLCALL sdltest_randomBoundaryNumberUint32(void *arg) SDL_ClearError(); SDLTest_AssertPass("SDL_ClearError()"); - /* RandomUintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ - uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 10, SDL_TRUE); + /* RandomUintXBoundaryValue(10, 10, true) returns 10 */ + uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 10, true); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (10,10,true); expected: 10, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ - uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 11, SDL_TRUE); + /* RandomUintXBoundaryValue(10, 11, true) returns 10, 11 */ + uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 11, true); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (10,11,true); expected: 10|11, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ - uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 12, SDL_TRUE); + /* RandomUintXBoundaryValue(10, 12, true) returns 10, 11, 12 */ + uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 12, true); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (10,12,true); expected: 10|11|12, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ - uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 13, SDL_TRUE); + /* RandomUintXBoundaryValue(10, 13, true) returns 10, 11, 12, 13 */ + uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 13, true); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (10,13,true); expected: 10|11|12|13, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ - uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 20, SDL_TRUE); + /* RandomUintXBoundaryValue(10, 20, true) returns 10, 11, 19 or 20 */ + uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 20, true); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (10,20,true); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ - uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(20, 10, SDL_TRUE); + /* RandomUintXBoundaryValue(20, 10, true) returns 10, 11, 19 or 20 */ + uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(20, 10, true); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (20,10,true); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ - uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(1, 20, SDL_FALSE); + /* RandomUintXBoundaryValue(1, 20, false) returns 0, 21 */ + uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(1, 20, false); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 0 || uresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (1,20,false); expected: 0|21, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */ - uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(0, 99, SDL_FALSE); + /* RandomUintXBoundaryValue(0, 99, false) returns 100 */ + uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(0, 99, false); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 100, - "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (0,99,false); expected: 100, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(1, 0xffffffff, SDL_FALSE) returns 0 (no error) */ - uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(1, 0xffffffff, SDL_FALSE); + /* RandomUintXBoundaryValue(1, 0xffffffff, false) returns 0 (no error) */ + uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(1, 0xffffffff, false); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 0, - "Validate result value for parameters (1,0xffffffff,SDL_FALSE); expected: 0, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (1,0xffffffff,false); expected: 0, got: %" SDL_PRIs64, uresult); lastError = SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - /* RandomUintXBoundaryValue(0, 0xfffffffe, SDL_FALSE) returns 0xffffffff (no error) */ - uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(0, 0xfffffffe, SDL_FALSE); + /* RandomUintXBoundaryValue(0, 0xfffffffe, false) returns 0xffffffff (no error) */ + uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(0, 0xfffffffe, false); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 0xffffffff, - "Validate result value for parameters (0,0xfffffffe,SDL_FALSE); expected: 0xffffffff, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (0,0xfffffffe,false); expected: 0xffffffff, got: %" SDL_PRIs64, uresult); lastError = SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - /* RandomUintXBoundaryValue(0, 0xffffffff, SDL_FALSE) returns 0 (sets error) */ - uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(0, 0xffffffff, SDL_FALSE); + /* RandomUintXBoundaryValue(0, 0xffffffff, false) returns 0 (sets error) */ + uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(0, 0xffffffff, false); SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); SDLTest_AssertCheck( uresult == 0, - "Validate result value for parameters(0,0xffffffff,SDL_FALSE); expected: 0, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters(0,0xffffffff,false); expected: 0, got: %" SDL_PRIs64, uresult); lastError = SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, @@ -474,88 +474,88 @@ static int SDLCALL sdltest_randomBoundaryNumberUint64(void *arg) SDL_ClearError(); SDLTest_AssertPass("SDL_ClearError()"); - /* RandomUintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ - uresult = SDLTest_RandomUint64BoundaryValue(10, 10, SDL_TRUE); + /* RandomUintXBoundaryValue(10, 10, true) returns 10 */ + uresult = SDLTest_RandomUint64BoundaryValue(10, 10, true); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (10,10,true); expected: 10, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ - uresult = SDLTest_RandomUint64BoundaryValue(10, 11, SDL_TRUE); + /* RandomUintXBoundaryValue(10, 11, true) returns 10, 11 */ + uresult = SDLTest_RandomUint64BoundaryValue(10, 11, true); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (10,11,true); expected: 10|11, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ - uresult = SDLTest_RandomUint64BoundaryValue(10, 12, SDL_TRUE); + /* RandomUintXBoundaryValue(10, 12, true) returns 10, 11, 12 */ + uresult = SDLTest_RandomUint64BoundaryValue(10, 12, true); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (10,12,true); expected: 10|11|12, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ - uresult = SDLTest_RandomUint64BoundaryValue(10, 13, SDL_TRUE); + /* RandomUintXBoundaryValue(10, 13, true) returns 10, 11, 12, 13 */ + uresult = SDLTest_RandomUint64BoundaryValue(10, 13, true); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (10,13,true); expected: 10|11|12|13, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ - uresult = SDLTest_RandomUint64BoundaryValue(10, 20, SDL_TRUE); + /* RandomUintXBoundaryValue(10, 20, true) returns 10, 11, 19 or 20 */ + uresult = SDLTest_RandomUint64BoundaryValue(10, 20, true); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (10,20,true); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ - uresult = SDLTest_RandomUint64BoundaryValue(20, 10, SDL_TRUE); + /* RandomUintXBoundaryValue(20, 10, true) returns 10, 11, 19 or 20 */ + uresult = SDLTest_RandomUint64BoundaryValue(20, 10, true); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (20,10,true); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ - uresult = SDLTest_RandomUint64BoundaryValue(1, 20, SDL_FALSE); + /* RandomUintXBoundaryValue(1, 20, false) returns 0, 21 */ + uresult = SDLTest_RandomUint64BoundaryValue(1, 20, false); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 0 || uresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (1,20,false); expected: 0|21, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */ - uresult = SDLTest_RandomUint64BoundaryValue(0, 99, SDL_FALSE); + /* RandomUintXBoundaryValue(0, 99, false) returns 100 */ + uresult = SDLTest_RandomUint64BoundaryValue(0, 99, false); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 100, - "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (0,99,false); expected: 100, got: %" SDL_PRIs64, uresult); - /* RandomUintXBoundaryValue(1, 0xffffffffffffffff, SDL_FALSE) returns 0 (no error) */ - uresult = SDLTest_RandomUint64BoundaryValue(1, 0xffffffffffffffffULL, SDL_FALSE); + /* RandomUintXBoundaryValue(1, 0xffffffffffffffff, false) returns 0 (no error) */ + uresult = SDLTest_RandomUint64BoundaryValue(1, 0xffffffffffffffffULL, false); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 0, - "Validate result value for parameters (1,0xffffffffffffffff,SDL_FALSE); expected: 0, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (1,0xffffffffffffffff,false); expected: 0, got: %" SDL_PRIs64, uresult); lastError = SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - /* RandomUintXBoundaryValue(0, 0xfffffffffffffffe, SDL_FALSE) returns 0xffffffffffffffff (no error) */ - uresult = SDLTest_RandomUint64BoundaryValue(0, 0xfffffffffffffffeULL, SDL_FALSE); + /* RandomUintXBoundaryValue(0, 0xfffffffffffffffe, false) returns 0xffffffffffffffff (no error) */ + uresult = SDLTest_RandomUint64BoundaryValue(0, 0xfffffffffffffffeULL, false); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 0xffffffffffffffffULL, - "Validate result value for parameters (0,0xfffffffffffffffe,SDL_FALSE); expected: 0xffffffffffffffff, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters (0,0xfffffffffffffffe,false); expected: 0xffffffffffffffff, got: %" SDL_PRIs64, uresult); lastError = SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - /* RandomUintXBoundaryValue(0, 0xffffffffffffffff, SDL_FALSE) returns 0 (sets error) */ - uresult = SDLTest_RandomUint64BoundaryValue(0, 0xffffffffffffffffULL, SDL_FALSE); + /* RandomUintXBoundaryValue(0, 0xffffffffffffffff, false) returns 0 (sets error) */ + uresult = SDLTest_RandomUint64BoundaryValue(0, 0xffffffffffffffffULL, false); SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); SDLTest_AssertCheck( uresult == 0, - "Validate result value for parameters(0,0xffffffffffffffff,SDL_FALSE); expected: 0, got: %" SDL_PRIs64, uresult); + "Validate result value for parameters(0,0xffffffffffffffff,false); expected: 0, got: %" SDL_PRIs64, uresult); lastError = SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, @@ -583,88 +583,88 @@ static int SDLCALL sdltest_randomBoundaryNumberSint8(void *arg) SDL_ClearError(); SDLTest_AssertPass("SDL_ClearError()"); - /* RandomSintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ - sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 10, SDL_TRUE); + /* RandomSintXBoundaryValue(10, 10, true) returns 10 */ + sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 10, true); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (10,10,true); expected: 10, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ - sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 11, SDL_TRUE); + /* RandomSintXBoundaryValue(10, 11, true) returns 10, 11 */ + sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 11, true); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (10,11,true); expected: 10|11, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ - sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 12, SDL_TRUE); + /* RandomSintXBoundaryValue(10, 12, true) returns 10, 11, 12 */ + sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 12, true); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (10,12,true); expected: 10|11|12, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ - sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 13, SDL_TRUE); + /* RandomSintXBoundaryValue(10, 13, true) returns 10, 11, 12, 13 */ + sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 13, true); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (10,13,true); expected: 10|11|12|13, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ - sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 20, SDL_TRUE); + /* RandomSintXBoundaryValue(10, 20, true) returns 10, 11, 19 or 20 */ + sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 20, true); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (10,20,true); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ - sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(20, 10, SDL_TRUE); + /* RandomSintXBoundaryValue(20, 10, true) returns 10, 11, 19 or 20 */ + sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(20, 10, true); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (20,10,true); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ - sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(1, 20, SDL_FALSE); + /* RandomSintXBoundaryValue(1, 20, false) returns 0, 21 */ + sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(1, 20, false); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 0 || sresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (1,20,false); expected: 0|21, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(SCHAR_MIN, 99, SDL_FALSE) returns 100 */ - sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN, 99, SDL_FALSE); + /* RandomSintXBoundaryValue(SCHAR_MIN, 99, false) returns 100 */ + sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN, 99, false); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == 100, - "Validate result value for parameters (SCHAR_MIN,99,SDL_FALSE); expected: 100, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (SCHAR_MIN,99,false); expected: 100, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(SCHAR_MIN + 1, SCHAR_MAX, SDL_FALSE) returns SCHAR_MIN (no error) */ - sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN + 1, SCHAR_MAX, SDL_FALSE); + /* RandomSintXBoundaryValue(SCHAR_MIN + 1, SCHAR_MAX, false) returns SCHAR_MIN (no error) */ + sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN + 1, SCHAR_MAX, false); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == SCHAR_MIN, - "Validate result value for parameters (SCHAR_MIN + 1,SCHAR_MAX,SDL_FALSE); expected: %d, got: %" SDL_PRIs64, SCHAR_MIN, sresult); + "Validate result value for parameters (SCHAR_MIN + 1,SCHAR_MAX,false); expected: %d, got: %" SDL_PRIs64, SCHAR_MIN, sresult); lastError = SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - /* RandomSintXBoundaryValue(SCHAR_MIN, SCHAR_MAX - 1, SDL_FALSE) returns SCHAR_MAX (no error) */ - sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN, SCHAR_MAX - 1, SDL_FALSE); + /* RandomSintXBoundaryValue(SCHAR_MIN, SCHAR_MAX - 1, false) returns SCHAR_MAX (no error) */ + sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN, SCHAR_MAX - 1, false); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == SCHAR_MAX, - "Validate result value for parameters (SCHAR_MIN,SCHAR_MAX - 1,SDL_FALSE); expected: %d, got: %" SDL_PRIs64, SCHAR_MAX, sresult); + "Validate result value for parameters (SCHAR_MIN,SCHAR_MAX - 1,false); expected: %d, got: %" SDL_PRIs64, SCHAR_MAX, sresult); lastError = SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - /* RandomSintXBoundaryValue(SCHAR_MIN, SCHAR_MAX, SDL_FALSE) returns SCHAR_MIN (sets error) */ - sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN, SCHAR_MAX, SDL_FALSE); + /* RandomSintXBoundaryValue(SCHAR_MIN, SCHAR_MAX, false) returns SCHAR_MIN (sets error) */ + sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN, SCHAR_MAX, false); SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); SDLTest_AssertCheck( sresult == SCHAR_MIN, - "Validate result value for parameters(SCHAR_MIN,SCHAR_MAX,SDL_FALSE); expected: %d, got: %" SDL_PRIs64, SCHAR_MIN, sresult); + "Validate result value for parameters(SCHAR_MIN,SCHAR_MAX,false); expected: %d, got: %" SDL_PRIs64, SCHAR_MIN, sresult); lastError = SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, @@ -692,88 +692,88 @@ static int SDLCALL sdltest_randomBoundaryNumberSint16(void *arg) SDL_ClearError(); SDLTest_AssertPass("SDL_ClearError()"); - /* RandomSintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ - sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 10, SDL_TRUE); + /* RandomSintXBoundaryValue(10, 10, true) returns 10 */ + sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 10, true); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (10,10,true); expected: 10, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ - sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 11, SDL_TRUE); + /* RandomSintXBoundaryValue(10, 11, true) returns 10, 11 */ + sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 11, true); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (10,11,true); expected: 10|11, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ - sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 12, SDL_TRUE); + /* RandomSintXBoundaryValue(10, 12, true) returns 10, 11, 12 */ + sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 12, true); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (10,12,true); expected: 10|11|12, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ - sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 13, SDL_TRUE); + /* RandomSintXBoundaryValue(10, 13, true) returns 10, 11, 12, 13 */ + sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 13, true); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (10,13,true); expected: 10|11|12|13, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ - sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 20, SDL_TRUE); + /* RandomSintXBoundaryValue(10, 20, true) returns 10, 11, 19 or 20 */ + sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 20, true); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (10,20,true); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ - sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(20, 10, SDL_TRUE); + /* RandomSintXBoundaryValue(20, 10, true) returns 10, 11, 19 or 20 */ + sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(20, 10, true); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (20,10,true); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ - sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(1, 20, SDL_FALSE); + /* RandomSintXBoundaryValue(1, 20, false) returns 0, 21 */ + sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(1, 20, false); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 0 || sresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (1,20,false); expected: 0|21, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(SHRT_MIN, 99, SDL_FALSE) returns 100 */ - sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN, 99, SDL_FALSE); + /* RandomSintXBoundaryValue(SHRT_MIN, 99, false) returns 100 */ + sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN, 99, false); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == 100, - "Validate result value for parameters (SHRT_MIN,99,SDL_FALSE); expected: 100, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (SHRT_MIN,99,false); expected: 100, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(SHRT_MIN + 1, SHRT_MAX, SDL_FALSE) returns SHRT_MIN (no error) */ - sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN + 1, SHRT_MAX, SDL_FALSE); + /* RandomSintXBoundaryValue(SHRT_MIN + 1, SHRT_MAX, false) returns SHRT_MIN (no error) */ + sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN + 1, SHRT_MAX, false); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == SHRT_MIN, - "Validate result value for parameters (SHRT_MIN+1,SHRT_MAX,SDL_FALSE); expected: %d, got: %" SDL_PRIs64, SHRT_MIN, sresult); + "Validate result value for parameters (SHRT_MIN+1,SHRT_MAX,false); expected: %d, got: %" SDL_PRIs64, SHRT_MIN, sresult); lastError = SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - /* RandomSintXBoundaryValue(SHRT_MIN, SHRT_MAX - 1, SDL_FALSE) returns SHRT_MAX (no error) */ - sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN, SHRT_MAX - 1, SDL_FALSE); + /* RandomSintXBoundaryValue(SHRT_MIN, SHRT_MAX - 1, false) returns SHRT_MAX (no error) */ + sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN, SHRT_MAX - 1, false); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == SHRT_MAX, - "Validate result value for parameters (SHRT_MIN,SHRT_MAX - 1,SDL_FALSE); expected: %d, got: %" SDL_PRIs64, SHRT_MAX, sresult); + "Validate result value for parameters (SHRT_MIN,SHRT_MAX - 1,false); expected: %d, got: %" SDL_PRIs64, SHRT_MAX, sresult); lastError = SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - /* RandomSintXBoundaryValue(SHRT_MIN, SHRT_MAX, SDL_FALSE) returns 0 (sets error) */ - sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN, SHRT_MAX, SDL_FALSE); + /* RandomSintXBoundaryValue(SHRT_MIN, SHRT_MAX, false) returns 0 (sets error) */ + sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN, SHRT_MAX, false); SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); SDLTest_AssertCheck( sresult == SHRT_MIN, - "Validate result value for parameters(SHRT_MIN,SHRT_MAX,SDL_FALSE); expected: %d, got: %" SDL_PRIs64, SHRT_MIN, sresult); + "Validate result value for parameters(SHRT_MIN,SHRT_MAX,false); expected: %d, got: %" SDL_PRIs64, SHRT_MIN, sresult); lastError = SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, @@ -808,88 +808,88 @@ static int SDLCALL sdltest_randomBoundaryNumberSint32(void *arg) SDL_ClearError(); SDLTest_AssertPass("SDL_ClearError()"); - /* RandomSintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ - sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 10, SDL_TRUE); + /* RandomSintXBoundaryValue(10, 10, true) returns 10 */ + sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 10, true); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (10,10,true); expected: 10, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ - sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 11, SDL_TRUE); + /* RandomSintXBoundaryValue(10, 11, true) returns 10, 11 */ + sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 11, true); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (10,11,true); expected: 10|11, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ - sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 12, SDL_TRUE); + /* RandomSintXBoundaryValue(10, 12, true) returns 10, 11, 12 */ + sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 12, true); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (10,12,true); expected: 10|11|12, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ - sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 13, SDL_TRUE); + /* RandomSintXBoundaryValue(10, 13, true) returns 10, 11, 12, 13 */ + sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 13, true); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (10,13,true); expected: 10|11|12|13, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ - sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 20, SDL_TRUE); + /* RandomSintXBoundaryValue(10, 20, true) returns 10, 11, 19 or 20 */ + sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 20, true); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (10,20,true); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ - sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(20, 10, SDL_TRUE); + /* RandomSintXBoundaryValue(20, 10, true) returns 10, 11, 19 or 20 */ + sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(20, 10, true); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (20,10,true); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ - sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(1, 20, SDL_FALSE); + /* RandomSintXBoundaryValue(1, 20, false) returns 0, 21 */ + sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(1, 20, false); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 0 || sresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (1,20,false); expected: 0|21, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(LONG_MIN, 99, SDL_FALSE) returns 100 */ - sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min, 99, SDL_FALSE); + /* RandomSintXBoundaryValue(LONG_MIN, 99, false) returns 100 */ + sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min, 99, false); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == 100, - "Validate result value for parameters (LONG_MIN,99,SDL_FALSE); expected: 100, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (LONG_MIN,99,false); expected: 100, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(LONG_MIN + 1, LONG_MAX, SDL_FALSE) returns LONG_MIN (no error) */ - sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min + 1, long_max, SDL_FALSE); + /* RandomSintXBoundaryValue(LONG_MIN + 1, LONG_MAX, false) returns LONG_MIN (no error) */ + sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min + 1, long_max, false); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == long_min, - "Validate result value for parameters (LONG_MIN+1,LONG_MAX,SDL_FALSE); expected: %" SDL_PRIs32 ", got: %" SDL_PRIs64, long_min, sresult); + "Validate result value for parameters (LONG_MIN+1,LONG_MAX,false); expected: %" SDL_PRIs32 ", got: %" SDL_PRIs64, long_min, sresult); lastError = SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - /* RandomSintXBoundaryValue(LONG_MIN, LONG_MAX - 1, SDL_FALSE) returns LONG_MAX (no error) */ - sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min, long_max - 1, SDL_FALSE); + /* RandomSintXBoundaryValue(LONG_MIN, LONG_MAX - 1, false) returns LONG_MAX (no error) */ + sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min, long_max - 1, false); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == long_max, - "Validate result value for parameters (LONG_MIN,LONG_MAX - 1,SDL_FALSE); expected: %" SDL_PRIs32 ", got: %" SDL_PRIs64, long_max, sresult); + "Validate result value for parameters (LONG_MIN,LONG_MAX - 1,false); expected: %" SDL_PRIs32 ", got: %" SDL_PRIs64, long_max, sresult); lastError = SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - /* RandomSintXBoundaryValue(LONG_MIN, LONG_MAX, SDL_FALSE) returns 0 (sets error) */ - sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min, long_max, SDL_FALSE); + /* RandomSintXBoundaryValue(LONG_MIN, LONG_MAX, false) returns 0 (sets error) */ + sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min, long_max, false); SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); SDLTest_AssertCheck( sresult == long_min, - "Validate result value for parameters(LONG_MIN,LONG_MAX,SDL_FALSE); expected: %" SDL_PRIs32 ", got: %" SDL_PRIs64, long_min, sresult); + "Validate result value for parameters(LONG_MIN,LONG_MAX,false); expected: %" SDL_PRIs32 ", got: %" SDL_PRIs64, long_min, sresult); lastError = SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, @@ -917,88 +917,88 @@ static int SDLCALL sdltest_randomBoundaryNumberSint64(void *arg) SDL_ClearError(); SDLTest_AssertPass("SDL_ClearError()"); - /* RandomSintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ - sresult = SDLTest_RandomSint64BoundaryValue(10, 10, SDL_TRUE); + /* RandomSintXBoundaryValue(10, 10, true) returns 10 */ + sresult = SDLTest_RandomSint64BoundaryValue(10, 10, true); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (10,10,true); expected: 10, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ - sresult = SDLTest_RandomSint64BoundaryValue(10, 11, SDL_TRUE); + /* RandomSintXBoundaryValue(10, 11, true) returns 10, 11 */ + sresult = SDLTest_RandomSint64BoundaryValue(10, 11, true); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (10,11,true); expected: 10|11, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ - sresult = SDLTest_RandomSint64BoundaryValue(10, 12, SDL_TRUE); + /* RandomSintXBoundaryValue(10, 12, true) returns 10, 11, 12 */ + sresult = SDLTest_RandomSint64BoundaryValue(10, 12, true); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (10,12,true); expected: 10|11|12, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ - sresult = SDLTest_RandomSint64BoundaryValue(10, 13, SDL_TRUE); + /* RandomSintXBoundaryValue(10, 13, true) returns 10, 11, 12, 13 */ + sresult = SDLTest_RandomSint64BoundaryValue(10, 13, true); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (10,13,true); expected: 10|11|12|13, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ - sresult = SDLTest_RandomSint64BoundaryValue(10, 20, SDL_TRUE); + /* RandomSintXBoundaryValue(10, 20, true) returns 10, 11, 19 or 20 */ + sresult = SDLTest_RandomSint64BoundaryValue(10, 20, true); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (10,20,true); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ - sresult = SDLTest_RandomSint64BoundaryValue(20, 10, SDL_TRUE); + /* RandomSintXBoundaryValue(20, 10, true) returns 10, 11, 19 or 20 */ + sresult = SDLTest_RandomSint64BoundaryValue(20, 10, true); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (20,10,true); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ - sresult = SDLTest_RandomSint64BoundaryValue(1, 20, SDL_FALSE); + /* RandomSintXBoundaryValue(1, 20, false) returns 0, 21 */ + sresult = SDLTest_RandomSint64BoundaryValue(1, 20, false); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 0 || sresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (1,20,false); expected: 0|21, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(LLONG_MIN, 99, SDL_FALSE) returns 100 */ - sresult = SDLTest_RandomSint64BoundaryValue(INT64_MIN, 99, SDL_FALSE); + /* RandomSintXBoundaryValue(LLONG_MIN, 99, false) returns 100 */ + sresult = SDLTest_RandomSint64BoundaryValue(INT64_MIN, 99, false); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == 100, - "Validate result value for parameters (LLONG_MIN,99,SDL_FALSE); expected: 100, got: %" SDL_PRIs64, sresult); + "Validate result value for parameters (LLONG_MIN,99,false); expected: 100, got: %" SDL_PRIs64, sresult); - /* RandomSintXBoundaryValue(LLONG_MIN + 1, LLONG_MAX, SDL_FALSE) returns LLONG_MIN (no error) */ - sresult = SDLTest_RandomSint64BoundaryValue(INT64_MIN + 1, INT64_MAX, SDL_FALSE); + /* RandomSintXBoundaryValue(LLONG_MIN + 1, LLONG_MAX, false) returns LLONG_MIN (no error) */ + sresult = SDLTest_RandomSint64BoundaryValue(INT64_MIN + 1, INT64_MAX, false); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == INT64_MIN, - "Validate result value for parameters (LLONG_MIN+1,LLONG_MAX,SDL_FALSE); expected: %" SDL_PRIs64 ", got: %" SDL_PRIs64, INT64_MIN, sresult); + "Validate result value for parameters (LLONG_MIN+1,LLONG_MAX,false); expected: %" SDL_PRIs64 ", got: %" SDL_PRIs64, INT64_MIN, sresult); lastError = SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - /* RandomSintXBoundaryValue(LLONG_MIN, LLONG_MAX - 1, SDL_FALSE) returns LLONG_MAX (no error) */ - sresult = SDLTest_RandomSint64BoundaryValue(INT64_MIN, INT64_MAX - 1, SDL_FALSE); + /* RandomSintXBoundaryValue(LLONG_MIN, LLONG_MAX - 1, false) returns LLONG_MAX (no error) */ + sresult = SDLTest_RandomSint64BoundaryValue(INT64_MIN, INT64_MAX - 1, false); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == INT64_MAX, - "Validate result value for parameters (LLONG_MIN,LLONG_MAX - 1,SDL_FALSE); expected: %" SDL_PRIs64 ", got: %" SDL_PRIs64, INT64_MAX, sresult); + "Validate result value for parameters (LLONG_MIN,LLONG_MAX - 1,false); expected: %" SDL_PRIs64 ", got: %" SDL_PRIs64, INT64_MAX, sresult); lastError = SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - /* RandomSintXBoundaryValue(LLONG_MIN, LLONG_MAX, SDL_FALSE) returns 0 (sets error) */ - sresult = SDLTest_RandomSint64BoundaryValue(INT64_MIN, INT64_MAX, SDL_FALSE); + /* RandomSintXBoundaryValue(LLONG_MIN, LLONG_MAX, false) returns 0 (sets error) */ + sresult = SDLTest_RandomSint64BoundaryValue(INT64_MIN, INT64_MAX, false); SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); SDLTest_AssertCheck( sresult == INT64_MIN, - "Validate result value for parameters(LLONG_MIN,LLONG_MAX,SDL_FALSE); expected: %" SDL_PRIs64 ", got: %" SDL_PRIs64, INT64_MIN, sresult); + "Validate result value for parameters(LLONG_MIN,LLONG_MAX,false); expected: %" SDL_PRIs64 ", got: %" SDL_PRIs64, INT64_MIN, sresult); lastError = SDL_GetError(); SDLTest_AssertPass("SDL_GetError()"); SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, diff --git a/test/testautomation_stdlib.c b/test/testautomation_stdlib.c index d49da29c7..2e0e509cc 100644 --- a/test/testautomation_stdlib.c +++ b/test/testautomation_stdlib.c @@ -581,7 +581,7 @@ static int SDLCALL stdlib_getsetenv(void *arg) expected = value1; result = SDL_SetEnvironmentVariable(env, name, value1, overwrite); SDLTest_AssertPass("Call to SDL_SetEnvironmentVariable(env, '%s','%s', %i)", name, value1, overwrite); - SDLTest_AssertCheck(result == SDL_TRUE, "Check result, expected: 1, got: %i", result); + SDLTest_AssertCheck(result == true, "Check result, expected: 1, got: %i", result); /* Check value */ text = SDL_GetEnvironmentVariable(env, name); @@ -600,7 +600,7 @@ static int SDLCALL stdlib_getsetenv(void *arg) expected = value2; result = SDL_SetEnvironmentVariable(env, name, value2, overwrite); SDLTest_AssertPass("Call to SDL_SetEnvironmentVariable(env, '%s','%s', %i)", name, value2, overwrite); - SDLTest_AssertCheck(result == SDL_TRUE, "Check result, expected: 1, got: %i", result); + SDLTest_AssertCheck(result == true, "Check result, expected: 1, got: %i", result); /* Check value */ text = SDL_GetEnvironmentVariable(env, name); @@ -619,7 +619,7 @@ static int SDLCALL stdlib_getsetenv(void *arg) expected = value2; result = SDL_SetEnvironmentVariable(env, name, value1, overwrite); SDLTest_AssertPass("Call to SDL_SetEnvironmentVariable(env, '%s','%s', %i)", name, value1, overwrite); - SDLTest_AssertCheck(result == SDL_TRUE, "Check result, expected: 1, got: %i", result); + SDLTest_AssertCheck(result == true, "Check result, expected: 1, got: %i", result); /* Check value */ text = SDL_GetEnvironmentVariable(env, name); @@ -638,7 +638,7 @@ static int SDLCALL stdlib_getsetenv(void *arg) expected = value1; result = SDL_SetEnvironmentVariable(env, name, value1, overwrite); SDLTest_AssertPass("Call to SDL_SetEnvironmentVariable(env, '%s','%s', %i)", name, value1, overwrite); - SDLTest_AssertCheck(result == SDL_TRUE, "Check result, expected: 1, got: %i", result); + SDLTest_AssertCheck(result == true, "Check result, expected: 1, got: %i", result); /* Check value */ text = SDL_GetEnvironmentVariable(env, name); @@ -655,27 +655,27 @@ static int SDLCALL stdlib_getsetenv(void *arg) /* Verify setenv() with empty string vs unsetenv() */ result = SDL_SetEnvironmentVariable(env, "FOO", "1", 1); SDLTest_AssertPass("Call to SDL_SetEnvironmentVariable(env, 'FOO','1', 1)"); - SDLTest_AssertCheck(result == SDL_TRUE, "Check result, expected: 1, got: %i", result); + SDLTest_AssertCheck(result == true, "Check result, expected: 1, got: %i", result); expected = "1"; text = SDL_GetEnvironmentVariable(env, "FOO"); SDLTest_AssertPass("Call to SDL_GetEnvironmentVariable(env, 'FOO')"); SDLTest_AssertCheck(text && SDL_strcmp(text, expected) == 0, "Verify returned text, expected: %s, got: %s", expected, text); result = SDL_SetEnvironmentVariable(env, "FOO", "", 1); SDLTest_AssertPass("Call to SDL_SetEnvironmentVariable(env, 'FOO','', 1)"); - SDLTest_AssertCheck(result == SDL_TRUE, "Check result, expected: 1, got: %i", result); + SDLTest_AssertCheck(result == true, "Check result, expected: 1, got: %i", result); expected = ""; text = SDL_GetEnvironmentVariable(env, "FOO"); SDLTest_AssertPass("Call to SDL_GetEnvironmentVariable(env, 'FOO')"); SDLTest_AssertCheck(text && SDL_strcmp(text, expected) == 0, "Verify returned text, expected: '%s', got: '%s'", expected, text); result = SDL_UnsetEnvironmentVariable(env, "FOO"); SDLTest_AssertPass("Call to SDL_UnsetEnvironmentVariable(env, 'FOO')"); - SDLTest_AssertCheck(result == SDL_TRUE, "Check result, expected: 1, got: %i", result); + SDLTest_AssertCheck(result == true, "Check result, expected: 1, got: %i", result); text = SDL_GetEnvironmentVariable(env, "FOO"); SDLTest_AssertPass("Call to SDL_GetEnvironmentVariable(env, 'FOO')"); SDLTest_AssertCheck(text == NULL, "Verify returned text, expected: (null), got: %s", text); result = SDL_SetEnvironmentVariable(env, "FOO", "0", 0); SDLTest_AssertPass("Call to SDL_SetEnvironmentVariable(env, 'FOO','0', 0)"); - SDLTest_AssertCheck(result == SDL_TRUE, "Check result, expected: 1, got: %i", result); + SDLTest_AssertCheck(result == true, "Check result, expected: 1, got: %i", result); expected = "0"; text = SDL_GetEnvironmentVariable(env, "FOO"); SDLTest_AssertPass("Call to SDL_GetEnvironmentVariable(env, 'FOO')"); @@ -685,16 +685,16 @@ static int SDLCALL stdlib_getsetenv(void *arg) for (overwrite = 0; overwrite <= 1; overwrite++) { result = SDL_SetEnvironmentVariable(env, NULL, value1, overwrite); SDLTest_AssertPass("Call to SDL_SetEnvironmentVariable(env, NULL,'%s', %i)", value1, overwrite); - SDLTest_AssertCheck(result == SDL_FALSE, "Check result, expected: 0, got: %i", result); + SDLTest_AssertCheck(result == false, "Check result, expected: 0, got: %i", result); result = SDL_SetEnvironmentVariable(env, "", value1, overwrite); SDLTest_AssertPass("Call to SDL_SetEnvironmentVariable(env, '','%s', %i)", value1, overwrite); - SDLTest_AssertCheck(result == SDL_FALSE, "Check result, expected: 0, got: %i", result); + SDLTest_AssertCheck(result == false, "Check result, expected: 0, got: %i", result); result = SDL_SetEnvironmentVariable(env, "=", value1, overwrite); SDLTest_AssertPass("Call to SDL_SetEnvironmentVariable(env, '=','%s', %i)", value1, overwrite); - SDLTest_AssertCheck(result == SDL_FALSE, "Check result, expected: 0, got: %i", result); + SDLTest_AssertCheck(result == false, "Check result, expected: 0, got: %i", result); result = SDL_SetEnvironmentVariable(env, name, NULL, overwrite); SDLTest_AssertPass("Call to SDL_SetEnvironmentVariable(env, '%s', NULL, %i)", name, overwrite); - SDLTest_AssertCheck(result == SDL_FALSE, "Check result, expected: 0, got: %i", result); + SDLTest_AssertCheck(result == false, "Check result, expected: 0, got: %i", result); } /* Clean up */ @@ -923,32 +923,32 @@ typedef struct size_t a; size_t b; size_t result; - SDL_bool status; + bool status; } overflow_test; static const overflow_test multiplications[] = { - { 1, 1, 1, SDL_TRUE }, - { 0, 0, 0, SDL_TRUE }, - { SDL_SIZE_MAX, 0, 0, SDL_TRUE }, - { SDL_SIZE_MAX, 1, SDL_SIZE_MAX, SDL_TRUE }, - { SDL_SIZE_MAX / 2, 2, SDL_SIZE_MAX - (SDL_SIZE_MAX % 2), SDL_TRUE }, - { SDL_SIZE_MAX / 23, 23, SDL_SIZE_MAX - (SDL_SIZE_MAX % 23), SDL_TRUE }, + { 1, 1, 1, true }, + { 0, 0, 0, true }, + { SDL_SIZE_MAX, 0, 0, true }, + { SDL_SIZE_MAX, 1, SDL_SIZE_MAX, true }, + { SDL_SIZE_MAX / 2, 2, SDL_SIZE_MAX - (SDL_SIZE_MAX % 2), true }, + { SDL_SIZE_MAX / 23, 23, SDL_SIZE_MAX - (SDL_SIZE_MAX % 23), true }, - { (SDL_SIZE_MAX / 2) + 1, 2, 0, SDL_FALSE }, - { (SDL_SIZE_MAX / 23) + 42, 23, 0, SDL_FALSE }, - { SDL_SIZE_MAX, SDL_SIZE_MAX, 0, SDL_FALSE }, + { (SDL_SIZE_MAX / 2) + 1, 2, 0, false }, + { (SDL_SIZE_MAX / 23) + 42, 23, 0, false }, + { SDL_SIZE_MAX, SDL_SIZE_MAX, 0, false }, }; static const overflow_test additions[] = { - { 1, 1, 2, SDL_TRUE }, - { 0, 0, 0, SDL_TRUE }, - { SDL_SIZE_MAX, 0, SDL_SIZE_MAX, SDL_TRUE }, - { SDL_SIZE_MAX - 1, 1, SDL_SIZE_MAX, SDL_TRUE }, - { SDL_SIZE_MAX - 42, 23, SDL_SIZE_MAX - (42 - 23), SDL_TRUE }, + { 1, 1, 2, true }, + { 0, 0, 0, true }, + { SDL_SIZE_MAX, 0, SDL_SIZE_MAX, true }, + { SDL_SIZE_MAX - 1, 1, SDL_SIZE_MAX, true }, + { SDL_SIZE_MAX - 42, 23, SDL_SIZE_MAX - (42 - 23), true }, - { SDL_SIZE_MAX, 1, 0, SDL_FALSE }, - { SDL_SIZE_MAX, 23, 0, SDL_FALSE }, - { SDL_SIZE_MAX, SDL_SIZE_MAX, 0, SDL_FALSE }, + { SDL_SIZE_MAX, 1, 0, false }, + { SDL_SIZE_MAX, 23, 0, false }, + { SDL_SIZE_MAX, SDL_SIZE_MAX, 0, false }, }; static int SDLCALL @@ -1018,7 +1018,7 @@ stdlib_overflow(void *arg) for (i = 0; i < SDL_arraysize(additions); i++) { const overflow_test *t = &additions[i]; - SDL_bool status; + bool status; size_t result = ~t->result; if (useBuiltin) { @@ -1082,18 +1082,18 @@ static int SDLCALL stdlib_iconv(void *arg) { struct { - SDL_bool expect_success; + bool expect_success; const char *from_encoding; const char *text; const char *to_encoding; const char *expected; } inputs[] = { - { SDL_FALSE, "bogus-from-encoding", NULL, "bogus-to-encoding", NULL }, - { SDL_FALSE, "bogus-from-encoding", "hello world", "bogus-to-encoding", NULL }, - { SDL_FALSE, "bogus-from-encoding", "hello world", "ascii", NULL }, - { SDL_TRUE, "utf-8", NULL, "ascii", "" }, - { SDL_TRUE, "utf-8", "hello world", "ascii", "hello world" }, - { SDL_TRUE, "utf-8", "\xe2\x8c\xa8\xf0\x9f\x92\xbb", "utf-16le", "\x28\x23\x3d\xd8\xbb\xdc\x00" }, + { false, "bogus-from-encoding", NULL, "bogus-to-encoding", NULL }, + { false, "bogus-from-encoding", "hello world", "bogus-to-encoding", NULL }, + { false, "bogus-from-encoding", "hello world", "ascii", NULL }, + { true, "utf-8", NULL, "ascii", "" }, + { true, "utf-8", "hello world", "ascii", "hello world" }, + { true, "utf-8", "\xe2\x8c\xa8\xf0\x9f\x92\xbb", "utf-16le", "\x28\x23\x3d\xd8\xbb\xdc\x00" }, }; SDL_iconv_t cd; size_t i; @@ -1111,7 +1111,7 @@ stdlib_iconv(void *arg) char *output; size_t iconv_result; size_t out_len; - SDL_bool is_error; + bool is_error; size_t out_pos; SDLTest_AssertPass("case %d", (int)i); @@ -1165,7 +1165,7 @@ stdlib_iconv(void *arg) break; } if (count_read == 0) { - SDLTest_AssertCheck(SDL_FALSE, "SDL_iconv wrote data, but read no data"); + SDLTest_AssertCheck(false, "SDL_iconv wrote data, but read no data"); break; } } while (!is_error && in_pos < len_text); diff --git a/test/testautomation_surface.c b/test/testautomation_surface.c index 3ae33e99b..838fe8f29 100644 --- a/test/testautomation_surface.c +++ b/test/testautomation_surface.c @@ -25,9 +25,9 @@ #define CHECK_FUNC(FUNC, PARAMS) \ { \ - SDL_bool result = FUNC PARAMS; \ + bool result = FUNC PARAMS; \ if (!result) { \ - SDLTest_AssertCheck(result, "Validate result from %s, expected: SDL_TRUE, got: SDL_FALSE, %s", #FUNC, SDL_GetError()); \ + SDLTest_AssertCheck(result, "Validate result from %s, expected: true, got: false, %s", #FUNC, SDL_GetError()); \ } \ } @@ -53,14 +53,14 @@ static void SDLCALL surfaceSetUp(void **arg) if (testSurface != NULL) { /* Disable blend mode for target surface */ result = SDL_SetSurfaceBlendMode(testSurface, blendMode); - SDLTest_AssertCheck(result == SDL_TRUE, "Validate result from SDL_SetSurfaceBlendMode, expected: SDL_TRUE, got: %i", result); + SDLTest_AssertCheck(result == true, "Validate result from SDL_SetSurfaceBlendMode, expected: true, got: %i", result); result = SDL_GetSurfaceBlendMode(testSurface, ¤tBlendMode); - SDLTest_AssertCheck(result == SDL_TRUE, "Validate result from SDL_GetSurfaceBlendMode, expected: SDL_TRUE, got: %i", result); + SDLTest_AssertCheck(result == true, "Validate result from SDL_GetSurfaceBlendMode, expected: true, got: %i", result); SDLTest_AssertCheck(currentBlendMode == blendMode, "Validate blendMode, expected: %" SDL_PRIu32 ", got: %" SDL_PRIu32, blendMode, currentBlendMode); /* Clear the target surface */ result = SDL_FillSurfaceRect(testSurface, NULL, SDL_MapSurfaceRGBA(testSurface, 0, 0, 0, 255)); - SDLTest_AssertCheck(result == SDL_TRUE, "Validate result from SDL_FillSurfaceRect, expected: SDL_TRUE, got: %i", result); + SDLTest_AssertCheck(result == true, "Validate result from SDL_FillSurfaceRect, expected: true, got: %i", result); } } @@ -133,7 +133,7 @@ static void testBlitBlendModeWithFormats(int mode, SDL_PixelFormat src_format, S } ret = SDL_FillSurfaceRect(dst, NULL, color); SDLTest_AssertPass("Call to SDL_FillSurfaceRect()"); - SDLTest_AssertCheck(ret == SDL_TRUE, "Verify result from SDL_FillSurfaceRect, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Verify result from SDL_FillSurfaceRect, expected: true, got: %i", ret); SDL_GetRGBA(color, SDL_GetPixelFormatDetails(dst->format), SDL_GetSurfacePalette(dst), &dstR, &dstG, &dstB, &dstA); /* Create src surface */ @@ -153,35 +153,35 @@ static void testBlitBlendModeWithFormats(int mode, SDL_PixelFormat src_format, S /* Reset alpha modulation */ ret = SDL_SetSurfaceAlphaMod(src, 255); SDLTest_AssertPass("Call to SDL_SetSurfaceAlphaMod()"); - SDLTest_AssertCheck(ret == SDL_TRUE, "Verify result from SDL_SetSurfaceAlphaMod(), expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Verify result from SDL_SetSurfaceAlphaMod(), expected: true, got: %i", ret); /* Reset color modulation */ ret = SDL_SetSurfaceColorMod(src, 255, 255, 255); SDLTest_AssertPass("Call to SDL_SetSurfaceColorMod()"); - SDLTest_AssertCheck(ret == SDL_TRUE, "Verify result from SDL_SetSurfaceColorMod(), expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Verify result from SDL_SetSurfaceColorMod(), expected: true, got: %i", ret); /* Reset color key */ - ret = SDL_SetSurfaceColorKey(src, SDL_FALSE, 0); + ret = SDL_SetSurfaceColorKey(src, false, 0); SDLTest_AssertPass("Call to SDL_SetSurfaceColorKey()"); - SDLTest_AssertCheck(ret == SDL_TRUE, "Verify result from SDL_SetSurfaceColorKey(), expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Verify result from SDL_SetSurfaceColorKey(), expected: true, got: %i", ret); /* Clear surface. */ color = SDL_MapSurfaceRGBA(src, srcR, srcG, srcB, srcA); SDLTest_AssertPass("Call to SDL_MapSurfaceRGBA()"); ret = SDL_FillSurfaceRect(src, NULL, color); SDLTest_AssertPass("Call to SDL_FillSurfaceRect()"); - SDLTest_AssertCheck(ret == SDL_TRUE, "Verify result from SDL_FillSurfaceRect, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Verify result from SDL_FillSurfaceRect, expected: true, got: %i", ret); SDL_GetRGBA(color, SDL_GetPixelFormatDetails(src->format), SDL_GetSurfacePalette(src), &srcR, &srcG, &srcB, &srcA); /* Set blend mode. */ if (mode >= 0) { ret = SDL_SetSurfaceBlendMode(src, (SDL_BlendMode)mode); SDLTest_AssertPass("Call to SDL_SetSurfaceBlendMode()"); - SDLTest_AssertCheck(ret == SDL_TRUE, "Verify result from SDL_SetSurfaceBlendMode(..., %i), expected: SDL_TRUE, got: %i", mode, ret); + SDLTest_AssertCheck(ret == true, "Verify result from SDL_SetSurfaceBlendMode(..., %i), expected: true, got: %i", mode, ret); } else { ret = SDL_SetSurfaceBlendMode(src, SDL_BLENDMODE_BLEND); SDLTest_AssertPass("Call to SDL_SetSurfaceBlendMode()"); - SDLTest_AssertCheck(ret == SDL_TRUE, "Verify result from SDL_SetSurfaceBlendMode(..., %i), expected: SDL_TRUE, got: %i", mode, ret); + SDLTest_AssertCheck(ret == true, "Verify result from SDL_SetSurfaceBlendMode(..., %i), expected: true, got: %i", mode, ret); } /* Test blend mode. */ @@ -190,7 +190,7 @@ static void testBlitBlendModeWithFormats(int mode, SDL_PixelFormat src_format, S case -1: /* Set color mod. */ ret = SDL_SetSurfaceColorMod(src, srcR, srcG, srcB); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate results from calls to SDL_SetSurfaceColorMod, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Validate results from calls to SDL_SetSurfaceColorMod, expected: true, got: %i", ret); expectedR = (Uint8)SDL_roundf(SDL_clamp((FLOAT(srcR) * FLOAT(srcR)) * FLOAT(srcA) + FLOAT(dstR) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); expectedG = (Uint8)SDL_roundf(SDL_clamp((FLOAT(srcG) * FLOAT(srcG)) * FLOAT(srcA) + FLOAT(dstG) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); expectedB = (Uint8)SDL_roundf(SDL_clamp((FLOAT(srcB) * FLOAT(srcB)) * FLOAT(srcA) + FLOAT(dstB) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); @@ -199,7 +199,7 @@ static void testBlitBlendModeWithFormats(int mode, SDL_PixelFormat src_format, S case -2: /* Set alpha mod. */ ret = SDL_SetSurfaceAlphaMod(src, srcA); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate results from calls to SDL_SetSurfaceAlphaMod, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Validate results from calls to SDL_SetSurfaceAlphaMod, expected: true, got: %i", ret); expectedR = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcR) * (FLOAT(srcA) * FLOAT(srcA)) + FLOAT(dstR) * (1.0f - (FLOAT(srcA) * FLOAT(srcA))), 0.0f, 1.0f) * 255.0f); expectedG = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcG) * (FLOAT(srcA) * FLOAT(srcA)) + FLOAT(dstG) * (1.0f - (FLOAT(srcA) * FLOAT(srcA))), 0.0f, 1.0f) * 255.0f); expectedB = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcB) * (FLOAT(srcA) * FLOAT(srcA)) + FLOAT(dstB) * (1.0f - (FLOAT(srcA) * FLOAT(srcA))), 0.0f, 1.0f) * 255.0f); @@ -262,7 +262,7 @@ static void testBlitBlendModeWithFormats(int mode, SDL_PixelFormat src_format, S /* Blitting. */ ret = SDL_BlitSurface(src, NULL, dst, NULL); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate results from calls to SDL_BlitSurface, expected: SDL_TRUE, got: %i: %s", ret, !ret ? SDL_GetError() : "success"); + SDLTest_AssertCheck(ret == true, "Validate results from calls to SDL_BlitSurface, expected: true, got: %i: %s", ret, !ret ? SDL_GetError() : "success"); if (ret) { SDL_ReadSurfacePixel(dst, 0, 0, &actualR, &actualG, &actualB, &actualA); deltaR = SDL_abs((int)actualR - expectedR); @@ -336,7 +336,7 @@ static int SDLCALL surface_testSaveLoadBitmap(void *arg) /* Save a surface */ ret = SDL_SaveBMP(face, sampleFilename); SDLTest_AssertPass("Call to SDL_SaveBMP()"); - SDLTest_AssertCheck(ret == SDL_TRUE, "Verify result from SDL_SaveBMP, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Verify result from SDL_SaveBMP, expected: true, got: %i", ret); AssertFileExist(sampleFilename); /* Load a surface */ @@ -380,7 +380,7 @@ static int SDLCALL surface_testBlitTiled(void *arg) /* Tiled blit - 1.0 scale */ { ret = SDL_BlitSurfaceTiled(face, NULL, testSurface, NULL); - SDLTest_AssertCheck(ret == SDL_TRUE, "Verify result from SDL_BlitSurfaceTiled expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Verify result from SDL_BlitSurfaceTiled expected: true, got: %i", ret); /* See if it's the same */ SDL_DestroySurface(referenceSurface); @@ -394,15 +394,15 @@ static int SDLCALL surface_testBlitTiled(void *arg) testSurface2x = SDL_CreateSurface(testSurface->w * 2, testSurface->h * 2, testSurface->format); SDLTest_AssertCheck(testSurface != NULL, "Check that testSurface2x is not NULL"); ret = SDL_FillSurfaceRect(testSurface2x, NULL, SDL_MapSurfaceRGBA(testSurface2x, 0, 0, 0, 255)); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate result from SDL_FillSurfaceRect, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Validate result from SDL_FillSurfaceRect, expected: true, got: %i", ret); ret = SDL_BlitSurfaceTiledWithScale(face, NULL, 2.0f, SDL_SCALEMODE_NEAREST, testSurface2x, NULL); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate results from call to SDL_BlitSurfaceTiledWithScale, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Validate results from call to SDL_BlitSurfaceTiledWithScale, expected: true, got: %i", ret); /* See if it's the same */ referenceSurface2x = SDL_CreateSurface(referenceSurface->w * 2, referenceSurface->h * 2, referenceSurface->format); SDL_BlitSurfaceScaled(referenceSurface, NULL, referenceSurface2x, NULL, SDL_SCALEMODE_NEAREST); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate results from call to SDL_BlitSurfaceScaled, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Validate results from call to SDL_BlitSurfaceScaled, expected: true, got: %i", ret); ret = SDLTest_CompareSurfaces(testSurface2x, referenceSurface2x, 0); SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); } @@ -512,7 +512,7 @@ static int SDLCALL surface_testBlit9Grid(void *arg) Fill9GridReferenceSurface(referenceSurface, 1, 1, 1, 1); ret = SDL_BlitSurface9Grid(source, NULL, 1, 1, 1, 1, 0.0f, SDL_SCALEMODE_NEAREST, testSurface, NULL); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate result from SDL_BlitSurface9Grid, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Validate result from SDL_BlitSurface9Grid, expected: true, got: %i", ret); ret = SDLTest_CompareSurfaces(testSurface, referenceSurface, 0); SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); @@ -527,7 +527,7 @@ static int SDLCALL surface_testBlit9Grid(void *arg) Fill9GridReferenceSurface(referenceSurface, 2, 2, 2, 2); ret = SDL_BlitSurface9Grid(source, NULL, 1, 1, 1, 1, 2.0f, SDL_SCALEMODE_NEAREST, testSurface, NULL); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate result from SDL_BlitSurface9Grid, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Validate result from SDL_BlitSurface9Grid, expected: true, got: %i", ret); ret = SDLTest_CompareSurfaces(testSurface, referenceSurface, 0); SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); @@ -579,7 +579,7 @@ static int SDLCALL surface_testBlit9Grid(void *arg) Fill9GridReferenceSurface(referenceSurface, 1, 2, 1, 2); ret = SDL_BlitSurface9Grid(source, NULL, 1, 2, 1, 2, 0.0f, SDL_SCALEMODE_NEAREST, testSurface, NULL); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate result from SDL_BlitSurface9Grid, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Validate result from SDL_BlitSurface9Grid, expected: true, got: %i", ret); ret = SDLTest_CompareSurfaces(testSurface, referenceSurface, 0); SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); @@ -595,7 +595,7 @@ static int SDLCALL surface_testBlit9Grid(void *arg) Fill9GridReferenceSurface(referenceSurface, 2, 4, 2, 4); ret = SDL_BlitSurface9Grid(source, NULL, 1, 2, 1, 2, 2.0f, SDL_SCALEMODE_NEAREST, testSurface, NULL); - SDLTest_AssertCheck(ret == SDL_TRUE, "Validate result from SDL_BlitSurface9Grid, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Validate result from SDL_BlitSurface9Grid, expected: true, got: %i", ret); ret = SDLTest_CompareSurfaces(testSurface, referenceSurface, 0); SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); @@ -689,9 +689,9 @@ static int SDLCALL surface_testSurfaceConversion(void *arg) /* Set transparent pixel as the pixel at (0,0) */ if (SDL_GetSurfacePalette(face)) { - ret = SDL_SetSurfaceColorKey(face, SDL_TRUE, *(Uint8 *)face->pixels); + ret = SDL_SetSurfaceColorKey(face, true, *(Uint8 *)face->pixels); SDLTest_AssertPass("Call to SDL_SetSurfaceColorKey()"); - SDLTest_AssertCheck(ret == SDL_TRUE, "Verify result from SDL_SetSurfaceColorKey, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Verify result from SDL_SetSurfaceColorKey, expected: true, got: %i", ret); } /* Convert to 32 bit to compare. */ @@ -764,9 +764,9 @@ static int SDLCALL surface_testCompleteSurfaceConversion(void *arg) /* Set transparent pixel as the pixel at (0,0) */ if (SDL_GetSurfacePalette(face)) { - ret = SDL_SetSurfaceColorKey(face, SDL_TRUE, *(Uint8 *)face->pixels); + ret = SDL_SetSurfaceColorKey(face, true, *(Uint8 *)face->pixels); SDLTest_AssertPass("Call to SDL_SetSurfaceColorKey()"); - SDLTest_AssertCheck(ret == SDL_TRUE, "Verify result from SDL_SetSurfaceColorKey, expected: SDL_TRUE, got: %i", ret); + SDLTest_AssertCheck(ret == true, "Verify result from SDL_SetSurfaceColorKey, expected: true, got: %i", ret); } for (i = 0; i < SDL_arraysize(pixel_formats); ++i) { @@ -1321,11 +1321,11 @@ static int SDLCALL surface_testPalettization(void *arg) SDLTest_AssertCheck(source->format == SDL_PIXELFORMAT_RGBA8888, "Expected source->format == SDL_PIXELFORMAT_RGBA8888, got 0x%x (%s)", source->format, SDL_GetPixelFormatName(source->format)); for (i = 0; i < SDL_arraysize(colors); i++) { result = SDL_WriteSurfacePixel(source, i, 0, colors[i].c.r, colors[i].c.g, colors[i].c.b, colors[i].c.a); - SDLTest_AssertCheck(result == SDL_TRUE, "SDL_WriteSurfacePixel"); + SDLTest_AssertCheck(result == true, "SDL_WriteSurfacePixel"); } for (i = 0; i < SDL_arraysize(palette_colors); i++) { result = SDL_WriteSurfacePixel(source, SDL_arraysize(colors) + i, 0, palette_colors[i].r, palette_colors[i].g, palette_colors[i].b, palette_colors[i].a); - SDLTest_AssertCheck(result == SDL_TRUE, "SDL_WriteSurfacePixel"); + SDLTest_AssertCheck(result == true, "SDL_WriteSurfacePixel"); } output = SDL_ConvertSurfaceAndColorspace(source, SDL_PIXELFORMAT_INDEX8, palette, SDL_COLORSPACE_UNKNOWN, 0); @@ -1383,9 +1383,9 @@ static int SDLCALL surface_testClearSurface(void *arg) surface = SDL_CreateSurface(1, 1, format); SDLTest_AssertCheck(surface != NULL, "SDL_CreateSurface()"); ret = SDL_ClearSurface(surface, srcR, srcG, srcB, srcA); - SDLTest_AssertCheck(ret == SDL_TRUE, "SDL_ClearSurface()"); + SDLTest_AssertCheck(ret == true, "SDL_ClearSurface()"); ret = SDL_ReadSurfacePixelFloat(surface, 0, 0, &actualR, &actualG, &actualB, &actualA); - SDLTest_AssertCheck(ret == SDL_TRUE, "SDL_ReadSurfacePixelFloat()"); + SDLTest_AssertCheck(ret == true, "SDL_ReadSurfacePixelFloat()"); deltaR = SDL_fabsf(actualR - srcR); deltaG = SDL_fabsf(actualG - srcG); deltaB = SDL_fabsf(actualB - srcB); @@ -1433,13 +1433,13 @@ static int SDLCALL surface_testPremultiplyAlpha(void *arg) surface = SDL_CreateSurface(1, 1, format); SDLTest_AssertCheck(surface != NULL, "SDL_CreateSurface()"); ret = SDL_SetSurfaceColorspace(surface, SDL_COLORSPACE_SRGB); - SDLTest_AssertCheck(ret == SDL_TRUE, "SDL_SetSurfaceColorspace()"); + SDLTest_AssertCheck(ret == true, "SDL_SetSurfaceColorspace()"); ret = SDL_ClearSurface(surface, srcR, srcG, srcB, srcA); - SDLTest_AssertCheck(ret == SDL_TRUE, "SDL_ClearSurface()"); - ret = SDL_PremultiplySurfaceAlpha(surface, SDL_FALSE); - SDLTest_AssertCheck(ret == SDL_TRUE, "SDL_PremultiplySurfaceAlpha()"); + SDLTest_AssertCheck(ret == true, "SDL_ClearSurface()"); + ret = SDL_PremultiplySurfaceAlpha(surface, false); + SDLTest_AssertCheck(ret == true, "SDL_PremultiplySurfaceAlpha()"); ret = SDL_ReadSurfacePixelFloat(surface, 0, 0, &actualR, &actualG, &actualB, NULL); - SDLTest_AssertCheck(ret == SDL_TRUE, "SDL_ReadSurfacePixelFloat()"); + SDLTest_AssertCheck(ret == true, "SDL_ReadSurfacePixelFloat()"); deltaR = SDL_fabsf(actualR - expectedR); deltaG = SDL_fabsf(actualG - expectedG); deltaB = SDL_fabsf(actualB - expectedB); diff --git a/test/testautomation_time.c b/test/testautomation_time.c index 55129aa6c..2b599d087 100644 --- a/test/testautomation_time.c +++ b/test/testautomation_time.c @@ -20,7 +20,7 @@ static int SDLCALL time_getRealtimeClock(void *arg) result = SDL_GetCurrentTime(&ticks); SDLTest_AssertPass("Call to SDL_GetRealtimeClockTicks()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Check result value, expected SDL_TRUE, got: %i", result); + SDLTest_AssertCheck(result == true, "Check result value, expected true, got: %i", result); return TEST_COMPLETED; } @@ -36,9 +36,9 @@ static int SDLCALL time_dateTimeConversion(void *arg) ticks[0] = JAN_1_2000_NS; - result = SDL_TimeToDateTime(ticks[0], &dt, SDL_FALSE); + result = SDL_TimeToDateTime(ticks[0], &dt, false); SDLTest_AssertPass("Call to SDL_TimeToUTCDateTime()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Check result value, expected SDL_TRUE, got: %i", result); + SDLTest_AssertCheck(result == true, "Check result value, expected true, got: %i", result); SDLTest_AssertCheck(dt.year == 2000, "Check year value, expected 2000, got: %i", dt.year); SDLTest_AssertCheck(dt.month == 1, "Check month value, expected 1, got: %i", dt.month); SDLTest_AssertCheck(dt.day == 1, "Check day value, expected 1, got: %i", dt.day); @@ -48,20 +48,20 @@ static int SDLCALL time_dateTimeConversion(void *arg) result = SDL_DateTimeToTime(&dt, &ticks[1]); SDLTest_AssertPass("Call to SDL_DateTimeToTime()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Check result value, expected SDL_TRUE, got: %i", result); + SDLTest_AssertCheck(result == true, "Check result value, expected true, got: %i", result); result = ticks[0] == ticks[1]; SDLTest_AssertCheck(result, "Check that original and converted SDL_Time values match: ticks0 = %" SDL_PRIs64 ", ticks1 = %" SDL_PRIs64, ticks[0], ticks[1]); /* Local time unknown, so just verify success. */ - result = SDL_TimeToDateTime(ticks[0], &dt, SDL_TRUE); + result = SDL_TimeToDateTime(ticks[0], &dt, true); SDLTest_AssertPass("Call to SDL_TimeToLocalDateTime()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Check result value, expected SDL_TRUE, got: %i", result); + SDLTest_AssertCheck(result == true, "Check result value, expected true, got: %i", result); /* Convert back and verify result. */ result = SDL_DateTimeToTime(&dt, &ticks[1]); SDLTest_AssertPass("Call to SDL_DateTimeToTime()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Check result value, expected SDL_TRUE, got: %i", result); + SDLTest_AssertCheck(result == true, "Check result value, expected true, got: %i", result); result = ticks[0] == ticks[1]; SDLTest_AssertCheck(result, "Check that original and converted SDL_Time values match: ticks0 = %" SDL_PRIs64 ", ticks1 = %" SDL_PRIs64, ticks[0], ticks[1]); @@ -79,7 +79,7 @@ static int SDLCALL time_dateTimeConversion(void *arg) result = SDL_DateTimeToTime(&dt, &ticks[1]); SDLTest_AssertPass("Call to SDL_DateTimeToTime() (one day advanced)"); - SDLTest_AssertCheck(result == SDL_TRUE, "Check result value, expected SDL_TRUE, got: %i", result); + SDLTest_AssertCheck(result == true, "Check result value, expected true, got: %i", result); result = (ticks[0] + (Sint64)SDL_SECONDS_TO_NS(86400)) == ticks[1]; SDLTest_AssertCheck(result, "Check that the difference is exactly 86400 seconds, got: %" SDL_PRIs64, (Sint64)SDL_NS_TO_SECONDS(ticks[1] - ticks[0])); @@ -90,12 +90,12 @@ static int SDLCALL time_dateTimeConversion(void *arg) dt.day = 1; result = SDL_DateTimeToTime(&dt, &ticks[0]); SDLTest_AssertPass("Call to SDL_DateTimeToTime() (year overflows an SDL_Time)"); - SDLTest_AssertCheck(result == SDL_FALSE, "Check result value, expected SDL_FALSE, got: %i", result); + SDLTest_AssertCheck(result == false, "Check result value, expected false, got: %i", result); dt.year = 1601; result = SDL_DateTimeToTime(&dt, &ticks[0]); SDLTest_AssertPass("Call to SDL_DateTimeToTime() (year underflows an SDL_Time)"); - SDLTest_AssertCheck(result == SDL_FALSE, "Check result value, expected SDL_FALSE, got: %i", result); + SDLTest_AssertCheck(result == false, "Check result value, expected false, got: %i", result); return TEST_COMPLETED; } @@ -175,19 +175,19 @@ static int SDLCALL time_dateTimeUtilities(void *arg) result = SDL_GetDateTimeLocalePreferences(&dateFormat, &timeFormat); SDLTest_AssertPass("Call to SDL_GetDateTimeLocalePreferences(&dateFormat, &timeFormat)"); - SDLTest_AssertCheck(result == SDL_TRUE, "Check result value, expected SDL_TRUE, got: %i", result); + SDLTest_AssertCheck(result == true, "Check result value, expected true, got: %i", result); result = SDL_GetDateTimeLocalePreferences(&dateFormat, NULL); SDLTest_AssertPass("Call to SDL_GetDateTimeLocalePreferences(&dateFormat, NULL)"); - SDLTest_AssertCheck(result == SDL_TRUE, "Check result value, expected SDL_TRUE, got: %i", result); + SDLTest_AssertCheck(result == true, "Check result value, expected true, got: %i", result); result = SDL_GetDateTimeLocalePreferences(NULL, &timeFormat); SDLTest_AssertPass("Call to SDL_GetDateTimeLocalePreferences(NULL, &timeFormat)"); - SDLTest_AssertCheck(result == SDL_TRUE, "Check result value, expected SDL_TRUE, got: %i", result); + SDLTest_AssertCheck(result == true, "Check result value, expected true, got: %i", result); result = SDL_GetDateTimeLocalePreferences(NULL, NULL); SDLTest_AssertPass("Call to SDL_GetDateTimeLocalePreferences(NULL, NULL)"); - SDLTest_AssertCheck(result == SDL_TRUE, "Check result value, expected SDL_TRUE, got: %i", result); + SDLTest_AssertCheck(result == true, "Check result value, expected true, got: %i", result); return TEST_COMPLETED; } diff --git a/test/testautomation_timer.c b/test/testautomation_timer.c index 2bfb2da37..03face2d8 100644 --- a/test/testautomation_timer.c +++ b/test/testautomation_timer.c @@ -141,13 +141,13 @@ static int SDLCALL timer_addRemoveTimer(void *arg) /* Remove timer again and check that callback was not called */ result = SDL_RemoveTimer(id); SDLTest_AssertPass("Call to SDL_RemoveTimer()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Check result value, expected: SDL_TRUE, got: %i", result); + SDLTest_AssertCheck(result == true, "Check result value, expected: true, got: %i", result); SDLTest_AssertCheck(g_timerCallbackCalled == 0, "Check callback WAS NOT called, expected: 0, got: %i", g_timerCallbackCalled); /* Try to remove timer again (should be a NOOP) */ result = SDL_RemoveTimer(id); SDLTest_AssertPass("Call to SDL_RemoveTimer()"); - SDLTest_AssertCheck(result == SDL_FALSE, "Check result value, expected: SDL_FALSE, got: %i", result); + SDLTest_AssertCheck(result == false, "Check result value, expected: false, got: %i", result); /* Reset state */ param = SDLTest_RandomIntegerInRange(-1024, 1024); @@ -167,7 +167,7 @@ static int SDLCALL timer_addRemoveTimer(void *arg) /* Remove timer again and check that callback was called */ result = SDL_RemoveTimer(id); SDLTest_AssertPass("Call to SDL_RemoveTimer()"); - SDLTest_AssertCheck(result == SDL_FALSE, "Check result value, expected: SDL_FALSE, got: %i", result); + SDLTest_AssertCheck(result == false, "Check result value, expected: false, got: %i", result); SDLTest_AssertCheck(g_timerCallbackCalled == 1, "Check callback WAS called, expected: 1, got: %i", g_timerCallbackCalled); return TEST_COMPLETED; diff --git a/test/testautomation_video.c b/test/testautomation_video.c index 96b860a1c..e9b2433f1 100644 --- a/test/testautomation_video.c +++ b/test/testautomation_video.c @@ -18,8 +18,8 @@ static SDL_Window *createVideoSuiteTestWindow(const char *title) int w, h; int count; SDL_WindowFlags flags; - SDL_bool needs_renderer = SDL_FALSE; - SDL_bool needs_events_pumped = SDL_FALSE; + bool needs_renderer = false; + bool needs_events_pumped = false; /* Standard window */ w = SDLTest_RandomIntegerInRange(320, 1024); @@ -40,16 +40,16 @@ static SDL_Window *createVideoSuiteTestWindow(const char *title) * This is required for the mouse/keyboard grab tests to pass. */ if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "wayland") == 0) { - needs_renderer = SDL_TRUE; + needs_renderer = true; } else if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "x11") == 0) { /* Try to detect if the x11 driver is running under XWayland */ const char *session_type = SDL_GetEnvironmentVariable(SDL_GetEnvironment(), "XDG_SESSION_TYPE"); if (session_type && SDL_strcasecmp(session_type, "wayland") == 0) { - needs_renderer = SDL_TRUE; + needs_renderer = true; } /* X11 needs the initial events pumped, or it can erroneously deliver old configuration events at a later time. */ - needs_events_pumped = SDL_TRUE; + needs_events_pumped = true; } if (needs_renderer) { @@ -100,13 +100,13 @@ static void destroyVideoSuiteTestWindow(SDL_Window *window) */ static int SDLCALL video_enableDisableScreensaver(void *arg) { - SDL_bool initialResult; - SDL_bool result; + bool initialResult; + bool result; /* Get current state and proceed according to current state */ initialResult = SDL_ScreenSaverEnabled(); SDLTest_AssertPass("Call to SDL_ScreenSaverEnabled()"); - if (initialResult == SDL_TRUE) { + if (initialResult == true) { /* Currently enabled: disable first, then enable again */ @@ -115,14 +115,14 @@ static int SDLCALL video_enableDisableScreensaver(void *arg) SDLTest_AssertPass("Call to SDL_DisableScreenSaver()"); result = SDL_ScreenSaverEnabled(); SDLTest_AssertPass("Call to SDL_ScreenSaverEnabled()"); - SDLTest_AssertCheck(result == SDL_FALSE, "Verify result from SDL_ScreenSaverEnabled, expected: %i, got: %i", SDL_FALSE, result); + SDLTest_AssertCheck(result == false, "Verify result from SDL_ScreenSaverEnabled, expected: %i, got: %i", false, result); /* Enable screensaver and check */ SDL_EnableScreenSaver(); SDLTest_AssertPass("Call to SDL_EnableScreenSaver()"); result = SDL_ScreenSaverEnabled(); SDLTest_AssertPass("Call to SDL_ScreenSaverEnabled()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify result from SDL_ScreenSaverEnabled, expected: %i, got: %i", SDL_TRUE, result); + SDLTest_AssertCheck(result == true, "Verify result from SDL_ScreenSaverEnabled, expected: %i, got: %i", true, result); } else { @@ -133,14 +133,14 @@ static int SDLCALL video_enableDisableScreensaver(void *arg) SDLTest_AssertPass("Call to SDL_EnableScreenSaver()"); result = SDL_ScreenSaverEnabled(); SDLTest_AssertPass("Call to SDL_ScreenSaverEnabled()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify result from SDL_ScreenSaverEnabled, expected: %i, got: %i", SDL_TRUE, result); + SDLTest_AssertCheck(result == true, "Verify result from SDL_ScreenSaverEnabled, expected: %i, got: %i", true, result); /* Disable screensaver and check */ SDL_DisableScreenSaver(); SDLTest_AssertPass("Call to SDL_DisableScreenSaver()"); result = SDL_ScreenSaverEnabled(); SDLTest_AssertPass("Call to SDL_ScreenSaverEnabled()"); - SDLTest_AssertCheck(result == SDL_FALSE, "Verify result from SDL_ScreenSaverEnabled, expected: %i, got: %i", SDL_FALSE, result); + SDLTest_AssertCheck(result == false, "Verify result from SDL_ScreenSaverEnabled, expected: %i, got: %i", false, result); } return TEST_COMPLETED; @@ -358,9 +358,9 @@ static int SDLCALL video_getClosestDisplayModeCurrentResolution(void *arg) SDL_memcpy(¤t, modes[0], sizeof(current)); /* Make call */ - result = SDL_GetClosestFullscreenDisplayMode(displays[i], current.w, current.h, current.refresh_rate, SDL_FALSE, &closest); + result = SDL_GetClosestFullscreenDisplayMode(displays[i], current.w, current.h, current.refresh_rate, false, &closest); SDLTest_AssertPass("Call to SDL_GetClosestFullscreenDisplayMode(target=current)"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); /* Check that one gets the current resolution back again */ if (result == 0) { @@ -409,7 +409,7 @@ static int SDLCALL video_getClosestDisplayModeRandomResolution(void *arg) target.refresh_rate = (variation & 8) ? (float)SDLTest_RandomIntegerInRange(25, 120) : 0.0f; /* Make call; may or may not find anything, so don't validate any further */ - SDL_GetClosestFullscreenDisplayMode(displays[i], target.w, target.h, target.refresh_rate, SDL_FALSE, &closest); + SDL_GetClosestFullscreenDisplayMode(displays[i], target.w, target.h, target.refresh_rate, false, &closest); SDLTest_AssertPass("Call to SDL_GetClosestFullscreenDisplayMode(target=random/variation%d)", variation); } } @@ -482,13 +482,13 @@ static int SDLCALL video_getWindowDisplayModeNegative(void *arg) } /* Helper for setting and checking the window mouse grab state */ -static void setAndCheckWindowMouseGrabState(SDL_Window *window, SDL_bool desiredState) +static void setAndCheckWindowMouseGrabState(SDL_Window *window, bool desiredState) { - SDL_bool currentState; + bool currentState; /* Set state */ SDL_SetWindowMouseGrab(window, desiredState); - SDLTest_AssertPass("Call to SDL_SetWindowMouseGrab(%s)", (desiredState == SDL_FALSE) ? "SDL_FALSE" : "SDL_TRUE"); + SDLTest_AssertPass("Call to SDL_SetWindowMouseGrab(%s)", (desiredState == false) ? "false" : "true"); /* Get and check state */ currentState = SDL_GetWindowMouseGrab(window); @@ -496,8 +496,8 @@ static void setAndCheckWindowMouseGrabState(SDL_Window *window, SDL_bool desired SDLTest_AssertCheck( currentState == desiredState, "Validate returned state; expected: %s, got: %s", - (desiredState == SDL_FALSE) ? "SDL_FALSE" : "SDL_TRUE", - (currentState == SDL_FALSE) ? "SDL_FALSE" : "SDL_TRUE"); + (desiredState == false) ? "false" : "true", + (currentState == false) ? "false" : "true"); if (desiredState) { SDLTest_AssertCheck( @@ -514,13 +514,13 @@ static void setAndCheckWindowMouseGrabState(SDL_Window *window, SDL_bool desired } /* Helper for setting and checking the window keyboard grab state */ -static void setAndCheckWindowKeyboardGrabState(SDL_Window *window, SDL_bool desiredState) +static void setAndCheckWindowKeyboardGrabState(SDL_Window *window, bool desiredState) { - SDL_bool currentState; + bool currentState; /* Set state */ SDL_SetWindowKeyboardGrab(window, desiredState); - SDLTest_AssertPass("Call to SDL_SetWindowKeyboardGrab(%s)", (desiredState == SDL_FALSE) ? "SDL_FALSE" : "SDL_TRUE"); + SDLTest_AssertPass("Call to SDL_SetWindowKeyboardGrab(%s)", (desiredState == false) ? "false" : "true"); /* Get and check state */ currentState = SDL_GetWindowKeyboardGrab(window); @@ -528,8 +528,8 @@ static void setAndCheckWindowKeyboardGrabState(SDL_Window *window, SDL_bool desi SDLTest_AssertCheck( currentState == desiredState, "Validate returned state; expected: %s, got: %s", - (desiredState == SDL_FALSE) ? "SDL_FALSE" : "SDL_TRUE", - (currentState == SDL_FALSE) ? "SDL_FALSE" : "SDL_TRUE"); + (desiredState == false) ? "false" : "true", + (currentState == false) ? "false" : "true"); if (desiredState) { SDLTest_AssertCheck( @@ -557,8 +557,8 @@ static int SDLCALL video_getSetWindowGrab(void *arg) { const char *title = "video_getSetWindowGrab Test Window"; SDL_Window *window; - SDL_bool originalMouseState, originalKeyboardState; - SDL_bool hasFocusGained = SDL_FALSE; + bool originalMouseState, originalKeyboardState; + bool hasFocusGained = false; /* Call against new test window */ window = createVideoSuiteTestWindow(title); @@ -578,15 +578,15 @@ static int SDLCALL video_getSetWindowGrab(void *arg) while (!hasFocusGained && count++ < 3) { while (SDL_PollEvent(&evt)) { if (evt.type == SDL_EVENT_WINDOW_FOCUS_GAINED) { - hasFocusGained = SDL_TRUE; + hasFocusGained = true; } } } } else { - hasFocusGained = SDL_TRUE; + hasFocusGained = true; } - SDLTest_AssertCheck(hasFocusGained == SDL_TRUE, "Expectded window with focus"); + SDLTest_AssertCheck(hasFocusGained == true, "Expectded window with focus"); /* Get state */ originalMouseState = SDL_GetWindowMouseGrab(window); @@ -595,39 +595,39 @@ static int SDLCALL video_getSetWindowGrab(void *arg) SDLTest_AssertPass("Call to SDL_GetWindowKeyboardGrab()"); /* F */ - setAndCheckWindowKeyboardGrabState(window, SDL_FALSE); - setAndCheckWindowMouseGrabState(window, SDL_FALSE); + setAndCheckWindowKeyboardGrabState(window, false); + setAndCheckWindowMouseGrabState(window, false); SDLTest_AssertCheck(SDL_GetGrabbedWindow() == NULL, "Expected NULL grabbed window"); /* F --> F */ - setAndCheckWindowMouseGrabState(window, SDL_FALSE); - setAndCheckWindowKeyboardGrabState(window, SDL_FALSE); + setAndCheckWindowMouseGrabState(window, false); + setAndCheckWindowKeyboardGrabState(window, false); SDLTest_AssertCheck(SDL_GetGrabbedWindow() == NULL, "Expected NULL grabbed window"); /* F --> T */ - setAndCheckWindowMouseGrabState(window, SDL_TRUE); - setAndCheckWindowKeyboardGrabState(window, SDL_TRUE); + setAndCheckWindowMouseGrabState(window, true); + setAndCheckWindowKeyboardGrabState(window, true); /* T --> T */ - setAndCheckWindowKeyboardGrabState(window, SDL_TRUE); - setAndCheckWindowMouseGrabState(window, SDL_TRUE); + setAndCheckWindowKeyboardGrabState(window, true); + setAndCheckWindowMouseGrabState(window, true); /* M: T --> F */ /* K: T --> T */ - setAndCheckWindowKeyboardGrabState(window, SDL_TRUE); - setAndCheckWindowMouseGrabState(window, SDL_FALSE); + setAndCheckWindowKeyboardGrabState(window, true); + setAndCheckWindowMouseGrabState(window, false); /* M: F --> T */ /* K: T --> F */ - setAndCheckWindowMouseGrabState(window, SDL_TRUE); - setAndCheckWindowKeyboardGrabState(window, SDL_FALSE); + setAndCheckWindowMouseGrabState(window, true); + setAndCheckWindowKeyboardGrabState(window, false); /* M: T --> F */ /* K: F --> F */ - setAndCheckWindowMouseGrabState(window, SDL_FALSE); - setAndCheckWindowKeyboardGrabState(window, SDL_FALSE); + setAndCheckWindowMouseGrabState(window, false); + setAndCheckWindowKeyboardGrabState(window, false); SDLTest_AssertCheck(SDL_GetGrabbedWindow() == NULL, "Expected NULL grabbed window"); @@ -640,20 +640,20 @@ static int SDLCALL video_getSetWindowGrab(void *arg) SDLTest_AssertPass("Call to SDL_GetWindowKeyboardGrab(window=NULL)"); checkInvalidWindowError(); - SDL_SetWindowMouseGrab(NULL, SDL_FALSE); - SDLTest_AssertPass("Call to SDL_SetWindowMouseGrab(window=NULL,SDL_FALSE)"); + SDL_SetWindowMouseGrab(NULL, false); + SDLTest_AssertPass("Call to SDL_SetWindowMouseGrab(window=NULL,false)"); checkInvalidWindowError(); - SDL_SetWindowKeyboardGrab(NULL, SDL_FALSE); - SDLTest_AssertPass("Call to SDL_SetWindowKeyboardGrab(window=NULL,SDL_FALSE)"); + SDL_SetWindowKeyboardGrab(NULL, false); + SDLTest_AssertPass("Call to SDL_SetWindowKeyboardGrab(window=NULL,false)"); checkInvalidWindowError(); - SDL_SetWindowMouseGrab(NULL, SDL_TRUE); - SDLTest_AssertPass("Call to SDL_SetWindowMouseGrab(window=NULL,SDL_TRUE)"); + SDL_SetWindowMouseGrab(NULL, true); + SDLTest_AssertPass("Call to SDL_SetWindowMouseGrab(window=NULL,true)"); checkInvalidWindowError(); - SDL_SetWindowKeyboardGrab(NULL, SDL_TRUE); - SDLTest_AssertPass("Call to SDL_SetWindowKeyboardGrab(window=NULL,SDL_TRUE)"); + SDL_SetWindowKeyboardGrab(NULL, true); + SDLTest_AssertPass("Call to SDL_SetWindowKeyboardGrab(window=NULL,true)"); checkInvalidWindowError(); /* Restore state */ @@ -759,31 +759,31 @@ static int SDLCALL video_getWindowPixelFormat(void *arg) } -static SDL_bool getPositionFromEvent(int *x, int *y) +static bool getPositionFromEvent(int *x, int *y) { - SDL_bool ret = SDL_FALSE; + bool ret = false; SDL_Event evt; SDL_zero(evt); while (SDL_PollEvent(&evt)) { if (evt.type == SDL_EVENT_WINDOW_MOVED) { *x = evt.window.data1; *y = evt.window.data2; - ret = SDL_TRUE; + ret = true; } } return ret; } -static SDL_bool getSizeFromEvent(int *w, int *h) +static bool getSizeFromEvent(int *w, int *h) { - SDL_bool ret = SDL_FALSE; + bool ret = false; SDL_Event evt; SDL_zero(evt); while (SDL_PollEvent(&evt)) { if (evt.type == SDL_EVENT_WINDOW_RESIZED) { *w = evt.window.data1; *h = evt.window.data2; - ret = SDL_TRUE; + ret = true; } } return ret; @@ -891,7 +891,7 @@ static int SDLCALL video_getSetWindowPosition(void *arg) result = SDL_SyncWindow(window); SDLTest_AssertPass("SDL_SyncWindow()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); /* Get position */ currentX = desiredX + 1; @@ -903,13 +903,13 @@ static int SDLCALL video_getSetWindowPosition(void *arg) SDLTest_AssertCheck(desiredX == currentX, "Verify returned X position; expected: %d, got: %d", desiredX, currentX); SDLTest_AssertCheck(desiredY == currentY, "Verify returned Y position; expected: %d, got: %d", desiredY, currentY); } else { - SDL_bool hasEvent; + bool hasEvent; /* SDL_SetWindowPosition() and SDL_SetWindowSize() will make requests of the window manager and set the internal position and size, * and then we get events signaling what actually happened, and they get passed on to the application if they're not what we expect. */ currentX = desiredX + 1; currentY = desiredY + 1; hasEvent = getPositionFromEvent(¤tX, ¤tY); - SDLTest_AssertCheck(hasEvent == SDL_TRUE, "Changing position was not honored by WM, checking present of SDL_EVENT_WINDOW_MOVED"); + SDLTest_AssertCheck(hasEvent == true, "Changing position was not honored by WM, checking present of SDL_EVENT_WINDOW_MOVED"); if (hasEvent) { SDLTest_AssertCheck(desiredX == currentX, "Verify returned X position is the position from SDL event; expected: %d, got: %d", desiredX, currentX); SDLTest_AssertCheck(desiredY == currentY, "Verify returned Y position is the position from SDL event; expected: %d, got: %d", desiredY, currentY); @@ -1006,7 +1006,7 @@ static int SDLCALL video_getSetWindowSize(void *arg) int referenceW, referenceH; int currentW, currentH; int desiredW, desiredH; - const SDL_bool restoreHint = SDL_GetHintBoolean("SDL_BORDERLESS_RESIZABLE_STYLE", SDL_TRUE); + const bool restoreHint = SDL_GetHintBoolean("SDL_BORDERLESS_RESIZABLE_STYLE", true); /* Win32 borderless windows are not resizable by default and need this undocumented hint */ SDL_SetHint("SDL_BORDERLESS_RESIZABLE_STYLE", "1"); @@ -1014,7 +1014,7 @@ static int SDLCALL video_getSetWindowSize(void *arg) /* Get display bounds for size range */ result = SDL_GetDisplayUsableBounds(SDL_GetPrimaryDisplay(), &display); SDLTest_AssertPass("SDL_GetDisplayUsableBounds()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); if (!result) { return TEST_ABORTED; } @@ -1098,7 +1098,7 @@ static int SDLCALL video_getSetWindowSize(void *arg) result = SDL_SyncWindow(window); SDLTest_AssertPass("SDL_SyncWindow()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); /* Get size */ currentW = desiredW + 1; @@ -1110,13 +1110,13 @@ static int SDLCALL video_getSetWindowSize(void *arg) SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentW); SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredH, currentH); } else { - SDL_bool hasEvent; + bool hasEvent; /* SDL_SetWindowPosition() and SDL_SetWindowSize() will make requests of the window manager and set the internal position and size, * and then we get events signaling what actually happened, and they get passed on to the application if they're not what we expect. */ currentW = desiredW + 1; currentH = desiredH + 1; hasEvent = getSizeFromEvent(¤tW, ¤tH); - SDLTest_AssertCheck(hasEvent == SDL_TRUE, "Changing size was not honored by WM, checking presence of SDL_EVENT_WINDOW_RESIZED"); + SDLTest_AssertCheck(hasEvent == true, "Changing size was not honored by WM, checking presence of SDL_EVENT_WINDOW_RESIZED"); if (hasEvent) { SDLTest_AssertCheck(desiredW == currentW, "Verify returned width is the one from SDL event; expected: %d, got: %d", desiredW, currentW); SDLTest_AssertCheck(desiredH == currentH, "Verify returned height is the one from SDL event; expected: %d, got: %d", desiredH, currentH); @@ -1213,7 +1213,7 @@ static int SDLCALL video_getSetWindowMinimumSize(void *arg) /* Get display bounds for size range */ result = SDL_GetDisplayBounds(SDL_GetPrimaryDisplay(), &display); SDLTest_AssertPass("SDL_GetDisplayBounds()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); if (!result) { return TEST_ABORTED; } @@ -1355,7 +1355,7 @@ static int SDLCALL video_getSetWindowMaximumSize(void *arg) /* Get display bounds for size range */ result = SDL_GetDisplayBounds(SDL_GetPrimaryDisplay(), &display); SDLTest_AssertPass("SDL_GetDisplayBounds()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); if (!result) { return TEST_ABORTED; } @@ -1684,8 +1684,8 @@ static int SDLCALL video_setWindowCenteredOnDisplay(void *arg) int result; SDL_Rect display0, display1; const char *video_driver = SDL_GetCurrentVideoDriver(); - SDL_bool video_driver_is_wayland = SDL_strcmp(video_driver, "wayland") == 0; - SDL_bool video_driver_is_emscripten = SDL_strcmp(video_driver, "emscripten") == 0; + bool video_driver_is_wayland = SDL_strcmp(video_driver, "wayland") == 0; + bool video_driver_is_emscripten = SDL_strcmp(video_driver, "emscripten") == 0; displays = SDL_GetDisplays(&displayNum); if (displays) { @@ -1693,14 +1693,14 @@ static int SDLCALL video_setWindowCenteredOnDisplay(void *arg) /* Get display bounds */ result = SDL_GetDisplayUsableBounds(displays[0 % displayNum], &display0); SDLTest_AssertPass("SDL_GetDisplayUsableBounds()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); if (!result) { return TEST_ABORTED; } result = SDL_GetDisplayUsableBounds(displays[1 % displayNum], &display1); SDLTest_AssertPass("SDL_GetDisplayUsableBounds()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); if (!result) { return TEST_ABORTED; } @@ -1731,7 +1731,7 @@ static int SDLCALL video_setWindowCenteredOnDisplay(void *arg) SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_Y_NUMBER, y); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, w); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER, h); - SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_BORDERLESS_BOOLEAN, SDL_TRUE); + SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_BORDERLESS_BOOLEAN, true); window = SDL_CreateWindowWithProperties(props); SDL_DestroyProperties(props); SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%d,%d,SHOWN)", x, y, w, h); @@ -1780,12 +1780,12 @@ static int SDLCALL video_setWindowCenteredOnDisplay(void *arg) /* Enter fullscreen desktop */ SDL_SetWindowPosition(window, x, y); - result = SDL_SetWindowFullscreen(window, SDL_TRUE); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + result = SDL_SetWindowFullscreen(window, true); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); result = SDL_SyncWindow(window); SDLTest_AssertPass("SDL_SyncWindow()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); /* Check we are filling the full display */ currentDisplay = SDL_GetDisplayForWindow(window); @@ -1798,7 +1798,7 @@ static int SDLCALL video_setWindowCenteredOnDisplay(void *arg) */ result = SDL_GetDisplayBounds(expectedDisplay, &expectedFullscreenRect); SDLTest_AssertPass("SDL_GetDisplayBounds()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); if (video_driver_is_wayland) { SDLTest_Log("Skipping display ID validation: Wayland driver does not support window positioning"); @@ -1820,12 +1820,12 @@ static int SDLCALL video_setWindowCenteredOnDisplay(void *arg) } /* Leave fullscreen desktop */ - result = SDL_SetWindowFullscreen(window, SDL_FALSE); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + result = SDL_SetWindowFullscreen(window, false); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); result = SDL_SyncWindow(window); SDLTest_AssertPass("SDL_SyncWindow()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); /* Check window was restored correctly */ currentDisplay = SDL_GetDisplayForWindow(window); @@ -1862,7 +1862,7 @@ static int SDLCALL video_setWindowCenteredOnDisplay(void *arg) result = SDL_SyncWindow(window); SDLTest_AssertPass("SDL_SyncWindow()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); currentDisplay = SDL_GetDisplayForWindow(window); SDL_GetWindowSize(window, ¤tW, ¤tH); @@ -1919,8 +1919,8 @@ static int SDLCALL video_getSetWindowState(void *arg) int currentW, currentH; int desiredW = 0, desiredH = 0; SDL_WindowFlags skipFlags = 0; - const SDL_bool restoreHint = SDL_GetHintBoolean("SDL_BORDERLESS_RESIZABLE_STYLE", SDL_TRUE); - const SDL_bool skipPos = SDL_strcmp(SDL_GetCurrentVideoDriver(), "wayland") == 0; + const bool restoreHint = SDL_GetHintBoolean("SDL_BORDERLESS_RESIZABLE_STYLE", true); + const bool skipPos = SDL_strcmp(SDL_GetCurrentVideoDriver(), "wayland") == 0; /* This test is known to be good only on GNOME and KDE. At the time of writing, Weston seems to have maximize related bugs * that prevent it from running correctly (no configure events are received when unsetting maximize), and tiling window @@ -1966,7 +1966,7 @@ static int SDLCALL video_getSetWindowState(void *arg) result = SDL_SyncWindow(window); SDLTest_AssertPass("SDL_SyncWindow()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); flags = SDL_GetWindowFlags(window); SDLTest_AssertPass("SDL_GetWindowFlags()"); @@ -1979,7 +1979,7 @@ static int SDLCALL video_getSetWindowState(void *arg) if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "windows") != 0) { result = SDL_GetDisplayUsableBounds(SDL_GetDisplayForWindow(window), &display); SDLTest_AssertPass("SDL_GetDisplayUsableBounds()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); desiredW = display.w; desiredH = display.h; @@ -1996,11 +1996,11 @@ static int SDLCALL video_getSetWindowState(void *arg) /* Restore and check the dimensions */ result = SDL_RestoreWindow(window); SDLTest_AssertPass("SDL_RestoreWindow()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); result = SDL_SyncWindow(window); SDLTest_AssertPass("SDL_SyncWindow()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); flags = SDL_GetWindowFlags(window); SDLTest_AssertPass("SDL_GetWindowFlags()"); @@ -2025,15 +2025,15 @@ static int SDLCALL video_getSetWindowState(void *arg) /* Maximize, then immediately restore */ result = SDL_MaximizeWindow(window); SDLTest_AssertPass("SDL_MaximizeWindow()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); result = SDL_RestoreWindow(window); SDLTest_AssertPass("SDL_RestoreWindow()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); result = SDL_SyncWindow(window); SDLTest_AssertPass("SDL_SyncWindow()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); flags = SDL_GetWindowFlags(window); SDLTest_AssertPass("SDL_GetWindowFlags()"); @@ -2059,15 +2059,15 @@ static int SDLCALL video_getSetWindowState(void *arg) /* Maximize, then enter fullscreen */ result = SDL_MaximizeWindow(window); SDLTest_AssertPass("SDL_MaximizeWindow()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); - result = SDL_SetWindowFullscreen(window, SDL_TRUE); - SDLTest_AssertPass("SDL_SetWindowFullscreen(SDL_TRUE)"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + result = SDL_SetWindowFullscreen(window, true); + SDLTest_AssertPass("SDL_SetWindowFullscreen(true)"); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); result = SDL_SyncWindow(window); SDLTest_AssertPass("SDL_SyncWindow()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); flags = SDL_GetWindowFlags(window); SDLTest_AssertPass("SDL_GetWindowFlags()"); @@ -2077,7 +2077,7 @@ static int SDLCALL video_getSetWindowState(void *arg) /* Verify the fullscreen size and position */ result = SDL_GetDisplayBounds(SDL_GetDisplayForWindow(window), &display); SDLTest_AssertPass("SDL_GetDisplayBounds()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); if (!skipPos) { desiredX = display.x; @@ -2100,17 +2100,17 @@ static int SDLCALL video_getSetWindowState(void *arg) SDLTest_AssertCheck(currentH == desiredH, "Verify returned height; expected: %d, got: %d", desiredH, currentH); /* Leave fullscreen and restore the window */ - result = SDL_SetWindowFullscreen(window, SDL_FALSE); - SDLTest_AssertPass("SDL_SetWindowFullscreen(SDL_FALSE)"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + result = SDL_SetWindowFullscreen(window, false); + SDLTest_AssertPass("SDL_SetWindowFullscreen(false)"); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); result = SDL_RestoreWindow(window); SDLTest_AssertPass("SDL_RestoreWindow()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); result = SDL_SyncWindow(window); SDLTest_AssertPass("SDL_SyncWindow()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); flags = SDL_GetWindowFlags(window); SDLTest_AssertPass("SDL_GetWindowFlags()"); @@ -2136,29 +2136,29 @@ static int SDLCALL video_getSetWindowState(void *arg) /* Maximize, change size, and restore */ result = SDL_MaximizeWindow(window); SDLTest_AssertPass("SDL_MaximizeWindow()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); desiredW = windowedW + 10; desiredH = windowedH + 10; result = SDL_SetWindowSize(window, desiredW, desiredH); SDLTest_AssertPass("SDL_SetWindowSize()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); if (!skipPos) { desiredX = windowedX + 10; desiredY = windowedY + 10; result = SDL_SetWindowPosition(window, desiredX, desiredY); SDLTest_AssertPass("SDL_SetWindowPosition()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); } result = SDL_RestoreWindow(window); SDLTest_AssertPass("SDL_RestoreWindow()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); result = SDL_SyncWindow(window); SDLTest_AssertPass("SDL_SyncWindow()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); flags = SDL_GetWindowFlags(window); SDLTest_AssertPass("SDL_GetWindowFlags()"); @@ -2185,27 +2185,27 @@ static int SDLCALL video_getSetWindowState(void *arg) desiredH = windowedH - 5; result = SDL_SetWindowSize(window, desiredW, desiredH); SDLTest_AssertPass("SDL_SetWindowSize()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); if (!skipPos) { desiredX = windowedX + 5; desiredY = windowedY + 5; result = SDL_SetWindowPosition(window, desiredX, desiredY); SDLTest_AssertPass("SDL_SetWindowPosition()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); } result = SDL_MaximizeWindow(window); SDLTest_AssertPass("SDL_MaximizeWindow()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); result = SDL_RestoreWindow(window); SDLTest_AssertPass("SDL_RestoreWindow()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); result = SDL_SyncWindow(window); SDLTest_AssertPass("SDL_SyncWindow()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); flags = SDL_GetWindowFlags(window); SDLTest_AssertPass("SDL_GetWindowFlags()"); @@ -2233,11 +2233,11 @@ minimize_test: result = SDL_MinimizeWindow(window); if (result) { SDLTest_AssertPass("SDL_MinimizeWindow()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); result = SDL_SyncWindow(window); SDLTest_AssertPass("SDL_SyncWindow()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); flags = SDL_GetWindowFlags(window); SDLTest_AssertPass("SDL_GetWindowFlags()"); @@ -2285,7 +2285,7 @@ static int SDLCALL video_createMinimized(void *arg) if (SDL_GetWindowFlags(window) & SDL_WINDOW_MINIMIZED) { result = SDL_RestoreWindow(window); SDLTest_AssertPass("SDL_RestoreWindow()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); } else { SDLTest_Log("Requested minimized window on creation, but that isn't supported on this platform."); } @@ -2324,7 +2324,7 @@ static int SDLCALL video_createMaximized(void *arg) if (SDL_GetWindowFlags(window) & SDL_WINDOW_MAXIMIZED) { result = SDL_RestoreWindow(window); SDLTest_AssertPass("SDL_RestoreWindow()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); } else { SDLTest_Log("Requested maximized window on creation, but that isn't supported on this platform."); } @@ -2364,7 +2364,7 @@ static int SDLCALL video_getWindowSurface(void *arg) result = SDL_UpdateWindowSurface(window); SDLTest_AssertPass("Call to SDL_UpdateWindowSurface(window)"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); /* We shouldn't be able to create a renderer on a window with a surface */ renderer = SDL_CreateRenderer(window, renderer_name); @@ -2373,7 +2373,7 @@ static int SDLCALL video_getWindowSurface(void *arg) result = SDL_DestroyWindowSurface(window); SDLTest_AssertPass("Call to SDL_DestroyWindowSurface(window)"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify return value; expected: SDL_TRUE, got: %d", result); + SDLTest_AssertCheck(result == true, "Verify return value; expected: true, got: %d", result); SDLTest_AssertCheck(!SDL_WindowHasSurface(window), "Validate that window does not have a surface"); /* We should be able to create a renderer on the window now */ diff --git a/test/testcamera.c b/test/testcamera.c index 3a02c8162..0df3d91ee 100644 --- a/test/testcamera.c +++ b/test/testcamera.c @@ -21,7 +21,7 @@ static SDLTest_CommonState *state = NULL; static SDL_Camera *camera = NULL; static SDL_CameraSpec spec; static SDL_Texture *texture = NULL; -static SDL_bool texture_updated = SDL_FALSE; +static bool texture_updated = false; static SDL_Surface *frame_current = NULL; static SDL_CameraID front_camera = 0; static SDL_CameraID back_camera = 0; @@ -302,7 +302,7 @@ SDL_AppResult SDL_AppIterate(void *appstate) * But in case of 0-copy, it's needed to have the frame while using the texture. */ frame_current = frame_next; - texture_updated = SDL_FALSE; + texture_updated = false; } if (frame_current) { @@ -336,7 +336,7 @@ SDL_AppResult SDL_AppIterate(void *appstate) /* Update SDL_Texture with last video frame (only once per new frame) */ if (frame_current && !texture_updated) { SDL_UpdateTexture(texture, NULL, frame_current->pixels, frame_current->pitch); - texture_updated = SDL_TRUE; + texture_updated = true; } SDL_GetTextureSize(texture, &tw, &th); diff --git a/test/testcolorspace.c b/test/testcolorspace.c index 53ddb8e8f..a1e4deff4 100644 --- a/test/testcolorspace.c +++ b/test/testcolorspace.c @@ -59,10 +59,10 @@ static void FreeRenderer(void) static void UpdateHDRState(void) { SDL_PropertiesID props; - SDL_bool HDR_enabled; + bool HDR_enabled; props = SDL_GetWindowProperties(window); - HDR_enabled = SDL_GetBooleanProperty(props, SDL_PROP_WINDOW_HDR_ENABLED_BOOLEAN, SDL_FALSE); + HDR_enabled = SDL_GetBooleanProperty(props, SDL_PROP_WINDOW_HDR_ENABLED_BOOLEAN, false); SDL_Log("HDR %s\n", HDR_enabled ? "enabled" : "disabled"); @@ -144,11 +144,11 @@ static void PrevStage(void) } } -static SDL_bool ReadPixel(int x, int y, SDL_Color *c) +static bool ReadPixel(int x, int y, SDL_Color *c) { SDL_Surface *surface; SDL_Rect r; - SDL_bool result = SDL_FALSE; + bool result = false; r.x = x; r.y = y; @@ -161,7 +161,7 @@ static SDL_bool ReadPixel(int x, int y, SDL_Color *c) SDL_SetStringProperty(SDL_GetSurfaceProperties(surface), SDL_PROP_SURFACE_TONEMAP_OPERATOR_STRING, "*=1"); if (SDL_ReadSurfacePixel(surface, 0, 0, &c->r, &c->g, &c->b, &c->a)) { - result = SDL_TRUE; + result = true; } else { SDL_Log("Couldn't read pixel: %s\n", SDL_GetError()); } diff --git a/test/testcontroller.c b/test/testcontroller.c index fa6a8f007..6b7f9680c 100644 --- a/test/testcontroller.c +++ b/test/testcontroller.c @@ -42,7 +42,7 @@ typedef struct { - SDL_bool m_bMoving; + bool m_bMoving; int m_nLastValue; int m_nStartingValue; int m_nFarthestValue; @@ -58,7 +58,7 @@ typedef struct SDL_Gamepad *gamepad; char *mapping; - SDL_bool has_bindings; + bool has_bindings; int audio_route; int trigger_effect; @@ -78,30 +78,30 @@ static GamepadButton *clear_button = NULL; static GamepadButton *copy_button = NULL; static GamepadButton *paste_button = NULL; static char *backup_mapping = NULL; -static SDL_bool done = SDL_FALSE; -static SDL_bool set_LED = SDL_FALSE; +static bool done = false; +static bool set_LED = false; static int num_controllers = 0; static Controller *controllers; static Controller *controller; static SDL_JoystickID mapping_controller = 0; static int binding_element = SDL_GAMEPAD_ELEMENT_INVALID; static int last_binding_element = SDL_GAMEPAD_ELEMENT_INVALID; -static SDL_bool binding_flow = SDL_FALSE; +static bool binding_flow = false; static int binding_flow_direction = 0; static Uint64 binding_advance_time = 0; static SDL_FRect title_area; -static SDL_bool title_highlighted; -static SDL_bool title_pressed; +static bool title_highlighted; +static bool title_pressed; static SDL_FRect type_area; -static SDL_bool type_highlighted; -static SDL_bool type_pressed; +static bool type_highlighted; +static bool type_pressed; static char *controller_name; static SDL_Joystick *virtual_joystick = NULL; static SDL_GamepadAxis virtual_axis_active = SDL_GAMEPAD_AXIS_INVALID; static float virtual_axis_start_x; static float virtual_axis_start_y; static SDL_GamepadButton virtual_button_active = SDL_GAMEPAD_BUTTON_INVALID; -static SDL_bool virtual_touchpad_active = SDL_FALSE; +static bool virtual_touchpad_active = false; static float virtual_touchpad_x; static float virtual_touchpad_y; @@ -254,24 +254,24 @@ static void CyclePS5TriggerEffect(Controller *device) static void ClearButtonHighlights(void) { - title_highlighted = SDL_FALSE; - title_pressed = SDL_FALSE; + title_highlighted = false; + title_pressed = false; - type_highlighted = SDL_FALSE; - type_pressed = SDL_FALSE; + type_highlighted = false; + type_pressed = false; ClearGamepadImage(image); - SetGamepadDisplayHighlight(gamepad_elements, SDL_GAMEPAD_ELEMENT_INVALID, SDL_FALSE); - SetGamepadTypeDisplayHighlight(gamepad_type, SDL_GAMEPAD_TYPE_UNSELECTED, SDL_FALSE); - SetGamepadButtonHighlight(setup_mapping_button, SDL_FALSE, SDL_FALSE); - SetGamepadButtonHighlight(done_mapping_button, SDL_FALSE, SDL_FALSE); - SetGamepadButtonHighlight(cancel_button, SDL_FALSE, SDL_FALSE); - SetGamepadButtonHighlight(clear_button, SDL_FALSE, SDL_FALSE); - SetGamepadButtonHighlight(copy_button, SDL_FALSE, SDL_FALSE); - SetGamepadButtonHighlight(paste_button, SDL_FALSE, SDL_FALSE); + SetGamepadDisplayHighlight(gamepad_elements, SDL_GAMEPAD_ELEMENT_INVALID, false); + SetGamepadTypeDisplayHighlight(gamepad_type, SDL_GAMEPAD_TYPE_UNSELECTED, false); + SetGamepadButtonHighlight(setup_mapping_button, false, false); + SetGamepadButtonHighlight(done_mapping_button, false, false); + SetGamepadButtonHighlight(cancel_button, false, false); + SetGamepadButtonHighlight(clear_button, false, false); + SetGamepadButtonHighlight(copy_button, false, false); + SetGamepadButtonHighlight(paste_button, false, false); } -static void UpdateButtonHighlights(float x, float y, SDL_bool button_down) +static void UpdateButtonHighlights(float x, float y, bool button_down) { ClearButtonHighlights(); @@ -285,19 +285,19 @@ static void UpdateButtonHighlights(float x, float y, SDL_bool button_down) point.x = x; point.y = y; if (SDL_PointInRectFloat(&point, &title_area)) { - title_highlighted = SDL_TRUE; + title_highlighted = true; title_pressed = button_down; } else { - title_highlighted = SDL_FALSE; - title_pressed = SDL_FALSE; + title_highlighted = false; + title_pressed = false; } if (SDL_PointInRectFloat(&point, &type_area)) { - type_highlighted = SDL_TRUE; + type_highlighted = true; type_pressed = button_down; } else { - type_highlighted = SDL_FALSE; - type_pressed = SDL_FALSE; + type_highlighted = false; + type_pressed = false; } if (controller->joystick != virtual_joystick) { @@ -364,7 +364,7 @@ static void SetAndFreeGamepadMapping(char *mapping) SDL_free(mapping); } -static void SetCurrentBindingElement(int element, SDL_bool flow) +static void SetCurrentBindingElement(int element, bool flow) { int i; @@ -400,11 +400,11 @@ static void SetNextBindingElement(void) for (i = 0; i < SDL_arraysize(s_arrBindingOrder); ++i) { if (binding_element == s_arrBindingOrder[i]) { binding_flow_direction = 1; - SetCurrentBindingElement(s_arrBindingOrder[i + 1], SDL_TRUE); + SetCurrentBindingElement(s_arrBindingOrder[i + 1], true); return; } } - SetCurrentBindingElement(SDL_GAMEPAD_ELEMENT_INVALID, SDL_FALSE); + SetCurrentBindingElement(SDL_GAMEPAD_ELEMENT_INVALID, false); } static void SetPrevBindingElement(void) @@ -418,16 +418,16 @@ static void SetPrevBindingElement(void) for (i = 1; i < SDL_arraysize(s_arrBindingOrder); ++i) { if (binding_element == s_arrBindingOrder[i]) { binding_flow_direction = -1; - SetCurrentBindingElement(s_arrBindingOrder[i - 1], SDL_TRUE); + SetCurrentBindingElement(s_arrBindingOrder[i - 1], true); return; } } - SetCurrentBindingElement(SDL_GAMEPAD_ELEMENT_INVALID, SDL_FALSE); + SetCurrentBindingElement(SDL_GAMEPAD_ELEMENT_INVALID, false); } static void StopBinding(void) { - SetCurrentBindingElement(SDL_GAMEPAD_ELEMENT_INVALID, SDL_FALSE); + SetCurrentBindingElement(SDL_GAMEPAD_ELEMENT_INVALID, false); } typedef struct @@ -436,10 +436,10 @@ typedef struct int direction; } AxisInfo; -static SDL_bool ParseAxisInfo(const char *description, AxisInfo *info) +static bool ParseAxisInfo(const char *description, AxisInfo *info) { if (!description) { - return SDL_FALSE; + return false; } if (*description == '-') { @@ -455,16 +455,16 @@ static SDL_bool ParseAxisInfo(const char *description, AxisInfo *info) if (description[0] == 'a' && SDL_isdigit(description[1])) { ++description; info->axis = SDL_atoi(description); - return SDL_TRUE; + return true; } - return SDL_FALSE; + return false; } -static void CommitBindingElement(const char *binding, SDL_bool force) +static void CommitBindingElement(const char *binding, bool force) { char *mapping; int direction = 1; - SDL_bool ignore_binding = SDL_FALSE; + bool ignore_binding = false; if (binding_element == SDL_GAMEPAD_ELEMENT_INVALID) { return; @@ -479,36 +479,36 @@ static void CommitBindingElement(const char *binding, SDL_bool force) /* If the controller generates multiple events for a single element, pick the best one */ if (!force && binding_advance_time) { char *current = GetElementBinding(mapping, binding_element); - SDL_bool native_button = (binding_element < SDL_GAMEPAD_BUTTON_COUNT); - SDL_bool native_axis = (binding_element >= SDL_GAMEPAD_BUTTON_COUNT && + bool native_button = (binding_element < SDL_GAMEPAD_BUTTON_COUNT); + bool native_axis = (binding_element >= SDL_GAMEPAD_BUTTON_COUNT && binding_element <= SDL_GAMEPAD_ELEMENT_AXIS_MAX); - SDL_bool native_trigger = (binding_element == SDL_GAMEPAD_ELEMENT_AXIS_LEFT_TRIGGER || + bool native_trigger = (binding_element == SDL_GAMEPAD_ELEMENT_AXIS_LEFT_TRIGGER || binding_element == SDL_GAMEPAD_ELEMENT_AXIS_RIGHT_TRIGGER); - SDL_bool native_dpad = (binding_element == SDL_GAMEPAD_BUTTON_DPAD_UP || + bool native_dpad = (binding_element == SDL_GAMEPAD_BUTTON_DPAD_UP || binding_element == SDL_GAMEPAD_BUTTON_DPAD_DOWN || binding_element == SDL_GAMEPAD_BUTTON_DPAD_LEFT || binding_element == SDL_GAMEPAD_BUTTON_DPAD_RIGHT); if (native_button) { - SDL_bool current_button = (current && *current == 'b'); - SDL_bool proposed_button = (binding && *binding == 'b'); + bool current_button = (current && *current == 'b'); + bool proposed_button = (binding && *binding == 'b'); if (current_button && !proposed_button) { - ignore_binding = SDL_TRUE; + ignore_binding = true; } /* Use the lower index button (we map from lower to higher button index) */ if (current_button && proposed_button && current[1] < binding[1]) { - ignore_binding = SDL_TRUE; + ignore_binding = true; } } if (native_axis) { AxisInfo current_axis_info = { 0, 0 }; AxisInfo proposed_axis_info = { 0, 0 }; - SDL_bool current_axis = ParseAxisInfo(current, ¤t_axis_info); - SDL_bool proposed_axis = ParseAxisInfo(binding, &proposed_axis_info); + bool current_axis = ParseAxisInfo(current, ¤t_axis_info); + bool proposed_axis = ParseAxisInfo(binding, &proposed_axis_info); if (current_axis) { /* Ignore this unless the proposed binding extends the existing axis */ - ignore_binding = SDL_TRUE; + ignore_binding = true; if (native_trigger && ((*current == '-' && *binding == '+' && @@ -517,24 +517,24 @@ static void CommitBindingElement(const char *binding, SDL_bool force) SDL_strcmp(current + 1, binding + 1) == 0))) { /* Merge two half axes into a whole axis for a trigger */ ++binding; - ignore_binding = SDL_FALSE; + ignore_binding = false; } /* Use the lower index axis (we map from lower to higher axis index) */ if (proposed_axis && proposed_axis_info.axis < current_axis_info.axis) { - ignore_binding = SDL_FALSE; + ignore_binding = false; } } } if (native_dpad) { - SDL_bool current_hat = (current && *current == 'h'); - SDL_bool proposed_hat = (binding && *binding == 'h'); + bool current_hat = (current && *current == 'h'); + bool proposed_hat = (binding && *binding == 'h'); if (current_hat && !proposed_hat) { - ignore_binding = SDL_TRUE; + ignore_binding = true; } /* Use the lower index hat (we map from lower to higher hat index) */ if (current_hat && proposed_hat && current[1] < binding[1]) { - ignore_binding = SDL_TRUE; + ignore_binding = true; } } SDL_free(current); @@ -550,43 +550,43 @@ static void CommitBindingElement(const char *binding, SDL_bool force) /* Bind it! */ } else if (binding_element == action_backward) { if (existing == action_forward) { - SDL_bool bound_backward = MappingHasElement(controller->mapping, action_backward); + bool bound_backward = MappingHasElement(controller->mapping, action_backward); if (bound_backward) { /* Just move on to the next one */ - ignore_binding = SDL_TRUE; + ignore_binding = true; SetNextBindingElement(); } else { /* You can't skip the backward action, go back and start over */ - ignore_binding = SDL_TRUE; + ignore_binding = true; SetPrevBindingElement(); } } else if (existing == action_backward && binding_flow_direction == -1) { /* Keep going backwards */ - ignore_binding = SDL_TRUE; + ignore_binding = true; SetPrevBindingElement(); } else { /* Bind it! */ } } else if (existing == action_forward) { /* Just move on to the next one */ - ignore_binding = SDL_TRUE; + ignore_binding = true; SetNextBindingElement(); } else if (existing == action_backward) { - ignore_binding = SDL_TRUE; + ignore_binding = true; SetPrevBindingElement(); } else if (existing == binding_element) { /* We're rebinding the same thing, just move to the next one */ - ignore_binding = SDL_TRUE; + ignore_binding = true; SetNextBindingElement(); } else if (existing == action_delete) { /* Clear the current binding and move to the next one */ binding = NULL; direction = 1; - force = SDL_TRUE; + force = true; } else if (binding_element != action_forward && binding_element != action_backward) { /* Actually, we'll just clear the existing binding */ - /*ignore_binding = SDL_TRUE;*/ + /*ignore_binding = true;*/ } } } @@ -618,7 +618,7 @@ static void CommitBindingElement(const char *binding, SDL_bool force) static void ClearBinding(void) { - CommitBindingElement(NULL, SDL_TRUE); + CommitBindingElement(NULL, true); } static void SetDisplayMode(ControllerDisplayMode mode) @@ -633,9 +633,9 @@ static void SetDisplayMode(ControllerDisplayMode mode) } mapping_controller = controller->id; if (MappingHasBindings(backup_mapping)) { - SetCurrentBindingElement(SDL_GAMEPAD_ELEMENT_INVALID, SDL_FALSE); + SetCurrentBindingElement(SDL_GAMEPAD_ELEMENT_INVALID, false); } else { - SetCurrentBindingElement(SDL_GAMEPAD_BUTTON_SOUTH, SDL_TRUE); + SetCurrentBindingElement(SDL_GAMEPAD_BUTTON_SOUTH, true); } } else { if (backup_mapping) { @@ -652,7 +652,7 @@ static void SetDisplayMode(ControllerDisplayMode mode) button_state = SDL_GetMouseState(&x, &y); SDL_RenderCoordinatesFromWindow(screen, x, y, &x, &y); - UpdateButtonHighlights(x, y, button_state ? SDL_TRUE : SDL_FALSE); + UpdateButtonHighlights(x, y, button_state ? true : false); } static void CancelMapping(void) @@ -666,7 +666,7 @@ static void CancelMapping(void) static void ClearMapping(void) { SetAndFreeGamepadMapping(NULL); - SetCurrentBindingElement(SDL_GAMEPAD_ELEMENT_INVALID, SDL_FALSE); + SetCurrentBindingElement(SDL_GAMEPAD_ELEMENT_INVALID, false); } static void CopyMapping(void) @@ -887,7 +887,7 @@ static void SetController(SDL_JoystickID id) RefreshControllerName(); } -static void AddController(SDL_JoystickID id, SDL_bool verbose) +static void AddController(SDL_JoystickID id, bool verbose) { Controller *new_controllers; Controller *new_controller; @@ -999,7 +999,7 @@ static void HandleGamepadRemapped(SDL_JoystickID id) controllers[i].has_bindings = MappingHasBindings(mapping); } -static void HandleGamepadAdded(SDL_JoystickID id, SDL_bool verbose) +static void HandleGamepadAdded(SDL_JoystickID id, bool verbose) { SDL_Gamepad *gamepad; Uint16 firmware_version; @@ -1034,15 +1034,15 @@ static void HandleGamepadAdded(SDL_JoystickID id, SDL_bool verbose) SDL_Log("Firmware version: 0x%x (%d)\n", firmware_version, firmware_version); } - if (SDL_GetBooleanProperty(props, SDL_PROP_GAMEPAD_CAP_PLAYER_LED_BOOLEAN, SDL_FALSE)) { + if (SDL_GetBooleanProperty(props, SDL_PROP_GAMEPAD_CAP_PLAYER_LED_BOOLEAN, false)) { SDL_Log("Has player LED"); } - if (SDL_GetBooleanProperty(props, SDL_PROP_GAMEPAD_CAP_RUMBLE_BOOLEAN, SDL_FALSE)) { + if (SDL_GetBooleanProperty(props, SDL_PROP_GAMEPAD_CAP_RUMBLE_BOOLEAN, false)) { SDL_Log("Rumble supported"); } - if (SDL_GetBooleanProperty(props, SDL_PROP_GAMEPAD_CAP_TRIGGER_RUMBLE_BOOLEAN, SDL_FALSE)) { + if (SDL_GetBooleanProperty(props, SDL_PROP_GAMEPAD_CAP_TRIGGER_RUMBLE_BOOLEAN, false)) { SDL_Log("Trigger rumble supported"); } @@ -1058,7 +1058,7 @@ static void HandleGamepadAdded(SDL_JoystickID id, SDL_bool verbose) if (verbose) { SDL_Log("Enabling %s at %.2f Hz\n", GetSensorName(sensor), SDL_GetGamepadSensorDataRate(gamepad, sensor)); } - SDL_SetGamepadSensorEnabled(gamepad, sensor, SDL_TRUE); + SDL_SetGamepadSensorEnabled(gamepad, sensor, true); } } @@ -1106,21 +1106,21 @@ static Uint16 ConvertAxisToRumble(Sint16 axisval) } } -static SDL_bool ShowingFront(void) +static bool ShowingFront(void) { - SDL_bool showing_front = SDL_TRUE; + bool showing_front = true; int i; /* Show the back of the gamepad if the paddles are being held or bound */ for (i = SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1; i <= SDL_GAMEPAD_BUTTON_LEFT_PADDLE2; ++i) { if (SDL_GetGamepadButton(controller->gamepad, (SDL_GamepadButton)i) || binding_element == i) { - showing_front = SDL_FALSE; + showing_front = false; break; } } if ((SDL_GetModState() & SDL_KMOD_SHIFT) && binding_element != SDL_GAMEPAD_ELEMENT_NAME) { - showing_front = SDL_FALSE; + showing_front = false; } return showing_front; } @@ -1130,22 +1130,22 @@ static void SDLCALL VirtualGamepadSetPlayerIndex(void *userdata, int player_inde SDL_Log("Virtual Gamepad: player index set to %d\n", player_index); } -static SDL_bool SDLCALL VirtualGamepadRumble(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static bool SDLCALL VirtualGamepadRumble(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { SDL_Log("Virtual Gamepad: rumble set to %d/%d\n", low_frequency_rumble, high_frequency_rumble); - return SDL_TRUE; + return true; } -static SDL_bool SDLCALL VirtualGamepadRumbleTriggers(void *userdata, Uint16 left_rumble, Uint16 right_rumble) +static bool SDLCALL VirtualGamepadRumbleTriggers(void *userdata, Uint16 left_rumble, Uint16 right_rumble) { SDL_Log("Virtual Gamepad: trigger rumble set to %d/%d\n", left_rumble, right_rumble); - return SDL_TRUE; + return true; } -static SDL_bool SDLCALL VirtualGamepadSetLED(void *userdata, Uint8 red, Uint8 green, Uint8 blue) +static bool SDLCALL VirtualGamepadSetLED(void *userdata, Uint8 red, Uint8 green, Uint8 blue) { SDL_Log("Virtual Gamepad: LED set to RGB %d,%d,%d\n", red, green, blue); - return SDL_TRUE; + return true; } static void OpenVirtualGamepad(void) @@ -1210,7 +1210,7 @@ static void VirtualGamepadMouseMotion(float x, float y) const float MOVING_DISTANCE = 2.0f; if (SDL_fabs(x - virtual_axis_start_x) >= MOVING_DISTANCE || SDL_fabs(y - virtual_axis_start_y) >= MOVING_DISTANCE) { - SDL_SetJoystickVirtualButton(virtual_joystick, virtual_button_active, SDL_FALSE); + SDL_SetJoystickVirtualButton(virtual_joystick, virtual_button_active, false); virtual_button_active = SDL_GAMEPAD_BUTTON_INVALID; } } @@ -1248,7 +1248,7 @@ static void VirtualGamepadMouseMotion(float x, float y) GetGamepadTouchpadArea(image, &touchpad); virtual_touchpad_x = (x - touchpad.x) / touchpad.w; virtual_touchpad_y = (y - touchpad.y) / touchpad.h; - SDL_SetJoystickVirtualTouchpad(virtual_joystick, 0, 0, SDL_TRUE, virtual_touchpad_x, virtual_touchpad_y, 1.0f); + SDL_SetJoystickVirtualTouchpad(virtual_joystick, 0, 0, true, virtual_touchpad_x, virtual_touchpad_y, 1.0f); } } @@ -1261,17 +1261,17 @@ static void VirtualGamepadMouseDown(float x, float y) SDL_FRect touchpad; GetGamepadTouchpadArea(image, &touchpad); if (SDL_PointInRectFloat(&point, &touchpad)) { - virtual_touchpad_active = SDL_TRUE; + virtual_touchpad_active = true; virtual_touchpad_x = (x - touchpad.x) / touchpad.w; virtual_touchpad_y = (y - touchpad.y) / touchpad.h; - SDL_SetJoystickVirtualTouchpad(virtual_joystick, 0, 0, SDL_TRUE, virtual_touchpad_x, virtual_touchpad_y, 1.0f); + SDL_SetJoystickVirtualTouchpad(virtual_joystick, 0, 0, true, virtual_touchpad_x, virtual_touchpad_y, 1.0f); } return; } if (element < SDL_GAMEPAD_BUTTON_COUNT) { virtual_button_active = (SDL_GamepadButton)element; - SDL_SetJoystickVirtualButton(virtual_joystick, virtual_button_active, SDL_TRUE); + SDL_SetJoystickVirtualButton(virtual_joystick, virtual_button_active, true); } else { switch (element) { case SDL_GAMEPAD_ELEMENT_AXIS_LEFTX_NEGATIVE: @@ -1301,7 +1301,7 @@ static void VirtualGamepadMouseDown(float x, float y) static void VirtualGamepadMouseUp(float x, float y) { if (virtual_button_active != SDL_GAMEPAD_BUTTON_INVALID) { - SDL_SetJoystickVirtualButton(virtual_joystick, virtual_button_active, SDL_FALSE); + SDL_SetJoystickVirtualButton(virtual_joystick, virtual_button_active, false); virtual_button_active = SDL_GAMEPAD_BUTTON_INVALID; } @@ -1317,8 +1317,8 @@ static void VirtualGamepadMouseUp(float x, float y) } if (virtual_touchpad_active) { - SDL_SetJoystickVirtualTouchpad(virtual_joystick, 0, 0, SDL_FALSE, virtual_touchpad_x, virtual_touchpad_y, 0.0f); - virtual_touchpad_active = SDL_FALSE; + SDL_SetJoystickVirtualTouchpad(virtual_joystick, 0, 0, false, virtual_touchpad_x, virtual_touchpad_y, 0.0f); + virtual_touchpad_active = false; } } @@ -1464,11 +1464,11 @@ static void DrawBindingTips(SDL_Renderer *renderer) Uint8 r, g, b, a; SDL_FRect rect; SDL_GamepadButton action_forward = SDL_GAMEPAD_BUTTON_SOUTH; - SDL_bool bound_forward = MappingHasElement(controller->mapping, action_forward); + bool bound_forward = MappingHasElement(controller->mapping, action_forward); SDL_GamepadButton action_backward = SDL_GAMEPAD_BUTTON_EAST; - SDL_bool bound_backward = MappingHasElement(controller->mapping, action_backward); + bool bound_backward = MappingHasElement(controller->mapping, action_backward); SDL_GamepadButton action_delete = SDL_GAMEPAD_BUTTON_WEST; - SDL_bool bound_delete = MappingHasElement(controller->mapping, action_delete); + bool bound_delete = MappingHasElement(controller->mapping, action_delete); y -= (FONT_CHARACTER_SIZE + BUTTON_MARGIN) / 2; @@ -1584,7 +1584,7 @@ static void loop(void *arg) switch (event.type) { case SDL_EVENT_JOYSTICK_ADDED: - AddController(event.jdevice.which, SDL_TRUE); + AddController(event.jdevice.which, true); break; case SDL_EVENT_JOYSTICK_REMOVED: @@ -1647,7 +1647,7 @@ static void loop(void *arg) #ifdef DEBUG_AXIS_MAPPING SDL_Log("AXIS %d axis_min = %d, axis_max = %d, binding = %s\n", event.jaxis.axis, axis_min, axis_max, binding); #endif - CommitBindingElement(binding, SDL_FALSE); + CommitBindingElement(binding, false); } } break; @@ -1665,7 +1665,7 @@ static void loop(void *arg) char binding[12]; SDL_snprintf(binding, sizeof(binding), "b%d", event.jbutton.button); - CommitBindingElement(binding, SDL_FALSE); + CommitBindingElement(binding, false); } break; @@ -1677,12 +1677,12 @@ static void loop(void *arg) char binding[12]; SDL_snprintf(binding, sizeof(binding), "h%d.%d", event.jhat.hat, event.jhat.value); - CommitBindingElement(binding, SDL_FALSE); + CommitBindingElement(binding, false); } break; case SDL_EVENT_GAMEPAD_ADDED: - HandleGamepadAdded(event.gdevice.which, SDL_TRUE); + HandleGamepadAdded(event.gdevice.which, true); break; case SDL_EVENT_GAMEPAD_REMOVED: @@ -1801,9 +1801,9 @@ static void loop(void *arg) } else if (GamepadButtonContains(paste_button, event.button.x, event.button.y)) { PasteMapping(); } else if (title_pressed) { - SetCurrentBindingElement(SDL_GAMEPAD_ELEMENT_NAME, SDL_FALSE); + SetCurrentBindingElement(SDL_GAMEPAD_ELEMENT_NAME, false); } else if (type_pressed) { - SetCurrentBindingElement(SDL_GAMEPAD_ELEMENT_TYPE, SDL_FALSE); + SetCurrentBindingElement(SDL_GAMEPAD_ELEMENT_TYPE, false); } else if (binding_element == SDL_GAMEPAD_ELEMENT_TYPE) { int type = GetGamepadTypeDisplayAt(gamepad_type, event.button.x, event.button.y); if (type != SDL_GAMEPAD_TYPE_UNSELECTED) { @@ -1821,14 +1821,14 @@ static void loop(void *arg) gamepad_element = GetGamepadDisplayElementAt(gamepad_elements, controller->gamepad, event.button.x, event.button.y); } if (gamepad_element != SDL_GAMEPAD_ELEMENT_INVALID) { - /* Set this to SDL_FALSE if you don't want to start the binding flow at this point */ - const SDL_bool should_start_flow = SDL_TRUE; + /* Set this to false if you don't want to start the binding flow at this point */ + const bool should_start_flow = true; SetCurrentBindingElement(gamepad_element, should_start_flow); } joystick_element = GetJoystickDisplayElementAt(joystick_elements, controller->joystick, event.button.x, event.button.y); if (joystick_element) { - CommitBindingElement(joystick_element, SDL_TRUE); + CommitBindingElement(joystick_element, true); SDL_free(joystick_element); } } @@ -1840,7 +1840,7 @@ static void loop(void *arg) if (virtual_joystick && controller && controller->joystick == virtual_joystick) { VirtualGamepadMouseMotion(event.motion.x, event.motion.y); } - UpdateButtonHighlights(event.motion.x, event.motion.y, event.motion.state ? SDL_TRUE : SDL_FALSE); + UpdateButtonHighlights(event.motion.x, event.motion.y, event.motion.state ? true : false); break; case SDL_EVENT_KEY_DOWN: @@ -1859,7 +1859,7 @@ static void loop(void *arg) } else if (event.key.key == SDLK_R && (event.key.mod & SDL_KMOD_CTRL)) { SDL_ReloadGamepadMappings(); } else if (event.key.key == SDLK_ESCAPE) { - done = SDL_TRUE; + done = true; } } else if (display_mode == CONTROLLER_MODE_BINDING) { if (event.key.key == SDLK_C && (event.key.mod & SDL_KMOD_CTRL)) { @@ -1912,7 +1912,7 @@ static void loop(void *arg) } break; case SDL_EVENT_QUIT: - done = SDL_TRUE; + done = true; break; default: break; @@ -1940,7 +1940,7 @@ static void loop(void *arg) UpdateGamepadImageFromGamepad(image, controller->gamepad); if (display_mode == CONTROLLER_MODE_BINDING && binding_element != SDL_GAMEPAD_ELEMENT_INVALID) { - SetGamepadImageElement(image, binding_element, SDL_TRUE); + SetGamepadImageElement(image, binding_element, true); } RenderGamepadImage(image); @@ -1983,7 +1983,7 @@ static void loop(void *arg) int main(int argc, char *argv[]) { - SDL_bool show_mappings = SDL_FALSE; + bool show_mappings = false; int i; float content_scale; int screen_width, screen_height; @@ -2015,7 +2015,7 @@ int main(int argc, char *argv[]) consumed = SDLTest_CommonArg(state, i); if (!consumed) { if (SDL_strcmp(argv[i], "--mappings") == 0) { - show_mappings = SDL_TRUE; + show_mappings = true; consumed = 1; } else if (SDL_strcmp(argv[i], "--virtual") == 0) { OpenVirtualGamepad(); diff --git a/test/testcustomcursor.c b/test/testcustomcursor.c index 6f7f2d077..20012ad4e 100644 --- a/test/testcustomcursor.c +++ b/test/testcustomcursor.c @@ -223,7 +223,7 @@ static SDL_Cursor *cursors[3 + SDL_SYSTEM_CURSOR_COUNT]; static SDL_SystemCursor cursor_types[3 + SDL_SYSTEM_CURSOR_COUNT]; static int num_cursors; static int current_cursor; -static SDL_bool show_cursor; +static bool show_cursor; /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ static void @@ -346,7 +346,7 @@ static void loop(void) rect.w = 128.0f; rect.h = 128.0f; for (y = 0, row = 0; y < window_h; y += (int)rect.h, ++row) { - SDL_bool black = ((row % 2) == 0) ? SDL_TRUE : SDL_FALSE; + bool black = ((row % 2) == 0) ? true : false; for (x = 0; x < window_w; x += (int)rect.w) { rect.x = (float)x; rect.y = (float)y; diff --git a/test/testdisplayinfo.c b/test/testdisplayinfo.c index 88388184d..0acac188c 100644 --- a/test/testdisplayinfo.c +++ b/test/testdisplayinfo.c @@ -66,7 +66,7 @@ int main(int argc, char *argv[]) SDL_PropertiesID props = SDL_GetDisplayProperties(dpy); SDL_Rect rect = { 0, 0, 0, 0 }; int m, num_modes = 0; - const SDL_bool has_HDR = SDL_GetBooleanProperty(props, SDL_PROP_DISPLAY_HDR_ENABLED_BOOLEAN, SDL_FALSE); + const bool has_HDR = SDL_GetBooleanProperty(props, SDL_PROP_DISPLAY_HDR_ENABLED_BOOLEAN, false); SDL_GetDisplayBounds(dpy, &rect); modes = SDL_GetFullscreenDisplayModes(dpy, &num_modes); diff --git a/test/testdraw.c b/test/testdraw.c index ca9e51d5e..fd79bc60c 100644 --- a/test/testdraw.c +++ b/test/testdraw.c @@ -24,8 +24,8 @@ static SDLTest_CommonState *state; static int num_objects; -static SDL_bool cycle_color; -static SDL_bool cycle_alpha; +static bool cycle_color; +static bool cycle_alpha; static int cycle_direction = 1; static int current_alpha = 255; static int current_color = 255; @@ -258,10 +258,10 @@ int main(int argc, char *argv[]) } } } else if (SDL_strcasecmp(argv[i], "--cyclecolor") == 0) { - cycle_color = SDL_TRUE; + cycle_color = true; consumed = 1; } else if (SDL_strcasecmp(argv[i], "--cyclealpha") == 0) { - cycle_alpha = SDL_TRUE; + cycle_alpha = true; consumed = 1; } else if (SDL_isdigit(*argv[i])) { num_objects = SDL_atoi(argv[i]); diff --git a/test/testdropfile.c b/test/testdropfile.c index d0d611984..10395539c 100644 --- a/test/testdropfile.c +++ b/test/testdropfile.c @@ -16,7 +16,7 @@ typedef struct { SDLTest_CommonState *state; - SDL_bool is_hover; + bool is_hover; float x; float y; unsigned int windowID; @@ -73,7 +73,7 @@ SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event) if (event->type == SDL_EVENT_DROP_BEGIN) { SDL_Log("Drop beginning on window %u at (%f, %f)", (unsigned int)event->drop.windowID, event->drop.x, event->drop.y); } else if (event->type == SDL_EVENT_DROP_COMPLETE) { - dialog->is_hover = SDL_FALSE; + dialog->is_hover = false; SDL_Log("Drop complete on window %u at (%f, %f)", (unsigned int)event->drop.windowID, event->drop.x, event->drop.y); } else if ((event->type == SDL_EVENT_DROP_FILE) || (event->type == SDL_EVENT_DROP_TEXT)) { const char *typestr = (event->type == SDL_EVENT_DROP_FILE) ? "File" : "Text"; @@ -82,7 +82,7 @@ SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event) const float w_x = event->drop.x; const float w_y = event->drop.y; SDL_ConvertEventToRenderCoordinates(SDL_GetRenderer(SDL_GetWindowFromEvent(event)), event); - dialog->is_hover = SDL_TRUE; + dialog->is_hover = true; dialog->x = event->drop.x; dialog->y = event->drop.y; dialog->windowID = event->drop.windowID; diff --git a/test/testerror.c b/test/testerror.c index a7c23885c..8ac93ecbe 100644 --- a/test/testerror.c +++ b/test/testerror.c @@ -50,7 +50,7 @@ int main(int argc, char *argv[]) SDL_Thread *thread; SDLTest_CommonState *state; int i; - SDL_bool enable_threads = SDL_TRUE; + bool enable_threads = true; /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, 0); @@ -66,7 +66,7 @@ int main(int argc, char *argv[]) if (consumed == 0) { consumed = -1; if (SDL_strcasecmp(argv[i], "--no-threads") == 0) { - enable_threads = SDL_FALSE; + enable_threads = false; consumed = 1; } } diff --git a/test/testffmpeg.c b/test/testffmpeg.c index ecad2ae9e..de3dda402 100644 --- a/test/testffmpeg.c +++ b/test/testffmpeg.c @@ -82,11 +82,11 @@ static SDL_Renderer *renderer; static SDL_AudioStream *audio; static SDL_Texture *video_texture; static Uint64 video_start; -static SDL_bool software_only; -static SDL_bool has_eglCreateImage; +static bool software_only; +static bool has_eglCreateImage; #ifdef HAVE_EGL -static SDL_bool has_EGL_EXT_image_dma_buf_import; -static SDL_bool has_EGL_EXT_image_dma_buf_import_modifiers; +static bool has_EGL_EXT_image_dma_buf_import; +static bool has_EGL_EXT_image_dma_buf_import_modifiers; static PFNGLACTIVETEXTUREARBPROC glActiveTextureARBFunc; static PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOESFunc; #endif @@ -102,14 +102,14 @@ struct SwsContextContainer }; static const char *SWS_CONTEXT_CONTAINER_PROPERTY = "SWS_CONTEXT_CONTAINER"; static int done; -static SDL_bool verbose; +static bool verbose; -static SDL_bool CreateWindowAndRenderer(SDL_WindowFlags window_flags, const char *driver) +static bool CreateWindowAndRenderer(SDL_WindowFlags window_flags, const char *driver) { SDL_PropertiesID props; - SDL_bool useOpenGL = (driver && (SDL_strcmp(driver, "opengl") == 0 || SDL_strcmp(driver, "opengles2") == 0)); - SDL_bool useEGL = (driver && SDL_strcmp(driver, "opengles2") == 0); - SDL_bool useVulkan = (driver && SDL_strcmp(driver, "vulkan") == 0); + bool useOpenGL = (driver && (SDL_strcmp(driver, "opengl") == 0 || SDL_strcmp(driver, "opengles2") == 0)); + bool useEGL = (driver && SDL_strcmp(driver, "opengles2") == 0); + bool useVulkan = (driver && SDL_strcmp(driver, "vulkan") == 0); Uint32 flags = SDL_WINDOW_HIDDEN; if (useOpenGL) { @@ -137,7 +137,7 @@ static SDL_bool CreateWindowAndRenderer(SDL_WindowFlags window_flags, const char /* The window will be resized to the video size when it's loaded, in OpenVideoStream() */ window = SDL_CreateWindow("testffmpeg", 1920, 1080, flags); if (!window) { - return SDL_FALSE; + return false; } if (useVulkan) { @@ -145,7 +145,7 @@ static SDL_bool CreateWindowAndRenderer(SDL_WindowFlags window_flags, const char if (!vulkan_context) { SDL_DestroyWindow(window); window = NULL; - return SDL_FALSE; + return false; } } @@ -155,7 +155,7 @@ static SDL_bool CreateWindowAndRenderer(SDL_WindowFlags window_flags, const char if (useVulkan) { SetupVulkanRenderProperties(vulkan_context, props); } - if (SDL_GetBooleanProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_HDR_ENABLED_BOOLEAN, SDL_FALSE)) { + if (SDL_GetBooleanProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_HDR_ENABLED_BOOLEAN, false)) { /* Try to create an HDR capable renderer */ SDL_SetNumberProperty(props, SDL_PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBER, SDL_COLORSPACE_SRGB_LINEAR); renderer = SDL_CreateRendererWithProperties(props); @@ -169,7 +169,7 @@ static SDL_bool CreateWindowAndRenderer(SDL_WindowFlags window_flags, const char if (!renderer) { SDL_DestroyWindow(window); window = NULL; - return SDL_FALSE; + return false; } SDL_Log("Created renderer %s\n", SDL_GetRendererName(renderer)); @@ -178,25 +178,25 @@ static SDL_bool CreateWindowAndRenderer(SDL_WindowFlags window_flags, const char if (useEGL) { const char *egl_extensions = eglQueryString(eglGetCurrentDisplay(), EGL_EXTENSIONS); if (!egl_extensions) { - return SDL_FALSE; + return false; } char *extensions = SDL_strdup(egl_extensions); if (!extensions) { - return SDL_FALSE; + return false; } char *saveptr, *token; token = SDL_strtok_r(extensions, " ", &saveptr); if (!token) { SDL_free(extensions); - return SDL_FALSE; + return false; } do { if (SDL_strcmp(token, "EGL_EXT_image_dma_buf_import") == 0) { - has_EGL_EXT_image_dma_buf_import = SDL_TRUE; + has_EGL_EXT_image_dma_buf_import = true; } else if (SDL_strcmp(token, "EGL_EXT_image_dma_buf_import_modifiers") == 0) { - has_EGL_EXT_image_dma_buf_import_modifiers = SDL_TRUE; + has_EGL_EXT_image_dma_buf_import_modifiers = true; } } while ((token = SDL_strtok_r(NULL, " ", &saveptr)) != NULL); @@ -211,7 +211,7 @@ static SDL_bool CreateWindowAndRenderer(SDL_WindowFlags window_flags, const char if (has_EGL_EXT_image_dma_buf_import && glEGLImageTargetTexture2DOESFunc && glActiveTextureARBFunc) { - has_eglCreateImage = SDL_TRUE; + has_eglCreateImage = true; } } #endif /* HAVE_EGL */ @@ -224,7 +224,7 @@ static SDL_bool CreateWindowAndRenderer(SDL_WindowFlags window_flags, const char } #endif - return SDL_TRUE; + return true; } static SDL_Texture *CreateTexture(SDL_Renderer *r, unsigned char *data, unsigned int len, int *w, int *h) @@ -233,10 +233,10 @@ static SDL_Texture *CreateTexture(SDL_Renderer *r, unsigned char *data, unsigned SDL_Surface *surface; SDL_IOStream *src = SDL_IOFromConstMem(data, len); if (src) { - surface = SDL_LoadBMP_IO(src, SDL_TRUE); + surface = SDL_LoadBMP_IO(src, true); if (surface) { /* Treat white as transparent */ - SDL_SetSurfaceColorKey(surface, SDL_TRUE, SDL_MapSurfaceRGB(surface, 255, 255, 255)); + SDL_SetSurfaceColorKey(surface, true, SDL_MapSurfaceRGB(surface, 255, 255, 255)); texture = SDL_CreateTextureFromSurface(r, surface); *w = surface->w; @@ -331,32 +331,32 @@ static SDL_PixelFormat GetTextureFormat(enum AVPixelFormat format) } } -static SDL_bool SupportedPixelFormat(enum AVPixelFormat format) +static bool SupportedPixelFormat(enum AVPixelFormat format) { if (!software_only) { if (has_eglCreateImage && (format == AV_PIX_FMT_VAAPI || format == AV_PIX_FMT_DRM_PRIME)) { - return SDL_TRUE; + return true; } #ifdef SDL_PLATFORM_APPLE if (format == AV_PIX_FMT_VIDEOTOOLBOX) { - return SDL_TRUE; + return true; } #endif #ifdef SDL_PLATFORM_WIN32 if (d3d11_device && format == AV_PIX_FMT_D3D11) { - return SDL_TRUE; + return true; } #endif if (vulkan_context && format == AV_PIX_FMT_VULKAN) { - return SDL_TRUE; + return true; } } if (GetTextureFormat(format) != SDL_PIXELFORMAT_UNKNOWN) { - return SDL_TRUE; + return true; } - return SDL_FALSE; + return false; } static enum AVPixelFormat GetSupportedPixelFormat(AVCodecContext *s, const enum AVPixelFormat *pix_fmts) @@ -568,7 +568,7 @@ static void SDLCALL FreeSwsContextContainer(void *userdata, void *value) SDL_free(sws_container); } -static SDL_bool GetTextureForMemoryFrame(AVFrame *frame, SDL_Texture **texture) +static bool GetTextureForMemoryFrame(AVFrame *frame, SDL_Texture **texture) { int texture_width = 0, texture_height = 0; SDL_PixelFormat texture_format = SDL_PIXELFORMAT_UNKNOWN; @@ -596,7 +596,7 @@ static SDL_bool GetTextureForMemoryFrame(AVFrame *frame, SDL_Texture **texture) *texture = SDL_CreateTextureWithProperties(renderer, props); SDL_DestroyProperties(props); if (!*texture) { - return SDL_FALSE; + return false; } if (frame_format == SDL_PIXELFORMAT_UNKNOWN || SDL_ISPIXELFORMAT_ALPHA(frame_format)) { @@ -615,7 +615,7 @@ static SDL_bool GetTextureForMemoryFrame(AVFrame *frame, SDL_Texture **texture) if (!sws_container) { sws_container = (struct SwsContextContainer *)SDL_calloc(1, sizeof(*sws_container)); if (!sws_container) { - return SDL_FALSE; + return false; } SDL_SetPointerPropertyWithCleanup(props, SWS_CONTEXT_CONTAINER_PROPERTY, sws_container, FreeSwsContextContainer, NULL); } @@ -629,7 +629,7 @@ static SDL_bool GetTextureForMemoryFrame(AVFrame *frame, SDL_Texture **texture) } } else { SDL_SetError("Can't initialize the conversion context"); - return SDL_FALSE; + return false; } break; } @@ -652,12 +652,12 @@ static SDL_bool GetTextureForMemoryFrame(AVFrame *frame, SDL_Texture **texture) } break; } - return SDL_TRUE; + return true; } #ifdef HAVE_EGL -static SDL_bool GetNV12TextureForDRMFrame(AVFrame *frame, SDL_Texture **texture) +static bool GetNV12TextureForDRMFrame(AVFrame *frame, SDL_Texture **texture) { AVHWFramesContext *frames = (AVHWFramesContext *)(frame->hw_frames_ctx ? frame->hw_frames_ctx->data : NULL); const AVDRMFrameDescriptor *desc = (const AVDRMFrameDescriptor *)frame->data[0]; @@ -678,7 +678,7 @@ static SDL_bool GetNV12TextureForDRMFrame(AVFrame *frame, SDL_Texture **texture) *texture = SDL_CreateTextureWithProperties(renderer, props); SDL_DestroyProperties(props); if (!*texture) { - return SDL_FALSE; + return false; } SDL_SetTextureBlendMode(*texture, SDL_BLENDMODE_NONE); SDL_SetTextureScaleMode(*texture, SDL_SCALEMODE_LINEAR); @@ -688,7 +688,7 @@ static SDL_bool GetNV12TextureForDRMFrame(AVFrame *frame, SDL_Texture **texture) textures[1] = (GLuint)SDL_GetNumberProperty(props, SDL_PROP_TEXTURE_OPENGLES2_TEXTURE_UV_NUMBER, 0); if (!textures[0] || !textures[1]) { SDL_SetError("Couldn't get NV12 OpenGL textures"); - return SDL_FALSE; + return false; } /* import the frame into OpenGL */ @@ -733,7 +733,7 @@ static SDL_bool GetNV12TextureForDRMFrame(AVFrame *frame, SDL_Texture **texture) EGLImage image = eglCreateImage(display, EGL_NO_CONTEXT, EGL_LINUX_DMA_BUF_EXT, NULL, attr); if (image == EGL_NO_IMAGE) { SDL_Log("Couldn't create image: %d\n", glGetError()); - return SDL_FALSE; + return false; } glActiveTextureARBFunc(GL_TEXTURE0_ARB + image_index); @@ -743,10 +743,10 @@ static SDL_bool GetNV12TextureForDRMFrame(AVFrame *frame, SDL_Texture **texture) } } - return SDL_TRUE; + return true; } -static SDL_bool GetOESTextureForDRMFrame(AVFrame *frame, SDL_Texture **texture) +static bool GetOESTextureForDRMFrame(AVFrame *frame, SDL_Texture **texture) { AVHWFramesContext *frames = (AVHWFramesContext *)(frame->hw_frames_ctx ? frame->hw_frames_ctx->data : NULL); const AVDRMFrameDescriptor *desc = (const AVDRMFrameDescriptor *)frame->data[0]; @@ -766,7 +766,7 @@ static SDL_bool GetOESTextureForDRMFrame(AVFrame *frame, SDL_Texture **texture) *texture = SDL_CreateTextureWithProperties(renderer, props); SDL_DestroyProperties(props); if (!*texture) { - return SDL_FALSE; + return false; } SDL_SetTextureBlendMode(*texture, SDL_BLENDMODE_NONE); SDL_SetTextureScaleMode(*texture, SDL_SCALEMODE_LINEAR); @@ -775,7 +775,7 @@ static SDL_bool GetOESTextureForDRMFrame(AVFrame *frame, SDL_Texture **texture) textureID = (GLuint)SDL_GetNumberProperty(props, SDL_PROP_TEXTURE_OPENGLES2_TEXTURE_NUMBER, 0); if (!textureID) { SDL_SetError("Couldn't get OpenGL texture"); - return SDL_FALSE; + return false; } colorspace = (SDL_Colorspace)SDL_GetNumberProperty(props, SDL_PROP_TEXTURE_COLORSPACE_NUMBER, SDL_COLORSPACE_UNKNOWN); @@ -918,17 +918,17 @@ static SDL_bool GetOESTextureForDRMFrame(AVFrame *frame, SDL_Texture **texture) EGLImage image = eglCreateImage(display, EGL_NO_CONTEXT, EGL_LINUX_DMA_BUF_EXT, NULL, attr); if (image == EGL_NO_IMAGE) { SDL_Log("Couldn't create image: %d\n", glGetError()); - return SDL_FALSE; + return false; } glActiveTextureARBFunc(GL_TEXTURE0_ARB); glBindTexture(GL_TEXTURE_EXTERNAL_OES, textureID); glEGLImageTargetTexture2DOESFunc(GL_TEXTURE_EXTERNAL_OES, image); - return SDL_TRUE; + return true; } #endif // HAVE_EGL -static SDL_bool GetTextureForDRMFrame(AVFrame *frame, SDL_Texture **texture) +static bool GetTextureForDRMFrame(AVFrame *frame, SDL_Texture **texture) { #ifdef HAVE_EGL const AVDRMFrameDescriptor *desc = (const AVDRMFrameDescriptor *)frame->data[0]; @@ -941,14 +941,14 @@ static SDL_bool GetTextureForDRMFrame(AVFrame *frame, SDL_Texture **texture) return GetOESTextureForDRMFrame(frame, texture); } #else - return SDL_FALSE; + return false; #endif } -static SDL_bool GetTextureForVAAPIFrame(AVFrame *frame, SDL_Texture **texture) +static bool GetTextureForVAAPIFrame(AVFrame *frame, SDL_Texture **texture) { AVFrame *drm_frame; - SDL_bool result = SDL_FALSE; + bool result = false; drm_frame = av_frame_alloc(); if (drm_frame) { @@ -963,7 +963,7 @@ static SDL_bool GetTextureForVAAPIFrame(AVFrame *frame, SDL_Texture **texture) return result; } -static SDL_bool GetTextureForD3D11Frame(AVFrame *frame, SDL_Texture **texture) +static bool GetTextureForD3D11Frame(AVFrame *frame, SDL_Texture **texture) { #ifdef SDL_PLATFORM_WIN32 AVHWFramesContext *frames = (AVHWFramesContext *)(frame->hw_frames_ctx->data); @@ -985,24 +985,24 @@ static SDL_bool GetTextureForD3D11Frame(AVFrame *frame, SDL_Texture **texture) *texture = SDL_CreateTextureWithProperties(renderer, props); SDL_DestroyProperties(props); if (!*texture) { - return SDL_FALSE; + return false; } } ID3D11Resource *dx11_resource = SDL_GetPointerProperty(SDL_GetTextureProperties(*texture), SDL_PROP_TEXTURE_D3D11_TEXTURE_POINTER, NULL); if (!dx11_resource) { SDL_SetError("Couldn't get texture ID3D11Resource interface"); - return SDL_FALSE; + return false; } ID3D11DeviceContext_CopySubresourceRegion(d3d11_context, dx11_resource, 0, 0, 0, 0, (ID3D11Resource *)pTexture, iSliceIndex, NULL); - return SDL_TRUE; + return true; #else - return SDL_FALSE; + return false; #endif } -static SDL_bool GetTextureForVideoToolboxFrame(AVFrame *frame, SDL_Texture **texture) +static bool GetTextureForVideoToolboxFrame(AVFrame *frame, SDL_Texture **texture) { #ifdef SDL_PLATFORM_APPLE CVPixelBufferRef pPixelBuffer = (CVPixelBufferRef)frame->data[3]; @@ -1019,16 +1019,16 @@ static SDL_bool GetTextureForVideoToolboxFrame(AVFrame *frame, SDL_Texture **tex *texture = SDL_CreateTextureWithProperties(renderer, props); SDL_DestroyProperties(props); if (!*texture) { - return SDL_FALSE; + return false; } - return SDL_TRUE; + return true; #else - return SDL_FALSE; + return false; #endif } -static SDL_bool GetTextureForVulkanFrame(AVFrame *frame, SDL_Texture **texture) +static bool GetTextureForVulkanFrame(AVFrame *frame, SDL_Texture **texture) { SDL_PropertiesID props; @@ -1040,12 +1040,12 @@ static SDL_bool GetTextureForVulkanFrame(AVFrame *frame, SDL_Texture **texture) *texture = CreateVulkanVideoTexture(vulkan_context, frame, renderer, props); SDL_DestroyProperties(props); if (!*texture) { - return SDL_FALSE; + return false; } - return SDL_TRUE; + return true; } -static SDL_bool GetTextureForFrame(AVFrame *frame, SDL_Texture **texture) +static bool GetTextureForFrame(AVFrame *frame, SDL_Texture **texture) { switch (frame->format) { case AV_PIX_FMT_VAAPI: @@ -1194,7 +1194,7 @@ static SDL_AudioFormat GetAudioFormat(enum AVSampleFormat format) } } -static SDL_bool IsPlanarAudioFormat(enum AVSampleFormat format) +static bool IsPlanarAudioFormat(enum AVSampleFormat format) { switch (format) { case AV_SAMPLE_FMT_U8P: @@ -1203,9 +1203,9 @@ static SDL_bool IsPlanarAudioFormat(enum AVSampleFormat format) case AV_SAMPLE_FMT_FLTP: case AV_SAMPLE_FMT_DBLP: case AV_SAMPLE_FMT_S64P: - return SDL_TRUE; + return true; default: - return SDL_FALSE; + return false; } } @@ -1311,8 +1311,8 @@ int main(int argc, char *argv[]) int result; int return_code = -1; SDL_WindowFlags window_flags; - SDL_bool flushing = SDL_FALSE; - SDL_bool decoded = SDL_FALSE; + bool flushing = false; + bool decoded = false; SDLTest_CommonState *state; /* Initialize test framework */ @@ -1331,7 +1331,7 @@ int main(int argc, char *argv[]) consumed = SDLTest_CommonArg(state, i); if (!consumed) { if (SDL_strcmp(argv[i], "--verbose") == 0) { - verbose = SDL_TRUE; + verbose = true; consumed = 1; } else if (SDL_strcmp(argv[i], "--sprites") == 0 && argv[i + 1]) { num_sprites = SDL_atoi(argv[i + 1]); @@ -1343,7 +1343,7 @@ int main(int argc, char *argv[]) video_codec_name = argv[i + 1]; consumed = 2; } else if (SDL_strcmp(argv[i], "--software") == 0) { - software_only = SDL_TRUE; + software_only = true; consumed = 1; } else if (!file) { /* We'll try to open this as a media file */ @@ -1520,7 +1520,7 @@ int main(int argc, char *argv[]) if (video_context) { avcodec_flush_buffers(video_context); } - flushing = SDL_TRUE; + flushing = true; } else { if (pkt->stream_index == audio_stream) { result = avcodec_send_packet(audio_context, pkt); @@ -1537,11 +1537,11 @@ int main(int argc, char *argv[]) } } - decoded = SDL_FALSE; + decoded = false; if (audio_context) { while (avcodec_receive_frame(audio_context, frame) >= 0) { HandleAudioFrame(frame); - decoded = SDL_TRUE; + decoded = true; } if (flushing) { /* Let SDL know we're done sending audio */ @@ -1557,7 +1557,7 @@ int main(int argc, char *argv[]) pts -= first_pts; HandleVideoFrame(frame, pts); - decoded = SDL_TRUE; + decoded = true; } } else { /* Update video rendering */ diff --git a/test/testffmpeg_vulkan.c b/test/testffmpeg_vulkan.c index 5e14728bf..6a208f274 100644 --- a/test/testffmpeg_vulkan.c +++ b/test/testffmpeg_vulkan.c @@ -321,7 +321,7 @@ static int findPhysicalDevice(VulkanVideoContext *context) uint32_t queueFamiliesCount = 0; uint32_t queueFamilyIndex; uint32_t deviceExtensionCount = 0; - SDL_bool hasSwapchainExtension = SDL_FALSE; + bool hasSwapchainExtension = false; uint32_t i; VkPhysicalDevice physicalDevice = physicalDevices[physicalDeviceIndex]; @@ -424,7 +424,7 @@ static int findPhysicalDevice(VulkanVideoContext *context) } for (i = 0; i < deviceExtensionCount; i++) { if (SDL_strcmp(deviceExtensions[i].extensionName, VK_KHR_SWAPCHAIN_EXTENSION_NAME) == 0) { - hasSwapchainExtension = SDL_TRUE; + hasSwapchainExtension = true; break; } } diff --git a/test/testgeometry.c b/test/testgeometry.c index 3958af1a1..dde8e8cf4 100644 --- a/test/testgeometry.c +++ b/test/testgeometry.c @@ -24,7 +24,7 @@ #endif static SDLTest_CommonState *state; -static SDL_bool use_texture = SDL_FALSE; +static bool use_texture = false; static SDL_Texture **sprites; static SDL_BlendMode blendMode = SDL_BLENDMODE_NONE; static float angle = 0.0f; @@ -52,7 +52,7 @@ static int LoadSprite(const char *file) for (i = 0; i < state->num_windows; ++i) { /* This does the SDL_LoadBMP step repeatedly, but that's OK for test code. */ - sprites[i] = LoadTexture(state->renderers[i], file, SDL_TRUE, &sprite_w, &sprite_h); + sprites[i] = LoadTexture(state->renderers[i], file, true, &sprite_w, &sprite_h); if (!sprites[i]) { return -1; } @@ -220,7 +220,7 @@ int main(int argc, char *argv[]) } } } else if (SDL_strcasecmp(argv[i], "--use-texture") == 0) { - use_texture = SDL_TRUE; + use_texture = true; consumed = 1; } } diff --git a/test/testgl.c b/test/testgl.c index 48bcfd596..cfa82d95b 100644 --- a/test/testgl.c +++ b/test/testgl.c @@ -31,7 +31,7 @@ typedef struct GL_Context static SDLTest_CommonState *state; static SDL_GLContext context; static GL_Context ctx; -static SDL_bool suspend_when_occluded; +static bool suspend_when_occluded; static int LoadContext(GL_Context *data) { @@ -243,7 +243,7 @@ int main(int argc, char *argv[]) accel = SDL_atoi(argv[i + 1]); consumed = 2; } else if(SDL_strcasecmp(argv[i], "--suspend-when-occluded") == 0) { - suspend_when_occluded = SDL_TRUE; + suspend_when_occluded = true; consumed = 1; } else { consumed = -1; @@ -371,7 +371,7 @@ int main(int argc, char *argv[]) then = SDL_GetTicks(); done = 0; while (!done) { - SDL_bool update_swap_interval = SDL_FALSE; + bool update_swap_interval = false; int active_windows = 0; /* Check for events */ @@ -381,10 +381,10 @@ int main(int argc, char *argv[]) if (event.type == SDL_EVENT_KEY_DOWN) { if (event.key.key == SDLK_O) { swap_interval--; - update_swap_interval = SDL_TRUE; + update_swap_interval = true; } else if (event.key.key == SDLK_P) { swap_interval++; - update_swap_interval = SDL_TRUE; + update_swap_interval = true; } } } diff --git a/test/testgles2.c b/test/testgles2.c index 772a7ba65..1903938fb 100644 --- a/test/testgles2.c +++ b/test/testgles2.c @@ -66,7 +66,7 @@ typedef struct thread_data static SDLTest_CommonState *state; static SDL_GLContext *context = NULL; static int depth = 16; -static SDL_bool suspend_when_occluded; +static bool suspend_when_occluded; static GLES2_Context ctx; static shader_data *datas; @@ -699,7 +699,7 @@ int main(int argc, char *argv[]) ++threaded; consumed = 1; } else if(SDL_strcasecmp(argv[i], "--suspend-when-occluded") == 0) { - suspend_when_occluded = SDL_TRUE; + suspend_when_occluded = true; consumed = 1; } else if (SDL_strcasecmp(argv[i], "--zdepth") == 0) { i++; diff --git a/test/testgpu_simple_clear.c b/test/testgpu_simple_clear.c index 61b1a5e01..21e71b79b 100644 --- a/test/testgpu_simple_clear.c +++ b/test/testgpu_simple_clear.c @@ -41,7 +41,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[]) return SDL_APP_FAILURE; } - gpu_device = SDL_CreateGPUDevice(TESTGPU_SUPPORTED_FORMATS, SDL_TRUE, NULL); + gpu_device = SDL_CreateGPUDevice(TESTGPU_SUPPORTED_FORMATS, true, NULL); if (!gpu_device) { SDL_Log("SDL_CreateGPUDevice failed: %s", SDL_GetError()); return SDL_APP_FAILURE; diff --git a/test/testgpu_spinning_cube.c b/test/testgpu_spinning_cube.c index 767e07372..2df8f70c6 100644 --- a/test/testgpu_spinning_cube.c +++ b/test/testgpu_spinning_cube.c @@ -398,8 +398,8 @@ Render(SDL_Window *window, const int windownum) color_target.store_op = SDL_GPU_STOREOP_RESOLVE; color_target.texture = winstate->tex_msaa; color_target.resolve_texture = winstate->tex_resolve; - color_target.cycle = SDL_TRUE; - color_target.cycle_resolve_texture = SDL_TRUE; + color_target.cycle = true; + color_target.cycle_resolve_texture = true; } else { color_target.load_op = SDL_GPU_LOADOP_CLEAR; color_target.store_op = SDL_GPU_STOREOP_STORE; @@ -413,7 +413,7 @@ Render(SDL_Window *window, const int windownum) depth_target.stencil_load_op = SDL_GPU_LOADOP_DONT_CARE; depth_target.stencil_store_op = SDL_GPU_STOREOP_DONT_CARE; depth_target.texture = winstate->tex_depth; - depth_target.cycle = SDL_TRUE; + depth_target.cycle = true; /* Set up the bindings */ @@ -454,7 +454,7 @@ Render(SDL_Window *window, const int windownum) } static SDL_GPUShader* -load_shader(SDL_bool is_vertex) +load_shader(bool is_vertex) { SDL_GPUShaderCreateInfo createinfo; createinfo.num_samplers = 0; @@ -512,7 +512,7 @@ init_render_state(int msaa) gpu_device = SDL_CreateGPUDevice( TESTGPU_SUPPORTED_FORMATS, - SDL_TRUE, + true, state->gpudriver ); CHECK_CREATE(gpu_device, "GPU device"); @@ -528,9 +528,9 @@ init_render_state(int msaa) /* Create shaders */ - vertex_shader = load_shader(SDL_TRUE); + vertex_shader = load_shader(true); CHECK_CREATE(vertex_shader, "Vertex Shader") - fragment_shader = load_shader(SDL_FALSE); + fragment_shader = load_shader(false); CHECK_CREATE(fragment_shader, "Fragment Shader") /* Create buffers */ @@ -556,7 +556,7 @@ init_render_state(int msaa) CHECK_CREATE(buf_transfer, "Vertex transfer buffer") /* We just need to upload the static data once. */ - map = SDL_MapGPUTransferBuffer(gpu_device, buf_transfer, SDL_FALSE); + map = SDL_MapGPUTransferBuffer(gpu_device, buf_transfer, false); SDL_memcpy(map, vertex_data, sizeof(vertex_data)); SDL_UnmapGPUTransferBuffer(gpu_device, buf_transfer); @@ -567,7 +567,7 @@ init_render_state(int msaa) dst_region.buffer = render_state.buf_vertex; dst_region.offset = 0; dst_region.size = sizeof(vertex_data); - SDL_UploadToGPUBuffer(copy_pass, &buf_location, &dst_region, SDL_FALSE); + SDL_UploadToGPUBuffer(copy_pass, &buf_location, &dst_region, false); SDL_EndGPUCopyPass(copy_pass); SDL_SubmitGPUCommandBuffer(cmd); @@ -592,10 +592,10 @@ init_render_state(int msaa) pipelinedesc.target_info.num_color_targets = 1; pipelinedesc.target_info.color_target_descriptions = &color_target_desc; pipelinedesc.target_info.depth_stencil_format = SDL_GPU_TEXTUREFORMAT_D16_UNORM; - pipelinedesc.target_info.has_depth_stencil_target = SDL_TRUE; + pipelinedesc.target_info.has_depth_stencil_target = true; - pipelinedesc.depth_stencil_state.enable_depth_test = SDL_TRUE; - pipelinedesc.depth_stencil_state.enable_depth_write = SDL_TRUE; + pipelinedesc.depth_stencil_state.enable_depth_test = true; + pipelinedesc.depth_stencil_state.enable_depth_write = true; pipelinedesc.depth_stencil_state.compare_op = SDL_GPU_COMPAREOP_LESS_OR_EQUAL; pipelinedesc.multisample_state.sample_count = render_state.sample_count; diff --git a/test/testhotplug.c b/test/testhotplug.c index 0972eef0b..fb94b9613 100644 --- a/test/testhotplug.c +++ b/test/testhotplug.c @@ -26,9 +26,9 @@ int main(int argc, char *argv[]) SDL_Joystick *joystick = NULL; SDL_Haptic *haptic = NULL; SDL_JoystickID instance = 0; - SDL_bool keepGoing = SDL_TRUE; + bool keepGoing = true; int i; - SDL_bool enable_haptic = SDL_TRUE; + bool enable_haptic = true; Uint32 init_subsystems = SDL_INIT_VIDEO | SDL_INIT_JOYSTICK; SDLTest_CommonState *state; @@ -45,7 +45,7 @@ int main(int argc, char *argv[]) consumed = SDLTest_CommonArg(state, i); if (!consumed) { if (SDL_strcasecmp(argv[i], "--nohaptic") == 0) { - enable_haptic = SDL_FALSE; + enable_haptic = false; consumed = 1; } } @@ -94,7 +94,7 @@ int main(int argc, char *argv[]) while (SDL_PollEvent(&event)) { switch (event.type) { case SDL_EVENT_QUIT: - keepGoing = SDL_FALSE; + keepGoing = false; break; case SDL_EVENT_KEYBOARD_ADDED: SDL_Log("Keyboard '%s' added : %" SDL_PRIu32 "\n", SDL_GetKeyboardNameForID(event.kdevice.which), event.kdevice.which); @@ -163,7 +163,7 @@ int main(int argc, char *argv[]) } if (event.jbutton.button == 0) { SDL_Log("Exiting due to button press of button 0\n"); - keepGoing = SDL_FALSE; + keepGoing = false; } break; case SDL_EVENT_JOYSTICK_BUTTON_UP: diff --git a/test/testime.c b/test/testime.c index 59017a879..00cce6f6a 100644 --- a/test/testime.c +++ b/test/testime.c @@ -53,7 +53,7 @@ typedef struct SDL_Window *window; SDL_Renderer *renderer; int rendererID; - SDL_bool settings_visible; + bool settings_visible; SDL_Texture *settings_icon; SDL_FRect settings_rect; SDL_PropertiesID text_settings; @@ -63,12 +63,12 @@ typedef struct char markedText[MAX_TEXT_LENGTH]; int cursor; int cursor_length; - SDL_bool cursor_visible; + bool cursor_visible; Uint64 last_cursor_change; char **candidates; int num_candidates; int selected_candidate; - SDL_bool horizontal_candidates; + bool horizontal_candidates; } WindowState; static SDLTest_CommonState *state; @@ -99,10 +99,10 @@ static const struct { "Capitalize words", SDL_PROP_TEXTINPUT_CAPITALIZATION_NUMBER, SDL_CAPITALIZE_WORDS }, { "All caps", SDL_PROP_TEXTINPUT_CAPITALIZATION_NUMBER, SDL_CAPITALIZE_LETTERS }, { "", NULL }, - { "Auto-correct OFF", SDL_PROP_TEXTINPUT_AUTOCORRECT_BOOLEAN, SDL_FALSE }, - { "Auto-correct ON", SDL_PROP_TEXTINPUT_AUTOCORRECT_BOOLEAN, SDL_TRUE }, - { "Multiline OFF", SDL_PROP_TEXTINPUT_MULTILINE_BOOLEAN, SDL_FALSE }, - { "Multiline ON", SDL_PROP_TEXTINPUT_MULTILINE_BOOLEAN, SDL_TRUE } + { "Auto-correct OFF", SDL_PROP_TEXTINPUT_AUTOCORRECT_BOOLEAN, false }, + { "Auto-correct ON", SDL_PROP_TEXTINPUT_AUTOCORRECT_BOOLEAN, true }, + { "Multiline OFF", SDL_PROP_TEXTINPUT_MULTILINE_BOOLEAN, false }, + { "Multiline ON", SDL_PROP_TEXTINPUT_MULTILINE_BOOLEAN, true } }; #ifdef HAVE_SDL_TTF @@ -751,11 +751,11 @@ static void DrawSettingsButton(WindowState *ctx) static void ToggleSettings(WindowState *ctx) { if (ctx->settings_visible) { - ctx->settings_visible = SDL_FALSE; + ctx->settings_visible = false; SDL_StartTextInputWithProperties(ctx->window, ctx->text_settings); } else { SDL_StopTextInput(ctx->window); - ctx->settings_visible = SDL_TRUE; + ctx->settings_visible = true; } } @@ -777,11 +777,11 @@ static int GetDefaultSetting(SDL_PropertiesID props, const char *setting) } if (SDL_strcmp(setting, SDL_PROP_TEXTINPUT_AUTOCORRECT_BOOLEAN) == 0) { - return SDL_TRUE; + return true; } if (SDL_strcmp(setting, SDL_PROP_TEXTINPUT_MULTILINE_BOOLEAN) == 0) { - return SDL_TRUE; + return true; } SDL_assert(!"Unknown setting"); @@ -1027,8 +1027,8 @@ static void Redraw(void) int main(int argc, char *argv[]) { - SDL_bool render_composition = SDL_FALSE; - SDL_bool render_candidates = SDL_FALSE; + bool render_composition = false; + bool render_candidates = false; int i, done; SDL_Event event; char *fontname = NULL; @@ -1050,10 +1050,10 @@ int main(int argc, char *argv[]) consumed = 2; } } else if (SDL_strcmp(argv[i], "--render-composition") == 0) { - render_composition = SDL_TRUE; + render_composition = true; consumed = 1; } else if (SDL_strcmp(argv[i], "--render-candidates") == 0) { - render_candidates = SDL_TRUE; + render_candidates = true; consumed = 1; } if (consumed <= 0) { @@ -1114,7 +1114,7 @@ int main(int argc, char *argv[]) ctx->window = window; ctx->renderer = renderer; ctx->rendererID = i; - ctx->settings_icon = LoadTexture(renderer, "icon.bmp", SDL_TRUE, &icon_w, &icon_h); + ctx->settings_icon = LoadTexture(renderer, "icon.bmp", true, &icon_w, &icon_h); ctx->settings_rect.x = (float)WINDOW_WIDTH - icon_w - MARGIN; ctx->settings_rect.y = MARGIN; ctx->settings_rect.w = (float)icon_w; diff --git a/test/testintersections.c b/test/testintersections.c index b86bb5a3b..7838047b9 100644 --- a/test/testintersections.c +++ b/test/testintersections.c @@ -29,8 +29,8 @@ static SDLTest_CommonState *state; static int num_objects; -static SDL_bool cycle_color; -static SDL_bool cycle_alpha; +static bool cycle_color; +static bool cycle_alpha; static int cycle_direction = 1; static int current_alpha = 255; static int current_color = 255; @@ -327,10 +327,10 @@ int main(int argc, char *argv[]) } } } else if (SDL_strcasecmp(argv[i], "--cyclecolor") == 0) { - cycle_color = SDL_TRUE; + cycle_color = true; consumed = 1; } else if (SDL_strcasecmp(argv[i], "--cyclealpha") == 0) { - cycle_alpha = SDL_TRUE; + cycle_alpha = true; consumed = 1; } else if (num_objects < 0 && SDL_isdigit(*argv[i])) { char *endptr = NULL; diff --git a/test/testlocale.c b/test/testlocale.c index 4a34ecadf..65549ad7b 100644 --- a/test/testlocale.c +++ b/test/testlocale.c @@ -67,7 +67,7 @@ int main(int argc, char **argv) } /* Print locales and languages */ - if (SDLTest_CommonInit(state) == SDL_FALSE) { + if (SDLTest_CommonInit(state) == false) { return 1; } diff --git a/test/testmanymouse.c b/test/testmanymouse.c index 6890ca358..4f64536b3 100644 --- a/test/testmanymouse.c +++ b/test/testmanymouse.c @@ -125,7 +125,7 @@ SDL_COMPILE_TIME_ASSERT(keyboard_colors, SDL_arraysize(colors) == MAX_KEYBOARDS) typedef struct { SDL_MouseID instance_id; - SDL_bool active; + bool active; Uint8 button_state; SDL_FPoint position; int trail_head; @@ -138,7 +138,7 @@ static MouseState mice[MAX_MICE]; typedef struct { SDL_KeyboardID instance_id; - SDL_bool active; + bool active; Uint8 button_state; SDL_FPoint position; } KeyboardState; @@ -172,7 +172,7 @@ static SDL_Texture *CreateTexture(const char *image[], SDL_Renderer *renderer) palette->colors['X'].g = 0x00; palette->colors['X'].b = 0x00; - SDL_SetSurfaceColorKey(surface, SDL_TRUE, ' '); + SDL_SetSurfaceColorKey(surface, true, ' '); texture = SDL_CreateTextureFromSurface(renderer, surface); SDL_DestroySurface(surface); @@ -190,7 +190,7 @@ static void HandleMouseAdded(SDL_MouseID instance_id) MouseState *mouse_state = &mice[i]; if (!mouse_state->active) { mouse_state->instance_id = instance_id; - mouse_state->active = SDL_TRUE; + mouse_state->active = true; mouse_state->position.x = w * 0.5f; mouse_state->position.y = h * 0.5f; return; @@ -339,7 +339,7 @@ static void HandleKeyboardAdded(SDL_KeyboardID instance_id) KeyboardState *keyboard_state = &keyboards[i]; if (!keyboard_state->active) { keyboard_state->instance_id = instance_id; - keyboard_state->active = SDL_TRUE; + keyboard_state->active = true; keyboard_state->position.x = w * 0.5f; keyboard_state->position.y = h * 0.5f; return; @@ -537,7 +537,7 @@ int main(int argc, char *argv[]) SDL_SetPointerProperty(SDL_GetRendererProperties(renderer), PROP_CROSS_CURSOR_TEXTURE, cursor_cross); /* We only get mouse motion for distinct devices when relative mode is enabled */ - SDL_SetWindowRelativeMouseMode(state->windows[i], SDL_TRUE); + SDL_SetWindowRelativeMouseMode(state->windows[i], true); } /* Main render loop */ diff --git a/test/testmouse.c b/test/testmouse.c index 8defd5b05..d995df8f1 100644 --- a/test/testmouse.c +++ b/test/testmouse.c @@ -43,21 +43,21 @@ typedef struct _Object float x1, y1, x2, y2; Uint8 r, g, b; - SDL_bool isRect; + bool isRect; } Object; static Object *active = NULL; static Object *objects = NULL; static int buttons = 0; -static SDL_bool isRect = SDL_FALSE; +static bool isRect = false; -static SDL_bool wheel_x_active = SDL_FALSE; -static SDL_bool wheel_y_active = SDL_FALSE; +static bool wheel_x_active = false; +static bool wheel_y_active = false; static float wheel_x = SCREEN_WIDTH * 0.5f; static float wheel_y = SCREEN_HEIGHT * 0.5f; struct mouse_loop_data { - SDL_bool done; + bool done; SDL_Renderer *renderer; }; @@ -127,12 +127,12 @@ static void loop(void *arg) event.wheel.y *= -1; } if (event.wheel.x != 0.0f) { - wheel_x_active = SDL_TRUE; + wheel_x_active = true; /* "positive to the right and negative to the left" */ wheel_x += event.wheel.x * 10.0f; } if (event.wheel.y != 0.0f) { - wheel_y_active = SDL_TRUE; + wheel_y_active = true; /* "positive away from the user and negative towards the user" */ wheel_y -= event.wheel.y * 10.0f; } @@ -239,7 +239,7 @@ static void loop(void *arg) break; case SDL_EVENT_QUIT: - loop_data->done = SDL_TRUE; + loop_data->done = true; break; default: @@ -317,7 +317,7 @@ int main(int argc, char *argv[]) return 0; } - loop_data.done = SDL_FALSE; + loop_data.done = false; loop_data.renderer = SDL_CreateRenderer(window, NULL); if (!loop_data.renderer) { @@ -330,7 +330,7 @@ int main(int argc, char *argv[]) #ifdef SDL_PLATFORM_EMSCRIPTEN emscripten_set_main_loop_arg(loop, &loop_data, 0, 1); #else - while (loop_data.done == SDL_FALSE) { + while (loop_data.done == false) { loop(&loop_data); } #endif diff --git a/test/testnative.c b/test/testnative.c index 3899a6434..95fb1c203 100644 --- a/test/testnative.c +++ b/test/testnative.c @@ -149,7 +149,7 @@ int main(int argc, char *argv[]) } props = SDL_CreateProperties(); SDL_SetPointerProperty(props, "sdl2-compat.external_window", native_window); - SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN, SDL_TRUE); + SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN, true); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, WINDOW_W); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER, WINDOW_H); window = SDL_CreateWindowWithProperties(props); @@ -171,7 +171,7 @@ int main(int argc, char *argv[]) SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF); SDL_RenderClear(renderer); - sprite = LoadTexture(renderer, "icon.bmp", SDL_TRUE, NULL, NULL); + sprite = LoadTexture(renderer, "icon.bmp", true, NULL, NULL); if (!sprite) { quit(6); } diff --git a/test/testoffscreen.c b/test/testoffscreen.c index eecd82aa7..69ba62380 100644 --- a/test/testoffscreen.c +++ b/test/testoffscreen.c @@ -23,7 +23,7 @@ static SDL_Renderer *renderer = NULL; static SDL_Window *window = NULL; -static int done = SDL_FALSE; +static int done = false; static int frame_number = 0; static int width = 640; static int height = 480; @@ -69,7 +69,7 @@ static void loop(void) while (SDL_PollEvent(&event)) { switch (event.type) { case SDL_EVENT_QUIT: - done = SDL_TRUE; + done = true; break; default: break; diff --git a/test/testoverlay.c b/test/testoverlay.c index 9ef1aaf2e..0b3971f87 100644 --- a/test/testoverlay.c +++ b/test/testoverlay.c @@ -156,7 +156,7 @@ static int window_h; static int paused = 0; static int done = 0; static int fpsdelay; -static SDL_bool streaming = SDL_TRUE; +static bool streaming = true; static Uint8 *RawMooseData = NULL; /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ @@ -362,7 +362,7 @@ int main(int argc, char **argv) nodelay = 1; } else if (SDL_strcmp(argv[i], "--nostreaming") == 0) { consumed = 1; - streaming = SDL_FALSE; + streaming = false; } else if (SDL_strcmp(argv[i], "--scale") == 0) { consumed = 2; if (argv[i + 1]) { @@ -524,7 +524,7 @@ int main(int argc, char **argv) displayrect.h = (float)window_h; /* Ignore key up events, they don't even get filtered */ - SDL_SetEventEnabled(SDL_EVENT_KEY_UP, SDL_FALSE); + SDL_SetEventEnabled(SDL_EVENT_KEY_UP, false); /* Main render loop */ frames = 0; diff --git a/test/testpen.c b/test/testpen.c index 0be0092f6..68fa2123b 100644 --- a/test/testpen.c +++ b/test/testpen.c @@ -23,8 +23,8 @@ typedef struct Pen float x; float y; Uint32 buttons; - SDL_bool eraser; - SDL_bool touching; + bool eraser; + bool touching; struct Pen *next; } Pen; @@ -150,7 +150,7 @@ SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event) /*SDL_Log("Pen %" SDL_PRIu32 " down!", event->ptouch.which);*/ pen = FindPen(event->ptouch.which); if (pen) { - pen->touching = SDL_TRUE; + pen->touching = true; pen->eraser = (event->ptouch.eraser != 0); } return SDL_APP_CONTINUE; @@ -159,7 +159,7 @@ SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event) /*SDL_Log("Pen %" SDL_PRIu32 " up!", event->ptouch.which);*/ pen = FindPen(event->ptouch.which); if (pen) { - pen->touching = SDL_FALSE; + pen->touching = false; pen->axes[SDL_PEN_AXIS_PRESSURE] = 0.0f; } return SDL_APP_CONTINUE; diff --git a/test/testplatform.c b/test/testplatform.c index 8fcd779c6..271911cc1 100644 --- a/test/testplatform.c +++ b/test/testplatform.c @@ -44,7 +44,7 @@ SDL_COMPILE_TIME_ASSERT(SDL_MIN_SINT64, SDL_MIN_SINT64 == ~INT64_C(0x7ffffffffff SDL_COMPILE_TIME_ASSERT(SDL_MAX_UINT64, SDL_MAX_UINT64 == UINT64_C(18446744073709551615)); SDL_COMPILE_TIME_ASSERT(SDL_MIN_UINT64, SDL_MIN_UINT64 == 0); -static int TestTypes(SDL_bool verbose) +static int TestTypes(bool verbose) { int error = 0; @@ -79,7 +79,7 @@ static int TestTypes(SDL_bool verbose) return error ? 1 : 0; } -static int TestEndian(SDL_bool verbose) +static int TestEndian(bool verbose) { int error = 0; Uint16 value = 0x1234; @@ -360,7 +360,7 @@ static LL_Test LL_Tests[] = { { NULL, NULL, 0, 0, 0, 0 } }; -static int Test64Bit(SDL_bool verbose) +static int Test64Bit(bool verbose) { LL_Test *t; int failed = 0; @@ -386,7 +386,7 @@ static int Test64Bit(SDL_bool verbose) return failed ? 1 : 0; } -static int TestCPUInfo(SDL_bool verbose) +static int TestCPUInfo(bool verbose) { if (verbose) { SDL_Log("Number of logical CPU cores: %d\n", SDL_GetNumLogicalCPUCores()); @@ -410,7 +410,7 @@ static int TestCPUInfo(SDL_bool verbose) return 0; } -static int TestAssertions(SDL_bool verbose) +static int TestAssertions(bool verbose) { SDL_assert(1); SDL_assert_release(1); @@ -441,7 +441,7 @@ static int TestAssertions(SDL_bool verbose) int main(int argc, char *argv[]) { int i; - SDL_bool verbose = SDL_TRUE; + bool verbose = true; int status = 0; SDLTest_CommonState *state; @@ -458,7 +458,7 @@ int main(int argc, char *argv[]) consumed = SDLTest_CommonArg(state, i); if (!consumed) { if (SDL_strcmp(argv[i], "-q") == 0) { - verbose = SDL_FALSE; + verbose = false; consumed = 1; } } diff --git a/test/testpopup.c b/test/testpopup.c index 683d7f23e..c2964e634 100644 --- a/test/testpopup.c +++ b/test/testpopup.c @@ -75,19 +75,19 @@ static int get_menu_index_by_window(SDL_Window *window) return -1; } -static SDL_bool window_is_root(SDL_Window *window) +static bool window_is_root(SDL_Window *window) { int i; for (i = 0; i < state->num_windows; ++i) { if (window == state->windows[i]) { - return SDL_TRUE; + return true; } } - return SDL_FALSE; + return false; } -static SDL_bool create_popup(struct PopupWindow *new_popup, SDL_bool is_menu) +static bool create_popup(struct PopupWindow *new_popup, bool is_menu) { SDL_Window *focus; SDL_Window *new_win; @@ -111,11 +111,11 @@ static SDL_bool create_popup(struct PopupWindow *new_popup, SDL_bool is_menu) new_popup->renderer = new_renderer; new_popup->parent = focus; - return SDL_TRUE; + return true; } SDL_zerop(new_popup); - return SDL_FALSE; + return false; } static void close_popups(void) @@ -167,7 +167,7 @@ static void loop(void) } else if (event.button.button == SDL_BUTTON_RIGHT) { /* Create a new popup menu */ menus = SDL_realloc(menus, sizeof(struct PopupWindow) * (num_menus + 1)); - if (create_popup(&menus[num_menus], SDL_TRUE)) { + if (create_popup(&menus[num_menus], true)) { ++num_menus; } } @@ -195,7 +195,7 @@ static void loop(void) /* Show the tooltip if the delay period has elapsed */ if (SDL_GetTicks() > tooltip_timer) { if (!tooltip.win) { - create_popup(&tooltip, SDL_FALSE); + create_popup(&tooltip, false); } } diff --git a/test/testprocess.c b/test/testprocess.c index c345f710d..0e482463c 100644 --- a/test/testprocess.c +++ b/test/testprocess.c @@ -40,17 +40,17 @@ static SDL_Environment *DuplicateEnvironment(const char *key0, ...) va_list ap; const char *keyN; SDL_Environment *env = SDL_GetEnvironment(); - SDL_Environment *new_env = SDL_CreateEnvironment(SDL_FALSE); + SDL_Environment *new_env = SDL_CreateEnvironment(false); if (key0) { char *sep = SDL_strchr(key0, '='); if (sep) { *sep = '\0'; - SDL_SetEnvironmentVariable(new_env, key0, sep + 1, SDL_TRUE); + SDL_SetEnvironmentVariable(new_env, key0, sep + 1, true); *sep = '='; - SDL_SetEnvironmentVariable(new_env, key0, sep, SDL_TRUE); + SDL_SetEnvironmentVariable(new_env, key0, sep, true); } else { - SDL_SetEnvironmentVariable(new_env, key0, SDL_GetEnvironmentVariable(env, key0), SDL_TRUE); + SDL_SetEnvironmentVariable(new_env, key0, SDL_GetEnvironmentVariable(env, key0), true); } va_start(ap, key0); for (;;) { @@ -59,10 +59,10 @@ static SDL_Environment *DuplicateEnvironment(const char *key0, ...) sep = SDL_strchr(keyN, '='); if (sep) { *sep = '\0'; - SDL_SetEnvironmentVariable(new_env, keyN, sep + 1, SDL_TRUE); + SDL_SetEnvironmentVariable(new_env, keyN, sep + 1, true); *sep = '='; } else { - SDL_SetEnvironmentVariable(new_env, keyN, SDL_GetEnvironmentVariable(env, keyN), SDL_TRUE); + SDL_SetEnvironmentVariable(new_env, keyN, SDL_GetEnvironmentVariable(env, keyN), true); } } else { break; @@ -99,7 +99,7 @@ static int SDLCALL process_testArguments(void *arg) int exit_code; int i; - process = SDL_CreateProcess(process_args, SDL_TRUE); + process = SDL_CreateProcess(process_args, true); SDLTest_AssertCheck(process != NULL, "SDL_CreateProcess()"); if (!process) { goto failed; @@ -142,14 +142,14 @@ static int SDLCALL process_testInheritedEnv(void *arg) Sint64 pid; SDL_IOStream *process_stdout = NULL; char buffer[256]; - SDL_bool wait_result; + bool wait_result; int exit_code; static const char *const TEST_ENV_KEY = "testprocess_environment"; char *test_env_val = NULL; test_env_val = SDLTest_RandomAsciiStringOfSize(32); SDLTest_AssertPass("Setting parent environment variable %s=%s", TEST_ENV_KEY, test_env_val); - SDL_SetEnvironmentVariable(SDL_GetEnvironment(), TEST_ENV_KEY, test_env_val, SDL_TRUE); + SDL_SetEnvironmentVariable(SDL_GetEnvironment(), TEST_ENV_KEY, test_env_val, true); SDL_snprintf(buffer, sizeof(buffer), "%s=%s", TEST_ENV_KEY, test_env_val); process_args[3] = buffer; @@ -190,8 +190,8 @@ static int SDLCALL process_testInheritedEnv(void *arg) SDLTest_AssertPass("About to wait on process"); exit_code = 0xdeadbeef; - wait_result = SDL_WaitProcess(process, SDL_TRUE, &exit_code); - SDLTest_AssertCheck(wait_result == SDL_TRUE, "Process should have closed when closing stdin"); + wait_result = SDL_WaitProcess(process, true, &exit_code); + SDLTest_AssertCheck(wait_result == true, "Process should have closed when closing stdin"); SDLTest_AssertPass("exit_code will be != 0 when environment variable was not set"); SDLTest_AssertCheck(exit_code == 0, "Exit code should be 0, is %d", exit_code); SDLTest_AssertPass("About to destroy process"); @@ -219,7 +219,7 @@ static int SDLCALL process_testNewEnv(void *arg) Sint64 pid; SDL_IOStream *process_stdout = NULL; char buffer[256]; - SDL_bool wait_result; + bool wait_result; int exit_code; static const char *const TEST_ENV_KEY = "testprocess_environment"; char *test_env_val = NULL; @@ -268,8 +268,8 @@ static int SDLCALL process_testNewEnv(void *arg) SDLTest_AssertPass("About to wait on process"); exit_code = 0xdeadbeef; - wait_result = SDL_WaitProcess(process, SDL_TRUE, &exit_code); - SDLTest_AssertCheck(wait_result == SDL_TRUE, "Process should have closed when closing stdin"); + wait_result = SDL_WaitProcess(process, true, &exit_code); + SDLTest_AssertCheck(wait_result == true, "Process should have closed when closing stdin"); SDLTest_AssertPass("exit_code will be != 0 when environment variable was not set"); SDLTest_AssertCheck(exit_code == 0, "Exit code should be 0, is %d", exit_code); SDLTest_AssertPass("About to destroy process"); @@ -303,7 +303,7 @@ static int process_testStdinToStdout(void *arg) size_t amount_to_write; char buffer[128]; size_t total_read; - SDL_bool wait_result; + bool wait_result; int exit_code; props = SDL_CreateProperties(); @@ -372,13 +372,13 @@ static int process_testStdinToStdout(void *arg) SDLTest_AssertPass("About to wait on process"); exit_code = 0xdeadbeef; - wait_result = SDL_WaitProcess(process, SDL_TRUE, &exit_code); - SDLTest_AssertCheck(wait_result == SDL_TRUE, "Process should have closed when closing stdin"); + wait_result = SDL_WaitProcess(process, true, &exit_code); + SDLTest_AssertCheck(wait_result == true, "Process should have closed when closing stdin"); SDLTest_AssertCheck(exit_code == 0, "Exit code should be 0, is %d", exit_code); if (!wait_result) { - SDL_bool killed; + bool killed; SDL_Log("About to kill process"); - killed = SDL_KillProcess(process, SDL_TRUE); + killed = SDL_KillProcess(process, true); SDLTest_AssertCheck(killed, "SDL_KillProcess succeeded"); } SDLTest_AssertPass("About to destroy process"); @@ -405,7 +405,7 @@ static int process_testSimpleStdinToStdout(void *arg) size_t result; int exit_code; - process = SDL_CreateProcess(process_args, SDL_TRUE); + process = SDL_CreateProcess(process_args, true); SDLTest_AssertCheck(process != NULL, "SDL_CreateProcess()"); if (!process) { goto failed; @@ -459,7 +459,7 @@ static int process_testMultiprocessStdinToStdout(void *arg) size_t result; int exit_code; - process1 = SDL_CreateProcess(process_args, SDL_TRUE); + process1 = SDL_CreateProcess(process_args, true); SDLTest_AssertCheck(process1 != NULL, "SDL_CreateProcess()"); if (!process1) { goto failed; diff --git a/test/testrelative.c b/test/testrelative.c index a26a0859e..a0e4b7b82 100644 --- a/test/testrelative.c +++ b/test/testrelative.c @@ -24,7 +24,7 @@ static SDLTest_CommonState *state; static int i, done; static SDL_FRect rect; static SDL_Event event; -static SDL_bool warp; +static bool warp; static void DrawRects(SDL_Renderer *renderer) { @@ -152,7 +152,7 @@ int main(int argc, char *argv[]) if (consumed == 0) { consumed = -1; if (SDL_strcasecmp(argv[i], "--warp") == 0) { - warp = SDL_TRUE; + warp = true; consumed = 1; } } @@ -191,7 +191,7 @@ int main(int argc, char *argv[]) SDL_HideCursor(); } else { for (i = 0; i < state->num_windows; ++i) { - SDL_SetWindowRelativeMouseMode(state->windows[i], SDL_TRUE); + SDL_SetWindowRelativeMouseMode(state->windows[i], true); } } diff --git a/test/testrendercopyex.c b/test/testrendercopyex.c index ead35a2e6..22f5cc7cc 100644 --- a/test/testrendercopyex.c +++ b/test/testrendercopyex.c @@ -135,8 +135,8 @@ int main(int argc, char *argv[]) drawstate->window = state->windows[i]; drawstate->renderer = state->renderers[i]; - drawstate->sprite = LoadTexture(drawstate->renderer, "icon.bmp", SDL_TRUE, NULL, NULL); - drawstate->background = LoadTexture(drawstate->renderer, "sample.bmp", SDL_FALSE, NULL, NULL); + drawstate->sprite = LoadTexture(drawstate->renderer, "icon.bmp", true, NULL, NULL); + drawstate->background = LoadTexture(drawstate->renderer, "sample.bmp", false, NULL, NULL); if (!drawstate->sprite || !drawstate->background) { quit(2); } diff --git a/test/testrendertarget.c b/test/testrendertarget.c index 082cab5c7..739cb7f49 100644 --- a/test/testrendertarget.c +++ b/test/testrendertarget.c @@ -35,7 +35,7 @@ typedef struct static DrawState *drawstates; static int done; -static SDL_bool test_composite = SDL_FALSE; +static bool test_composite = false; /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ static void @@ -48,7 +48,7 @@ quit(int rc) } } -static SDL_bool +static bool DrawComposite(DrawState *s) { SDL_Rect viewport; @@ -56,7 +56,7 @@ DrawComposite(DrawState *s) SDL_Texture *target; SDL_Surface *surface; - static SDL_bool blend_tested = SDL_FALSE; + static bool blend_tested = false; if (!blend_tested) { SDL_Texture *A, *B; @@ -86,7 +86,7 @@ DrawComposite(DrawState *s) SDL_DestroyTexture(A); SDL_DestroyTexture(B); - blend_tested = SDL_TRUE; + blend_tested = true; } SDL_GetRenderViewport(s->renderer, &viewport); @@ -135,10 +135,10 @@ DrawComposite(DrawState *s) /* Update the screen! */ SDL_RenderPresent(s->renderer); - return SDL_TRUE; + return true; } -static SDL_bool +static bool Draw(DrawState *s) { SDL_Rect viewport; @@ -149,7 +149,7 @@ Draw(DrawState *s) target = SDL_CreateTexture(s->renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_TARGET, viewport.w, viewport.h); if (!target) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create render target texture: %s\n", SDL_GetError()); - return SDL_FALSE; + return false; } SDL_SetRenderTarget(s->renderer, target); @@ -179,7 +179,7 @@ Draw(DrawState *s) /* Update the screen! */ SDL_RenderPresent(s->renderer); - return SDL_TRUE; + return true; } static void loop(void) @@ -231,7 +231,7 @@ int main(int argc, char *argv[]) if (consumed == 0) { consumed = -1; if (SDL_strcasecmp(argv[i], "--composite") == 0) { - test_composite = SDL_TRUE; + test_composite = true; consumed = 1; } } @@ -253,11 +253,11 @@ int main(int argc, char *argv[]) drawstate->window = state->windows[i]; drawstate->renderer = state->renderers[i]; if (test_composite) { - drawstate->sprite = LoadTexture(drawstate->renderer, "icon-alpha.bmp", SDL_TRUE, NULL, NULL); + drawstate->sprite = LoadTexture(drawstate->renderer, "icon-alpha.bmp", true, NULL, NULL); } else { - drawstate->sprite = LoadTexture(drawstate->renderer, "icon.bmp", SDL_TRUE, NULL, NULL); + drawstate->sprite = LoadTexture(drawstate->renderer, "icon.bmp", true, NULL, NULL); } - drawstate->background = LoadTexture(drawstate->renderer, "sample.bmp", SDL_FALSE, NULL, NULL); + drawstate->background = LoadTexture(drawstate->renderer, "sample.bmp", false, NULL, NULL); if (!drawstate->sprite || !drawstate->background) { quit(2); } diff --git a/test/testrwlock.c b/test/testrwlock.c index b95afb71a..d416a15c0 100644 --- a/test/testrwlock.c +++ b/test/testrwlock.c @@ -31,7 +31,7 @@ static SDLTest_CommonState *state; static void DoWork(const int workticks) /* "Work" */ { const SDL_ThreadID tid = SDL_GetCurrentThreadID(); - const SDL_bool is_reader = tid != mainthread; + const bool is_reader = tid != mainthread; const char *typestr = is_reader ? "Reader" : "Writer"; SDL_Log("%s Thread %" SDL_PRIu64 ": ready to work\n", typestr, tid); diff --git a/test/testscale.c b/test/testscale.c index 76890401f..6f53d3bb4 100644 --- a/test/testscale.c +++ b/test/testscale.c @@ -126,8 +126,8 @@ int main(int argc, char *argv[]) drawstate->window = state->windows[i]; drawstate->renderer = state->renderers[i]; - drawstate->sprite = LoadTexture(drawstate->renderer, "icon.bmp", SDL_TRUE, NULL, NULL); - drawstate->background = LoadTexture(drawstate->renderer, "sample.bmp", SDL_FALSE, NULL, NULL); + drawstate->sprite = LoadTexture(drawstate->renderer, "icon.bmp", true, NULL, NULL); + drawstate->background = LoadTexture(drawstate->renderer, "sample.bmp", false, NULL, NULL); if (!drawstate->sprite || !drawstate->background) { quit(2); } diff --git a/test/testsem.c b/test/testsem.c index b07a09671..232a2fdde 100644 --- a/test/testsem.c +++ b/test/testsem.c @@ -31,7 +31,7 @@ typedef struct Thread_State { SDL_Thread *thread; int number; - SDL_bool flag; + bool flag; int loop_count; int content_count; } Thread_State; @@ -108,7 +108,7 @@ TestWaitTimeout(void) Uint64 start_ticks; Uint64 end_ticks; Uint64 duration; - SDL_bool result; + bool result; sem = SDL_CreateSemaphore(0); SDL_Log("Waiting 2 seconds on semaphore\n"); @@ -125,7 +125,7 @@ TestWaitTimeout(void) /* Check to make sure the return value indicates timed out */ if (result) { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_WaitSemaphoreTimeout returned: %d; expected: SDL_FALSE\n\n", result); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_WaitSemaphoreTimeout returned: %d; expected: false\n\n", result); } SDL_DestroySemaphore(sem); @@ -184,7 +184,7 @@ ThreadFuncOverheadContended(void *data) } static void -TestOverheadContended(SDL_bool try_wait) +TestOverheadContended(bool try_wait) { Uint64 start_ticks; Uint64 end_ticks; @@ -257,7 +257,7 @@ int main(int argc, char **argv) int arg_count = 0; int i; int init_sem = 0; - SDL_bool enable_threads = SDL_TRUE; + bool enable_threads = true; SDLTest_CommonState *state; /* Initialize test framework */ @@ -274,7 +274,7 @@ int main(int argc, char **argv) if (consumed == 0) { consumed = -1; if (SDL_strcasecmp(argv[i], "--no-threads") == 0) { - enable_threads = SDL_FALSE; + enable_threads = false; consumed = 1; } else if (arg_count == 0) { char *endptr; @@ -317,9 +317,9 @@ int main(int argc, char **argv) TestOverheadUncontended(); if (enable_threads) { - TestOverheadContended(SDL_FALSE); + TestOverheadContended(false); - TestOverheadContended(SDL_TRUE); + TestOverheadContended(true); } SDL_Quit(); diff --git a/test/testsensor.c b/test/testsensor.c index 89aaaa618..dac097628 100644 --- a/test/testsensor.c +++ b/test/testsensor.c @@ -108,7 +108,7 @@ int main(int argc, char **argv) SDL_Log("Opened %d sensors\n", num_opened); if (num_opened > 0) { - SDL_bool done = SDL_FALSE; + bool done = false; SDL_Event event; SDL_CreateWindow("Sensor Test", 0, 0, SDL_WINDOW_FULLSCREEN); @@ -125,7 +125,7 @@ int main(int argc, char **argv) case SDL_EVENT_MOUSE_BUTTON_UP: case SDL_EVENT_KEY_UP: case SDL_EVENT_QUIT: - done = SDL_TRUE; + done = true; break; default: break; diff --git a/test/testshader.c b/test/testshader.c index 057376c72..1b6c66e2d 100644 --- a/test/testshader.c +++ b/test/testshader.c @@ -23,7 +23,7 @@ #include -static SDL_bool shaders_supported; +static bool shaders_supported; static int current_shader = 0; enum @@ -128,7 +128,7 @@ static PFNGLSHADERSOURCEARBPROC pglShaderSourceARB; static PFNGLUNIFORM1IARBPROC pglUniform1iARB; static PFNGLUSEPROGRAMOBJECTARBPROC pglUseProgramObjectARB; -static SDL_bool CompileShader(GLhandleARB shader, const char *source) +static bool CompileShader(GLhandleARB shader, const char *source) { GLint status = 0; @@ -148,13 +148,13 @@ static SDL_bool CompileShader(GLhandleARB shader, const char *source) SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to compile shader:\n%s\n%s", source, info); SDL_free(info); } - return SDL_FALSE; + return false; } else { - return SDL_TRUE; + return true; } } -static SDL_bool LinkProgram(ShaderData *data) +static bool LinkProgram(ShaderData *data) { GLint status = 0; @@ -176,13 +176,13 @@ static SDL_bool LinkProgram(ShaderData *data) SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to link program:\n%s", info); SDL_free(info); } - return SDL_FALSE; + return false; } else { - return SDL_TRUE; + return true; } } -static SDL_bool CompileShaderProgram(ShaderData *data) +static bool CompileShaderProgram(ShaderData *data) { const int num_tmus_bound = 4; int i; @@ -196,18 +196,18 @@ static SDL_bool CompileShaderProgram(ShaderData *data) /* Create the vertex shader */ data->vert_shader = pglCreateShaderObjectARB(GL_VERTEX_SHADER_ARB); if (!CompileShader(data->vert_shader, data->vert_source)) { - return SDL_FALSE; + return false; } /* Create the fragment shader */ data->frag_shader = pglCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB); if (!CompileShader(data->frag_shader, data->frag_source)) { - return SDL_FALSE; + return false; } /* ... and in the darkness bind them */ if (!LinkProgram(data)) { - return SDL_FALSE; + return false; } /* Set up some uniform variables */ @@ -234,12 +234,12 @@ static void DestroyShaderProgram(ShaderData *data) } } -static SDL_bool InitShaders(void) +static bool InitShaders(void) { int i; /* Check for shader support */ - shaders_supported = SDL_FALSE; + shaders_supported = false; if (SDL_GL_ExtensionSupported("GL_ARB_shader_objects") && SDL_GL_ExtensionSupported("GL_ARB_shading_language_100") && SDL_GL_ExtensionSupported("GL_ARB_vertex_shader") && @@ -268,24 +268,24 @@ static SDL_bool InitShaders(void) pglShaderSourceARB && pglUniform1iARB && pglUseProgramObjectARB) { - shaders_supported = SDL_TRUE; + shaders_supported = true; } } if (!shaders_supported) { - return SDL_FALSE; + return false; } /* Compile all the shaders */ for (i = 0; i < NUM_SHADERS; ++i) { if (!CompileShaderProgram(&shaders[i])) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to compile shader!\n"); - return SDL_FALSE; + return false; } } /* We're done! */ - return SDL_TRUE; + return true; } static void QuitShaders(void) diff --git a/test/testshape.c b/test/testshape.c index c55b2c9ef..b42c7e8ae 100644 --- a/test/testshape.c +++ b/test/testshape.c @@ -35,16 +35,16 @@ int main(int argc, char *argv[]) SDL_Window *window = NULL; SDL_Renderer *renderer = NULL; SDL_Surface *shape = NULL; - SDL_bool resizable = SDL_FALSE; + bool resizable = false; SDL_WindowFlags flags; - SDL_bool done = SDL_FALSE; + bool done = false; SDL_Event event; int i; int return_code = 1; for (i = 1; i < argc; ++i) { if (SDL_strcmp(argv[i], "--resizable") == 0) { - resizable = SDL_TRUE; + resizable = true; } else if (!image_file) { image_file = argv[i]; } else { @@ -60,7 +60,7 @@ int main(int argc, char *argv[]) goto quit; } } else { - shape = SDL_LoadBMP_IO(SDL_IOFromConstMem(glass_bmp, sizeof(glass_bmp)), SDL_TRUE); + shape = SDL_LoadBMP_IO(SDL_IOFromConstMem(glass_bmp, sizeof(glass_bmp)), true); if (!shape) { SDL_Log("Couldn't load glass.bmp: %s\n", SDL_GetError()); goto quit; @@ -112,11 +112,11 @@ int main(int argc, char *argv[]) switch (event.type) { case SDL_EVENT_KEY_DOWN: if (event.key.key == SDLK_ESCAPE) { - done = SDL_TRUE; + done = true; } break; case SDL_EVENT_QUIT: - done = SDL_TRUE; + done = true; break; default: break; diff --git a/test/testsprite.c b/test/testsprite.c index 15f645a64..9568efa97 100644 --- a/test/testsprite.c +++ b/test/testsprite.c @@ -23,8 +23,8 @@ static SDLTest_CommonState *state; static int num_sprites; static SDL_Texture **sprites; -static SDL_bool cycle_color; -static SDL_bool cycle_alpha; +static bool cycle_color; +static bool cycle_alpha; static int cycle_direction = 1; static int current_alpha = 0; static int current_color = 0; @@ -36,7 +36,7 @@ static Uint64 next_fps_check; static Uint32 frames; static const int fps_check_delay = 5000; static int use_rendergeometry = 0; -static SDL_bool suspend_when_occluded; +static bool suspend_when_occluded; /* Number of iterations to move sprites - used for visual tests. */ /* -1: infinite random moves (default); >=0: enables N deterministic moves */ @@ -56,7 +56,7 @@ static int LoadSprite(const char *file) for (i = 0; i < state->num_windows; ++i) { /* This does the SDL_LoadBMP step repeatedly, but that's OK for test code. */ - sprites[i] = LoadTexture(state->renderers[i], file, SDL_TRUE, &w, &h); + sprites[i] = LoadTexture(state->renderers[i], file, true, &w, &h); sprite_w = (float)w; sprite_h = (float)h; if (!sprites[i]) { @@ -218,8 +218,8 @@ static void MoveSprites(SDL_Renderer *renderer, SDL_Texture *sprite) if (iterations > 0) { iterations--; if (iterations == 0) { - cycle_alpha = SDL_FALSE; - cycle_color = SDL_FALSE; + cycle_alpha = false; + cycle_color = false; } } } @@ -444,13 +444,13 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[]) consumed = 2; } } else if (SDL_strcasecmp(argv[i], "--cyclecolor") == 0) { - cycle_color = SDL_TRUE; + cycle_color = true; consumed = 1; } else if (SDL_strcasecmp(argv[i], "--cyclealpha") == 0) { - cycle_alpha = SDL_TRUE; + cycle_alpha = true; consumed = 1; } else if (SDL_strcasecmp(argv[i], "--suspend-when-occluded") == 0) { - suspend_when_occluded = SDL_TRUE; + suspend_when_occluded = true; consumed = 1; } else if (SDL_strcasecmp(argv[i], "--use-rendergeometry") == 0) { if (argv[i + 1]) { diff --git a/test/testspriteminimal.c b/test/testspriteminimal.c index 3caeb35e5..a89d3a396 100644 --- a/test/testspriteminimal.c +++ b/test/testspriteminimal.c @@ -39,10 +39,10 @@ static SDL_Texture *CreateTexture(SDL_Renderer *r, unsigned char *data, unsigned SDL_Surface *surface; SDL_IOStream *src = SDL_IOFromConstMem(data, len); if (src) { - surface = SDL_LoadBMP_IO(src, SDL_TRUE); + surface = SDL_LoadBMP_IO(src, true); if (surface) { /* Treat white as transparent */ - SDL_SetSurfaceColorKey(surface, SDL_TRUE, SDL_MapSurfaceRGB(surface, 255, 255, 255)); + SDL_SetSurfaceColorKey(surface, true, SDL_MapSurfaceRGB(surface, 255, 255, 255)); texture = SDL_CreateTextureFromSurface(r, surface); *w = surface->w; diff --git a/test/testspritesurface.c b/test/testspritesurface.c index 42ca8479a..ccde675b7 100644 --- a/test/testspritesurface.c +++ b/test/testspritesurface.c @@ -38,10 +38,10 @@ static SDL_Surface *CreateSurface(unsigned char *data, unsigned int len, int *w, SDL_Surface *surface = NULL; SDL_IOStream *src = SDL_IOFromConstMem(data, len); if (src) { - surface = SDL_LoadBMP_IO(src, SDL_TRUE); + surface = SDL_LoadBMP_IO(src, true); if (surface) { /* Treat white as transparent */ - SDL_SetSurfaceColorKey(surface, SDL_TRUE, SDL_MapSurfaceRGB(surface, 255, 255, 255)); + SDL_SetSurfaceColorKey(surface, true, SDL_MapSurfaceRGB(surface, 255, 255, 255)); *w = surface->w; *h = surface->h; diff --git a/test/teststreaming.c b/test/teststreaming.c index 3a5e506cf..23b731172 100644 --- a/test/teststreaming.c +++ b/test/teststreaming.c @@ -63,7 +63,7 @@ static Uint8 MooseFrames[MOOSEFRAMES_COUNT][MOOSEFRAME_SIZE]; static SDL_Renderer *renderer; static int frame; static SDL_Texture *MooseTexture; -static SDL_bool done = SDL_FALSE; +static bool done = false; static SDLTest_CommonState *state; static void quit(int rc) @@ -108,11 +108,11 @@ static void loop(void) switch (event.type) { case SDL_EVENT_KEY_DOWN: if (event.key.key == SDLK_ESCAPE) { - done = SDL_TRUE; + done = true; } break; case SDL_EVENT_QUIT: - done = SDL_TRUE; + done = true; break; default: break; diff --git a/test/testsurround.c b/test/testsurround.c index 3d9bf7de1..dc3a8d72a 100644 --- a/test/testsurround.c +++ b/test/testsurround.c @@ -87,12 +87,12 @@ get_channel_name(int channel_index, int channel_count) case 7: return "Side Right"; } - SDLTest_AssertCheck(SDL_FALSE, "Invalid channel_index for channel_count: channel_count=%d channel_index=%d", channel_count, channel_index); + SDLTest_AssertCheck(false, "Invalid channel_index for channel_count: channel_count=%d channel_index=%d", channel_count, channel_index); SDL_assert(0); return NULL; } -static SDL_bool is_lfe_channel(int channel_index, int channel_count) +static bool is_lfe_channel(int channel_index, int channel_count) { return (channel_count == 3 && channel_index == 2) || (channel_count >= 6 && channel_index == 3); } diff --git a/test/testtime.c b/test/testtime.c index c1b419e15..fadc15115 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -46,7 +46,7 @@ static void RenderDateTime(SDL_Renderer *r) /* Query the current time and print it. */ SDL_GetCurrentTime(&ticks); - SDL_TimeToDateTime(ticks, &dt, SDL_FALSE); + SDL_TimeToDateTime(ticks, &dt, false); switch (date_format) { case SDL_DATE_FORMAT_YYYYMMDD: @@ -78,7 +78,7 @@ static void RenderDateTime(SDL_Renderer *r) SDLTest_DrawString(r, 10, 15, str); - SDL_TimeToDateTime(ticks, &dt, SDL_TRUE); + SDL_TimeToDateTime(ticks, &dt, true); if (time_format) { if (dt.hour > 12) { /* PM */ dt.hour -= 12; diff --git a/test/testtimer.c b/test/testtimer.c index 14f5ccbb0..c98983c52 100644 --- a/test/testtimer.c +++ b/test/testtimer.c @@ -80,7 +80,7 @@ int main(int argc, char *argv[]) Uint64 start, now; Uint64 start_perf, now_perf; SDLTest_CommonState *state; - SDL_bool run_interactive_tests = SDL_TRUE; + bool run_interactive_tests = true; int return_code = 0; /* Initialize test framework */ @@ -96,7 +96,7 @@ int main(int argc, char *argv[]) consumed = SDLTest_CommonArg(state, i); if (!consumed) { if (SDL_strcmp(argv[i], "--no-interactive") == 0) { - run_interactive_tests = SDL_FALSE; + run_interactive_tests = false; consumed = 1; } else if (desired < 0) { char *endptr; diff --git a/test/testutils.c b/test/testutils.c index b32e43652..ea1c3266e 100644 --- a/test/testutils.c +++ b/test/testutils.c @@ -72,7 +72,7 @@ char *GetResourceFilename(const char *user_specified, const char *def) * * If height_out is non-NULL, set it to the texture height. */ -SDL_Texture *LoadTexture(SDL_Renderer *renderer, const char *file, SDL_bool transparent, int *width_out, int *height_out) +SDL_Texture *LoadTexture(SDL_Renderer *renderer, const char *file, bool transparent, int *width_out, int *height_out) { SDL_Surface *temp = NULL; SDL_Texture *texture = NULL; @@ -94,24 +94,24 @@ SDL_Texture *LoadTexture(SDL_Renderer *renderer, const char *file, SDL_bool tran const Uint8 bpp = SDL_BITSPERPIXEL(temp->format); const Uint8 mask = (1 << bpp) - 1; if (SDL_PIXELORDER(temp->format) == SDL_BITMAPORDER_4321) - SDL_SetSurfaceColorKey(temp, SDL_TRUE, (*(Uint8 *)temp->pixels) & mask); + SDL_SetSurfaceColorKey(temp, true, (*(Uint8 *)temp->pixels) & mask); else - SDL_SetSurfaceColorKey(temp, SDL_TRUE, ((*(Uint8 *)temp->pixels) >> (8 - bpp)) & mask); + SDL_SetSurfaceColorKey(temp, true, ((*(Uint8 *)temp->pixels) >> (8 - bpp)) & mask); } else { switch (SDL_BITSPERPIXEL(temp->format)) { case 15: - SDL_SetSurfaceColorKey(temp, SDL_TRUE, + SDL_SetSurfaceColorKey(temp, true, (*(Uint16 *)temp->pixels) & 0x00007FFF); break; case 16: - SDL_SetSurfaceColorKey(temp, SDL_TRUE, *(Uint16 *)temp->pixels); + SDL_SetSurfaceColorKey(temp, true, *(Uint16 *)temp->pixels); break; case 24: - SDL_SetSurfaceColorKey(temp, SDL_TRUE, + SDL_SetSurfaceColorKey(temp, true, (*(Uint32 *)temp->pixels) & 0x00FFFFFF); break; case 32: - SDL_SetSurfaceColorKey(temp, SDL_TRUE, *(Uint32 *)temp->pixels); + SDL_SetSurfaceColorKey(temp, true, *(Uint32 *)temp->pixels); break; } } diff --git a/test/testutils.h b/test/testutils.h index 5cbbf45a1..5a2f7e188 100644 --- a/test/testutils.h +++ b/test/testutils.h @@ -16,7 +16,7 @@ #include -SDL_Texture *LoadTexture(SDL_Renderer *renderer, const char *file, SDL_bool transparent, +SDL_Texture *LoadTexture(SDL_Renderer *renderer, const char *file, bool transparent, int *width_out, int *height_out); char *GetNearbyFilename(const char *file); char *GetResourceFilename(const char *user_specified, const char *def); diff --git a/test/testviewport.c b/test/testviewport.c index 38c13b810..6943145ac 100644 --- a/test/testviewport.c +++ b/test/testviewport.c @@ -26,7 +26,7 @@ static SDLTest_CommonState *state; static SDL_Rect viewport; static int done, j; -static SDL_bool use_target = SDL_FALSE; +static bool use_target = false; #ifdef SDL_PLATFORM_EMSCRIPTEN static Uint32 wait_start; #endif @@ -174,7 +174,7 @@ int main(int argc, char *argv[]) if (consumed == 0) { consumed = -1; if (SDL_strcasecmp(argv[i], "--target") == 0) { - use_target = SDL_TRUE; + use_target = true; consumed = 1; } } @@ -189,7 +189,7 @@ int main(int argc, char *argv[]) quit(2); } - sprite = LoadTexture(state->renderers[0], "icon.bmp", SDL_TRUE, &sprite_w, &sprite_h); + sprite = LoadTexture(state->renderers[0], "icon.bmp", true, &sprite_w, &sprite_h); if (!sprite) { quit(2); diff --git a/test/testvulkan.c b/test/testvulkan.c index 41e21544b..3139d5d05 100644 --- a/test/testvulkan.c +++ b/test/testvulkan.c @@ -180,12 +180,12 @@ static SDLTest_CommonState *state; static VulkanContext *vulkanContexts = NULL; /* an array of state->num_windows items */ static VulkanContext *vulkanContext = NULL; /* for the currently-rendering window */ -static void shutdownVulkan(SDL_bool doDestroySwapchain); +static void shutdownVulkan(bool doDestroySwapchain); /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ static void quit(int rc) { - shutdownVulkan(SDL_TRUE); + shutdownVulkan(true); SDLTest_CommonQuit(state); /* Let 'main()' return normally */ if (rc != 0) { @@ -309,8 +309,8 @@ static void findPhysicalDevice(void) uint32_t queueFamiliesCount = 0; uint32_t queueFamilyIndex; uint32_t deviceExtensionCount = 0; - SDL_bool hasSwapchainExtension = SDL_FALSE; - SDL_bool supportsPresent; + bool hasSwapchainExtension = false; + bool supportsPresent; uint32_t i; VkPhysicalDevice physicalDevice = physicalDevices[physicalDeviceIndex]; @@ -422,7 +422,7 @@ static void findPhysicalDevice(void) } for (i = 0; i < deviceExtensionCount; i++) { if (SDL_strcmp(deviceExtensions[i].extensionName, VK_KHR_SWAPCHAIN_EXTENSION_NAME) == 0) { - hasSwapchainExtension = SDL_TRUE; + hasSwapchainExtension = true; break; } } @@ -626,7 +626,7 @@ static void getSwapchainImages(void) } } -static SDL_bool createSwapchain(void) +static bool createSwapchain(void) { uint32_t i; int w, h; @@ -674,7 +674,7 @@ static SDL_bool createSwapchain(void) vulkanContext->surfaceCapabilities.maxImageExtent.height); if (w == 0 || h == 0) { - return SDL_FALSE; + return false; } getSurfaceCaps(); @@ -712,7 +712,7 @@ static SDL_bool createSwapchain(void) } getSwapchainImages(); - return SDL_TRUE; + return true; } static void destroySwapchain(void) @@ -908,7 +908,7 @@ static void rerecordCommandBuffer(uint32_t frameIndex, const VkClearColorValue * } } -static void destroySwapchainAndSwapchainSpecificStuff(SDL_bool doDestroySwapchain) +static void destroySwapchainAndSwapchainSpecificStuff(bool doDestroySwapchain) { if (vkDeviceWaitIdle != NULL) { vkDeviceWaitIdle(vulkanContext->device); @@ -921,18 +921,18 @@ static void destroySwapchainAndSwapchainSpecificStuff(SDL_bool doDestroySwapchai } } -static SDL_bool createNewSwapchainAndSwapchainSpecificStuff(void) +static bool createNewSwapchainAndSwapchainSpecificStuff(void) { - destroySwapchainAndSwapchainSpecificStuff(SDL_FALSE); + destroySwapchainAndSwapchainSpecificStuff(false); getSurfaceCaps(); getSurfaceFormats(); if (!createSwapchain()) { - return SDL_FALSE; + return false; } createCommandPool(); createCommandBuffers(); createFences(); - return SDL_TRUE; + return true; } static void initVulkan(void) @@ -963,7 +963,7 @@ static void initVulkan(void) } } -static void shutdownVulkan(SDL_bool doDestroySwapchain) +static void shutdownVulkan(bool doDestroySwapchain) { if (vulkanContexts) { int i; @@ -1004,7 +1004,7 @@ static void shutdownVulkan(SDL_bool doDestroySwapchain) SDL_Vulkan_UnloadLibrary(); } -static SDL_bool render(void) +static bool render(void) { uint32_t frameIndex; VkResult rc; @@ -1016,7 +1016,7 @@ static SDL_bool render(void) int w, h; if (!vulkanContext->swapchain) { - SDL_bool result = createNewSwapchainAndSwapchainSpecificStuff(); + bool result = createNewSwapchainAndSwapchainSpecificStuff(); if (!result) { SDL_Delay(100); } @@ -1089,7 +1089,7 @@ static SDL_bool render(void) if (w != (int)vulkanContext->swapchainSize.width || h != (int)vulkanContext->swapchainSize.height) { return createNewSwapchainAndSwapchainSpecificStuff(); } - return SDL_TRUE; + return true; } int main(int argc, char **argv) @@ -1140,7 +1140,7 @@ int main(int argc, char **argv) * by SDL. */ if (event.type == SDL_EVENT_WINDOW_CLOSE_REQUESTED) { - destroySwapchainAndSwapchainSpecificStuff(SDL_TRUE); + destroySwapchainAndSwapchainSpecificStuff(true); } SDLTest_CommonEvent(state, &event, &done); } @@ -1162,7 +1162,7 @@ int main(int argc, char **argv) SDL_Log("%2.2f frames per second\n", ((double)frames * 1000) / (now - then)); } - shutdownVulkan(SDL_TRUE); + shutdownVulkan(true); SDLTest_CommonQuit(state); return 0; } diff --git a/test/testwaylandcustom.c b/test/testwaylandcustom.c index 22e1bdead..6c58185f3 100644 --- a/test/testwaylandcustom.c +++ b/test/testwaylandcustom.c @@ -35,10 +35,10 @@ static SDL_Texture *CreateTexture(SDL_Renderer *r, unsigned char *data, unsigned SDL_Surface *surface; SDL_IOStream *src = SDL_IOFromConstMem(data, len); if (src) { - surface = SDL_LoadBMP_IO(src, SDL_TRUE); + surface = SDL_LoadBMP_IO(src, true); if (surface) { /* Treat white as transparent */ - SDL_SetSurfaceColorKey(surface, SDL_TRUE, SDL_MapSurfaceRGB(surface, 255, 255, 255)); + SDL_SetSurfaceColorKey(surface, true, SDL_MapSurfaceRGB(surface, 255, 255, 255)); texture = SDL_CreateTextureFromSurface(r, surface); *w = surface->w; @@ -205,11 +205,11 @@ int main(int argc, char **argv) /* Create a window with the custom surface role property set. */ props = SDL_CreateProperties(); - SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN, SDL_TRUE); /* Roleless surface */ - SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN, SDL_TRUE); /* OpenGL enabled */ + SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN, true); /* Roleless surface */ + SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN, true); /* OpenGL enabled */ SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, WINDOW_WIDTH); /* Default width */ SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER, WINDOW_HEIGHT); /* Default height */ - SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN, SDL_TRUE); /* Handle DPI scaling internally */ + SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN, true); /* Handle DPI scaling internally */ SDL_SetStringProperty(props, SDL_PROP_WINDOW_CREATE_TITLE_STRING, "Wayland custom surface role test"); /* Default title */ window = SDL_CreateWindowWithProperties(props); diff --git a/test/testwm.c b/test/testwm.c index b48b898a1..068dbe42d 100644 --- a/test/testwm.c +++ b/test/testwm.c @@ -186,7 +186,7 @@ static void loop(void) } } if (event.type == SDL_EVENT_KEY_UP) { - SDL_bool updateCursor = SDL_FALSE; + bool updateCursor = false; if (event.key.key == SDLK_A) { SDL_assert(!"Keyboard generated assert"); @@ -195,13 +195,13 @@ static void loop(void) if (system_cursor < 0) { system_cursor = SDL_SYSTEM_CURSOR_COUNT - 1; } - updateCursor = SDL_TRUE; + updateCursor = true; } else if (event.key.key == SDLK_RIGHT) { ++system_cursor; if (system_cursor >= SDL_SYSTEM_CURSOR_COUNT) { system_cursor = 0; } - updateCursor = SDL_TRUE; + updateCursor = true; } if (updateCursor) { SDL_Log("Changing cursor to \"%s\"", cursorNames[system_cursor]); diff --git a/test/testyuv.c b/test/testyuv.c index 26fb3f30a..2406ce784 100644 --- a/test/testyuv.c +++ b/test/testyuv.c @@ -19,7 +19,7 @@ #define MAX_YUV_SURFACE_SIZE(W, H, P) ((H + 1) * ((W + 1) + P) * 4) /* Return true if the YUV format is packed pixels */ -static SDL_bool is_packed_yuv_format(Uint32 format) +static bool is_packed_yuv_format(Uint32 format) { return format == SDL_PIXELFORMAT_YUY2 || format == SDL_PIXELFORMAT_UYVY || format == SDL_PIXELFORMAT_YVYU; } @@ -65,21 +65,21 @@ static SDL_Surface *generate_test_pattern(int pattern_size) return pattern; } -static SDL_bool verify_yuv_data(Uint32 format, SDL_Colorspace colorspace, const Uint8 *yuv, int yuv_pitch, SDL_Surface *surface, int tolerance) +static bool verify_yuv_data(Uint32 format, SDL_Colorspace colorspace, const Uint8 *yuv, int yuv_pitch, SDL_Surface *surface, int tolerance) { const int size = (surface->h * surface->pitch); Uint8 *rgb; - SDL_bool result = SDL_FALSE; + bool result = false; rgb = (Uint8 *)SDL_malloc(size); if (!rgb) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory"); - return SDL_FALSE; + return false; } if (SDL_ConvertPixelsAndColorspace(surface->w, surface->h, format, colorspace, 0, yuv, yuv_pitch, surface->format, SDL_COLORSPACE_SRGB, 0, rgb, surface->pitch)) { int x, y; - result = SDL_TRUE; + result = true; for (y = 0; y < surface->h; ++y) { const Uint8 *actual = rgb + y * surface->pitch; const Uint8 *expected = (const Uint8 *)surface->pixels + y * surface->pitch; @@ -90,7 +90,7 @@ static SDL_bool verify_yuv_data(Uint32 format, SDL_Colorspace colorspace, const int distance = (deltaR * deltaR + deltaG * deltaG + deltaB * deltaB); if (distance > tolerance) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Pixel at %d,%d was 0x%.2x,0x%.2x,0x%.2x, expected 0x%.2x,0x%.2x,0x%.2x, distance = %d\n", x, y, actual[0], actual[1], actual[2], expected[0], expected[1], expected[2], distance); - result = SDL_FALSE; + result = false; } actual += 3; expected += 3; @@ -243,34 +243,34 @@ int main(int argc, char **argv) { struct { - SDL_bool enable_intrinsics; + bool enable_intrinsics; int pattern_size; int extra_pitch; } automated_test_params[] = { /* Test: single pixel */ - { SDL_FALSE, 1, 0 }, + { false, 1, 0 }, /* Test: even width and height */ - { SDL_FALSE, 2, 0 }, - { SDL_FALSE, 4, 0 }, + { false, 2, 0 }, + { false, 4, 0 }, /* Test: odd width and height */ - { SDL_FALSE, 1, 0 }, - { SDL_FALSE, 3, 0 }, + { false, 1, 0 }, + { false, 3, 0 }, /* Test: even width and height, extra pitch */ - { SDL_FALSE, 2, 3 }, - { SDL_FALSE, 4, 3 }, + { false, 2, 3 }, + { false, 4, 3 }, /* Test: odd width and height, extra pitch */ - { SDL_FALSE, 1, 3 }, - { SDL_FALSE, 3, 3 }, + { false, 1, 3 }, + { false, 3, 3 }, /* Test: even width and height with intrinsics */ - { SDL_TRUE, 32, 0 }, + { true, 32, 0 }, /* Test: odd width and height with intrinsics */ - { SDL_TRUE, 33, 0 }, - { SDL_TRUE, 37, 0 }, + { true, 33, 0 }, + { true, 37, 0 }, /* Test: even width and height with intrinsics, extra pitch */ - { SDL_TRUE, 32, 3 }, + { true, 32, 3 }, /* Test: odd width and height with intrinsics, extra pitch */ - { SDL_TRUE, 33, 3 }, - { SDL_TRUE, 37, 3 }, + { true, 33, 3 }, + { true, 37, 3 }, }; char *filename = NULL; SDL_Surface *original; @@ -289,14 +289,14 @@ int main(int argc, char **argv) Uint32 rgb_format = SDL_PIXELFORMAT_RGBX8888; SDL_Colorspace rgb_colorspace = SDL_COLORSPACE_SRGB; SDL_PropertiesID props; - SDL_bool monochrome = SDL_FALSE; + bool monochrome = false; int luminance = 100; int current = 0; int pitch; Uint8 *raw_yuv; Uint64 then, now; int i, iterations = 100; - SDL_bool should_run_automated_tests = SDL_FALSE; + bool should_run_automated_tests = false; SDLTest_CommonState *state; /* Initialize test framework */ @@ -369,13 +369,13 @@ int main(int argc, char **argv) rgb_format = SDL_PIXELFORMAT_BGRA8888; consumed = 1; } else if (SDL_strcmp(argv[i], "--monochrome") == 0) { - monochrome = SDL_TRUE; + monochrome = true; consumed = 1; } else if (SDL_strcmp(argv[i], "--luminance") == 0 && argv[i+1]) { luminance = SDL_atoi(argv[i+1]); consumed = 2; } else if (SDL_strcmp(argv[i], "--automated") == 0) { - should_run_automated_tests = SDL_TRUE; + should_run_automated_tests = true; consumed = 1; } else if (!filename) { filename = argv[i]; diff --git a/test/testyuv_cvt.c b/test/testyuv_cvt.c index 08e8c6ff7..e6d052f77 100644 --- a/test/testyuv_cvt.c +++ b/test/testyuv_cvt.c @@ -142,8 +142,8 @@ static void RGBtoYUV(const Uint8 *rgb, int rgb_bits, int *yuv, int yuv_bits, YUV * U = clip3(0, (2^M)-1, floor(2^(M-8) * (112*(B-L) / ((1-Kb)*S) + 128) + 0.5)); * V = clip3(0, (2^M)-1, floor(2^(M-8) * (112*(R-L) / ((1-Kr)*S) + 128) + 0.5)); */ - SDL_bool studio_RGB = SDL_FALSE; - SDL_bool full_range_YUV = SDL_FALSE; + bool studio_RGB = false; + bool full_range_YUV = false; float N, M, S, Z, R, G, B, L, Kr, Kb, Y, U, V; N = (float)rgb_bits; @@ -177,7 +177,7 @@ static void RGBtoYUV(const Uint8 *rgb, int rgb_bits, int *yuv, int yuv_bits, YUV B = rgb[2]; if (mode == YUV_CONVERSION_JPEG || mode == YUV_CONVERSION_BT2020) { - full_range_YUV = SDL_TRUE; + full_range_YUV = true; } if (mode == YUV_CONVERSION_BT2020) { @@ -514,25 +514,25 @@ static void ConvertRGBtoPacked4(Uint32 format, Uint8 *src, int pitch, Uint8 *out } } -SDL_bool ConvertRGBtoYUV(Uint32 format, Uint8 *src, int pitch, Uint8 *out, int w, int h, YUV_CONVERSION_MODE mode, int monochrome, int luminance) +bool ConvertRGBtoYUV(Uint32 format, Uint8 *src, int pitch, Uint8 *out, int w, int h, YUV_CONVERSION_MODE mode, int monochrome, int luminance) { switch (format) { case SDL_PIXELFORMAT_P010: ConvertRGBtoPlanar2x2_P010(format, src, pitch, out, w, h, mode, monochrome, luminance); - return SDL_TRUE; + return true; case SDL_PIXELFORMAT_YV12: case SDL_PIXELFORMAT_IYUV: case SDL_PIXELFORMAT_NV12: case SDL_PIXELFORMAT_NV21: ConvertRGBtoPlanar2x2(format, src, pitch, out, w, h, mode, monochrome, luminance); - return SDL_TRUE; + return true; case SDL_PIXELFORMAT_YUY2: case SDL_PIXELFORMAT_UYVY: case SDL_PIXELFORMAT_YVYU: ConvertRGBtoPacked4(format, src, pitch, out, w, h, mode, monochrome, luminance); - return SDL_TRUE; + return true; default: - return SDL_FALSE; + return false; } } diff --git a/test/testyuv_cvt.h b/test/testyuv_cvt.h index 36917b720..c8a87daaa 100644 --- a/test/testyuv_cvt.h +++ b/test/testyuv_cvt.h @@ -24,5 +24,5 @@ typedef enum extern void SetYUVConversionMode(YUV_CONVERSION_MODE mode); extern YUV_CONVERSION_MODE GetYUVConversionModeForResolution(int width, int height); extern SDL_Colorspace GetColorspaceForYUVConversionMode(YUV_CONVERSION_MODE mode); -extern SDL_bool ConvertRGBtoYUV(Uint32 format, Uint8 *src, int pitch, Uint8 *out, int w, int h, YUV_CONVERSION_MODE mode, int monochrome, int luminance); +extern bool ConvertRGBtoYUV(Uint32 format, Uint8 *src, int pitch, Uint8 *out, int w, int h, YUV_CONVERSION_MODE mode, int monochrome, int luminance); extern int CalculateYUVPitch(Uint32 format, int width);