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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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