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

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

View File

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

View File

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

View File

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

View File

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