mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-24 06:51:55 +00:00
[SDL2] pointer boolean (#8523)
This commit is contained in:
parent
4a3a9f3ad8
commit
a14b948b6c
394 changed files with 2564 additions and 2559 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue