mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-20 02:08:13 +00:00
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:
@@ -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);
|
||||
}
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user