SDL: Pointer as bool (libsdl-org#7214)

From d8600f717e1e90808757f7c7ba41b2d1a2858d1a Mon Sep 17 00:00:00 2001
From: Sylvain <[EMAIL REDACTED]>
Date: Thu, 9 Nov 2023 22:29:15 +0100
Subject: [PATCH]  Pointer as bool (libsdl-org#7214)

---
 VisualC-GDK/tests/testgdk/src/testgdk.cpp     |   6 +-
 cmake/test/main_gui.c                         |   2 +-
 src/SDL.c                                     |   2 +-
 src/SDL_assert.c                              |  16 +-
 src/SDL_error.c                               |   2 +-
 src/SDL_guid.c                                |   2 +-
 src/SDL_hashtable.c                           |  30 ++--
 src/SDL_hints.c                               |  34 ++--
 src/SDL_list.c                                |   4 +-
 src/SDL_log.c                                 |  12 +-
 src/atomic/SDL_spinlock.c                     |   2 +-
 src/audio/SDL_audio.c                         | 114 ++++++------
 src/audio/SDL_audiocvt.c                      |  46 ++---
 src/audio/SDL_audiodev.c                      |   6 +-
 src/audio/SDL_audioqueue.c                    |  32 ++--
 src/audio/SDL_wave.c                          |  36 ++--
 src/audio/aaudio/SDL_aaudio.c                 |  18 +-
 src/audio/alsa/SDL_alsa_audio.c               |  36 ++--
 src/audio/android/SDL_androidaudio.c          |  10 +-
 src/audio/directsound/SDL_directsound.c       |  18 +-
 src/audio/disk/SDL_diskaudio.c                |  12 +-
 src/audio/dsp/SDL_dspaudio.c                  |   4 +-
 src/audio/emscripten/SDL_emscriptenaudio.c    |   4 +-
 src/audio/haiku/SDL_haikuaudio.cc             |   6 +-
 src/audio/jack/SDL_jackaudio.c                |  18 +-
 src/audio/n3ds/SDL_n3dsaudio.c                |   6 +-
 src/audio/netbsd/SDL_netbsdaudio.c            |   4 +-
 src/audio/openslES/SDL_openslES.c             |   6 +-
 src/audio/pipewire/SDL_pipewire.c             |  64 +++----
 src/audio/ps2/SDL_ps2audio.c                  |   6 +-
 src/audio/psp/SDL_pspaudio.c                  |   6 +-
 src/audio/pulseaudio/SDL_pulseaudio.c         |  44 ++---
 src/audio/qnx/SDL_qsa_audio.c                 |   2 +-
 src/audio/sndio/SDL_sndioaudio.c              |  20 +--
 src/audio/vita/SDL_vitaaudio.c                |   6 +-
 src/audio/wasapi/SDL_wasapi.c                 |  22 +--
 src/audio/wasapi/SDL_wasapi_win32.c           |   4 +-
 src/core/SDL_runapp.c                         |   2 +-
 src/core/android/SDL_android.c                |  46 ++---
 src/core/freebsd/SDL_evdev_kbd_freebsd.c      |  10 +-
 src/core/haiku/SDL_BeApp.cc                   |   6 +-
 src/core/linux/SDL_dbus.c                     |  20 +--
 src/core/linux/SDL_evdev.c                    |  38 ++--
 src/core/linux/SDL_evdev_kbd.c                |  12 +-
 src/core/linux/SDL_fcitx.c                    |   2 +-
 src/core/linux/SDL_ibus.c                     |  30 ++--
 src/core/linux/SDL_ime.c                      |   6 +-
 src/core/linux/SDL_system_theme.c             |   4 +-
 src/core/linux/SDL_threadprio.c               |  10 +-
 src/core/linux/SDL_udev.c                     |  90 +++++-----
 src/core/ngage/SDL_ngage_runapp.cpp           |   2 +-
 src/core/openbsd/SDL_wscons_kbd.c             |   8 +-
 src/core/openbsd/SDL_wscons_mouse.c           |   4 +-
 src/core/windows/SDL_hid.c                    |   6 +-
 src/core/windows/SDL_immdevice.c              |   4 +-
 src/core/windows/SDL_windows.c                |   8 +-
 src/core/windows/SDL_xinput.c                 |   4 +-
 src/core/winrt/SDL_winrtapp_direct3d.cpp      |   2 +-
 src/dynapi/SDL_dynapi.c                       |   6 +-
 src/events/SDL_displayevents.c                |   2 +-
 src/events/SDL_keyboard.c                     |  10 +-
 src/events/SDL_mouse.c                        |  28 +--
 src/events/SDL_touch.c                        |  16 +-
 src/events/SDL_windowevents.c                 |   8 +-
 src/file/SDL_rwops.c                          |  24 +--
 src/file/n3ds/SDL_rwopsromfs.c                |   2 +-
 src/filesystem/android/SDL_sysfilesystem.c    |   2 +-
 src/filesystem/emscripten/SDL_sysfilesystem.c |   6 +-
 src/filesystem/gdk/SDL_sysfilesystem.cpp      |   6 +-
 src/filesystem/haiku/SDL_sysfilesystem.cc     |  10 +-
 src/filesystem/n3ds/SDL_sysfilesystem.c       |   4 +-
 src/filesystem/ps2/SDL_sysfilesystem.c        |   4 +-
 src/filesystem/psp/SDL_sysfilesystem.c        |   4 +-
 src/filesystem/riscos/SDL_sysfilesystem.c     |  24 +--
 src/filesystem/unix/SDL_sysfilesystem.c       |  66 +++----
 src/filesystem/vita/SDL_sysfilesystem.c       |   6 +-
 src/filesystem/windows/SDL_sysfilesystem.c    |  10 +-
 src/filesystem/winrt/SDL_sysfilesystem.cpp    |  16 +-
 src/haptic/SDL_haptic.c                       |   8 +-
 src/haptic/android/SDL_syshaptic.c            |  24 +--
 src/haptic/darwin/SDL_syshaptic.c             |  40 ++---
 src/haptic/linux/SDL_syshaptic.c              |  30 ++--
 src/haptic/windows/SDL_dinputhaptic.c         |  36 ++--
 src/haptic/windows/SDL_windowshaptic.c        |  10 +-
 src/haptic/windows/SDL_xinputhaptic.c         |  14 +-
 src/joystick/SDL_gamepad.c                    | 118 ++++++-------
 src/joystick/SDL_joystick.c                   |  22 +--
 src/joystick/android/SDL_sysjoystick.c        |  26 +--
 src/joystick/bsd/SDL_bsdjoystick.c            |  30 ++--
 src/joystick/darwin/SDL_iokitjoystick.c       |  20 +--
 src/joystick/emscripten/SDL_sysjoystick.c     |  20 +--
 src/joystick/hidapi/SDL_hidapi_gamecube.c     |   6 +-
 src/joystick/hidapi/SDL_hidapi_luna.c         |   4 +-
 src/joystick/hidapi/SDL_hidapi_ps3.c          |  10 +-
 src/joystick/hidapi/SDL_hidapi_ps4.c          |   4 +-
 src/joystick/hidapi/SDL_hidapi_ps5.c          |   4 +-
 src/joystick/hidapi/SDL_hidapi_rumble.c       |   2 +-
 src/joystick/hidapi/SDL_hidapi_shield.c       |   6 +-
 src/joystick/hidapi/SDL_hidapi_stadia.c       |   4 +-
 src/joystick/hidapi/SDL_hidapi_steam.c        |   4 +-
 src/joystick/hidapi/SDL_hidapi_switch.c       |   8 +-
 src/joystick/hidapi/SDL_hidapi_wii.c          |   4 +-
 src/joystick/hidapi/SDL_hidapi_xbox360.c      |   4 +-
 src/joystick/hidapi/SDL_hidapi_xbox360w.c     |   4 +-
 src/joystick/hidapi/SDL_hidapi_xboxone.c      |  14 +-
 src/joystick/hidapi/SDL_hidapijoystick.c      |  24 +--
 src/joystick/linux/SDL_sysjoystick.c          |  88 +++++-----
 src/joystick/virtual/SDL_virtualjoystick.c    |  24 +--
 src/joystick/windows/SDL_dinputjoystick.c     |  18 +-
 src/joystick/windows/SDL_rawinputjoystick.c   |  10 +-
 .../windows/SDL_windows_gaming_input.c        |   8 +-
 src/joystick/windows/SDL_windowsjoystick.c    |  14 +-
 src/joystick/windows/SDL_xinputjoystick.c     |   4 +-
 src/loadso/dlopen/SDL_sysloadso.c             |   8 +-
 src/loadso/windows/SDL_sysloadso.c            |   8 +-
 src/locale/SDL_locale.c                       |   4 +-
 src/locale/unix/SDL_syslocale.c               |   6 +-
 src/locale/windows/SDL_syslocale.c            |   6 +-
 src/misc/SDL_url.c                            |   2 +-
 src/misc/windows/SDL_sysurl.c                 |   2 +-
 src/power/SDL_power.c                         |   4 +-
 src/power/linux/SDL_syspower.c                |  10 +-
 src/render/SDL_render.c                       | 136 +++++++--------
 src/render/SDL_yuv_sw.c                       |   2 +-
 src/render/direct3d/SDL_render_d3d.c          |  44 ++---
 src/render/direct3d11/SDL_render_d3d11.c      |  44 ++---
 src/render/direct3d12/SDL_render_d3d12.c      |  36 ++--
 src/render/opengl/SDL_render_gl.c             |  32 ++--
 src/render/opengl/SDL_shaders_gl.c            |   2 +-
 src/render/opengles2/SDL_render_gles2.c       |  40 ++---
 src/render/ps2/SDL_render_ps2.c               |  16 +-
 src/render/psp/SDL_render_psp.c               |  42 ++---
 src/render/software/SDL_blendfillrect.c       |   6 +-
 src/render/software/SDL_blendline.c           |   8 +-
 src/render/software/SDL_blendpoint.c          |   6 +-
 src/render/software/SDL_drawline.c            |   8 +-
 src/render/software/SDL_drawpoint.c           |   4 +-
 src/render/software/SDL_render_sw.c           |  70 ++++----
 src/render/software/SDL_rotate.c              |   6 +-
 src/render/software/SDL_triangle.c            |   6 +-
 src/render/vitagxm/SDL_render_vita_gxm.c      |  24 +--
 .../vitagxm/SDL_render_vita_gxm_memory.c      |   8 +-
 .../vitagxm/SDL_render_vita_gxm_tools.c       |   6 +-
 src/sensor/SDL_sensor.c                       |   2 +-
 src/sensor/android/SDL_androidsensor.c        |   4 +-
 src/sensor/vita/SDL_vitasensor.c              |   4 +-
 src/sensor/windows/SDL_windowssensor.c        |   8 +-
 src/stdlib/SDL_getenv.c                       |  22 +--
 src/stdlib/SDL_iconv.c                        |  28 +--
 src/stdlib/SDL_string.c                       |  10 +-
 src/test/SDL_test_common.c                    |   8 +-
 src/test/SDL_test_compare.c                   |   4 +-
 src/test/SDL_test_crc32.c                     |  12 +-
 src/test/SDL_test_font.c                      |   8 +-
 src/test/SDL_test_fuzzer.c                    |   2 +-
 src/test/SDL_test_harness.c                   |  34 ++--
 src/test/SDL_test_md5.c                       |   8 +-
 src/test/SDL_test_memory.c                    |   4 +-
 src/test/SDL_test_random.c                    |   6 +-
 src/thread/SDL_thread.c                       |  34 ++--
 src/thread/generic/SDL_syscond.c              |   6 +-
 src/thread/generic/SDL_sysmutex.c             |   2 +-
 src/thread/generic/SDL_syssem.c               |   6 +-
 src/thread/n3ds/SDL_syscond.c                 |   8 +-
 src/thread/n3ds/SDL_sysmutex.c                |   2 +-
 src/thread/n3ds/SDL_syssem.c                  |   8 +-
 src/thread/n3ds/SDL_systhread.c               |   2 +-
 src/thread/ngage/SDL_syssem.cpp               |   8 +-
 src/thread/ps2/SDL_syssem.c                   |  10 +-
 src/thread/psp/SDL_syscond.c                  |   6 +-
 src/thread/psp/SDL_sysmutex.c                 |   2 +-
 src/thread/psp/SDL_syssem.c                   |  10 +-
 src/thread/pthread/SDL_syscond.c              |   6 +-
 src/thread/pthread/SDL_sysmutex.c             |   2 +-
 src/thread/pthread/SDL_syssem.c               |  10 +-
 src/thread/pthread/SDL_systhread.c            |   4 +-
 src/thread/stdcpp/SDL_syscond.cpp             |   6 +-
 src/thread/stdcpp/SDL_sysmutex.cpp            |   4 +-
 src/thread/stdcpp/SDL_sysrwlock.cpp           |   2 +-
 src/thread/vita/SDL_syscond.c                 |  10 +-
 src/thread/vita/SDL_sysmutex.c                |   6 +-
 src/thread/vita/SDL_syssem.c                  |  10 +-
 src/thread/windows/SDL_syscond_cv.c           |  16 +-
 src/thread/windows/SDL_sysmutex.c             |  10 +-
 src/thread/windows/SDL_sysrwlock_srw.c        |   8 +-
 src/thread/windows/SDL_syssem.c               |  22 +--
 src/thread/windows/SDL_systhread.c            |   8 +-
 src/timer/SDL_timer.c                         |   8 +-
 src/video/SDL_RLEaccel.c                      |  14 +-
 src/video/SDL_blit.c                          |   6 +-
 src/video/SDL_blit_A.c                        |   6 +-
 src/video/SDL_blit_N.c                        |   8 +-
 src/video/SDL_bmp.c                           |   8 +-
 src/video/SDL_clipboard.c                     |  22 +--
 src/video/SDL_egl.c                           |  50 +++---
 src/video/SDL_fillrect.c                      |  14 +-
 src/video/SDL_pixels.c                        |  34 ++--
 src/video/SDL_rect.c                          |   4 +-
 src/video/SDL_rect_impl.h                     |  32 ++--
 src/video/SDL_shape.c                         |  20 +--
 src/video/SDL_surface.c                       |  78 ++++-----
 src/video/SDL_surface_pixel_impl.h            |  10 +-
 src/video/SDL_video.c                         | 162 +++++++++---------
 src/video/SDL_vulkan_utils.c                  |  14 +-
 src/video/SDL_yuv.c                           |  10 +-
 src/video/android/SDL_androidmouse.c          |   8 +-
 src/video/android/SDL_androidtouch.c          |   2 +-
 src/video/android/SDL_androidvideo.c          |   4 +-
 src/video/android/SDL_androidvulkan.c         |   6 +-
 src/video/android/SDL_androidwindow.c         |   4 +-
 src/video/dummy/SDL_nullframebuffer.c         |   4 +-
 src/video/dummy/SDL_nullvideo.c               |   2 +-
 src/video/emscripten/SDL_emscriptenevents.c   |   4 +-
 .../emscripten/SDL_emscriptenframebuffer.c    |   4 +-
 src/video/emscripten/SDL_emscriptenmouse.c    |   8 +-
 src/video/emscripten/SDL_emscriptenopengles.c |   2 +-
 src/video/emscripten/SDL_emscriptenvideo.c    |   4 +-
 src/video/gdk/SDL_gdktextinput.cpp            |  18 +-
 src/video/haiku/SDL_bclipboard.cc             |   2 +-
 src/video/haiku/SDL_bframebuffer.cc           |   2 +-
 src/video/haiku/SDL_bmessagebox.cc            |   6 +-
 src/video/haiku/SDL_bopengl.cc                |   8 +-
 src/video/haiku/SDL_bvideo.cc                 |   8 +-
 src/video/haiku/SDL_bwindow.cc                |   2 +-
 src/video/kmsdrm/SDL_kmsdrmdyn.c              |  12 +-
 src/video/kmsdrm/SDL_kmsdrmmouse.c            |  14 +-
 src/video/kmsdrm/SDL_kmsdrmopengles.c         |   2 +-
 src/video/kmsdrm/SDL_kmsdrmvideo.c            |  36 ++--
 src/video/kmsdrm/SDL_kmsdrmvulkan.c           |   6 +-
 src/video/n3ds/SDL_n3dsframebuffer.c          |   4 +-
 src/video/n3ds/SDL_n3dsvideo.c                |  10 +-
 src/video/ngage/SDL_ngageframebuffer.cpp      |   4 +-
 src/video/ngage/SDL_ngagevideo.cpp            |   4 +-
 src/video/ngage/SDL_ngagewindow.cpp           |   2 +-
 .../offscreen/SDL_offscreenframebuffer.c      |   4 +-
 src/video/offscreen/SDL_offscreenvideo.c      |   2 +-
 src/video/offscreen/SDL_offscreenwindow.c     |   2 +-
 src/video/ps2/SDL_ps2video.c                  |   2 +-
 src/video/psp/SDL_pspvideo.c                  |   8 +-
 src/video/qnx/SDL_qnxgl.c                     |   2 +-
 src/video/qnx/SDL_qnxvideo.c                  |   4 +-
 src/video/raspberry/SDL_rpimouse.c            |  24 +--
 src/video/raspberry/SDL_rpivideo.c            |   8 +-
 src/video/riscos/SDL_riscosframebuffer.c      |   4 +-
 src/video/riscos/SDL_riscosmodes.c            |  12 +-
 src/video/riscos/SDL_riscosvideo.c            |   4 +-
 src/video/riscos/SDL_riscoswindow.c           |   4 +-
 src/video/vita/SDL_vitaframebuffer.c          |   2 +-
 src/video/vita/SDL_vitagl_pvr.c               |   4 +-
 src/video/vita/SDL_vitagles_pvr.c             |   4 +-
 src/video/vita/SDL_vitakeyboard.c             |   2 +-
 src/video/vita/SDL_vitamouse.c                |   2 +-
 src/video/vita/SDL_vitatouch.c                |   2 +-
 src/video/vita/SDL_vitavideo.c                |  10 +-
 src/video/vivante/SDL_vivantevideo.c          |   8 +-
 src/video/vivante/SDL_vivantevulkan.c         |   6 +-
 src/video/wayland/SDL_waylandclipboard.c      |  20 +--
 src/video/wayland/SDL_waylanddatamanager.c    |  82 ++++-----
 src/video/wayland/SDL_waylanddyn.c            |  12 +-
 src/video/wayland/SDL_waylandevents.c         | 126 +++++++-------
 src/video/wayland/SDL_waylandkeyboard.c       |  10 +-
 src/video/wayland/SDL_waylandmessagebox.c     |  16 +-
 src/video/wayland/SDL_waylandmouse.c          |  22 +--
 src/video/wayland/SDL_waylandvideo.c          |  14 +-
 src/video/wayland/SDL_waylandvulkan.c         |   6 +-
 src/video/wayland/SDL_waylandwindow.c         |  46 ++---
 src/video/windows/SDL_windowsclipboard.c      |   2 +-
 src/video/windows/SDL_windowsevents.c         |  20 ++-
 src/video/windows/SDL_windowsframebuffer.c    |   2 +-
 src/video/windows/SDL_windowskeyboard.c       |  18 +-
 src/video/windows/SDL_windowsmessagebox.c     |  32 ++--
 src/video/windows/SDL_windowsmodes.c          |  12 +-
 src/video/windows/SDL_windowsmouse.c          |   4 +-
 src/video/windows/SDL_windowsopengl.c         |  14 +-
 src/video/windows/SDL_windowsopengles.c       |   4 +-
 src/video/windows/SDL_windowsshape.c          |   8 +-
 src/video/windows/SDL_windowsvideo.c          |  10 +-
 src/video/windows/SDL_windowsvulkan.c         |   6 +-
 src/video/windows/SDL_windowswindow.c         |  24 +--
 src/video/winrt/SDL_winrtgamebar.cpp          |   6 +-
 src/video/winrt/SDL_winrtvideo.cpp            |   8 +-
 src/video/x11/SDL_x11clipboard.c              |   6 +-
 src/video/x11/SDL_x11dyn.c                    |  12 +-
 src/video/x11/SDL_x11events.c                 |  16 +-
 src/video/x11/SDL_x11framebuffer.c            |   4 +-
 src/video/x11/SDL_x11messagebox.c             |  20 +--
 src/video/x11/SDL_x11modes.c                  |  30 ++--
 src/video/x11/SDL_x11mouse.c                  |  10 +-
 src/video/x11/SDL_x11shape.c                  |   6 +-
 src/video/x11/SDL_x11video.c                  |  12 +-
 src/video/x11/SDL_x11vulkan.c                 |   8 +-
 src/video/x11/SDL_x11window.c                 |  34 ++--
 src/video/x11/SDL_x11xfixes.c                 |   2 +-
 src/video/x11/SDL_x11xinput2.c                |  18 +-
 test/checkkeys.c                              |   2 +-
 test/checkkeysthreads.c                       |   4 +-
 test/gamepadutils.c                           |   2 +-
 test/loopwave.c                               |   4 +-
 test/testatomic.c                             |   2 +-
 test/testaudio.c                              |  24 +--
 test/testaudiocapture.c                       |   2 +-
 test/testaudiohotplug.c                       |   8 +-
 test/testaudioinfo.c                          |   6 +-
 test/testaudiostreamdynamicresample.c         |   4 +-
 test/testautomation.c                         |   2 +-
 test/testautomation_mouse.c                   |   6 +-
 test/testautomation_render.c                  |  12 +-
 test/testautomation_stdlib.c                  |   4 +-
 test/testautomation_surface.c                 |  10 +-
 test/testautomation_video.c                   |  24 +--
 test/testbounds.c                             |   2 +-
 test/testcontroller.c                         |  12 +-
 test/testcustomcursor.c                       |   2 +-
 test/testdisplayinfo.c                        |   4 +-
 test/testdraw.c                               |   2 +-
 test/testdrawchessboard.c                     |   6 +-
 test/testdropfile.c                           |   2 +-
 test/testerror.c                              |   4 +-
 test/testevdev.c                              |   2 +-
 test/testffmpeg.c                             |   4 +-
 test/testfile.c                               |  20 +--
 test/testfilesystem.c                         |   8 +-
 test/testgeometry.c                           |   4 +-
 test/testgl.c                                 |   2 +-
 test/testgles.c                               |   6 +-
 test/testgles2.c                              |   6 +-
 test/testgles2_sdf.c                          |  12 +-
 test/testhaptic.c                             |   8 +-
 test/testhittesting.c                         |   4 +-
 test/testhotplug.c                            |   4 +-
 test/testiconv.c                              |   4 +-
 test/testime.c                                |  24 +--
 test/testintersections.c                      |   2 +-
 test/testkeys.c                               |   2 +-
 test/testloadso.c                             |   6 +-
 test/testlocale.c                             |   4 +-
 test/testlock.c                               |   4 +-
 test/testmessage.c                            |   2 +-
 test/testmouse.c                              |  12 +-
 test/testmultiaudio.c                         |   4 +-
 test/testnative.c                             |  16 +-
 test/testnativew32.c                          |   2 +-
 test/testoffscreen.c                          |   6 +-
 test/testoverlay.c                            |  14 +-
 test/testplatform.c                           |   4 +-
 test/testpopup.c                              |   4 +-
 test/testpower.c                              |   2 +-
 test/testqsort.c                              |   2 +-
 test/testrelative.c                           |   2 +-
 test/testrendercopyex.c                       |   2 +-
 test/testrendertarget.c                       |   4 +-
 test/testresample.c                           |   4 +-
 test/testrumble.c                             |   8 +-
 test/testrwlock.c                             |   4 +-
 test/testscale.c                              |   2 +-
 test/testsem.c                                |   2 +-
 test/testsensor.c                             |   6 +-
 test/testshader.c                             |  12 +-
 test/testshape.c                              |  14 +-
 test/testsprite.c                             |   6 +-
 test/testspriteminimal.c                      |   2 +-
 test/teststreaming.c                          |  12 +-
 test/testsurround.c                           |   4 +-
 test/testthread.c                             |   6 +-
 test/testtimer.c                              |   2 +-
 test/testutils.c                              |  20 +--
 test/testviewport.c                           |   4 +-
 test/testvulkan.c                             |  10 +-
 test/testwm.c                                 |   6 +-
 test/testyuv.c                                |  14 +-
 test/torturethread.c                          |   2 +-
 371 files changed, 2448 insertions(+), 2442 deletions(-)

diff --git a/VisualC-GDK/tests/testgdk/src/testgdk.cpp b/VisualC-GDK/tests/testgdk/src/testgdk.cpp
index 1a962a4c2062..50f93e2fab91 100644
--- a/VisualC-GDK/tests/testgdk/src/testgdk.cpp
+++ b/VisualC-GDK/tests/testgdk/src/testgdk.cpp
@@ -385,7 +385,7 @@ main(int argc, char *argv[])
 
     /* Initialize test framework */
     state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO | SDL_INIT_AUDIO);
-    if (state == NULL) {
+    if (!state) {
         return 1;
     }
 
@@ -448,7 +448,7 @@ main(int argc, char *argv[])
     /* Create the windows, initialize the renderers, and load the textures */
     sprites =
         (SDL_Texture **) SDL_malloc(state->num_windows * sizeof(*sprites));
-    if (sprites == NULL) {
+    if (!sprites) {
         SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!\n");
         quit(2);
     }
@@ -463,7 +463,7 @@ main(int argc, char *argv[])
 
     soundname = GetResourceFilename(argc > 1 ? argv[1] : NULL, "sample.wav");
 
-    if (soundname == NULL) {
+    if (!soundname) {
         SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "%s\n", SDL_GetError());
         quit(1);
     }
diff --git a/cmake/test/main_gui.c b/cmake/test/main_gui.c
index 715c4306f5ca..c8cc03c1289b 100644
--- a/cmake/test/main_gui.c
+++ b/cmake/test/main_gui.c
@@ -10,7 +10,7 @@ int main(int argc, char *argv[])
         return 1;
     }
     window = SDL_CreateWindow("Hello SDL", 640, 480, 0);
-    if (window == NULL) {
+    if (!window) {
         SDL_Log("could not create window: %s\n", SDL_GetError());
         return 1;
     }
diff --git a/src/SDL.c b/src/SDL.c
index 2959db874915..302e625e90dc 100644
--- a/src/SDL.c
+++ b/src/SDL.c
@@ -557,7 +557,7 @@ int SDL_GetVersion(SDL_version *ver)
     static SDL_bool check_hint = SDL_TRUE;
     static SDL_bool legacy_version = SDL_FALSE;
 
-    if (ver == NULL) {
+    if (!ver) {
         return SDL_InvalidParamError("ver");
     }
 
diff --git a/src/SDL_assert.c b/src/SDL_assert.c
index ba1c194d9c76..6c2491aaca0e 100644
--- a/src/SDL_assert.c
+++ b/src/SDL_assert.c
@@ -106,11 +106,11 @@ static void SDL_GenerateAssertionReport(void)
     const SDL_AssertData *item = triggered_assertions;
 
     /* only do this if the app hasn't assigned an assertion handler. */
-    if ((item != NULL) && (assertion_handler != SDL_PromptAssertion)) {
+    if ((item) && (assertion_handler != SDL_PromptAssertion)) {
         debug_print("\n\nSDL assertion report.\n");
         debug_print("All SDL assertions between last init/quit:\n\n");
 
-        while (item != NULL) {
+        while (item) {
             debug_print(
                 "'%s'\n"
                 "    * %s (%s:%d)\n"
@@ -198,7 +198,7 @@ static SDL_AssertState SDLCALL SDL_PromptAssertion(const SDL_AssertData *data, v
 
     /* let env. variable override, so unit tests won't block in a GUI. */
     envr = SDL_getenv("SDL_ASSERT");
-    if (envr != NULL) {
+    if (envr) {
         if (message != stack_buf) {
             SDL_free(message);
         }
@@ -334,9 +334,9 @@ SDL_AssertState SDL_ReportAssertion(SDL_AssertData *data, const char *func, cons
 #ifndef SDL_THREADS_DISABLED
     static SDL_SpinLock spinlock = 0;
     SDL_AtomicLock(&spinlock);
-    if (assertion_mutex == NULL) { /* never called SDL_Init()? */
+    if (!assertion_mutex) { /* never called SDL_Init()? */
         assertion_mutex = SDL_CreateMutex();
-        if (assertion_mutex == NULL) {
+        if (!assertion_mutex) {
             SDL_AtomicUnlock(&spinlock);
             return SDL_ASSERTION_IGNORE; /* oh well, I guess. */
         }
@@ -401,7 +401,7 @@ void SDL_AssertionsQuit(void)
 #if SDL_ASSERT_LEVEL > 0
     SDL_GenerateAssertionReport();
 #ifndef SDL_THREADS_DISABLED
-    if (assertion_mutex != NULL) {
+    if (assertion_mutex) {
         SDL_DestroyMutex(assertion_mutex);
         assertion_mutex = NULL;
     }
@@ -429,7 +429,7 @@ void SDL_ResetAssertionReport(void)
 {
     SDL_AssertData *next = NULL;
     SDL_AssertData *item;
-    for (item = triggered_assertions; item != NULL; item = next) {
+    for (item = triggered_assertions; item; item = next) {
         next = (SDL_AssertData *)item->next;
         item->always_ignore = SDL_FALSE;
         item->trigger_count = 0;
@@ -446,7 +446,7 @@ SDL_AssertionHandler SDL_GetDefaultAssertionHandler(void)
 
 SDL_AssertionHandler SDL_GetAssertionHandler(void **userdata)
 {
-    if (userdata != NULL) {
+    if (userdata) {
         *userdata = assertion_userdata;
     }
     return assertion_handler;
diff --git a/src/SDL_error.c b/src/SDL_error.c
index 00f1bcf7d944..25fe696c79fa 100644
--- a/src/SDL_error.c
+++ b/src/SDL_error.c
@@ -27,7 +27,7 @@
 int SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...)
 {
     /* Ignore call if invalid format pointer was passed */
-    if (fmt != NULL) {
+    if (fmt) {
         va_list ap;
         int result;
         SDL_error *error = SDL_GetErrBuf();
diff --git a/src/SDL_guid.c b/src/SDL_guid.c
index 61387941c794..fc68db429100 100644
--- a/src/SDL_guid.c
+++ b/src/SDL_guid.c
@@ -26,7 +26,7 @@ int SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID)
     static const char k_rgchHexToASCII[] = "0123456789abcdef";
     int i;
 
-    if (pszGUID == NULL) {
+    if (!pszGUID) {
         return SDL_InvalidParamError("pszGUID");
     }
     if (cbGUID <= 0) {
diff --git a/src/SDL_hashtable.c b/src/SDL_hashtable.c
index 1c3c7bb63b6c..0b898059853f 100644
--- a/src/SDL_hashtable.c
+++ b/src/SDL_hashtable.c
@@ -53,13 +53,13 @@ SDL_HashTable *SDL_CreateHashTable(void *data, const Uint32 num_buckets, const S
     }
 
     table = (SDL_HashTable *) SDL_calloc(1, sizeof (SDL_HashTable));
-    if (table == NULL) {
+    if (!table) {
         SDL_OutOfMemory();
         return NULL;
     }
 
     table->table = (SDL_HashItem **) SDL_calloc(num_buckets, sizeof (SDL_HashItem *));
-    if (table->table == NULL) {
+    if (!table->table) {
         SDL_free(table);
         SDL_OutOfMemory();
         return NULL;
@@ -91,7 +91,7 @@ SDL_bool SDL_InsertIntoHashTable(SDL_HashTable *table, const void *key, const vo
 
     // !!! FIXME: grow and rehash table if it gets too saturated.
     item = (SDL_HashItem *) SDL_malloc(sizeof (SDL_HashItem));
-    if (item == NULL) {
+    if (!item) {
         SDL_OutOfMemory();
         return SDL_FALSE;
     }
@@ -110,9 +110,9 @@ SDL_bool SDL_FindInHashTable(const SDL_HashTable *table, const void *key, const
     void *data = table->data;
     SDL_HashItem *i;
 
-    for (i = table->table[hash]; i != NULL; i = i->next) {
+    for (i = table->table[hash]; i; i = i->next) {
         if (table->keymatch(key, i->key, data)) {
-            if (_value != NULL) {
+            if (_value) {
                 *_value = i->value;
             }
             return SDL_TRUE;
@@ -129,9 +129,9 @@ SDL_bool SDL_RemoveFromHashTable(SDL_HashTable *table, const void *key)
     SDL_HashItem *prev = NULL;
     void *data = table->data;
 
-    for (item = table->table[hash]; item != NULL; item = item->next) {
+    for (item = table->table[hash]; item; item = item->next) {
         if (table->keymatch(key, item->key, data)) {
-            if (prev != NULL) {
+            if (prev) {
                 prev->next = item->next;
             } else {
                 table->table[hash] = item->next;
@@ -152,7 +152,7 @@ SDL_bool SDL_IterateHashTableKey(const SDL_HashTable *table, const void *key, co
 {
     SDL_HashItem *item = *iter ? ((SDL_HashItem *) *iter)->next : table->table[calc_hash(table, key)];
 
-    while (item != NULL) {
+    while (item) {
         if (table->keymatch(key, item->key, table->data)) {
             *_value = item->value;
             *iter = item;
@@ -172,10 +172,10 @@ SDL_bool SDL_IterateHashTable(const SDL_HashTable *table, const void **_key, con
     SDL_HashItem *item = (SDL_HashItem *) *iter;
     Uint32 idx = 0;
 
-    if (item != NULL) {
+    if (item) {
         const SDL_HashItem *orig = item;
         item = item->next;
-        if (item == NULL) {
+        if (!item) {
             idx = calc_hash(table, orig->key) + 1;  // !!! FIXME: we probably shouldn't rehash each time.
         }
     }
@@ -184,7 +184,7 @@ SDL_bool SDL_IterateHashTable(const SDL_HashTable *table, const void **_key, con
         item = table->table[idx++];  // skip empty buckets...
     }
 
-    if (item == NULL) {  // no more matches?
+    if (!item) {  // no more matches?
         *_key = NULL;
         *iter = NULL;
         return SDL_FALSE;
@@ -199,12 +199,12 @@ SDL_bool SDL_IterateHashTable(const SDL_HashTable *table, const void **_key, con
 
 SDL_bool SDL_HashTableEmpty(SDL_HashTable *table)
 {
-    if (table != NULL) {
+    if (table) {
         Uint32 i;
 
         for (i = 0; i < table->table_len; i++) {
             SDL_HashItem *item = table->table[i];
-            if (item != NULL) {
+            if (item) {
                 return SDL_FALSE;
             }
         }
@@ -214,13 +214,13 @@ SDL_bool SDL_HashTableEmpty(SDL_HashTable *table)
 
 void SDL_DestroyHashTable(SDL_HashTable *table)
 {
-    if (table != NULL) {
+    if (table) {
         void *data = table->data;
         Uint32 i;
 
         for (i = 0; i < table->table_len; i++) {
             SDL_HashItem *item = table->table[i];
-            while (item != NULL) {
+            while (item) {
                 SDL_HashItem *next = item->next;
                 table->nuke(item->key, item->value, data);
                 SDL_free(item);
diff --git a/src/SDL_hints.c b/src/SDL_hints.c
index 9ee0bc31c91c..3e792c6d50e1 100644
--- a/src/SDL_hints.c
+++ b/src/SDL_hints.c
@@ -49,7 +49,7 @@ SDL_bool SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPr
     SDL_Hint *hint;
     SDL_HintWatch *entry;
 
-    if (name == NULL) {
+    if (!name) {
         return SDL_FALSE;
     }
 
@@ -64,7 +64,7 @@ SDL_bool SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPr
                 return SDL_FALSE;
             }
             if (hint->value != value &&
-                (value == NULL || !hint->value || SDL_strcmp(hint->value, value) != 0)) {
+                (!value || !hint->value || SDL_strcmp(hint->value, value) != 0)) {
                 char *old_value = hint->value;
 
                 hint->value = value ? SDL_strdup(value) : NULL;
@@ -85,7 +85,7 @@ SDL_bool SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPr
 
     /* Couldn't find the hint, add a new one */
     hint = (SDL_Hint *)SDL_malloc(sizeof(*hint));
-    if 

(Patch may be truncated, please check the link at the top of this post.)