Removed SDL_bool in favor of plain bool

We require stdbool.h in the build environment, so we might as well use the plain bool type.

If your environment doesn't have stdbool.h, this simple replacement will suffice:
typedef signed char bool;
This commit is contained in:
Sam Lantinga
2024-09-18 07:52:28 -07:00
parent 9dd8859240
commit a90ad3b0e2
258 changed files with 4052 additions and 4057 deletions

View File

@@ -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);
}
}