mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-28 22:18:28 +00:00
[SDL2] pointer boolean (#8523)
This commit is contained in:
@@ -111,7 +111,7 @@ SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType)
|
||||
}
|
||||
|
||||
const wchar_t *ucs2Path = SDL_WinRTGetFSPathUNICODE(pathType);
|
||||
if (ucs2Path == NULL) {
|
||||
if (!ucs2Path) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -128,14 +128,14 @@ SDL_GetBasePath(void)
|
||||
size_t destPathLen;
|
||||
char *destPath = NULL;
|
||||
|
||||
if (srcPath == NULL) {
|
||||
if (!srcPath) {
|
||||
SDL_SetError("Couldn't locate our basepath: %s", SDL_GetError());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
destPathLen = SDL_strlen(srcPath) + 2;
|
||||
destPath = (char *)SDL_malloc(destPathLen);
|
||||
if (destPath == NULL) {
|
||||
if (!destPath) {
|
||||
SDL_OutOfMemory();
|
||||
return NULL;
|
||||
}
|
||||
@@ -161,16 +161,16 @@ SDL_GetPrefPath(const char *org, const char *app)
|
||||
size_t new_wpath_len = 0;
|
||||
BOOL api_result = FALSE;
|
||||
|
||||
if (app == NULL) {
|
||||
if (!app) {
|
||||
SDL_InvalidParamError("app");
|
||||
return NULL;
|
||||
}
|
||||
if (org == NULL) {
|
||||
if (!org) {
|
||||
org = "";
|
||||
}
|
||||
|
||||
srcPath = SDL_WinRTGetFSPathUNICODE(SDL_WINRT_PATH_LOCAL_FOLDER);
|
||||
if (srcPath == NULL) {
|
||||
if (!srcPath) {
|
||||
SDL_SetError("Unable to find a source path");
|
||||
return NULL;
|
||||
}
|
||||
@@ -182,13 +182,13 @@ SDL_GetPrefPath(const char *org, const char *app)
|
||||
SDL_wcslcpy(path, srcPath, SDL_arraysize(path));
|
||||
|
||||
worg = WIN_UTF8ToString(org);
|
||||
if (worg == NULL) {
|
||||
if (!worg) {
|
||||
SDL_OutOfMemory();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wapp = WIN_UTF8ToString(app);
|
||||
if (wapp == NULL) {
|
||||
if (!wapp) {
|
||||
SDL_free(worg);
|
||||
SDL_OutOfMemory();
|
||||
return NULL;
|
||||
|
Reference in New Issue
Block a user