Don't compare pointer against '0', but NULL

This commit is contained in:
Sylvain
2022-11-16 21:47:43 +01:00
parent 1d7966df15
commit ce5da5d579
14 changed files with 21 additions and 21 deletions

View File

@@ -318,7 +318,7 @@ ARTS_Init(SDL_AudioDriverImpl * impl)
if (LoadARTSLibrary() < 0) {
return SDL_FALSE;
} else {
if (SDL_NAME(arts_init) () != 0) {
if (SDL_NAME(arts_init) () != NULL) {
UnloadARTSLibrary();
SDL_SetError("ARTS: arts_init failed (no audio server?)");
return SDL_FALSE;

View File

@@ -546,10 +546,10 @@ PS2_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
GSTEXTURE *ps2_texture = (GSTEXTURE *) texture->driverdata;
PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata;
if (data == 0)
if (data == NULL)
return;
if(ps2_texture == 0)
if(ps2_texture == NULL)
return;
// Free from vram

View File

@@ -1280,10 +1280,10 @@ PSP_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
PSP_RenderData *renderdata = (PSP_RenderData *) renderer->driverdata;
PSP_TextureData *psp_texture = (PSP_TextureData *) texture->driverdata;
if (renderdata == 0)
if (renderdata == NULL)
return;
if(psp_texture == 0)
if(psp_texture == NULL)
return;
LRUTargetRemove(renderdata, psp_texture);

View File

@@ -1236,13 +1236,13 @@ VITA_GXM_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture)
VITA_GXM_RenderData *data = (VITA_GXM_RenderData *) renderer->driverdata;
VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *) texture->driverdata;
if (data == 0)
if (data == NULL)
return;
if(vita_texture == 0)
if(vita_texture == NULL)
return;
if(vita_texture->tex == 0)
if(vita_texture->tex == NULL)
return;
sceGxmFinish(data->gxm_context);

View File

@@ -414,7 +414,7 @@ static void qsort_nonaligned(void *base, size_t nmemb, size_t size,
char *first,*last;
char *pivot=malloc(size);
size_t trunc=TRUNC_nonaligned*size;
assert(pivot!=0);
assert(pivot);
first=(char*)base; last=first+(nmemb-1)*size;
@@ -445,7 +445,7 @@ static void qsort_aligned(void *base, size_t nmemb, size_t size,
char *first,*last;
char *pivot=malloc(size);
size_t trunc=TRUNC_aligned*size;
assert(pivot!=0);
assert(pivot);
first=(char*)base; last=first+(nmemb-1)*size;
@@ -475,7 +475,7 @@ static void qsort_words(void *base, size_t nmemb,
int stacktop=0;
char *first,*last;
char *pivot=malloc(WORD_BYTES);
assert(pivot!=0);
assert(pivot);
first=(char*)base; last=first+(nmemb-1)*WORD_BYTES;

View File

@@ -296,7 +296,7 @@ static BOOL voUpdate(PVODATA pVOData, HWND hwnd, SDL_Rect *pSDLRects,
return FALSE;
}
if (pSDLRects != 0) {
if (pSDLRects != NULL) {
PBYTE pbLineMask;
pbLineMask = SDL_stack_alloc(BYTE, pVOData->ulHeight);

View File

@@ -100,7 +100,7 @@ static void X11_ReadProperty(SDL_x11Prop *p, Display *disp, Window w, Atom prop)
int bytes_fetch = 0;
do {
if (ret != 0) X11_XFree(ret);
if (ret != NULL) X11_XFree(ret);
X11_XGetWindowProperty(disp, w, prop, 0, bytes_fetch, False, AnyPropertyType, &type, &fmt, &count, &bytes_left, &ret);
bytes_fetch += bytes_left;
} while (bytes_left != 0);

View File

@@ -1562,7 +1562,7 @@ static void X11_ReadProperty(SDL_x11Prop *p, Display *disp, Window w, Atom prop)
int bytes_fetch = 0;
do {
if (ret != 0) X11_XFree(ret);
if (ret != NULL) X11_XFree(ret);
X11_XGetWindowProperty(disp, w, prop, 0, bytes_fetch, False, AnyPropertyType, &type, &fmt, &count, &bytes_left, &ret);
bytes_fetch += bytes_left;
} while (bytes_left != 0);