Skip to content

Commit

Permalink
Code cleanup now that SDL_bool is equivalent to a C boolean expression
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Nov 3, 2023
1 parent 5f48cc1 commit ca64b9f
Show file tree
Hide file tree
Showing 53 changed files with 133 additions and 138 deletions.
4 changes: 2 additions & 2 deletions src/SDL.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ static SDL_bool SDL_ShouldInitSubsystem(Uint32 subsystem)
{
const int subsystem_index = SDL_MostSignificantBitIndex32(subsystem);
SDL_assert((subsystem_index < 0) || (SDL_SubsystemRefCount[subsystem_index] < 255));
return ((subsystem_index >= 0) && (SDL_SubsystemRefCount[subsystem_index] == 0)) ? SDL_TRUE : SDL_FALSE;
return ((subsystem_index >= 0) && (SDL_SubsystemRefCount[subsystem_index] == 0));
}

/* Private helper to check if a system needs to be quit. */
Expand All @@ -151,7 +151,7 @@ static SDL_bool SDL_ShouldQuitSubsystem(Uint32 subsystem)
/* If we're in SDL_Quit, we shut down every subsystem, even if refcount
* isn't zero.
*/
return (((subsystem_index >= 0) && (SDL_SubsystemRefCount[subsystem_index] == 1)) || SDL_bInMainQuit) ? SDL_TRUE : SDL_FALSE;
return (((subsystem_index >= 0) && (SDL_SubsystemRefCount[subsystem_index] == 1)) || SDL_bInMainQuit);
}

void SDL_SetMainReady(void)
Expand Down
2 changes: 1 addition & 1 deletion src/SDL_hashtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ SDL_bool SDL_KeyMatchString(const void *a, const void *b, void *data)
} else if (!a || !b) {
return SDL_FALSE; // one pointer is NULL (and first test shows they aren't the same pointer), must not match.
}
return (SDL_strcmp((const char *)a, (const char *)b) == 0) ? SDL_TRUE : SDL_FALSE; // Check against actual string contents.
return (SDL_strcmp((const char *)a, (const char *)b) == 0); // Check against actual string contents.
}

// We assume we can fit the ID in the key directly
Expand Down
16 changes: 8 additions & 8 deletions src/atomic/SDL_atomic.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@ SDL_bool SDL_AtomicCAS(SDL_AtomicInt *a, int oldval, int newval)
SDL_COMPILE_TIME_ASSERT(atomic_cas, sizeof(long) == sizeof(a->value));
return _InterlockedCompareExchange((long *)&a->value, (long)newval, (long)oldval) == (long)oldval;
#elif defined(HAVE_WATCOM_ATOMICS)
return (SDL_bool)_SDL_cmpxchg_watcom(&a->value, newval, oldval);
return _SDL_cmpxchg_watcom(&a->value, newval, oldval);
#elif defined(HAVE_GCC_ATOMICS)
return (SDL_bool)__sync_bool_compare_and_swap(&a->value, oldval, newval);
return __sync_bool_compare_and_swap(&a->value, oldval, newval);
#elif defined(__MACOS__) /* this is deprecated in 10.12 sdk; favor gcc atomics. */
return (SDL_bool)OSAtomicCompareAndSwap32Barrier(oldval, newval, &a->value);
return OSAtomicCompareAndSwap32Barrier(oldval, newval, &a->value);
#elif defined(__SOLARIS__)
return (SDL_bool)((int)atomic_cas_uint((volatile uint_t *)&a->value, (uint_t)oldval, (uint_t)newval) == oldval);
return ((int)atomic_cas_uint((volatile uint_t *)&a->value, (uint_t)oldval, (uint_t)newval) == oldval);
#elif defined(EMULATE_CAS)
SDL_bool retval = SDL_FALSE;

Expand All @@ -156,15 +156,15 @@ SDL_bool SDL_AtomicCASPtr(void **a, void *oldval, void *newval)
#ifdef HAVE_MSC_ATOMICS
return _InterlockedCompareExchangePointer(a, newval, oldval) == oldval;
#elif defined(HAVE_WATCOM_ATOMICS)
return (SDL_bool)_SDL_cmpxchg_watcom((int *)a, (long)newval, (long)oldval);
return _SDL_cmpxchg_watcom((int *)a, (long)newval, (long)oldval);
#elif defined(HAVE_GCC_ATOMICS)
return __sync_bool_compare_and_swap(a, oldval, newval);
#elif defined(__MACOS__) && defined(__LP64__) /* this is deprecated in 10.12 sdk; favor gcc atomics. */
return (SDL_bool)OSAtomicCompareAndSwap64Barrier((int64_t)oldval, (int64_t)newval, (int64_t *)a);
return OSAtomicCompareAndSwap64Barrier((int64_t)oldval, (int64_t)newval, (int64_t *)a);
#elif defined(__MACOS__) && !defined(__LP64__) /* this is deprecated in 10.12 sdk; favor gcc atomics. */
return (SDL_bool)OSAtomicCompareAndSwap32Barrier((int32_t)oldval, (int32_t)newval, (int32_t *)a);
return OSAtomicCompareAndSwap32Barrier((int32_t)oldval, (int32_t)newval, (int32_t *)a);
#elif defined(__SOLARIS__)
return (SDL_bool)(atomic_cas_ptr(a, oldval, newval) == oldval);
return (atomic_cas_ptr(a, oldval, newval) == oldval);
#elif defined(EMULATE_CAS)
SDL_bool retval = SDL_FALSE;

Expand Down
4 changes: 2 additions & 2 deletions src/atomic/SDL_spinlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ SDL_bool SDL_AtomicTryLock(SDL_SpinLock *lock)

#elif defined(__SOLARIS__) && defined(_LP64)
/* Used for Solaris with non-gcc compilers. */
return (SDL_bool)((int)atomic_cas_64((volatile uint64_t *)lock, 0, 1) == 0);
return ((int)atomic_cas_64((volatile uint64_t *)lock, 0, 1) == 0);

#elif defined(__SOLARIS__) && !defined(_LP64)
/* Used for Solaris with non-gcc compilers. */
return (SDL_bool)((int)atomic_cas_32((volatile uint32_t *)lock, 0, 1) == 0);
return ((int)atomic_cas_32((volatile uint32_t *)lock, 0, 1) == 0);
#elif defined(PS2)
uint32_t oldintr;
SDL_bool res = SDL_FALSE;
Expand Down
32 changes: 16 additions & 16 deletions src/audio/SDL_audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ static SDL_bool AudioDeviceCanUseSimpleCopy(SDL_AudioDevice *device)
!device->logical_devices->postmix && // there isn't a postmix callback
device->logical_devices->bound_streams && // there's a bound stream
!device->logical_devices->bound_streams->next_binding // there's only _ONE_ bound stream.
) ? SDL_TRUE : SDL_FALSE;
);
}

// should hold device->lock before calling.
Expand Down Expand Up @@ -320,7 +320,7 @@ static SDL_LogicalAudioDevice *ObtainLogicalAudioDevice(SDL_AudioDeviceID devid,
SDL_LogicalAudioDevice *logdev = NULL;

// bit #1 of devid is set for physical devices and unset for logical.
const SDL_bool islogical = (devid & (1<<1)) ? SDL_FALSE : SDL_TRUE;
const SDL_bool islogical = !(devid & (1<<1));
if (islogical) { // don't bother looking if it's not a logical device id value.
SDL_LockRWLockForReading(current_audio.device_hash_lock);
SDL_FindInHashTable(current_audio.device_hash, (const void *) (uintptr_t) devid, (const void **) &logdev);
Expand Down Expand Up @@ -349,7 +349,7 @@ static SDL_AudioDevice *ObtainPhysicalAudioDevice(SDL_AudioDeviceID devid) // !
SDL_AudioDevice *device = NULL;

// bit #1 of devid is set for physical devices and unset for logical.
const SDL_bool islogical = (devid & (1<<1)) ? SDL_FALSE : SDL_TRUE;
const SDL_bool islogical = !(devid & (1<<1));
if (islogical) {
ObtainLogicalAudioDevice(devid, &device);
} else if (!SDL_GetCurrentAudioDriver()) { // (the `islogical` path, above, checks this in ObtainLogicalAudioDevice.)
Expand All @@ -371,7 +371,7 @@ static SDL_AudioDevice *ObtainPhysicalAudioDevice(SDL_AudioDeviceID devid) // !

static SDL_AudioDevice *ObtainPhysicalAudioDeviceDefaultAllowed(SDL_AudioDeviceID devid) // !!! FIXME: SDL_ACQUIRE
{
const SDL_bool wants_default = ((devid == SDL_AUDIO_DEVICE_DEFAULT_OUTPUT) || (devid == SDL_AUDIO_DEVICE_DEFAULT_CAPTURE)) ? SDL_TRUE : SDL_FALSE;
const SDL_bool wants_default = ((devid == SDL_AUDIO_DEVICE_DEFAULT_OUTPUT) || (devid == SDL_AUDIO_DEVICE_DEFAULT_CAPTURE));
if (!wants_default) {
return ObtainPhysicalAudioDevice(devid);
}
Expand Down Expand Up @@ -623,7 +623,7 @@ void SDL_AudioDeviceDisconnected(SDL_AudioDevice *device)

SDL_LockRWLockForReading(current_audio.device_hash_lock);
const SDL_AudioDeviceID devid = device->instance_id;
const SDL_bool is_default_device = ((devid == current_audio.default_output_device_id) || (devid == current_audio.default_capture_device_id)) ? SDL_TRUE : SDL_FALSE;
const SDL_bool is_default_device = ((devid == current_audio.default_output_device_id) || (devid == current_audio.default_capture_device_id));
SDL_UnlockRWLock(current_audio.device_hash_lock);

const SDL_bool first_disconnect = SDL_AtomicCAS(&device->zombie, 0, 1);
Expand Down Expand Up @@ -763,8 +763,8 @@ static SDL_AudioDevice *GetFirstAddedAudioDevice(const SDL_bool iscapture)
const SDL_AudioDeviceID devid = (SDL_AudioDeviceID) (uintptr_t) key;
// bit #0 of devid is set for output devices and unset for capture.
// bit #1 of devid is set for physical devices and unset for logical.
const SDL_bool devid_iscapture = (devid & (1 << 0)) ? SDL_FALSE : SDL_TRUE;
const SDL_bool isphysical = (devid & (1 << 1)) ? SDL_TRUE : SDL_FALSE;
const SDL_bool devid_iscapture = !(devid & (1 << 0));
const SDL_bool isphysical = (devid & (1 << 1));
if (isphysical && (devid_iscapture == iscapture) && (devid < highest)) {
highest = devid;
retval = (SDL_AudioDevice *) value;
Expand All @@ -784,7 +784,7 @@ static Uint32 HashAudioDeviceID(const void *key, void *data)

static SDL_bool MatchAudioDeviceID(const void *a, const void *b, void *data)
{
return (a == b) ? SDL_TRUE : SDL_FALSE; // they're simple Uint32 values cast to pointers.
return (a == b);
}

static void NukeAudioDeviceHashItem(const void *key, const void *value, void *data)
Expand Down Expand Up @@ -966,7 +966,7 @@ void SDL_QuitAudio(void)
while (SDL_IterateHashTable(device_hash, &key, &value, &iter)) {
// bit #1 of devid is set for physical devices and unset for logical.
const SDL_AudioDeviceID devid = (SDL_AudioDeviceID) (uintptr_t) key;
const SDL_bool isphysical = (devid & (1<<1)) ? SDL_TRUE : SDL_FALSE;
const SDL_bool isphysical = (devid & (1<<1));
if (isphysical) {
DestroyPhysicalAudioDevice((SDL_AudioDevice *) value);
}
Expand Down Expand Up @@ -1273,8 +1273,8 @@ static SDL_AudioDeviceID *GetAudioDevices(int *reqcount, SDL_bool iscapture)
const SDL_AudioDeviceID devid = (SDL_AudioDeviceID) (uintptr_t) key;
// bit #0 of devid is set for output devices and unset for capture.
// bit #1 of devid is set for physical devices and unset for logical.
const SDL_bool devid_iscapture = (devid & (1<<0)) ? SDL_FALSE : SDL_TRUE;
const SDL_bool isphysical = (devid & (1<<1)) ? SDL_TRUE : SDL_FALSE;
const SDL_bool devid_iscapture = !(devid & (1<<0));
const SDL_bool isphysical = (devid & (1<<1));
if (isphysical && (devid_iscapture == iscapture)) {
SDL_assert(devs_seen < num_devices);
retval[devs_seen++] = devid;
Expand Down Expand Up @@ -1320,7 +1320,7 @@ SDL_AudioDevice *SDL_FindPhysicalAudioDeviceByCallback(SDL_bool (*callback)(SDL_
while (SDL_IterateHashTable(current_audio.device_hash, &key, &value, &iter)) {
const SDL_AudioDeviceID devid = (SDL_AudioDeviceID) (uintptr_t) key;
// bit #1 of devid is set for physical devices and unset for logical.
const SDL_bool isphysical = (devid & (1<<1)) ? SDL_TRUE : SDL_FALSE;
const SDL_bool isphysical = (devid & (1<<1));
if (isphysical) {
SDL_AudioDevice *device = (SDL_AudioDevice *) value;
if (callback(device, userdata)) { // found it?
Expand Down Expand Up @@ -1577,11 +1577,11 @@ SDL_AudioDeviceID SDL_OpenAudioDevice(SDL_AudioDeviceID devid, const SDL_AudioSp
return 0;
}

SDL_bool wants_default = ((devid == SDL_AUDIO_DEVICE_DEFAULT_OUTPUT) || (devid == SDL_AUDIO_DEVICE_DEFAULT_CAPTURE)) ? SDL_TRUE : SDL_FALSE;
SDL_bool wants_default = ((devid == SDL_AUDIO_DEVICE_DEFAULT_OUTPUT) || (devid == SDL_AUDIO_DEVICE_DEFAULT_CAPTURE));

// this will let you use a logical device to make a new logical device on the parent physical device. Could be useful?
SDL_AudioDevice *device = NULL;
const SDL_bool islogical = (wants_default || (devid & (1<<1))) ? SDL_FALSE : SDL_TRUE;
const SDL_bool islogical = (!wants_default && !(devid & (1<<1)));
if (!islogical) {
device = ObtainPhysicalAudioDeviceDefaultAllowed(devid);
} else {
Expand Down Expand Up @@ -1700,7 +1700,7 @@ int SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, SDL_AudioPostmixCallbac

int SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream **streams, int num_streams)
{
const SDL_bool islogical = (devid & (1<<1)) ? SDL_FALSE : SDL_TRUE;
const SDL_bool islogical = !(devid & (1<<1));
SDL_AudioDevice *device = NULL;
SDL_LogicalAudioDevice *logdev = NULL;
int retval = 0;
Expand Down Expand Up @@ -1969,7 +1969,7 @@ void SDL_DefaultAudioDeviceChanged(SDL_AudioDevice *new_default_device)
// change the official default over right away, so new opens will go to the new device.
SDL_LockRWLockForWriting(current_audio.device_hash_lock);
const SDL_AudioDeviceID current_devid = iscapture ? current_audio.default_capture_device_id : current_audio.default_output_device_id;
const SDL_bool is_already_default = (new_default_device->instance_id == current_devid) ? SDL_TRUE : SDL_FALSE;
const SDL_bool is_already_default = (new_default_device->instance_id == current_devid);
if (!is_already_default) {
if (iscapture) {
current_audio.default_capture_device_id = new_default_device->instance_id;
Expand Down
2 changes: 1 addition & 1 deletion src/audio/SDL_audiocvt.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ static SDL_bool SDL_IsSupportedAudioFormat(const SDL_AudioFormat fmt)

static SDL_bool SDL_IsSupportedChannelCount(const int channels)
{
return ((channels >= 1) && (channels <= 8)) ? SDL_TRUE : SDL_FALSE;
return ((channels >= 1) && (channels <= 8));
}


Expand Down
2 changes: 1 addition & 1 deletion src/audio/alsa/SDL_alsa_audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ static void ALSA_HotplugIteration(SDL_bool *has_default_output, SDL_bool *has_de
}

// only want physical hardware interfaces
const SDL_bool is_default = (has_default == i) ? SDL_TRUE : SDL_FALSE;
const SDL_bool is_default = (has_default == i);
if (is_default || (match != NULL && SDL_strncmp(name, match, match_len) == 0)) {
char *ioid = ALSA_snd_device_name_get_hint(hints[i], "IOID");
const SDL_bool isoutput = (ioid == NULL) || (SDL_strcmp(ioid, "Output") == 0);
Expand Down
2 changes: 1 addition & 1 deletion src/audio/coreaudio/SDL_coreaudio.m
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ static void RefreshPhysicalDevices(void)

CFIndex len = CFStringGetMaximumSizeForEncoding(CFStringGetLength(cfstr), kCFStringEncodingUTF8);
char *name = (char *)SDL_malloc(len + 1);
SDL_bool usable = ((name != NULL) && (CFStringGetCString(cfstr, name, len + 1, kCFStringEncodingUTF8))) ? SDL_TRUE : SDL_FALSE;
SDL_bool usable = ((name != NULL) && (CFStringGetCString(cfstr, name, len + 1, kCFStringEncodingUTF8)));

CFRelease(cfstr);

Expand Down
8 changes: 4 additions & 4 deletions src/audio/emscripten/SDL_emscriptenaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ static SDL_bool EMSCRIPTENAUDIO_Init(SDL_AudioDriverImpl *impl)
return true;
}
return false;
}) ? SDL_TRUE : SDL_FALSE;
});

if (!available) {
SDL_SetError("No audio context available");
Expand All @@ -334,10 +334,10 @@ static SDL_bool EMSCRIPTENAUDIO_Init(SDL_AudioDriverImpl *impl)
return true;
}
return false;
}) ? SDL_TRUE : SDL_FALSE;
});

impl->HasCaptureSupport = capture_available ? SDL_TRUE : SDL_FALSE;
impl->OnlyHasDefaultCaptureDevice = capture_available ? SDL_TRUE : SDL_FALSE;
impl->HasCaptureSupport = capture_available;
impl->OnlyHasDefaultCaptureDevice = capture_available;

return available;
}
Expand Down
8 changes: 4 additions & 4 deletions src/audio/pulseaudio/SDL_pulseaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -832,14 +832,14 @@ static SDL_bool FindAudioDeviceByIndex(SDL_AudioDevice *device, void *userdata)
{
const uint32_t idx = (uint32_t) (uintptr_t) userdata;
const PulseDeviceHandle *handle = (const PulseDeviceHandle *) device->handle;
return (handle->device_index == idx) ? SDL_TRUE : SDL_FALSE;
return (handle->device_index == idx);
}

static SDL_bool FindAudioDeviceByPath(SDL_AudioDevice *device, void *userdata)
{
const char *path = (const char *) userdata;
const PulseDeviceHandle *handle = (const PulseDeviceHandle *) device->handle;
return (SDL_strcmp(handle->device_path, path) == 0) ? SDL_TRUE : SDL_FALSE;
return (SDL_strcmp(handle->device_path, path) == 0);
}

// This is called when PulseAudio has a device connected/removed/changed.
Expand Down Expand Up @@ -925,8 +925,8 @@ static int SDLCALL HotplugThread(void *data)
SDL_free(current_default_source);

// set these to true if we didn't handle the change OR there was _another_ change while we were working unlocked.
default_sink_changed = (default_sink_changed || check_default_sink) ? SDL_TRUE : SDL_FALSE;
default_source_changed = (default_source_changed || check_default_source) ? SDL_TRUE : SDL_FALSE;
default_sink_changed = (default_sink_changed || check_default_sink);
default_source_changed = (default_source_changed || check_default_source);
}

if (op) {
Expand Down
2 changes: 1 addition & 1 deletion src/audio/wasapi/SDL_wasapi_winrt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static Platform::String ^ SDL_PKEY_AudioEngine_DeviceFormat = L"{f19f064d-082c-4

static SDL_bool FindWinRTAudioDeviceCallback(SDL_AudioDevice *device, void *userdata)
{
return (SDL_wcscmp((LPCWSTR) device->handle, (LPCWSTR) userdata) == 0) ? SDL_TRUE : SDL_FALSE;
return (SDL_wcscmp((LPCWSTR) device->handle, (LPCWSTR) userdata) == 0);
}

static SDL_AudioDevice *FindWinRTAudioDevice(LPCWSTR devid)
Expand Down
7 changes: 3 additions & 4 deletions src/core/android/SDL_android.c
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ SDL_JAVA_AUDIO_INTERFACE(addAudioDevice)(JNIEnv *env, jclass jcls, jboolean is_c
void *handle = (void *)((size_t)device_id);
if (!SDL_FindPhysicalAudioDeviceByHandle(handle)) {
const char *utf8name = (*env)->GetStringUTFChars(env, name, NULL);
SDL_AddAudioDevice(is_capture ? SDL_TRUE : SDL_FALSE, SDL_strdup(utf8name), NULL, handle);
SDL_AddAudioDevice(is_capture, SDL_strdup(utf8name), NULL, handle);
(*env)->ReleaseStringUTFChars(env, name, utf8name);
}
}
Expand Down Expand Up @@ -1072,7 +1072,7 @@ JNIEXPORT jint JNICALL SDL_JAVA_CONTROLLER_INTERFACE(nativeAddJoystick)(
const char *name = (*env)->GetStringUTFChars(env, device_name, NULL);
const char *desc = (*env)->GetStringUTFChars(env, device_desc, NULL);

retval = Android_AddJoystick(device_id, name, desc, vendor_id, product_id, is_accelerometer ? SDL_TRUE : SDL_FALSE, button_mask, naxes, axis_mask, nhats);
retval = Android_AddJoystick(device_id, name, desc, vendor_id, product_id, is_accelerometer, button_mask, naxes, axis_mask, nhats);

(*env)->ReleaseStringUTFChars(env, device_name, name);
(*env)->ReleaseStringUTFChars(env, device_desc, desc);
Expand Down Expand Up @@ -2057,8 +2057,7 @@ char *Android_JNI_GetClipboardText(void)
SDL_bool Android_JNI_HasClipboardText(void)
{
JNIEnv *env = Android_JNI_GetEnv();
jboolean retval = (*env)->CallStaticBooleanMethod(env, mActivityClass, midClipboardHasText);
return (retval == JNI_TRUE) ? SDL_TRUE : SDL_FALSE;
return (*env)->CallStaticBooleanMethod(env, mActivityClass, midClipboardHasText);
}

/* returns 0 on success or -1 on error (others undefined then)
Expand Down
2 changes: 1 addition & 1 deletion src/core/linux/SDL_dbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ SDL_bool SDL_DBus_ScreensaverInhibit(SDL_bool inhibit)
DBUS_TYPE_UINT32, &screensaver_cookie, DBUS_TYPE_INVALID)) {
return SDL_FALSE;
}
return (screensaver_cookie != 0) ? SDL_TRUE : SDL_FALSE;
return (screensaver_cookie != 0);
} else {
if (!SDL_DBus_CallVoidMethod(bus_name, path, interface, "UnInhibit", DBUS_TYPE_UINT32, &screensaver_cookie, DBUS_TYPE_INVALID)) {
return SDL_FALSE;
Expand Down
2 changes: 1 addition & 1 deletion src/core/linux/SDL_ibus.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ SDL_bool SDL_IBus_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state)

SDL_IBus_UpdateTextRect(NULL);

return result ? SDL_TRUE : SDL_FALSE;
return (result != 0);
}

void SDL_IBus_UpdateTextRect(const SDL_Rect *rect)
Expand Down
2 changes: 1 addition & 1 deletion src/events/SDL_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ int SDL_WaitEventTimeoutNS(SDL_Event *event, Sint64 timeoutNS)
SDL_VideoDevice *_this = SDL_GetVideoDevice();
SDL_Window *wakeup_window;
Uint64 start, expiration;
SDL_bool include_sentinel = (timeoutNS == 0) ? SDL_TRUE : SDL_FALSE;
SDL_bool include_sentinel = (timeoutNS == 0);
int result;

/* If there isn't a poll sentinel event pending, pump events and add one */
Expand Down
Loading

0 comments on commit ca64b9f

Please sign in to comment.