Pointer as bool (libsdl-org#7214)

This commit is contained in:
Sylvain authored and Sam Lantinga committed 2023-11-09 14:18:36 -08:00
1 parent 23db971681
commit d8600f717e
371 files changed
+2448 -2442

No files matched your search

+4 -4
View File
@@ -72,7 +72,7 @@ static void iteration(void)
const SDL_AudioDeviceID which = (SDL_AudioDeviceID) e.adevice.which;
const SDL_bool iscapture = e.adevice.iscapture ? SDL_TRUE : SDL_FALSE;
char *name = SDL_GetAudioDeviceName(which);
if (name != NULL) {
if (name) {
SDL_Log("New %s audio device at id %u: %s", devtypestr(iscapture), (unsigned int)which, name);
} else {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Got new %s device, id %u, but failed to get the name: %s",
@@ -119,7 +119,7 @@ int main(int argc, char *argv[])
/* Initialize test framework */
state = SDLTest_CommonCreateState(argv, 0);
if (state == NULL) {
if (!state) {
return 1;
}
@@ -154,7 +154,7 @@ int main(int argc, char *argv[])
/* Some targets (Mac CoreAudio) need an event queue for audio hotplug, so make and immediately hide a window. */
window = SDL_CreateWindow("testaudiohotplug", 640, 480, 0);
if (window == NULL) {
if (!window) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_CreateWindow failed: %s\n", SDL_GetError());
quit(1);
}
@@ -162,7 +162,7 @@ int main(int argc, char *argv[])
filename = GetResourceFilename(filename, "sample.wav");
if (filename == NULL) {
if (!filename) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "%s\n", SDL_GetError());
quit(1);
}