Check standard error code return values as < 0 instead of == -1

This commit is contained in:
Sam Lantinga committed 2024-08-22 09:04:30 -07:00
1 parent 46d9066a69
commit 037541a0e0
29 files changed
+59 -59

No files matched your search

@@ -468,7 +468,7 @@ static int MEDIAFOUNDATION_AcquireFrame(SDL_Camera *device, SDL_Surface *frame,
} else {
frame->pixels = pixels;
frame->pitch = (int) pitch;
if (SDL_SetPointerPropertyWithCleanup(surfprops, PROP_SURFACE_IMFOBJS_POINTER, objs, CleanupIMF2DBuffer2, NULL) == -1) {
if (SDL_SetPointerPropertyWithCleanup(surfprops, PROP_SURFACE_IMFOBJS_POINTER, objs, CleanupIMF2DBuffer2, NULL) < 0) {
retval = -1;
}
}
@@ -480,7 +480,7 @@ static int MEDIAFOUNDATION_AcquireFrame(SDL_Camera *device, SDL_Surface *frame,
} else {
frame->pixels = pixels;
frame->pitch = (int) pitch;
if (SDL_SetPointerPropertyWithCleanup(surfprops, PROP_SURFACE_IMFOBJS_POINTER, objs, CleanupIMF2DBuffer, NULL) == -1) {
if (SDL_SetPointerPropertyWithCleanup(surfprops, PROP_SURFACE_IMFOBJS_POINTER, objs, CleanupIMF2DBuffer, NULL) < 0) {
retval = -1;
}
}
@@ -497,7 +497,7 @@ static int MEDIAFOUNDATION_AcquireFrame(SDL_Camera *device, SDL_Surface *frame,
}
frame->pixels = pixels;
frame->pitch = (int) pitch;
if (SDL_SetPointerPropertyWithCleanup(surfprops, PROP_SURFACE_IMFOBJS_POINTER, objs, CleanupIMFMediaBuffer, NULL) == -1) {
if (SDL_SetPointerPropertyWithCleanup(surfprops, PROP_SURFACE_IMFOBJS_POINTER, objs, CleanupIMFMediaBuffer, NULL) < 0) {
retval = -1;
}
}