SDL: Use consistent style for pointer declarations and casts

From d7939abf42de34fff409f5e7c4b77ace79dff4de Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 18 Jun 2025 09:26:51 -0700
Subject: [PATCH] Use consistent style for pointer declarations and casts

---
 src/SDL_hints.c                               |  2 +-
 src/atomic/SDL_atomic.c                       |  2 +-
 src/audio/SDL_audiocvt.c                      | 44 ++++-----
 src/audio/SDL_audiotypecvt.c                  | 98 +++++++++----------
 src/audio/SDL_sysaudio.h                      |  8 +-
 src/audio/alsa/SDL_alsa_audio.c               | 10 +-
 src/audio/emscripten/SDL_emscriptenaudio.c    |  2 +-
 src/audio/pipewire/SDL_pipewire.c             |  2 +-
 src/audio/wasapi/SDL_wasapi.c                 |  2 +-
 src/camera/coremedia/SDL_camera_coremedia.m   |  2 +-
 .../SDL_camera_mediafoundation.c              |  4 +-
 src/camera/pipewire/SDL_camera_pipewire.c     |  2 +-
 src/camera/v4l2/SDL_camera_v4l2.c             |  6 +-
 src/camera/vita/SDL_camera_vita.c             | 14 +--
 src/core/SDL_core_unsupported.c               |  6 +-
 src/core/android/SDL_android.c                |  4 +-
 src/core/android/SDL_android.h                |  2 +-
 src/core/freebsd/SDL_evdev_kbd_freebsd.c      |  2 +-
 src/core/haiku/SDL_BApp.h                     |  2 +-
 src/core/haiku/SDL_BeApp.cc                   |  4 +-
 src/core/linux/SDL_evdev.c                    |  4 +-
 src/core/linux/SDL_evdev.h                    |  4 +-
 src/core/linux/SDL_evdev_kbd.c                |  4 +-
 src/core/linux/SDL_evdev_kbd.h                |  2 +-
 src/core/linux/SDL_udev.c                     |  2 +-
 src/dialog/cocoa/SDL_cocoadialog.m            | 12 +--
 src/dialog/haiku/SDL_haikudialog.cc           | 16 +--
 src/dialog/unix/SDL_portaldialog.c            |  6 +-
 src/dialog/windows/SDL_windowsdialog.c        | 10 +-
 src/filesystem/cocoa/SDL_sysfilesystem.m      |  2 +-
 src/filesystem/gdk/SDL_sysfilesystem.cpp      |  2 +-
 src/filesystem/ngage/SDL_sysfilesystem.c      |  2 +-
 src/filesystem/ngage/SDL_sysfilesystem.cpp    |  4 +-
 src/filesystem/unix/SDL_sysfilesystem.c       | 10 +-
 src/gpu/SDL_gpu.c                             |  4 +-
 src/gpu/d3d12/SDL_gpu_d3d12.c                 | 16 +--
 src/gpu/vulkan/SDL_gpu_vulkan.c               | 10 +-
 src/hidapi/android/hid.cpp                    | 14 +--
 src/io/windows/SDL_asyncio_windows_ioring.c   |  2 +-
 src/joystick/gdk/SDL_gameinputjoystick.cpp    |  6 +-
 src/joystick/hidapi/SDL_hidapi_gip.c          |  6 +-
 src/main/SDL_main_callbacks.c                 |  2 +-
 src/main/SDL_runapp.c                         |  4 +-
 src/main/emscripten/SDL_sysmain_callbacks.c   |  2 +-
 src/main/emscripten/SDL_sysmain_runapp.c      |  2 +-
 src/main/gdk/SDL_sysmain_runapp.cpp           |  2 +-
 src/main/generic/SDL_sysmain_callbacks.c      |  2 +-
 src/main/ios/SDL_sysmain_callbacks.m          |  2 +-
 src/main/n3ds/SDL_sysmain_runapp.c            |  2 +-
 src/main/ngage/SDL_sysmain_callbacks.c        |  2 +-
 src/main/ngage/SDL_sysmain_main.cpp           | 32 +++---
 src/main/ngage/SDL_sysmain_main.hpp           |  2 +-
 src/main/ps2/SDL_sysmain_runapp.c             |  2 +-
 src/main/psp/SDL_sysmain_runapp.c             |  2 +-
 src/main/windows/SDL_sysmain_runapp.c         |  2 +-
 src/render/direct3d12/SDL_render_d3d12.c      |  2 +-
 src/render/ngage/SDL_render_ops.cpp           | 18 ++--
 src/render/ngage/SDL_render_ops.hpp           |  8 +-
 src/render/vulkan/SDL_render_vulkan.c         | 10 +-
 src/stdlib/SDL_stdlib.c                       |  4 +-
 src/storage/SDL_sysstorage.h                  |  4 +-
 src/storage/steam/SDL_steamstorage.c          | 12 +--
 src/test/SDL_test_memory.c                    |  6 +-
 src/tray/unix/SDL_tray.c                      | 10 +-
 src/video/SDL_blit_A.c                        | 26 ++---
 src/video/SDL_blit_N.c                        | 16 +--
 src/video/SDL_stretch.c                       |  4 +-
 src/video/SDL_sysvideo.h                      |  2 +-
 src/video/SDL_video.c                         |  2 +-
 src/video/android/SDL_androidvulkan.c         |  3 +-
 src/video/android/SDL_androidvulkan.h         |  2 +-
 src/video/cocoa/SDL_cocoavideo.m              |  2 +-
 src/video/cocoa/SDL_cocoavulkan.h             |  2 +-
 src/video/cocoa/SDL_cocoavulkan.m             |  3 +-
 .../emscripten/SDL_emscriptenframebuffer.c    |  2 +-
 src/video/haiku/SDL_bclipboard.cc             |  2 +-
 src/video/haiku/SDL_bmessagebox.cc            |  2 +-
 src/video/haiku/SDL_bmodes.cc                 |  2 +-
 src/video/haiku/SDL_bopengl.cc                |  6 +-
 src/video/kmsdrm/SDL_kmsdrmvulkan.c           |  3 +-
 src/video/kmsdrm/SDL_kmsdrmvulkan.h           |  2 +-
 src/video/openvr/SDL_openvrvideo.c            | 14 +--
 src/video/uikit/SDL_uikitappdelegate.m        |  2 +-
 src/video/uikit/SDL_uikitvulkan.h             |  2 +-
 src/video/uikit/SDL_uikitvulkan.m             |  3 +-
 src/video/vivante/SDL_vivantevulkan.c         |  3 +-
 src/video/vivante/SDL_vivantevulkan.h         |  2 +-
 src/video/wayland/SDL_waylandsym.h            | 12 +--
 src/video/wayland/SDL_waylandvulkan.c         |  2 +-
 src/video/wayland/SDL_waylandvulkan.h         |  2 +-
 src/video/wayland/SDL_waylandwindow.c         |  6 +-
 src/video/windows/SDL_surface_utils.c         |  2 +-
 src/video/windows/SDL_windowsgameinput.cpp    |  8 +-
 src/video/windows/SDL_windowsmouse.c          |  4 +-
 src/video/windows/SDL_windowsvideo.c          |  6 +-
 src/video/windows/SDL_windowsvideo.h          |  4 +-
 src/video/windows/SDL_windowsvulkan.c         |  3 +-
 src/video/windows/SDL_windowsvulkan.h         |  2 +-
 src/video/windows/SDL_windowswindow.c         |  4 +-
 src/video/x11/SDL_x11events.c                 |  8 +-
 src/video/x11/SDL_x11messagebox.c             |  8 +-
 src/video/x11/SDL_x11opengl.c                 | 10 +-
 src/video/x11/SDL_x11vulkan.c                 |  3 +-
 src/video/x11/SDL_x11vulkan.h                 |  2 +-
 src/video/x11/SDL_x11window.c                 |  2 +-
 105 files changed, 339 insertions(+), 346 deletions(-)

diff --git a/src/SDL_hints.c b/src/SDL_hints.c
index a10598f0ffe69..786d654a28883 100644
--- a/src/SDL_hints.c
+++ b/src/SDL_hints.c
@@ -87,7 +87,7 @@ static void SDLCALL CleanupHintProperty(void *userdata, void *value)
     SDL_free(hint);
 }
 
-static const char* GetHintEnvironmentVariable(const char *name)
+static const char *GetHintEnvironmentVariable(const char *name)
 {
     const char *result = SDL_getenv(name);
     if (!result && name && *name) {
diff --git a/src/atomic/SDL_atomic.c b/src/atomic/SDL_atomic.c
index 5e7774da85356..7a575ac23ae84 100644
--- a/src/atomic/SDL_atomic.c
+++ b/src/atomic/SDL_atomic.c
@@ -163,7 +163,7 @@ bool SDL_CompareAndSwapAtomicU32(SDL_AtomicU32 *a, Uint32 oldval, Uint32 newval)
 #elif defined(HAVE_GCC_ATOMICS)
     return __sync_bool_compare_and_swap(&a->value, oldval, newval);
 #elif defined(SDL_PLATFORM_MACOS) // this is deprecated in 10.12 sdk; favor gcc atomics.
-    return OSAtomicCompareAndSwap32Barrier((int32_t)oldval, (int32_t)newval, (int32_t*)&a->value);
+    return OSAtomicCompareAndSwap32Barrier((int32_t)oldval, (int32_t)newval, (int32_t *)&a->value);
 #elif defined(SDL_PLATFORM_SOLARIS)
     SDL_COMPILE_TIME_ASSERT(atomic_cas, sizeof(uint_t) == sizeof(a->value));
     return ((Uint32)atomic_cas_uint((volatile uint_t *)&a->value, (uint_t)oldval, (uint_t)newval) == oldval);
diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c
index 13888fd2469b3..1d68840052e5e 100644
--- a/src/audio/SDL_audiocvt.c
+++ b/src/audio/SDL_audiocvt.c
@@ -280,7 +280,7 @@ void ConvertAudio(int num_frames,
 
     // swizzle input to "standard" format if necessary.
     if (src_map) {
-        void* buf = scratch ? scratch : dst;  // use scratch if available, since it has to be big enough to hold src, unless it's NULL, then dst has to be.
+        void *buf = scratch ? scratch : dst;  // use scratch if available, since it has to be big enough to hold src, unless it's NULL, then dst has to be.
         SwizzleAudio(num_frames, buf, src, src_channels, src_map, src_format);
         src = buf;
     }
@@ -318,7 +318,7 @@ void ConvertAudio(int num_frames,
 
     // get us to float format.
     if (srcconvert) {
-        void* buf = (channelconvert || dstconvert) ? scratch : dst;
+        void *buf = (channelconvert || dstconvert) ? scratch : dst;
         ConvertAudioToFloat((float *) buf, src, num_frames * src_channels, src_format);
         src = buf;
     }
@@ -368,7 +368,7 @@ void ConvertAudio(int num_frames,
             channel_converter = override;
         }
 
-        void* buf = dstconvert ? scratch : dst;
+        void *buf = dstconvert ? scratch : dst;
         channel_converter((float *) buf, (const float *) src, num_frames);
         src = buf;
     }
@@ -399,7 +399,7 @@ static int CalculateMaxFrameSize(SDL_AudioFormat src_format, int src_channels, S
     return max_format_size * max_channels;
 }
 
-static Sint64 GetAudioStreamResampleRate(SDL_AudioStream* stream, int src_freq, Sint64 resample_offset)
+static Sint64 GetAudioStreamResampleRate(SDL_AudioStream *stream, int src_freq, Sint64 resample_offset)
 {
     src_freq = (int)((float)src_freq * stream->freq_ratio);
 
@@ -778,9 +778,9 @@ static bool CheckAudioStreamIsFullySetup(SDL_AudioStream *stream)
 }
 
 // you MUST hold `stream->lock` when calling this, and validate your parameters!
-static bool PutAudioStreamBufferInternal(SDL_AudioStream *stream, const SDL_AudioSpec *spec, const int *chmap, const void *buf, int len, SDL_ReleaseAudioBufferCallback callback, void* userdata)
+static bool PutAudioStreamBufferInternal(SDL_AudioStream *stream, const SDL_AudioSpec *spec, const int *chmap, const void *buf, int len, SDL_ReleaseAudioBufferCallback callback, void *userdata)
 {
-    SDL_AudioTrack* track = NULL;
+    SDL_AudioTrack *track = NULL;
 
     if (callback) {
         track = SDL_CreateAudioTrack(stream->queue, spec, chmap, (Uint8 *)buf, len, len, callback, userdata);
@@ -809,7 +809,7 @@ static bool PutAudioStreamBufferInternal(SDL_AudioStream *stream, const SDL_Audi
     return retval;
 }
 
-static bool PutAudioStreamBuffer(SDL_AudioStream *stream, const void *buf, int len, SDL_ReleaseAudioBufferCallback callback, void* userdata)
+static bool PutAudioStreamBuffer(SDL_AudioStream *stream, const void *buf, int len, SDL_ReleaseAudioBufferCallback callback, void *userdata)
 {
 #if DEBUG_AUDIOSTREAM
     SDL_Log("AUDIOSTREAM: wants to put %d bytes", len);
@@ -836,7 +836,7 @@ static bool PutAudioStreamBuffer(SDL_AudioStream *stream, const void *buf, int l
 
 static void SDLCALL FreeAllocatedAudioBuffer(void *userdata, const void *buf, int len)
 {
-    SDL_free((void*) buf);
+    SDL_free((void *)buf);
 }
 
 bool SDL_PutAudioStreamData(SDL_AudioStream *stream, const void *buf, int len)
@@ -1081,8 +1081,8 @@ static Uint8 *EnsureAudioStreamWorkBufferSize(SDL_AudioStream *stream, size_t ne
     return ptr;
 }
 
-static Sint64 NextAudioStreamIter(SDL_AudioStream* stream, void** inout_iter,
-    Sint64* inout_resample_offset, SDL_AudioSpec* out_spec, int **out_chmap, bool* out_flushed)
+static Sint64 NextAudioStreamIter(SDL_AudioStream *stream, void **inout_iter,
+    Sint64 *inout_resample_offset, SDL_AudioSpec *out_spec, int **out_chmap, bool *out_flushed)
 {
     SDL_AudioSpec spec;
     bool flushed;
@@ -1136,9 +1136,9 @@ static Sint64 NextAudioStreamIter(SDL_AudioStream* stream, void** inout_iter,
     return output_frames;
 }
 
-static Sint64 GetAudioStreamAvailableFrames(SDL_AudioStream* stream, Sint64* out_resample_offset)
+static Sint64 GetAudioStreamAvailableFrames(SDL_AudioStream *stream, Sint64 *out_resample_offset)
 {
-    void* iter = SDL_BeginAudioQueueIter(stream->queue);
+    void *iter = SDL_BeginAudioQueueIter(stream->queue);
 
     Sint64 resample_offset = stream->resample_offset;
     Sint64 output_frames = 0;
@@ -1160,9 +1160,9 @@ static Sint64 GetAudioStreamAvailableFrames(SDL_AudioStream* stream, Sint64* out
     return output_frames;
 }
 
-static Sint64 GetAudioStreamHead(SDL_AudioStream* stream, SDL_AudioSpec* out_spec, int **out_chmap, bool* out_flushed)
+static Sint64 GetAudioStreamHead(SDL_AudioStream *stream, SDL_AudioSpec *out_spec, int **out_chmap, bool *out_flushed)
 {
-    void* iter = SDL_BeginAudioQueueIter(stream->queue);
+    void *iter = SDL_BeginAudioQueueIter(stream->queue);
 
     if (!iter) {
         SDL_zerop(out_spec);
@@ -1178,8 +1178,8 @@ static Sint64 GetAudioStreamHead(SDL_AudioStream* stream, SDL_AudioSpec* out_spe
 // Enough input data MUST be available!
 static bool GetAudioStreamDataInternal(SDL_AudioStream *stream, void *buf, int output_frames, float gain)
 {
-    const SDL_AudioSpec* src_spec = &stream->input_spec;
-    const SDL_AudioSpec* dst_spec = &stream->dst_spec;
+    const SDL_AudioSpec *src_spec = &stream->input_spec;
+    const SDL_AudioSpec *dst_spec = &stream->dst_spec;
 
     const SDL_AudioFormat src_format = src_spec->format;
     const int src_channels = src_spec->channels;
@@ -1199,7 +1199,7 @@ static bool GetAudioStreamDataInternal(SDL_AudioStream *stream, void *buf, int o
 
     // Not resampling? It's an easy conversion (and maybe not even that!)
     if (resample_rate == 0) {
-        Uint8* work_buffer = NULL;
+        Uint8 *work_buffer = NULL;
 
         // Ensure we have enough scratch space for any conversions
         if ((src_format != dst_format) || (src_channels != dst_channels) || (gain != 1.0f)) {
@@ -1269,7 +1269,7 @@ static bool GetAudioStreamDataInternal(SDL_AudioStream *stream, void *buf, int o
         work_buffer_capacity += resample_bytes;
     }
 
-    Uint8* work_buffer = EnsureAudioStreamWorkBufferSize(stream, work_buffer_capacity);
+    Uint8 *work_buffer = EnsureAudioStreamWorkBufferSize(stream, work_buffer_capacity);
 
     if (!work_buffer) {
         return false;
@@ -1281,7 +1281,7 @@ static bool GetAudioStreamDataInternal(SDL_AudioStream *stream, void *buf, int o
     const float postresample_gain = (input_frames > output_frames) ? gain : 1.0f;
 
     // (dst channel map is NULL because we'll do the final swizzle on ConvertAudio after resample.)
-    const Uint8* input_buffer = SDL_ReadFromAudioQueue(stream->queue,
+    const Uint8 *input_buffer = SDL_ReadFromAudioQueue(stream->queue,
         NULL, resample_format, resample_channels, NULL,
         padding_frames, input_frames, padding_frames, work_buffer, preresample_gain);
 
@@ -1292,11 +1292,11 @@ static bool GetAudioStreamDataInternal(SDL_AudioStream *stream, void *buf, int o
     input_buffer += padding_frames * resample_frame_size;
 
     // Decide where the resampled output goes
-    void* resample_buffer = (resample_buffer_offset != -1) ? (work_buffer + resample_buffer_offset) : buf;
+    void *resample_buffer = (resample_buffer_offset != -1) ? (work_buffer + resample_buffer_offset) : buf;
 
     SDL_ResampleAudio(resample_channels,
-                  (const float *) input_buffer, input_frames,
-                  (float*) resample_buffer, output_frames,
+                  (const float *)input_buffer, input_frames,
+                  (float *)resample_buffer, output_frames,
                   resample_rate, &stream->resample_offset);
 
     // Convert to the final format, if necessary (src channel map is NULL because SDL_ReadFromAudioQueue already handled this).
diff --git a/src/audio/SDL_audiotypecvt.c b/src/audio/SDL_audiotypecvt.c
index a27575f23947c..78c325e577572 100644
--- a/src/audio/SDL_audiotypecvt.c
+++ b/src/audio/SDL_audiotypecvt.c
@@ -185,7 +185,7 @@ static void SDL_Convert_F32_to_S32_Scalar(Sint32 *dst, const float *src, int num
 
 #undef SIGNMASK
 
-static void SDL_Convert_Swap16_Scalar(Uint16* dst, const Uint16* src, int num_samples)
+static void SDL_Convert_Swap16_Scalar(Uint16 *dst, const Uint16 *src, int num_samples)
 {
     int i;
 
@@ -194,7 +194,7 @@ static void SDL_Convert_Swap16_Scalar(Uint16* dst, const Uint16* src, int num_sa
     }
 }
 
-static void SDL_Convert_Swap32_Scalar(Uint32* dst, const Uint32* src, int num_samples)
+static void SDL_Convert_Swap32_Scalar(Uint32 *dst, const Uint32 *src, int num_samples)
 {
     int i;
 
@@ -375,7 +375,7 @@ static void SDL_TARGETING("sse2") SDL_Convert_F32_to_S8_SSE2(Sint8 *dst, const f
 
         const __m128i bytes = _mm_packus_epi16(shorts0, shorts1);
 
-        _mm_store_si128((__m128i*)&dst[i], bytes);
+        _mm_store_si128((__m128i *)&dst[i], bytes);
     })
 }
 
@@ -409,7 +409,7 @@ static void SDL_TARGETING("sse2") SDL_Convert_F32_to_U8_SSE2(Uint8 *dst, const f
 
         const __m128i bytes = _mm_packus_epi16(shorts0, shorts1);
 
-        _mm_store_si128((__m128i*)&dst[i], bytes);
+        _mm_store_si128((__m128i *)&dst[i], bytes);
     })
 }
 
@@ -441,8 +441,8 @@ static void SDL_TARGETING("sse2") SDL_Convert_F32_to_S16_SSE2(Sint16 *dst, const
         const __m128i shorts0 = _mm_packs_epi32(ints0, ints1);
         const __m128i shorts1 = _mm_packs_epi32(ints2, ints3);
 
-        _mm_store_si128((__m128i*)&dst[i], shorts0);
-        _mm_store_si128((__m128i*)&dst[i + 8], shorts1);
+        _mm_store_si128((__m128i *)&dst[i], shorts0);
+        _mm_store_si128((__m128i *)&dst[i + 8], shorts1);
     })
 }
 
@@ -477,55 +477,55 @@ static void SDL_TARGETING("sse2") SDL_Convert_F32_to_S32_SSE2(Sint32 *dst, const
         const __m128i ints2 = _mm_xor_si128(_mm_cvttps_epi32(values3), _mm_castps_si128(_mm_cmpge_ps(values3, limit)));
         const __m128i ints3 = _mm_xor_si128(_mm_cvttps_epi32(values4), _mm_castps_si128(_mm_cmpge_ps(values4, limit)));
 
-        _mm_store_si128((__m128i*)&dst[i], ints0);
-        _mm_store_si128((__m128i*)&dst[i + 4], ints1);
-        _mm_store_si128((__m128i*)&dst[i + 8], ints2);
-        _mm_store_si128((__m128i*)&dst[i + 12], ints3);
+        _mm_store_si128((__m128i *)&dst[i], ints0);
+        _mm_store_si128((__m128i *)&dst[i + 4], ints1);
+        _mm_store_si128((__m128i *)&dst[i + 8], ints2);
+        _mm_store_si128((__m128i *)&dst[i + 12], ints3);
     })
 }
 #endif
 
 // FIXME: SDL doesn't have SSSE3 detection, so use the next one up
 #ifdef SDL_SSE4_1_INTRINSICS
-static void SDL_TARGETING("ssse3") SDL_Convert_Swap16_SSSE3(Uint16* dst, const Uint16* src, int num_samples)
+static void SDL_TARGETING("ssse3") SDL_Convert_Swap16_SSSE3(Uint16 *dst, const Uint16 *src, int num_samples)
 {
     const __m128i shuffle = _mm_set_epi8(14, 15, 12, 13, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3, 0, 1);
 
     CONVERT_16_FWD({
         dst[i] = SDL_Swap16(src[i]);
     }, {
-        __m128i ints0 = _mm_loadu_si128((const __m128i*)&src[i]);
-        __m128i ints1 = _mm_loadu_si128((const __m128i*)&src[i + 8]);
+        __m128i ints0 = _mm_loadu_si128((const __m128i *)&src[i]);
+        __m128i ints1 = _mm_loadu_si128((const __m128i *)&src[i + 8]);
 
         ints0 = _mm_shuffle_epi8(ints0, shuffle);
         ints1 = _mm_shuffle_epi8(ints1, shuffle);
 
-        _mm_store_si128((__m128i*)&dst[i], ints0);
-        _mm_store_si128((__m128i*)&dst[i + 8], ints1);
+        _mm_store_si128((__m128i *)&dst[i], ints0);
+        _mm_store_si128((__m128i *)&dst[i + 8], ints1);
     })
 }
 
-static void SDL_TARGETING("ssse3") SDL_Convert_Swap32_SSSE3(Uint32* dst, const Uint32* src, int num_samples)
+static void SDL_TARGETING("ssse3") SDL_Convert_Swap32_SSSE3(Uint32 *dst, const Uint32 *src, int num_samples)
 {
     const __m128i shuffle = _mm_set_epi8(12, 13, 14, 15, 8, 9, 10, 11, 4, 5, 6, 7, 0, 1, 2, 3);
 
     CONVERT_16_FWD({
         dst[i] = SDL_Swap32(src[i]);
     }, {
-        __m128i ints0 = _mm_loadu_si128((const __m128i*)&src[i]);
-        __m128i ints1 = _mm_loadu_si128((const __m128i*)&src[i + 4]);
-        __m128i ints2 = _mm_loadu_si128((const __m128i*)&src[i + 8]);
-        __m128i ints3 = _mm_loadu_si128((const __m128i*)&src[i + 12]);
+        __m128i ints0 = _mm_loadu_si128((const __m128i *)&src[i]);
+        __m128i ints1 = _mm_loadu_si128((const __m128i *)&src[i + 4]);
+        __m128i ints2 = _mm_loadu_si128((const __m128i *)&src[i + 8]);
+        __m128i ints3 = _mm_loadu_si128((const __m128i *)&src[i + 12]);
 
         ints0 = _mm_shuffle_epi8(ints0, shuffle);
         ints1 = _mm_shuffle_epi8(ints1, shuffle);
         ints2 = _mm_shuffle_epi8(ints2, shuffle);
         ints3 = _mm_shuffle_epi8(ints3, shuffle);
 
-        _mm_store_si128((__m128i*)&dst[i], ints0);
-        _mm_store_si128((__m128i*)&dst[i + 4], ints1);
-        _mm_store_si128((__m128i*)&dst[i + 8], ints2);
-        _mm_store_si128((__m128i*)&dst[i + 12], ints3);
+        _mm_store_si128((__m128i *)&dst[i], ints0);
+        _mm_store_si128((__m128i *)&dst[i + 4], ints1);
+        _mm_store_si128((__m128i *)&dst[i + 8], ints2);
+        _mm_store_si128((__m128i *)&dst[i + 12], ints3);
     })
 }
 #endif
@@ -774,41 +774,41 @@ static void SDL_Convert_F32_to_S32_NEON(Sint32 *dst, const float *src, int num_s
     fesetenv(&fenv);
 }
 
-static void SDL_Convert_Swap16_NEON(Uint16* dst, const Uint16* src, int num_samples)
+static void SDL_Convert_Swap16_NEON(Uint16 *dst, const Uint16 *src, int num_samples)
 {
     CONVERT_16_FWD({
         dst[i] = SDL_Swap16(src[i]);
     }, {
-        uint8x16_t ints0 = vld1q_u8((const Uint8*)&src[i]);
-        uint8x16_t ints1 = vld1q_u8((const Uint8*)&src[i + 8]);
+        uint8x16_t ints0 = vld1q_u8((const Uint8 *)&src[i]);
+        uint8x16_t ints1 = vld1q_u8((const Uint8 *)&src[i + 8]);
 
         ints0 = vrev16q_u8(ints0);
         ints1 = vrev16q_u8(ints1);
 
-        vst1q_u8((Uint8*)&dst[i], ints0);
-        vst1q_u8((Uint8*)&dst[i + 8], ints1);
+        vst1q_u8((Uint8 *)&dst[i], ints0);
+        vst1q_u8((Uint8 *)&dst[i + 8], ints1);
     })
 }
 
-static void SDL_Convert_Swap32_NEON(Uint32* dst, const Uint32* src, int num_samples)
+static void SDL_Convert_Swap32_NEON(Uint32 *dst, const Uint32 *src, int num_samples)
 {
     CONVERT_16_FWD({
         dst[i] = SDL_Swap32(src[i]);
     }, {
-        uint8x16_t ints0 = vld1q_u8((const Uint8*)&src[i]);
-        uint8x16_t ints1 = vld1q_u8((const Uint8*)&src[i + 4]);
-        uint8x16_t ints2 = vld1q_u8((const Uint8*)&src[i + 8]);
-        uint8x16_t ints3 = vld1q_u8((const Uint8*)&src[i + 12]);
+        uint8x16_t ints0 = vld1q_u8((const Uint8 *)&src[i]);
+        uint8x16_t ints1 = vld1q_u8((const Uint8 *)&src[i + 4]);
+        uint8x16_t ints2 = vld1q_u8((const Uint8 *)&src[i + 8]);
+        uint8x16_t ints3 = vld1q_u8((const Uint8 *)&src[i + 12]);
 
         ints0 = vrev32q_u8(ints0);
         ints1 = vrev32q_u8(ints1);
         ints2 = vrev32q_u8(ints2);
         ints3 = vrev32q_u8(ints3);
 
-        vst1q_u8((Uint8*)&dst[i], ints0);
-        vst1q_u8((Uint8*)&dst[i + 4], ints1);
-        vst1q_u8((Uint8*)&dst[i + 8], ints2);
-        vst1q_u8((Uint8*)&dst[i + 12], ints3);
+        vst1q_u8((Uint8 *)&dst[i], ints0);
+        vst1q_u8((Uint8 *)&dst[i + 4], ints1);
+        vst1q_u8((Uint8 *)&dst[i + 8], ints2);
+        vst1q_u8((Uint8 *)&dst[i + 12], ints3);
     })
 }
 
@@ -839,8 +839,8 @@ static void (*SDL_Convert_F32_to_U8)(Uint8 *dst, const float *src, int num_sampl
 static void (*SDL_Convert_F32_to_S16)(Sint16 *dst, const float *src, int num_samples) = NULL;
 static void (*SDL_Convert_F32_to_S32)(Sint32 *dst, const float *src, int num_samples) = NULL;
 
-static void (*SDL_Convert_Swap16)(Uint16* dst, const Uint16* src, int num_samples) = NULL;
-static void (*SDL_Convert_Swap32)(Uint32* dst, const Uint32* src, int num_samples) = NULL;
+static void (*SDL_Convert_Swap16)(Uint16 *dst, const Uint16 *src, int num_samples) = NULL;
+static void (*SDL_Convert_Swap32)(Uint32 *dst, const Uint32 *src, int num_samples) = NULL;
 
 void ConvertAudioToFloat(float *dst, const void *src, int num_samples, SDL_AudioFormat src_fmt)
 {
@@ -858,7 +858,7 @@ void ConvertAudioToFloat(float *dst, const void *src, int num_samples, SDL_Audio
             break;
 
         case SDL_AUDIO_S16 ^ SDL_AUDIO_MASK_BIG_ENDIAN:
-            SDL_Convert_Swap16((Uint16*) dst, (const Uint16*) src, num_samples);
+            SDL_Convert_Swap16((Uint16 *)dst, (const Uint16 *)src, num_samples);
             SDL_Convert_S16_to_F32(dst, (const Sint16 *) dst, num_samples);
             break;
 
@@ -867,12 +867,12 @@ void ConvertAudioToFloat(float *dst, const void *src, int num_samples, SDL_Audio
             break;
 
         case SDL_AUDIO_S32 ^ SDL_AUDIO_MASK_BIG_ENDIAN:
-            SDL_Convert_Swap32((Uint32*) dst, (const Uint32*) src, num_samples);
+            SDL_Convert_Swap32((Uint32 *)dst, (const Uint32 *)src, num_samples);
             SDL_Convert_S32_to_F32(dst, (const Sint32 *) dst, num_samples);
             break;
 
         case SDL_AUDIO_F32 ^ SDL_AUDIO_MASK_BIG_ENDIAN:
-            SDL_Convert_Swap32((Uint32*) dst, (const Uint32*) src, num_samples);
+            SDL_Convert_Swap32((Uint32 *)dst, (const Uint32 *)src, num_samples);
             break;
 
         default: SDL_assert(!"Unexpected audio format!"); break;
@@ -896,7 +896,7 @@ void ConvertAudioFromFloat(void *dst, const float *src, int num_samples, SDL_Aud
 
         case SDL_AUDIO_S16 ^ SDL_AUDIO_MASK_BIG_ENDIAN:
             SDL_Convert_F32_to_S16((Sint16 *) dst, src, num_samples);
-            SDL_Convert_Swap16((Uint16*) dst, (const Uint16*) dst, num_samples);
+            SDL_Convert_Swap16((Uint16 *)dst, (const Uint16 *)dst, num_samples);
             break;
 
         case SDL_AUDIO_S32:
@@ -905,22 +905,22 @@ void ConvertAudioFromFloat(void *dst, const float *src, int num_samples, SDL_Aud
 
         case SDL_AUDIO_S32 ^ SDL_AUDIO_MASK_BIG_ENDIAN:
             SDL_Convert_F32_to_S32((Sint32 *) dst, src, num_samples);
-            SDL_Convert_Swap32((Uint32*) dst, (const Uint32*) dst, num_samples);
+            SDL_Convert_Swap32((Uint32 *)dst, (const Uint32 *)dst, num_samples);
             break;
 
         case SDL_AUDIO_F32 ^ SDL_AUDIO_MASK_BIG_ENDIAN:
-            SDL_Convert_Swap32((Uint32*) dst, (const Uint32*) src, num_samples);
+            SDL_Convert_Swap32((Uint32 *)dst, (const Uint32 *)src, num_samples);
             break;
 
         default: SDL_assert(!"Unexpected audio format!"); break;
     }
 }
 
-void ConvertAudioSwapEndian(void* dst, const void* src, int num_samples, int bitsize)
+void ConvertAudioSwapEndian(void *dst, const void *src, int num_samples, int bitsize)
 {
     switch (bitsize) {
-        case 16: SDL_Convert_Swap16((Uint16*) dst, (const Uint16*) src, num_samples); break;
-        case 32: SDL_Convert_Swap32((Uint32*) dst, (const Uint32*) src, num_samples); break;
+        case 16: SDL_Convert_Swap16((Uint16 *)dst, (const Uint16 *)src, num_samples); break;
+        case 32: SDL_Convert_Swap32((Uint32 *)dst, (const Uint32 *)src, num_samples); break;
         default: SDL_assert(!"Unexpected audio format!"); break;
     }
 }
diff --git a/src/audio/SDL_sysaudio.h b/src/audio/SDL_sysaudio.h
index ad1ea7e2ae61c..603eaab197056 100644
--- a/src/audio/SDL_sysaudio.h
+++ b/src/audio/SDL_sysaudio.h
@@ -112,7 +112,7 @@ extern void SDL_AudioThreadFinalize(SDL_AudioDevice *device);
 
 extern void ConvertAudioToFloat(float *dst, const void *src, int num_samples, SDL_AudioFormat src_fmt);
 extern void ConvertAudioFromFloat(void *dst, const float *src, int num_samples, SDL_AudioFormat dst_fmt);
-extern void ConvertAudioSwapEndian(void* dst, const void* src, int num_samples, int bitsize);
+extern void ConvertAudioSwapEndian(void *dst, const void *src, int num_samples, int bitsize);
 
 extern bool SDL_ChannelMapIsDefault(const int *map, int channels);
 extern bool SDL_ChannelMapIsBogus(const int *map, int channels);
@@ -121,7 +121,7 @@ extern bool SDL_ChannelMapIsBogus(const int *map, int channels);
 extern void ConvertAudio(int num_frames,
                          const void *src, SDL_AudioFormat src_format, int src_channels, const int *src_map,
                          void *dst, SDL_AudioFormat dst_format, int dst_channels, const int *dst_map,
-                         void* scratch, float gain);
+                         void *scratch, float gain);
 
 // Compare two SDL_AudioSpecs, return true if they match exactly.
 // Using SDL_memcmp directly isn't safe, since potential padding might not be initialized.
@@ -201,7 +201,7 @@ struct SDL_AudioQueue; // forward decl.
 
 struct SDL_AudioStream
 {
-    SDL_Mutex* lock;
+    SDL_Mutex *lock;
 
     SDL_PropertiesID props;
 
@@ -217,7 +217,7 @@ struct SDL_AudioStream
     float freq_ratio;
     float gain;
 
-    struct SDL_AudioQueue* queue;
+    struct SDL_AudioQueue *queue;
 
     SDL_AudioSpec input_spec; // The spec of input data currently being processed
     int *input_chmap;
diff --git a/src/audio/alsa/SDL_alsa_audio.c b/src/audio/alsa/SDL_alsa_audio.c
index 026b9bde5569c..da4a42a8d3e43 100644
--- a/src/audio/alsa/SDL_alsa_audio.c
+++ b/src/audio/alsa/SDL_alsa_audio.c
@@ -87,7 +87,7 @@ static int (*ALSA_snd_device_name_free_hint)(void **);
 static snd_pcm_sframes_t (*ALSA_snd_pcm_avail)(snd_pcm_t *);
 static size_t (*ALSA_snd_ctl_card_info_sizeof)(void);
 static size_t (*ALSA_snd_pcm_info_sizeof)(void);
-static int (*ALSA_snd_card_next)(int*);
+static int (*ALSA_snd_card_next)(int *);
 static int (*ALSA_snd_ctl_open)(snd_ctl_t **,const char *,int);
 static int (*ALSA_snd_ctl_close)(snd_ctl_t *);
 static int (*ALSA_snd_ctl_card_info)(snd_ctl_t *, snd_ctl_card_info_t *);
@@ -670,7 +670,7 @@ static void swizzle_map_compute(const struct ALSA_pcm_cfg_ctx *ctx, int *swizzle
 static int alsa_chmap_install(struct ALSA_pcm_cfg_ctx *ctx, const unsigned int *chmap)
 {
     bool isstack;
-    snd_pcm_chmap_t *chmap_to_install = (snd_pcm_chmap_t*)SDL_small_alloc(unsigned int, 1 + ctx->chans_n, &isstack);
+    snd_pcm_chmap_t *chmap_to_install = (snd_pcm_chmap_t *)SDL_small_alloc(unsigned int, 1 + ctx->chans_n, &isstack);
     if (!chmap_to_install) {
         return -1;
     }
@@ -1214,7 +1214,7 @@ static int hotplug_device_process(snd_ctl_t *ctl, snd_ctl_card_info_t *ctl_card_
     unsigned int subdev_idx = 0;
     const bool recording = direction == SND_PCM_STREAM_CAPTURE ? true : false; // used for the unicity of the device
     bool isstack;
-    snd_pcm_info_t *pcm_info = (snd_pcm_info_t*)SDL_small_alloc(Uint8, ALSA_snd_pcm_info_sizeof(), &isstack);
+    snd_pcm_info_t *pcm_info = (snd_pcm_info_t *)SDL_small_alloc(Uint8, ALSA_snd_pcm_info_sizeof(), &isstack);
     SDL_memset(pcm_info, 0, ALSA_snd_pcm_info_sizeof());
 
     while (true) {
@@ -1453,10 +1453,10 @@ static void ALSA_DetectDevices(SDL_AudioDevice **default_playback, SDL_AudioDevi
     bool has_default_playback = false, has_default_recording = false;
     ALSA_HotplugIteration(&has_default_playback, &has_default_recording); // run once now before a thread continues to check.
     if (has_default_playback) {
-        *default_playback = SDL_AddAudioDevice(/*recording=*/false, "ALSA default playback device", NULL, (void*)&default_playback_handle);
+        *default_playback = SDL_AddAudioDevice(/*recording=*/false, "ALSA default playback device", NULL, (void *)&default_playback_handle);
     }
     if (has_default_recording) {
-        *default_recording = SDL_AddAudioDevice(/*recording=*/true, "ALSA default recording device", NULL, (void*)&default_recording_handle);
+        *default_recording = SDL_AddAudioDevice(/*recording=*/true, "ALSA default recording device", NULL, (void *)&default_recording_handle);
     }
 
 #if SDL_ALSA_HOTPLUG_THREAD
diff --git a/src/audio/emscripten/SDL_emscriptenaudio.c b/src/audio/emscripten/SDL_emscriptenaudio.c
index 46b8b7645bf1b..4be919104ff0f 100644
--- a/src/audio/emscripten/SDL_emscriptenaudio.c
+++ b/src/audio/emscripten/SDL_emscriptenaudio.c
@@ -56,7 +56,7 @@ static bool EMSCRIPTENAUDIO_PlayDevice(SDL_AudioDevice *device, const Uint8 *buf
        

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