Browse Source

Use C++ style comments consistently in SDL source code

Implemented using this script:

find . -type f -exec sed -i'' -e 's,/\* *\([^*]*\)\*/ *$,// \1,' -e 's, \+$,,' {} \;
git checkout \
    core/linux/SDL_evdev_kbd_default_keymap.h \
    events/imKStoUCS.* \
    hidapi \
    joystick/controller_type.c \
    joystick/controller_type.h \
    joystick/hidapi/steam/controller_constants.h \
    joystick/hidapi/steam/controller_structs.h \
    joystick/SDL_gamepad_db.h \
    libm \
    render/*/*Shader*.h \
    render/vitagxm/SDL_render_vita_gxm_shaders.h \
    render/metal/SDL_shaders_metal_*.h \
    stdlib/SDL_malloc.c \
    stdlib/SDL_qsort.c \
    stdlib/SDL_strtokr.c \
    test/ \
    video/directx/SDL_d3d12_xbox_cmacros.h \
    video/directx/d3d12.h \
    video/directx/d3d12sdklayers.h \
    video/khronos \
    video/x11/edid-parse.c \
    video/x11/xsettings-client.* \
    video/yuv2rgb
sed -i'' -e 's,/\* *\([^*]*\)\*/ *$,// \1,' -e 's, \+$,,' hidapi/SDL_hidapi.c
Sam Lantinga 1 year ago
parent
commit
6501e90018
100 changed files with 1198 additions and 1198 deletions
  1. 44 44
      src/SDL.c
  2. 32 32
      src/SDL_assert.c
  3. 1 1
      src/SDL_assert_c.h
  4. 3 3
      src/SDL_error.c
  5. 2 2
      src/SDL_error_c.h
  6. 7 7
      src/SDL_guid.c
  7. 2 2
      src/SDL_hashtable.h
  8. 2 2
      src/SDL_hints_c.h
  9. 14 14
      src/SDL_internal.h
  10. 3 3
      src/SDL_list.c
  11. 1 1
      src/SDL_list.h
  12. 35 35
      src/SDL_log.c
  13. 2 2
      src/SDL_log_c.h
  14. 2 2
      src/SDL_properties.c
  15. 13 13
      src/SDL_utils.c
  16. 3 3
      src/SDL_utils_c.h
  17. 9 9
      src/atomic/SDL_atomic.c
  18. 12 12
      src/atomic/SDL_spinlock.c
  19. 1 1
      src/audio/SDL_audio.c
  20. 1 1
      src/audio/SDL_audio_c.h
  21. 1 1
      src/audio/SDL_audio_channel_converters.h
  22. 124 124
      src/audio/SDL_wave.c
  23. 35 35
      src/audio/SDL_wave.h
  24. 1 1
      src/audio/coreaudio/SDL_coreaudio.m
  25. 2 2
      src/audio/emscripten/SDL_emscriptenaudio.c
  26. 2 2
      src/audio/netbsd/SDL_netbsdaudio.c
  27. 1 1
      src/audio/wasapi/SDL_wasapi.c
  28. 2 2
      src/camera/emscripten/SDL_camera_emscripten.c
  29. 4 4
      src/camera/mediafoundation/SDL_camera_mediafoundation.c
  30. 5 5
      src/core/SDL_core_unsupported.c
  31. 134 134
      src/core/android/SDL_android.c
  32. 21 21
      src/core/android/SDL_android.h
  33. 25 25
      src/core/freebsd/SDL_evdev_kbd_default_keyaccmap.h
  34. 44 44
      src/core/freebsd/SDL_evdev_kbd_freebsd.c
  35. 8 8
      src/core/gdk/SDL_gdk.cpp
  36. 1 1
      src/core/gdk/SDL_gdk.h
  37. 31 31
      src/core/haiku/SDL_BApp.h
  38. 17 17
      src/core/haiku/SDL_BeApp.cc
  39. 4 4
      src/core/haiku/SDL_BeApp.h
  40. 25 25
      src/core/linux/SDL_dbus.c
  41. 4 4
      src/core/linux/SDL_dbus.h
  42. 41 41
      src/core/linux/SDL_evdev.c
  43. 2 2
      src/core/linux/SDL_evdev.h
  44. 16 16
      src/core/linux/SDL_evdev_capabilities.c
  45. 3 3
      src/core/linux/SDL_evdev_capabilities.h
  46. 36 36
      src/core/linux/SDL_evdev_kbd.c
  47. 1 1
      src/core/linux/SDL_evdev_kbd.h
  48. 14 14
      src/core/linux/SDL_fcitx.c
  49. 1 1
      src/core/linux/SDL_fcitx.h
  50. 17 17
      src/core/linux/SDL_ibus.c
  51. 4 4
      src/core/linux/SDL_ibus.h
  52. 5 5
      src/core/linux/SDL_ime.c
  53. 1 1
      src/core/linux/SDL_ime.h
  54. 2 2
      src/core/linux/SDL_sandbox.h
  55. 2 2
      src/core/linux/SDL_system_theme.c
  56. 1 1
      src/core/linux/SDL_system_theme.h
  57. 14 14
      src/core/linux/SDL_threadprio.c
  58. 12 12
      src/core/linux/SDL_udev.c
  59. 3 3
      src/core/linux/SDL_udev.h
  60. 39 39
      src/core/openbsd/SDL_wscons_kbd.c
  61. 6 6
      src/core/openbsd/SDL_wscons_mouse.c
  62. 3 3
      src/core/unix/SDL_appid.c
  63. 1 1
      src/core/unix/SDL_appid.h
  64. 4 4
      src/core/unix/SDL_poll.c
  65. 1 1
      src/core/unix/SDL_poll.h
  66. 8 8
      src/core/windows/SDL_directx.h
  67. 4 4
      src/core/windows/SDL_hid.c
  68. 2 2
      src/core/windows/SDL_hid.h
  69. 14 14
      src/core/windows/SDL_immdevice.c
  70. 1 1
      src/core/windows/SDL_immdevice.h
  71. 24 24
      src/core/windows/SDL_windows.c
  72. 26 26
      src/core/windows/SDL_windows.h
  73. 11 11
      src/core/windows/SDL_xinput.c
  74. 24 24
      src/core/windows/SDL_xinput.h
  75. 1 1
      src/core/winrt/SDL_winrtapp_common.cpp
  76. 5 5
      src/core/winrt/SDL_winrtapp_direct3d.cpp
  77. 3 3
      src/core/winrt/SDL_winrtapp_xaml.cpp
  78. 39 39
      src/cpuinfo/SDL_cpuinfo.c
  79. 1 1
      src/cpuinfo/SDL_cpuinfo_c.h
  80. 6 6
      src/dialog/SDL_dialog_utils.c
  81. 7 7
      src/dialog/SDL_dialog_utils.h
  82. 2 2
      src/dialog/android/SDL_androiddialog.c
  83. 2 2
      src/dialog/cocoa/SDL_cocoadialog.m
  84. 15 15
      src/dialog/unix/SDL_portaldialog.c
  85. 7 7
      src/dialog/unix/SDL_unixdialog.c
  86. 9 9
      src/dialog/unix/SDL_zenitydialog.c
  87. 12 12
      src/dialog/windows/SDL_windowsdialog.c
  88. 35 35
      src/dynapi/SDL_dynapi.c
  89. 12 12
      src/dynapi/SDL_dynapi.h
  90. 1 1
      src/dynapi/SDL_dynapi.sym
  91. 2 2
      src/dynapi/SDL_dynapi_overrides.h
  92. 2 2
      src/dynapi/SDL_dynapi_procs.h
  93. 1 1
      src/dynapi/gendynapi.py
  94. 3 3
      src/events/SDL_categories.c
  95. 1 1
      src/events/SDL_categories_c.h
  96. 2 2
      src/events/SDL_clipboardevents.c
  97. 1 1
      src/events/SDL_clipboardevents_c.h
  98. 2 2
      src/events/SDL_displayevents.c
  99. 1 1
      src/events/SDL_displayevents_c.h
  100. 3 3
      src/events/SDL_dropevents.c

+ 44 - 44
src/SDL.c

@@ -24,17 +24,17 @@
 #if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
 #if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
 #include "core/windows/SDL_windows.h"
 #include "core/windows/SDL_windows.h"
 #elif !defined(SDL_PLATFORM_WINRT)
 #elif !defined(SDL_PLATFORM_WINRT)
-#include <unistd.h> /* _exit(), etc. */
+#include <unistd.h> // _exit(), etc.
 #endif
 #endif
 
 
-/* this checks for HAVE_DBUS_DBUS_H internally. */
+// this checks for HAVE_DBUS_DBUS_H internally.
 #include "core/linux/SDL_dbus.h"
 #include "core/linux/SDL_dbus.h"
 
 
 #ifdef SDL_PLATFORM_EMSCRIPTEN
 #ifdef SDL_PLATFORM_EMSCRIPTEN
 #include <emscripten.h>
 #include <emscripten.h>
 #endif
 #endif
 
 
-/* Initialization code for SDL */
+// Initialization code for SDL
 
 
 #include "SDL_assert_c.h"
 #include "SDL_assert_c.h"
 #include "SDL_hints_c.h"
 #include "SDL_hints_c.h"
@@ -56,7 +56,7 @@
 
 
 #define SDL_INIT_EVERYTHING ~0U
 #define SDL_INIT_EVERYTHING ~0U
 
 
-/* Initialization/Cleanup routines */
+// Initialization/Cleanup routines
 #include "timer/SDL_timer_c.h"
 #include "timer/SDL_timer_c.h"
 #ifdef SDL_VIDEO_DRIVER_WINDOWS
 #ifdef SDL_VIDEO_DRIVER_WINDOWS
 extern int SDL_HelperWindowCreate(void);
 extern int SDL_HelperWindowCreate(void);
@@ -72,7 +72,7 @@ SDL_COMPILE_TIME_ASSERT(SDL_BUILD_MICRO_VERSION,
                         SDL_MICRO_VERSION == SDL_BUILD_MICRO_VERSION);
                         SDL_MICRO_VERSION == SDL_BUILD_MICRO_VERSION);
 #endif
 #endif
 
 
-/* Limited by its encoding in SDL_VERSIONNUM */
+// Limited by its encoding in SDL_VERSIONNUM
 SDL_COMPILE_TIME_ASSERT(SDL_MAJOR_VERSION_min, SDL_MAJOR_VERSION >= 0);
 SDL_COMPILE_TIME_ASSERT(SDL_MAJOR_VERSION_min, SDL_MAJOR_VERSION >= 0);
 SDL_COMPILE_TIME_ASSERT(SDL_MAJOR_VERSION_max, SDL_MAJOR_VERSION <= 10);
 SDL_COMPILE_TIME_ASSERT(SDL_MAJOR_VERSION_max, SDL_MAJOR_VERSION <= 10);
 SDL_COMPILE_TIME_ASSERT(SDL_MINOR_VERSION_min, SDL_MINOR_VERSION >= 0);
 SDL_COMPILE_TIME_ASSERT(SDL_MINOR_VERSION_min, SDL_MINOR_VERSION >= 0);
@@ -95,19 +95,19 @@ SDL_NORETURN void SDL_ExitProcess(int exitcode)
        ExitProcess here that will never be reached but make MingW happy. */
        ExitProcess here that will never be reached but make MingW happy. */
     ExitProcess(exitcode);
     ExitProcess(exitcode);
 #elif defined(SDL_PLATFORM_EMSCRIPTEN)
 #elif defined(SDL_PLATFORM_EMSCRIPTEN)
-    emscripten_cancel_main_loop();   /* this should "kill" the app. */
-    emscripten_force_exit(exitcode); /* this should "kill" the app. */
+    emscripten_cancel_main_loop();   // this should "kill" the app.
+    emscripten_force_exit(exitcode); // this should "kill" the app.
     exit(exitcode);
     exit(exitcode);
-#elif defined(SDL_PLATFORM_HAIKU)  /* Haiku has _Exit, but it's not marked noreturn. */
+#elif defined(SDL_PLATFORM_HAIKU)  // Haiku has _Exit, but it's not marked noreturn.
     _exit(exitcode);
     _exit(exitcode);
-#elif defined(HAVE__EXIT) /* Upper case _Exit() */
+#elif defined(HAVE__EXIT) // Upper case _Exit()
     _Exit(exitcode);
     _Exit(exitcode);
 #else
 #else
     _exit(exitcode);
     _exit(exitcode);
 #endif
 #endif
 }
 }
 
 
-/* App metadata */
+// App metadata
 
 
 int SDL_SetAppMetadata(const char *appname, const char *appversion, const char *appidentifier)
 int SDL_SetAppMetadata(const char *appname, const char *appversion, const char *appidentifier)
 {
 {
@@ -171,7 +171,7 @@ const char *SDL_GetAppMetadataProperty(const char *name)
 }
 }
 
 
 
 
-/* The initialized subsystems */
+// The initialized subsystems
 #ifdef SDL_MAIN_NEEDED
 #ifdef SDL_MAIN_NEEDED
 static SDL_bool SDL_MainIsReady = SDL_FALSE;
 static SDL_bool SDL_MainIsReady = SDL_FALSE;
 #else
 #else
@@ -180,7 +180,7 @@ static SDL_bool SDL_MainIsReady = SDL_TRUE;
 static SDL_bool SDL_bInMainQuit = SDL_FALSE;
 static SDL_bool SDL_bInMainQuit = SDL_FALSE;
 static Uint8 SDL_SubsystemRefCount[32];
 static Uint8 SDL_SubsystemRefCount[32];
 
 
-/* Private helper to increment a subsystem's ref counter. */
+// Private helper to increment a subsystem's ref counter.
 static void SDL_IncrementSubsystemRefCount(Uint32 subsystem)
 static void SDL_IncrementSubsystemRefCount(Uint32 subsystem)
 {
 {
     const int subsystem_index = SDL_MostSignificantBitIndex32(subsystem);
     const int subsystem_index = SDL_MostSignificantBitIndex32(subsystem);
@@ -190,7 +190,7 @@ static void SDL_IncrementSubsystemRefCount(Uint32 subsystem)
     }
     }
 }
 }
 
 
-/* Private helper to decrement a subsystem's ref counter. */
+// Private helper to decrement a subsystem's ref counter.
 static void SDL_DecrementSubsystemRefCount(Uint32 subsystem)
 static void SDL_DecrementSubsystemRefCount(Uint32 subsystem)
 {
 {
     const int subsystem_index = SDL_MostSignificantBitIndex32(subsystem);
     const int subsystem_index = SDL_MostSignificantBitIndex32(subsystem);
@@ -203,7 +203,7 @@ static void SDL_DecrementSubsystemRefCount(Uint32 subsystem)
     }
     }
 }
 }
 
 
-/* Private helper to check if a system needs init. */
+// Private helper to check if a system needs init.
 static SDL_bool SDL_ShouldInitSubsystem(Uint32 subsystem)
 static SDL_bool SDL_ShouldInitSubsystem(Uint32 subsystem)
 {
 {
     const int subsystem_index = SDL_MostSignificantBitIndex32(subsystem);
     const int subsystem_index = SDL_MostSignificantBitIndex32(subsystem);
@@ -211,7 +211,7 @@ static SDL_bool SDL_ShouldInitSubsystem(Uint32 subsystem)
     return ((subsystem_index >= 0) && (SDL_SubsystemRefCount[subsystem_index] == 0));
     return ((subsystem_index >= 0) && (SDL_SubsystemRefCount[subsystem_index] == 0));
 }
 }
 
 
-/* Private helper to check if a system needs to be quit. */
+// Private helper to check if a system needs to be quit.
 static SDL_bool SDL_ShouldQuitSubsystem(Uint32 subsystem)
 static SDL_bool SDL_ShouldQuitSubsystem(Uint32 subsystem)
 {
 {
     const int subsystem_index = SDL_MostSignificantBitIndex32(subsystem);
     const int subsystem_index = SDL_MostSignificantBitIndex32(subsystem);
@@ -246,7 +246,7 @@ void SDL_SetMainReady(void)
     SDL_MainIsReady = SDL_TRUE;
     SDL_MainIsReady = SDL_TRUE;
 }
 }
 
 
-/* Initialize all the subsystems that require initialization before threads start */
+// Initialize all the subsystems that require initialization before threads start
 void SDL_InitMainThread(void)
 void SDL_InitMainThread(void)
 {
 {
     SDL_InitTLSData();
     SDL_InitTLSData();
@@ -290,7 +290,7 @@ int SDL_InitSubSystem(SDL_InitFlags flags)
     }
     }
 #endif
 #endif
 
 
-    /* Initialize the event subsystem */
+    // Initialize the event subsystem
     if (flags & SDL_INIT_EVENTS) {
     if (flags & SDL_INIT_EVENTS) {
         if (SDL_ShouldInitSubsystem(SDL_INIT_EVENTS)) {
         if (SDL_ShouldInitSubsystem(SDL_INIT_EVENTS)) {
             SDL_IncrementSubsystemRefCount(SDL_INIT_EVENTS);
             SDL_IncrementSubsystemRefCount(SDL_INIT_EVENTS);
@@ -304,7 +304,7 @@ int SDL_InitSubSystem(SDL_InitFlags flags)
         flags_initialized |= SDL_INIT_EVENTS;
         flags_initialized |= SDL_INIT_EVENTS;
     }
     }
 
 
-    /* Initialize the timer subsystem */
+    // Initialize the timer subsystem
     if (flags & SDL_INIT_TIMER) {
     if (flags & SDL_INIT_TIMER) {
         if (SDL_ShouldInitSubsystem(SDL_INIT_TIMER)) {
         if (SDL_ShouldInitSubsystem(SDL_INIT_TIMER)) {
             SDL_IncrementSubsystemRefCount(SDL_INIT_TIMER);
             SDL_IncrementSubsystemRefCount(SDL_INIT_TIMER);
@@ -318,11 +318,11 @@ int SDL_InitSubSystem(SDL_InitFlags flags)
         flags_initialized |= SDL_INIT_TIMER;
         flags_initialized |= SDL_INIT_TIMER;
     }
     }
 
 
-    /* Initialize the video subsystem */
+    // Initialize the video subsystem
     if (flags & SDL_INIT_VIDEO) {
     if (flags & SDL_INIT_VIDEO) {
 #ifndef SDL_VIDEO_DISABLED
 #ifndef SDL_VIDEO_DISABLED
         if (SDL_ShouldInitSubsystem(SDL_INIT_VIDEO)) {
         if (SDL_ShouldInitSubsystem(SDL_INIT_VIDEO)) {
-            /* video implies events */
+            // video implies events
             if (!SDL_InitOrIncrementSubsystem(SDL_INIT_EVENTS)) {
             if (!SDL_InitOrIncrementSubsystem(SDL_INIT_EVENTS)) {
                 goto quit_and_error;
                 goto quit_and_error;
             }
             }
@@ -342,11 +342,11 @@ int SDL_InitSubSystem(SDL_InitFlags flags)
 #endif
 #endif
     }
     }
 
 
-    /* Initialize the audio subsystem */
+    // Initialize the audio subsystem
     if (flags & SDL_INIT_AUDIO) {
     if (flags & SDL_INIT_AUDIO) {
 #ifndef SDL_AUDIO_DISABLED
 #ifndef SDL_AUDIO_DISABLED
         if (SDL_ShouldInitSubsystem(SDL_INIT_AUDIO)) {
         if (SDL_ShouldInitSubsystem(SDL_INIT_AUDIO)) {
-            /* audio implies events */
+            // audio implies events
             if (!SDL_InitOrIncrementSubsystem(SDL_INIT_EVENTS)) {
             if (!SDL_InitOrIncrementSubsystem(SDL_INIT_EVENTS)) {
                 goto quit_and_error;
                 goto quit_and_error;
             }
             }
@@ -366,11 +366,11 @@ int SDL_InitSubSystem(SDL_InitFlags flags)
 #endif
 #endif
     }
     }
 
 
-    /* Initialize the joystick subsystem */
+    // Initialize the joystick subsystem
     if (flags & SDL_INIT_JOYSTICK) {
     if (flags & SDL_INIT_JOYSTICK) {
 #ifndef SDL_JOYSTICK_DISABLED
 #ifndef SDL_JOYSTICK_DISABLED
         if (SDL_ShouldInitSubsystem(SDL_INIT_JOYSTICK)) {
         if (SDL_ShouldInitSubsystem(SDL_INIT_JOYSTICK)) {
-            /* joystick implies events */
+            // joystick implies events
             if (!SDL_InitOrIncrementSubsystem(SDL_INIT_EVENTS)) {
             if (!SDL_InitOrIncrementSubsystem(SDL_INIT_EVENTS)) {
                 goto quit_and_error;
                 goto quit_and_error;
             }
             }
@@ -393,7 +393,7 @@ int SDL_InitSubSystem(SDL_InitFlags flags)
     if (flags & SDL_INIT_GAMEPAD) {
     if (flags & SDL_INIT_GAMEPAD) {
 #ifndef SDL_JOYSTICK_DISABLED
 #ifndef SDL_JOYSTICK_DISABLED
         if (SDL_ShouldInitSubsystem(SDL_INIT_GAMEPAD)) {
         if (SDL_ShouldInitSubsystem(SDL_INIT_GAMEPAD)) {
-            /* game controller implies joystick */
+            // game controller implies joystick
             if (!SDL_InitOrIncrementSubsystem(SDL_INIT_JOYSTICK)) {
             if (!SDL_InitOrIncrementSubsystem(SDL_INIT_JOYSTICK)) {
                 goto quit_and_error;
                 goto quit_and_error;
             }
             }
@@ -413,7 +413,7 @@ int SDL_InitSubSystem(SDL_InitFlags flags)
 #endif
 #endif
     }
     }
 
 
-    /* Initialize the haptic subsystem */
+    // Initialize the haptic subsystem
     if (flags & SDL_INIT_HAPTIC) {
     if (flags & SDL_INIT_HAPTIC) {
 #ifndef SDL_HAPTIC_DISABLED
 #ifndef SDL_HAPTIC_DISABLED
         if (SDL_ShouldInitSubsystem(SDL_INIT_HAPTIC)) {
         if (SDL_ShouldInitSubsystem(SDL_INIT_HAPTIC)) {
@@ -432,7 +432,7 @@ int SDL_InitSubSystem(SDL_InitFlags flags)
 #endif
 #endif
     }
     }
 
 
-    /* Initialize the sensor subsystem */
+    // Initialize the sensor subsystem
     if (flags & SDL_INIT_SENSOR) {
     if (flags & SDL_INIT_SENSOR) {
 #ifndef SDL_SENSOR_DISABLED
 #ifndef SDL_SENSOR_DISABLED
         if (SDL_ShouldInitSubsystem(SDL_INIT_SENSOR)) {
         if (SDL_ShouldInitSubsystem(SDL_INIT_SENSOR)) {
@@ -451,11 +451,11 @@ int SDL_InitSubSystem(SDL_InitFlags flags)
 #endif
 #endif
     }
     }
 
 
-    /* Initialize the camera subsystem */
+    // Initialize the camera subsystem
     if (flags & SDL_INIT_CAMERA) {
     if (flags & SDL_INIT_CAMERA) {
 #ifndef SDL_CAMERA_DISABLED
 #ifndef SDL_CAMERA_DISABLED
         if (SDL_ShouldInitSubsystem(SDL_INIT_CAMERA)) {
         if (SDL_ShouldInitSubsystem(SDL_INIT_CAMERA)) {
-            /* camera implies events */
+            // camera implies events
             if (!SDL_InitOrIncrementSubsystem(SDL_INIT_EVENTS)) {
             if (!SDL_InitOrIncrementSubsystem(SDL_INIT_EVENTS)) {
                 goto quit_and_error;
                 goto quit_and_error;
             }
             }
@@ -475,7 +475,7 @@ int SDL_InitSubSystem(SDL_InitFlags flags)
 #endif
 #endif
     }
     }
 
 
-    (void)flags_initialized; /* make static analysis happy, since this only gets used in error cases. */
+    (void)flags_initialized; // make static analysis happy, since this only gets used in error cases.
 
 
     return SDL_ClearError();
     return SDL_ClearError();
 
 
@@ -491,13 +491,13 @@ int SDL_Init(SDL_InitFlags flags)
 
 
 void SDL_QuitSubSystem(SDL_InitFlags flags)
 void SDL_QuitSubSystem(SDL_InitFlags flags)
 {
 {
-    /* Shut down requested initialized subsystems */
+    // Shut down requested initialized subsystems
 
 
 #ifndef SDL_CAMERA_DISABLED
 #ifndef SDL_CAMERA_DISABLED
     if (flags & SDL_INIT_CAMERA) {
     if (flags & SDL_INIT_CAMERA) {
         if (SDL_ShouldQuitSubsystem(SDL_INIT_CAMERA)) {
         if (SDL_ShouldQuitSubsystem(SDL_INIT_CAMERA)) {
             SDL_QuitCamera();
             SDL_QuitCamera();
-            /* camera implies events */
+            // camera implies events
             SDL_QuitSubSystem(SDL_INIT_EVENTS);
             SDL_QuitSubSystem(SDL_INIT_EVENTS);
         }
         }
         SDL_DecrementSubsystemRefCount(SDL_INIT_CAMERA);
         SDL_DecrementSubsystemRefCount(SDL_INIT_CAMERA);
@@ -517,7 +517,7 @@ void SDL_QuitSubSystem(SDL_InitFlags flags)
     if (flags & SDL_INIT_GAMEPAD) {
     if (flags & SDL_INIT_GAMEPAD) {
         if (SDL_ShouldQuitSubsystem(SDL_INIT_GAMEPAD)) {
         if (SDL_ShouldQuitSubsystem(SDL_INIT_GAMEPAD)) {
             SDL_QuitGamepads();
             SDL_QuitGamepads();
-            /* game controller implies joystick */
+            // game controller implies joystick
             SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
             SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
         }
         }
         SDL_DecrementSubsystemRefCount(SDL_INIT_GAMEPAD);
         SDL_DecrementSubsystemRefCount(SDL_INIT_GAMEPAD);
@@ -526,7 +526,7 @@ void SDL_QuitSubSystem(SDL_InitFlags flags)
     if (flags & SDL_INIT_JOYSTICK) {
     if (flags & SDL_INIT_JOYSTICK) {
         if (SDL_ShouldQuitSubsystem(SDL_INIT_JOYSTICK)) {
         if (SDL_ShouldQuitSubsystem(SDL_INIT_JOYSTICK)) {
             SDL_QuitJoysticks();
             SDL_QuitJoysticks();
-            /* joystick implies events */
+            // joystick implies events
             SDL_QuitSubSystem(SDL_INIT_EVENTS);
             SDL_QuitSubSystem(SDL_INIT_EVENTS);
         }
         }
         SDL_DecrementSubsystemRefCount(SDL_INIT_JOYSTICK);
         SDL_DecrementSubsystemRefCount(SDL_INIT_JOYSTICK);
@@ -546,7 +546,7 @@ void SDL_QuitSubSystem(SDL_InitFlags flags)
     if (flags & SDL_INIT_AUDIO) {
     if (flags & SDL_INIT_AUDIO) {
         if (SDL_ShouldQuitSubsystem(SDL_INIT_AUDIO)) {
         if (SDL_ShouldQuitSubsystem(SDL_INIT_AUDIO)) {
             SDL_QuitAudio();
             SDL_QuitAudio();
-            /* audio implies events */
+            // audio implies events
             SDL_QuitSubSystem(SDL_INIT_EVENTS);
             SDL_QuitSubSystem(SDL_INIT_EVENTS);
         }
         }
         SDL_DecrementSubsystemRefCount(SDL_INIT_AUDIO);
         SDL_DecrementSubsystemRefCount(SDL_INIT_AUDIO);
@@ -558,7 +558,7 @@ void SDL_QuitSubSystem(SDL_InitFlags flags)
         if (SDL_ShouldQuitSubsystem(SDL_INIT_VIDEO)) {
         if (SDL_ShouldQuitSubsystem(SDL_INIT_VIDEO)) {
             SDL_QuitRender();
             SDL_QuitRender();
             SDL_VideoQuit();
             SDL_VideoQuit();
-            /* video implies events */
+            // video implies events
             SDL_QuitSubSystem(SDL_INIT_EVENTS);
             SDL_QuitSubSystem(SDL_INIT_EVENTS);
         }
         }
         SDL_DecrementSubsystemRefCount(SDL_INIT_VIDEO);
         SDL_DecrementSubsystemRefCount(SDL_INIT_VIDEO);
@@ -586,7 +586,7 @@ Uint32 SDL_WasInit(SDL_InitFlags flags)
     int num_subsystems = SDL_arraysize(SDL_SubsystemRefCount);
     int num_subsystems = SDL_arraysize(SDL_SubsystemRefCount);
     Uint32 initialized = 0;
     Uint32 initialized = 0;
 
 
-    /* Fast path for checking one flag */
+    // Fast path for checking one flag
     if (SDL_HasExactlyOneBitSet32(flags)) {
     if (SDL_HasExactlyOneBitSet32(flags)) {
         int subsystem_index = SDL_MostSignificantBitIndex32(flags);
         int subsystem_index = SDL_MostSignificantBitIndex32(flags);
         return SDL_SubsystemRefCount[subsystem_index] ? flags : 0;
         return SDL_SubsystemRefCount[subsystem_index] ? flags : 0;
@@ -598,7 +598,7 @@ Uint32 SDL_WasInit(SDL_InitFlags flags)
 
 
     num_subsystems = SDL_min(num_subsystems, SDL_MostSignificantBitIndex32(flags) + 1);
     num_subsystems = SDL_min(num_subsystems, SDL_MostSignificantBitIndex32(flags) + 1);
 
 
-    /* Iterate over each bit in flags, and check the matching subsystem. */
+    // Iterate over each bit in flags, and check the matching subsystem.
     for (i = 0; i < num_subsystems; ++i) {
     for (i = 0; i < num_subsystems; ++i) {
         if ((flags & 1) && SDL_SubsystemRefCount[i] > 0) {
         if ((flags & 1) && SDL_SubsystemRefCount[i] > 0) {
             initialized |= (1 << i);
             initialized |= (1 << i);
@@ -614,7 +614,7 @@ void SDL_Quit(void)
 {
 {
     SDL_bInMainQuit = SDL_TRUE;
     SDL_bInMainQuit = SDL_TRUE;
 
 
-    /* Quit all subsystems */
+    // Quit all subsystems
 #ifdef SDL_VIDEO_DRIVER_WINDOWS
 #ifdef SDL_VIDEO_DRIVER_WINDOWS
     SDL_HelperWindowDestroy();
     SDL_HelperWindowDestroy();
 #endif
 #endif
@@ -641,13 +641,13 @@ void SDL_Quit(void)
     SDL_bInMainQuit = SDL_FALSE;
     SDL_bInMainQuit = SDL_FALSE;
 }
 }
 
 
-/* Get the library version number */
+// Get the library version number
 int SDL_GetVersion(void)
 int SDL_GetVersion(void)
 {
 {
     return SDL_VERSION;
     return SDL_VERSION;
 }
 }
 
 
-/* Get the library source revision */
+// Get the library source revision
 const char *SDL_GetRevision(void)
 const char *SDL_GetRevision(void)
 {
 {
     return SDL_REVISION;
     return SDL_REVISION;
@@ -739,7 +739,7 @@ SDL_bool SDL_IsTablet(void)
 #ifdef SDL_PLATFORM_WIN32
 #ifdef SDL_PLATFORM_WIN32
 
 
 #if (!defined(HAVE_LIBC) || defined(__WATCOMC__)) && !defined(SDL_STATIC_LIB)
 #if (!defined(HAVE_LIBC) || defined(__WATCOMC__)) && !defined(SDL_STATIC_LIB)
-/* FIXME: Still need to include DllMain() on Watcom C ? */
+// FIXME: Still need to include DllMain() on Watcom C ?
 
 
 BOOL APIENTRY MINGW32_FORCEALIGN _DllMainCRTStartup(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
 BOOL APIENTRY MINGW32_FORCEALIGN _DllMainCRTStartup(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
 {
 {
@@ -752,6 +752,6 @@ BOOL APIENTRY MINGW32_FORCEALIGN _DllMainCRTStartup(HANDLE hModule, DWORD ul_rea
     }
     }
     return TRUE;
     return TRUE;
 }
 }
-#endif /* Building DLL */
+#endif // Building DLL
 
 
-#endif /* defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) */
+#endif // defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)

+ 32 - 32
src/SDL_assert.c

@@ -35,7 +35,7 @@
 
 
 #ifdef SDL_PLATFORM_EMSCRIPTEN
 #ifdef SDL_PLATFORM_EMSCRIPTEN
     #include <emscripten.h>
     #include <emscripten.h>
-    /* older Emscriptens don't have this, but we need to for wasm64 compatibility. */
+    // older Emscriptens don't have this, but we need to for wasm64 compatibility.
     #ifndef MAIN_THREAD_EM_ASM_PTR
     #ifndef MAIN_THREAD_EM_ASM_PTR
         #ifdef __wasm64__
         #ifdef __wasm64__
             #error You need to upgrade your Emscripten compiler to support wasm64
             #error You need to upgrade your Emscripten compiler to support wasm64
@@ -45,7 +45,7 @@
     #endif
     #endif
 #endif
 #endif
 
 
-/* The size of the stack buffer to use for rendering assert messages. */
+// The size of the stack buffer to use for rendering assert messages.
 #define SDL_MAX_ASSERT_MESSAGE_STACK 256
 #define SDL_MAX_ASSERT_MESSAGE_STACK 256
 
 
 static SDL_AssertState SDLCALL SDL_PromptAssertion(const SDL_AssertData *data, void *userdata);
 static SDL_AssertState SDLCALL SDL_PromptAssertion(const SDL_AssertData *data, void *userdata);
@@ -80,7 +80,7 @@ static void SDL_AddAssertionToReport(SDL_AssertData *data)
     /* (data) is always a static struct defined with the assert macros, so
     /* (data) is always a static struct defined with the assert macros, so
        we don't have to worry about copying or allocating them. */
        we don't have to worry about copying or allocating them. */
     data->trigger_count++;
     data->trigger_count++;
-    if (data->trigger_count == 1) { /* not yet added? */
+    if (data->trigger_count == 1) { // not yet added?
         data->next = triggered_assertions;
         data->next = triggered_assertions;
         triggered_assertions = data;
         triggered_assertions = data;
     }
     }
@@ -105,7 +105,7 @@ static void SDL_GenerateAssertionReport(void)
 {
 {
     const SDL_AssertData *item = triggered_assertions;
     const SDL_AssertData *item = triggered_assertions;
 
 
-    /* only do this if the app hasn't assigned an assertion handler. */
+    // only do this if the app hasn't assigned an assertion handler.
     if ((item) && (assertion_handler != SDL_PromptAssertion)) {
     if ((item) && (assertion_handler != SDL_PromptAssertion)) {
         debug_print("\n\nSDL assertion report.\n");
         debug_print("\n\nSDL assertion report.\n");
         debug_print("All SDL assertions between last init/quit:\n\n");
         debug_print("All SDL assertions between last init/quit:\n\n");
@@ -168,12 +168,12 @@ static SDL_AssertState SDLCALL SDL_PromptAssertion(const SDL_AssertData *data, v
     size_t buf_len = sizeof(stack_buf);
     size_t buf_len = sizeof(stack_buf);
     int len;
     int len;
 
 
-    (void)userdata; /* unused in default handler. */
+    (void)userdata; // unused in default handler.
 
 
-    /* Assume the output will fit... */
+    // Assume the output will fit...
     len = SDL_RenderAssertMessage(message, buf_len, data);
     len = SDL_RenderAssertMessage(message, buf_len, data);
 
 
-    /* .. and if it didn't, try to allocate as much room as we actually need. */
+    // .. and if it didn't, try to allocate as much room as we actually need.
     if (len >= (int)buf_len) {
     if (len >= (int)buf_len) {
         if (SDL_size_add_overflow(len, 1, &buf_len) == 0) {
         if (SDL_size_add_overflow(len, 1, &buf_len) == 0) {
             message = (char *)SDL_malloc(buf_len);
             message = (char *)SDL_malloc(buf_len);
@@ -185,7 +185,7 @@ static SDL_AssertState SDLCALL SDL_PromptAssertion(const SDL_AssertData *data, v
         }
         }
     }
     }
 
 
-    /* Something went very wrong */
+    // Something went very wrong
     if (len < 0) {
     if (len < 0) {
         if (message != stack_buf) {
         if (message != stack_buf) {
             SDL_free(message);
             SDL_free(message);
@@ -195,7 +195,7 @@ static SDL_AssertState SDLCALL SDL_PromptAssertion(const SDL_AssertData *data, v
 
 
     debug_print("\n\n%s\n\n", message);
     debug_print("\n\n%s\n\n", message);
 
 
-    /* let env. variable override, so unit tests won't block in a GUI. */
+    // let env. variable override, so unit tests won't block in a GUI.
     const char *hint = SDL_GetHint(SDL_HINT_ASSERT);
     const char *hint = SDL_GetHint(SDL_HINT_ASSERT);
     if (hint) {
     if (hint) {
         if (message != stack_buf) {
         if (message != stack_buf) {
@@ -213,23 +213,23 @@ static SDL_AssertState SDLCALL SDL_PromptAssertion(const SDL_AssertData *data, v
         } else if (SDL_strcmp(hint, "always_ignore") == 0) {
         } else if (SDL_strcmp(hint, "always_ignore") == 0) {
             return SDL_ASSERTION_ALWAYS_IGNORE;
             return SDL_ASSERTION_ALWAYS_IGNORE;
         } else {
         } else {
-            return SDL_ASSERTION_ABORT; /* oh well. */
+            return SDL_ASSERTION_ABORT; // oh well.
         }
         }
     }
     }
 
 
-    /* Leave fullscreen mode, if possible (scary!) */
+    // Leave fullscreen mode, if possible (scary!)
     window = SDL_GetToplevelForKeyboardFocus();
     window = SDL_GetToplevelForKeyboardFocus();
     if (window) {
     if (window) {
         if (window->fullscreen_exclusive) {
         if (window->fullscreen_exclusive) {
             SDL_MinimizeWindow(window);
             SDL_MinimizeWindow(window);
         } else {
         } else {
-            /* !!! FIXME: ungrab the input if we're not fullscreen? */
-            /* No need to mess with the window */
+            // !!! FIXME: ungrab the input if we're not fullscreen?
+            // No need to mess with the window
             window = NULL;
             window = NULL;
         }
         }
     }
     }
 
 
-    /* Show a messagebox if we can, otherwise fall back to stdio */
+    // Show a messagebox if we can, otherwise fall back to stdio
     SDL_zero(messagebox);
     SDL_zero(messagebox);
     messagebox.flags = SDL_MESSAGEBOX_WARNING;
     messagebox.flags = SDL_MESSAGEBOX_WARNING;
     messagebox.window = window;
     messagebox.window = window;
@@ -246,10 +246,10 @@ static SDL_AssertState SDLCALL SDL_PromptAssertion(const SDL_AssertData *data, v
         }
         }
     } else {
     } else {
 #ifdef SDL_PLATFORM_EMSCRIPTEN
 #ifdef SDL_PLATFORM_EMSCRIPTEN
-        /* This is nasty, but we can't block on a custom UI. */
+        // This is nasty, but we can't block on a custom UI.
         for (;;) {
         for (;;) {
             SDL_bool okay = SDL_TRUE;
             SDL_bool okay = SDL_TRUE;
-            /* *INDENT-OFF* */ /* clang-format off */
+            /* *INDENT-OFF* */ // clang-format off
             char *buf = (char *) MAIN_THREAD_EM_ASM_PTR({
             char *buf = (char *) MAIN_THREAD_EM_ASM_PTR({
                 var str =
                 var str =
                     UTF8ToString($0) + '\n\n' +
                     UTF8ToString($0) + '\n\n' +
@@ -260,11 +260,11 @@ static SDL_AssertState SDLCALL SDL_PromptAssertion(const SDL_AssertData *data, v
                 }
                 }
                 return allocate(intArrayFromString(reply), 'i8', ALLOC_NORMAL);
                 return allocate(intArrayFromString(reply), 'i8', ALLOC_NORMAL);
             }, message);
             }, message);
-            /* *INDENT-ON* */ /* clang-format on */
+            /* *INDENT-ON* */ // clang-format on
 
 
             if (SDL_strcmp(buf, "a") == 0) {
             if (SDL_strcmp(buf, "a") == 0) {
                 state = SDL_ASSERTION_ABORT;
                 state = SDL_ASSERTION_ABORT;
-#if 0 /* (currently) no break functionality on Emscripten */
+#if 0 // (currently) no break functionality on Emscripten
             } else if (SDL_strcmp(buf, "b") == 0) {
             } else if (SDL_strcmp(buf, "b") == 0) {
                 state = SDL_ASSERTION_BREAK;
                 state = SDL_ASSERTION_BREAK;
 #endif
 #endif
@@ -277,14 +277,14 @@ static SDL_AssertState SDLCALL SDL_PromptAssertion(const SDL_AssertData *data, v
             } else {
             } else {
                 okay = SDL_FALSE;
                 okay = SDL_FALSE;
             }
             }
-            free(buf);  /* This should NOT be SDL_free() */
+            free(buf);  // This should NOT be SDL_free()
 
 
             if (okay) {
             if (okay) {
                 break;
                 break;
             }
             }
         }
         }
 #elif defined(HAVE_STDIO_H)
 #elif defined(HAVE_STDIO_H)
-        /* this is a little hacky. */
+        // this is a little hacky.
         for (;;) {
         for (;;) {
             char buf[32];
             char buf[32];
             (void)fprintf(stderr, "Abort/Break/Retry/Ignore/AlwaysIgnore? [abriA] : ");
             (void)fprintf(stderr, "Abort/Break/Retry/Ignore/AlwaysIgnore? [abriA] : ");
@@ -310,10 +310,10 @@ static SDL_AssertState SDLCALL SDL_PromptAssertion(const SDL_AssertData *data, v
                 break;
                 break;
             }
             }
         }
         }
-#endif /* HAVE_STDIO_H */
+#endif // HAVE_STDIO_H
     }
     }
 
 
-    /* Re-enter fullscreen mode */
+    // Re-enter fullscreen mode
     if (window) {
     if (window) {
         SDL_RestoreWindow(window);
         SDL_RestoreWindow(window);
     }
     }
@@ -333,19 +333,19 @@ SDL_AssertState SDL_ReportAssertion(SDL_AssertData *data, const char *func, cons
 #ifndef SDL_THREADS_DISABLED
 #ifndef SDL_THREADS_DISABLED
     static SDL_SpinLock spinlock = 0;
     static SDL_SpinLock spinlock = 0;
     SDL_LockSpinlock(&spinlock);
     SDL_LockSpinlock(&spinlock);
-    if (!assertion_mutex) { /* never called SDL_Init()? */
+    if (!assertion_mutex) { // never called SDL_Init()?
         assertion_mutex = SDL_CreateMutex();
         assertion_mutex = SDL_CreateMutex();
         if (!assertion_mutex) {
         if (!assertion_mutex) {
             SDL_UnlockSpinlock(&spinlock);
             SDL_UnlockSpinlock(&spinlock);
-            return SDL_ASSERTION_IGNORE; /* oh well, I guess. */
+            return SDL_ASSERTION_IGNORE; // oh well, I guess.
         }
         }
     }
     }
     SDL_UnlockSpinlock(&spinlock);
     SDL_UnlockSpinlock(&spinlock);
 
 
     SDL_LockMutex(assertion_mutex);
     SDL_LockMutex(assertion_mutex);
-#endif /* !SDL_THREADS_DISABLED */
+#endif // !SDL_THREADS_DISABLED
 
 
-    /* doing this because Visual C is upset over assigning in the macro. */
+    // doing this because Visual C is upset over assigning in the macro.
     if (data->trigger_count == 0) {
     if (data->trigger_count == 0) {
         data->function = func;
         data->function = func;
         data->filename = file;
         data->filename = file;
@@ -355,13 +355,13 @@ SDL_AssertState SDL_ReportAssertion(SDL_AssertData *data, const char *func, cons
     SDL_AddAssertionToReport(data);
     SDL_AddAssertionToReport(data);
 
 
     assertion_running++;
     assertion_running++;
-    if (assertion_running > 1) { /* assert during assert! Abort. */
+    if (assertion_running > 1) { // assert during assert! Abort.
         if (assertion_running == 2) {
         if (assertion_running == 2) {
             SDL_AbortAssertion();
             SDL_AbortAssertion();
-        } else if (assertion_running == 3) { /* Abort asserted! */
+        } else if (assertion_running == 3) { // Abort asserted!
             SDL_ExitProcess(42);
             SDL_ExitProcess(42);
         } else {
         } else {
-            while (1) { /* do nothing but spin; what else can you do?! */
+            while (1) { // do nothing but spin; what else can you do?!
             }
             }
         }
         }
     }
     }
@@ -379,11 +379,11 @@ SDL_AssertState SDL_ReportAssertion(SDL_AssertData *data, const char *func, cons
     case SDL_ASSERTION_IGNORE:
     case SDL_ASSERTION_IGNORE:
     case SDL_ASSERTION_RETRY:
     case SDL_ASSERTION_RETRY:
     case SDL_ASSERTION_BREAK:
     case SDL_ASSERTION_BREAK:
-        break; /* macro handles these. */
+        break; // macro handles these.
 
 
     case SDL_ASSERTION_ABORT:
     case SDL_ASSERTION_ABORT:
         SDL_AbortAssertion();
         SDL_AbortAssertion();
-        /*break;  ...shouldn't return, but oh well. */
+        // break;  ...shouldn't return, but oh well.
     }
     }
 
 
     assertion_running--;
     assertion_running--;
@@ -405,7 +405,7 @@ void SDL_AssertionsQuit(void)
         assertion_mutex = NULL;
         assertion_mutex = NULL;
     }
     }
 #endif
 #endif
-#endif /* SDL_ASSERT_LEVEL > 0 */
+#endif // SDL_ASSERT_LEVEL > 0
 }
 }
 
 
 void SDL_SetAssertionHandler(SDL_AssertionHandler handler, void *userdata)
 void SDL_SetAssertionHandler(SDL_AssertionHandler handler, void *userdata)

+ 1 - 1
src/SDL_assert_c.h

@@ -25,4 +25,4 @@
 
 
 extern void SDL_AssertionsQuit(void);
 extern void SDL_AssertionsQuit(void);
 
 
-#endif /* SDL_assert_c_h_ */
+#endif // SDL_assert_c_h_

+ 3 - 3
src/SDL_error.c

@@ -20,13 +20,13 @@
 */
 */
 #include "SDL_internal.h"
 #include "SDL_internal.h"
 
 
-/* Simple error handling in SDL */
+// Simple error handling in SDL
 
 
 #include "SDL_error_c.h"
 #include "SDL_error_c.h"
 
 
 int SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...)
 int SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...)
 {
 {
-    /* Ignore call if invalid format pointer was passed */
+    // Ignore call if invalid format pointer was passed
     if (fmt) {
     if (fmt) {
         va_list ap;
         va_list ap;
         int result;
         int result;
@@ -51,7 +51,7 @@ int SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...)
         }
         }
 
 
         if (SDL_GetLogPriority(SDL_LOG_CATEGORY_ERROR) <= SDL_LOG_PRIORITY_DEBUG) {
         if (SDL_GetLogPriority(SDL_LOG_CATEGORY_ERROR) <= SDL_LOG_PRIORITY_DEBUG) {
-            /* If we are in debug mode, print out the error message */
+            // If we are in debug mode, print out the error message
             SDL_LogDebug(SDL_LOG_CATEGORY_ERROR, "%s", error->str);
             SDL_LogDebug(SDL_LOG_CATEGORY_ERROR, "%s", error->str);
         }
         }
     }
     }

+ 2 - 2
src/SDL_error_c.h

@@ -43,7 +43,7 @@ typedef struct SDL_error
     SDL_free_func free_func;
     SDL_free_func free_func;
 } SDL_error;
 } SDL_error;
 
 
-/* Defined in SDL_thread.c */
+// Defined in SDL_thread.c
 extern SDL_error *SDL_GetErrBuf(SDL_bool create);
 extern SDL_error *SDL_GetErrBuf(SDL_bool create);
 
 
-#endif /* SDL_error_c_h_ */
+#endif // SDL_error_c_h_

+ 7 - 7
src/SDL_guid.c

@@ -20,7 +20,7 @@
 */
 */
 #include "SDL_internal.h"
 #include "SDL_internal.h"
 
 
-/* convert the guid to a printable string */
+// convert the guid to a printable string
 void SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID)
 void SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID)
 {
 {
     static const char k_rgchHexToASCII[] = "0123456789abcdef";
     static const char k_rgchHexToASCII[] = "0123456789abcdef";
@@ -31,8 +31,8 @@ void SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID)
     }
     }
 
 
     for (i = 0; i < sizeof(guid.data) && i < (cbGUID - 1) / 2; i++) {
     for (i = 0; i < sizeof(guid.data) && i < (cbGUID - 1) / 2; i++) {
-        /* each input byte writes 2 ascii chars, and might write a null byte. */
-        /* If we don't have room for next input byte, stop */
+        // each input byte writes 2 ascii chars, and might write a null byte.
+        // If we don't have room for next input byte, stop
         unsigned char c = guid.data[i];
         unsigned char c = guid.data[i];
 
 
         *pszGUID++ = k_rgchHexToASCII[c >> 4];
         *pszGUID++ = k_rgchHexToASCII[c >> 4];
@@ -60,12 +60,12 @@ static unsigned char nibble(unsigned char c)
         return c - 'a' + 0x0a;
         return c - 'a' + 0x0a;
     }
     }
 
 
-    /* received an invalid character, and no real way to return an error */
-    /* AssertMsg1(false, "Q_nibble invalid hex character '%c' ", c); */
+    // received an invalid character, and no real way to return an error
+    // AssertMsg1(false, "Q_nibble invalid hex character '%c' ", c);
     return 0;
     return 0;
 }
 }
 
 
-/* convert the string version of a guid to the struct */
+// convert the string version of a guid to the struct
 SDL_GUID SDL_StringToGUID(const char *pchGUID)
 SDL_GUID SDL_StringToGUID(const char *pchGUID)
 {
 {
     SDL_GUID guid;
     SDL_GUID guid;
@@ -74,7 +74,7 @@ SDL_GUID SDL_StringToGUID(const char *pchGUID)
     Uint8 *p;
     Uint8 *p;
     size_t i;
     size_t i;
 
 
-    /* Make sure it's even */
+    // Make sure it's even
     len = (len) & ~0x1;
     len = (len) & ~0x1;
 
 
     SDL_memset(&guid, 0x00, sizeof(guid));
     SDL_memset(&guid, 0x00, sizeof(guid));

+ 2 - 2
src/SDL_hashtable.h

@@ -21,7 +21,7 @@
 #ifndef SDL_hashtable_h_
 #ifndef SDL_hashtable_h_
 #define SDL_hashtable_h_
 #define SDL_hashtable_h_
 
 
-/* this is not (currently) a public API. But maybe it should be! */
+// this is not (currently) a public API. But maybe it should be!
 
 
 struct SDL_HashTable;
 struct SDL_HashTable;
 typedef struct SDL_HashTable SDL_HashTable;
 typedef struct SDL_HashTable SDL_HashTable;
@@ -57,4 +57,4 @@ extern SDL_bool SDL_KeyMatchID(const void *a, const void *b, void *unused);
 
 
 extern void SDL_NukeFreeValue(const void *key, const void *value, void *unused);
 extern void SDL_NukeFreeValue(const void *key, const void *value, void *unused);
 
 
-#endif /* SDL_hashtable_h_ */
+#endif // SDL_hashtable_h_

+ 2 - 2
src/SDL_hints_c.h

@@ -20,7 +20,7 @@
 */
 */
 #include "SDL_internal.h"
 #include "SDL_internal.h"
 
 
-/* This file defines useful function for working with SDL hints */
+// This file defines useful function for working with SDL hints
 
 
 #ifndef SDL_hints_c_h_
 #ifndef SDL_hints_c_h_
 #define SDL_hints_c_h_
 #define SDL_hints_c_h_
@@ -30,4 +30,4 @@ extern SDL_bool SDL_GetStringBoolean(const char *value, SDL_bool default_value);
 extern int SDL_GetStringInteger(const char *value, int default_value);
 extern int SDL_GetStringInteger(const char *value, int default_value);
 extern void SDL_QuitHints(void);
 extern void SDL_QuitHints(void);
 
 
-#endif /* SDL_hints_c_h_ */
+#endif // SDL_hints_c_h_

+ 14 - 14
src/SDL_internal.h

@@ -21,12 +21,12 @@
 #ifndef SDL_internal_h_
 #ifndef SDL_internal_h_
 #define SDL_internal_h_
 #define SDL_internal_h_
 
 
-/* Many of SDL's features require _GNU_SOURCE on various platforms */
+// Many of SDL's features require _GNU_SOURCE on various platforms
 #ifndef _GNU_SOURCE
 #ifndef _GNU_SOURCE
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 #endif
 #endif
 
 
-/* Need this so Linux systems define fseek64o, ftell64o and off64_t */
+// Need this so Linux systems define fseek64o, ftell64o and off64_t
 #ifndef _LARGEFILE64_SOURCE
 #ifndef _LARGEFILE64_SOURCE
 #define _LARGEFILE64_SOURCE 1
 #define _LARGEFILE64_SOURCE 1
 #endif
 #endif
@@ -44,11 +44,11 @@
 #define HAVE_GCC_DIAGNOSTIC_PRAGMA 1
 #define HAVE_GCC_DIAGNOSTIC_PRAGMA 1
 #endif
 #endif
 
 
-#ifdef _MSC_VER /* We use constant comparison for generated code */
+#ifdef _MSC_VER // We use constant comparison for generated code
 #pragma warning(disable : 6326)
 #pragma warning(disable : 6326)
 #endif
 #endif
 
 
-#ifdef _MSC_VER /* SDL_MAX_SMALL_ALLOC_STACKSIZE is smaller than _ALLOCA_S_THRESHOLD and should be generally safe */
+#ifdef _MSC_VER // SDL_MAX_SMALL_ALLOC_STACKSIZE is smaller than _ALLOCA_S_THRESHOLD and should be generally safe
 #pragma warning(disable : 6255)
 #pragma warning(disable : 6255)
 #endif
 #endif
 #define SDL_MAX_SMALL_ALLOC_STACKSIZE          128
 #define SDL_MAX_SMALL_ALLOC_STACKSIZE          128
@@ -76,7 +76,7 @@
 
 
 #ifdef SDL_PLATFORM_APPLE
 #ifdef SDL_PLATFORM_APPLE
 #ifndef _DARWIN_C_SOURCE
 #ifndef _DARWIN_C_SOURCE
-#define _DARWIN_C_SOURCE 1 /* for memset_pattern4() */
+#define _DARWIN_C_SOURCE 1 // for memset_pattern4()
 #endif
 #endif
 #endif
 #endif
 
 
@@ -121,7 +121,7 @@
 #include <float.h>
 #include <float.h>
 #endif
 #endif
 
 
-/* If you run into a warning that O_CLOEXEC is redefined, update the SDL configuration header for your platform to add HAVE_O_CLOEXEC */
+// If you run into a warning that O_CLOEXEC is redefined, update the SDL configuration header for your platform to add HAVE_O_CLOEXEC
 #ifndef HAVE_O_CLOEXEC
 #ifndef HAVE_O_CLOEXEC
 #define O_CLOEXEC 0
 #define O_CLOEXEC 0
 #endif
 #endif
@@ -192,7 +192,7 @@
 #endif
 #endif
 
 
 #ifndef SDL_RENDER_DISABLED
 #ifndef SDL_RENDER_DISABLED
-/* define the not defined ones as 0 */
+// define the not defined ones as 0
 #ifndef SDL_VIDEO_RENDER_D3D
 #ifndef SDL_VIDEO_RENDER_D3D
 #define SDL_VIDEO_RENDER_D3D 0
 #define SDL_VIDEO_RENDER_D3D 0
 #endif
 #endif
@@ -223,7 +223,7 @@
 #ifndef SDL_VIDEO_RENDER_VULKAN
 #ifndef SDL_VIDEO_RENDER_VULKAN
 #define SDL_VIDEO_RENDER_VULKAN 0
 #define SDL_VIDEO_RENDER_VULKAN 0
 #endif
 #endif
-#else /* define all as 0 */
+#else // define all as 0
 #undef SDL_VIDEO_RENDER_SW
 #undef SDL_VIDEO_RENDER_SW
 #define SDL_VIDEO_RENDER_SW 0
 #define SDL_VIDEO_RENDER_SW 0
 #undef SDL_VIDEO_RENDER_D3D
 #undef SDL_VIDEO_RENDER_D3D
@@ -246,7 +246,7 @@
 #define SDL_VIDEO_RENDER_VITA_GXM 0
 #define SDL_VIDEO_RENDER_VITA_GXM 0
 #undef SDL_VIDEO_RENDER_VULKAN
 #undef SDL_VIDEO_RENDER_VULKAN
 #define SDL_VIDEO_RENDER_VULKAN 0
 #define SDL_VIDEO_RENDER_VULKAN 0
-#endif /* SDL_RENDER_DISABLED */
+#endif // SDL_RENDER_DISABLED
 
 
 #define SDL_HAS_RENDER_DRIVER \
 #define SDL_HAS_RENDER_DRIVER \
        (SDL_VIDEO_RENDER_SW       | \
        (SDL_VIDEO_RENDER_SW       | \
@@ -276,17 +276,17 @@
 #include <SDL3/SDL.h>
 #include <SDL3/SDL.h>
 #include <SDL3/SDL_intrin.h>
 #include <SDL3/SDL_intrin.h>
 
 
-#define SDL_MAIN_NOIMPL /* don't drag in header-only implementation of SDL_main */
+#define SDL_MAIN_NOIMPL // don't drag in header-only implementation of SDL_main
 #include <SDL3/SDL_main.h>
 #include <SDL3/SDL_main.h>
 
 
-/* Set up for C function definitions, even when using C++ */
+// Set up for C function definitions, even when using C++
 #ifdef __cplusplus
 #ifdef __cplusplus
 extern "C" {
 extern "C" {
 #endif
 #endif
 
 
 #include "SDL_utils_c.h"
 #include "SDL_utils_c.h"
 
 
-/* Do any initialization that needs to happen before threads are started */
+// Do any initialization that needs to happen before threads are started
 extern void SDL_InitMainThread(void);
 extern void SDL_InitMainThread(void);
 
 
 /* The internal implementations of these functions have up to nanosecond precision.
 /* The internal implementations of these functions have up to nanosecond precision.
@@ -296,9 +296,9 @@ extern int SDLCALL SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeout
 extern int SDLCALL SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS);
 extern int SDLCALL SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS);
 extern SDL_bool SDLCALL SDL_WaitEventTimeoutNS(SDL_Event *event, Sint64 timeoutNS);
 extern SDL_bool SDLCALL SDL_WaitEventTimeoutNS(SDL_Event *event, Sint64 timeoutNS);
 
 
-/* Ends C function definitions when using C++ */
+// Ends C function definitions when using C++
 #ifdef __cplusplus
 #ifdef __cplusplus
 }
 }
 #endif
 #endif
 
 
-#endif /* SDL_internal_h_ */
+#endif // SDL_internal_h_

+ 3 - 3
src/SDL_list.c

@@ -22,7 +22,7 @@
 
 
 #include "./SDL_list.h"
 #include "./SDL_list.h"
 
 
-/* Push */
+// Push
 int SDL_ListAdd(SDL_ListNode **head, void *ent)
 int SDL_ListAdd(SDL_ListNode **head, void *ent)
 {
 {
     SDL_ListNode *node = (SDL_ListNode *)SDL_malloc(sizeof(*node));
     SDL_ListNode *node = (SDL_ListNode *)SDL_malloc(sizeof(*node));
@@ -37,12 +37,12 @@ int SDL_ListAdd(SDL_ListNode **head, void *ent)
     return 0;
     return 0;
 }
 }
 
 
-/* Pop from end as a FIFO (if add with SDL_ListAdd) */
+// Pop from end as a FIFO (if add with SDL_ListAdd)
 void SDL_ListPop(SDL_ListNode **head, void **ent)
 void SDL_ListPop(SDL_ListNode **head, void **ent)
 {
 {
     SDL_ListNode **ptr = head;
     SDL_ListNode **ptr = head;
 
 
-    /* Invalid or empty */
+    // Invalid or empty
     if (!head || !*head) {
     if (!head || !*head) {
         return;
         return;
     }
     }

+ 1 - 1
src/SDL_list.h

@@ -33,4 +33,4 @@ void SDL_ListPop(SDL_ListNode **head, void **ent);
 void SDL_ListRemove(SDL_ListNode **head, void *ent);
 void SDL_ListRemove(SDL_ListNode **head, void *ent);
 void SDL_ListClear(SDL_ListNode **head);
 void SDL_ListClear(SDL_ListNode **head);
 
 
-#endif /* SDL_list_h_ */
+#endif // SDL_list_h_

+ 35 - 35
src/SDL_log.c

@@ -24,7 +24,7 @@
 #include "core/windows/SDL_windows.h"
 #include "core/windows/SDL_windows.h"
 #endif
 #endif
 
 
-/* Simple log messages in SDL */
+// Simple log messages in SDL
 
 
 #include "SDL_log_c.h"
 #include "SDL_log_c.h"
 
 
@@ -38,7 +38,7 @@
 
 
 #include "stdlib/SDL_vacopy.h"
 #include "stdlib/SDL_vacopy.h"
 
 
-/* The size of the stack buffer to use for rendering log messages. */
+// The size of the stack buffer to use for rendering log messages.
 #define SDL_MAX_LOG_MESSAGE_STACK 256
 #define SDL_MAX_LOG_MESSAGE_STACK 256
 
 
 #define DEFAULT_CATEGORY -1
 #define DEFAULT_CATEGORY -1
@@ -51,7 +51,7 @@ typedef struct SDL_LogLevel
 } SDL_LogLevel;
 } SDL_LogLevel;
 
 
 
 
-/* The default log output function */
+// The default log output function
 static void SDLCALL SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority, const char *message);
 static void SDLCALL SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority, const char *message);
 
 
 static void SDL_ResetLogPrefixes(void);
 static void SDL_ResetLogPrefixes(void);
@@ -68,7 +68,7 @@ static SDL_Mutex *log_function_mutex = NULL;
 #pragma GCC diagnostic ignored "-Wunused-variable"
 #pragma GCC diagnostic ignored "-Wunused-variable"
 #endif
 #endif
 
 
-/* If this list changes, update the documentation for SDL_HINT_LOGGING */
+// If this list changes, update the documentation for SDL_HINT_LOGGING
 static const char * const SDL_priority_names[] = {
 static const char * const SDL_priority_names[] = {
     NULL,
     NULL,
     "VERBOSE",
     "VERBOSE",
@@ -82,7 +82,7 @@ SDL_COMPILE_TIME_ASSERT(priority_names, SDL_arraysize(SDL_priority_names) == SDL
 
 
 static const char *SDL_priority_prefixes[SDL_NUM_LOG_PRIORITIES];
 static const char *SDL_priority_prefixes[SDL_NUM_LOG_PRIORITIES];
 
 
-/* If this list changes, update the documentation for SDL_HINT_LOGGING */
+// If this list changes, update the documentation for SDL_HINT_LOGGING
 static const char * const SDL_category_names[] = {
 static const char * const SDL_category_names[] = {
     "APP",
     "APP",
     "ERROR",
     "ERROR",
@@ -110,12 +110,12 @@ static int SDL_android_priority[SDL_NUM_LOG_PRIORITIES] = {
     ANDROID_LOG_ERROR,
     ANDROID_LOG_ERROR,
     ANDROID_LOG_FATAL
     ANDROID_LOG_FATAL
 };
 };
-#endif /* SDL_PLATFORM_ANDROID */
+#endif // SDL_PLATFORM_ANDROID
 
 
 void SDL_InitLog(void)
 void SDL_InitLog(void)
 {
 {
     if (!log_function_mutex) {
     if (!log_function_mutex) {
-        /* if this fails we'll try to continue without it. */
+        // if this fails we'll try to continue without it.
         log_function_mutex = SDL_CreateMutex();
         log_function_mutex = SDL_CreateMutex();
     }
     }
 }
 }
@@ -154,7 +154,7 @@ void SDL_SetLogPriority(int category, SDL_LogPriority priority)
         }
         }
     }
     }
 
 
-    /* Create a new entry */
+    // Create a new entry
     entry = (SDL_LogLevel *)SDL_malloc(sizeof(*entry));
     entry = (SDL_LogLevel *)SDL_malloc(sizeof(*entry));
     if (entry) {
     if (entry) {
         entry->category = category;
         entry->category = category;
@@ -194,7 +194,7 @@ static SDL_bool SDL_ParseLogPriority(const char *string, size_t length, SDL_LogP
     if (SDL_isdigit(*string)) {
     if (SDL_isdigit(*string)) {
         i = SDL_atoi(string);
         i = SDL_atoi(string);
         if (i == 0) {
         if (i == 0) {
-            /* 0 has a special meaning of "disable this category" */
+            // 0 has a special meaning of "disable this category"
             *priority = SDL_NUM_LOG_PRIORITIES;
             *priority = SDL_NUM_LOG_PRIORITIES;
             return SDL_TRUE;
             return SDL_TRUE;
         }
         }
@@ -439,7 +439,7 @@ static const char *GetCategoryPrefix(int category)
     }
     }
     return "CUSTOM";
     return "CUSTOM";
 }
 }
-#endif /* SDL_PLATFORM_ANDROID */
+#endif // SDL_PLATFORM_ANDROID
 
 
 void SDL_LogMessageV(int category, SDL_LogPriority priority, SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap)
 void SDL_LogMessageV(int category, SDL_LogPriority priority, SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap)
 {
 {
@@ -449,27 +449,27 @@ void SDL_LogMessageV(int category, SDL_LogPriority priority, SDL_PRINTF_FORMAT_S
     int len;
     int len;
     va_list aq;
     va_list aq;
 
 
-    /* Nothing to do if we don't have an output function */
+    // Nothing to do if we don't have an output function
     if (!SDL_log_function) {
     if (!SDL_log_function) {
         return;
         return;
     }
     }
 
 
-    /* Make sure we don't exceed array bounds */
+    // Make sure we don't exceed array bounds
     if ((int)priority < 0 || priority >= SDL_NUM_LOG_PRIORITIES) {
     if ((int)priority < 0 || priority >= SDL_NUM_LOG_PRIORITIES) {
         return;
         return;
     }
     }
 
 
-    /* See if we want to do anything with this message */
+    // See if we want to do anything with this message
     if (priority < SDL_GetLogPriority(category)) {
     if (priority < SDL_GetLogPriority(category)) {
         return;
         return;
     }
     }
 
 
     if (!log_function_mutex) {
     if (!log_function_mutex) {
-        /* this mutex creation can race if you log from two threads at startup. You should have called SDL_Init first! */
+        // this mutex creation can race if you log from two threads at startup. You should have called SDL_Init first!
         log_function_mutex = SDL_CreateMutex();
         log_function_mutex = SDL_CreateMutex();
     }
     }
 
 
-    /* Render into stack buffer */
+    // Render into stack buffer
     va_copy(aq, ap);
     va_copy(aq, ap);
     len = SDL_vsnprintf(stack_buf, sizeof(stack_buf), fmt, aq);
     len = SDL_vsnprintf(stack_buf, sizeof(stack_buf), fmt, aq);
     va_end(aq);
     va_end(aq);
@@ -478,9 +478,9 @@ void SDL_LogMessageV(int category, SDL_LogPriority priority, SDL_PRINTF_FORMAT_S
         return;
         return;
     }
     }
 
 
-    /* If message truncated, allocate and re-render */
+    // If message truncated, allocate and re-render
     if (len >= sizeof(stack_buf) && SDL_size_add_overflow(len, 1, &len_plus_term) == 0) {
     if (len >= sizeof(stack_buf) && SDL_size_add_overflow(len, 1, &len_plus_term) == 0) {
-        /* Allocate exactly what we need, including the zero-terminator */
+        // Allocate exactly what we need, including the zero-terminator
         message = (char *)SDL_malloc(len_plus_term);
         message = (char *)SDL_malloc(len_plus_term);
         if (!message) {
         if (!message) {
             return;
             return;
@@ -492,10 +492,10 @@ void SDL_LogMessageV(int category, SDL_LogPriority priority, SDL_PRINTF_FORMAT_S
         message = stack_buf;
         message = stack_buf;
     }
     }
 
 
-    /* Chop off final endline. */
+    // Chop off final endline.
     if ((len > 0) && (message[len - 1] == '\n')) {
     if ((len > 0) && (message[len - 1] == '\n')) {
         message[--len] = '\0';
         message[--len] = '\0';
-        if ((len > 0) && (message[len - 1] == '\r')) { /* catch "\r\n", too. */
+        if ((len > 0) && (message[len - 1] == '\r')) { // catch "\r\n", too.
             message[--len] = '\0';
             message[--len] = '\0';
         }
         }
     }
     }
@@ -504,7 +504,7 @@ void SDL_LogMessageV(int category, SDL_LogPriority priority, SDL_PRINTF_FORMAT_S
     SDL_log_function(SDL_log_userdata, category, priority, message);
     SDL_log_function(SDL_log_userdata, category, priority, message);
     SDL_UnlockMutex(log_function_mutex);
     SDL_UnlockMutex(log_function_mutex);
 
 
-    /* Free only if dynamically allocated */
+    // Free only if dynamically allocated
     if (message != stack_buf) {
     if (message != stack_buf) {
         SDL_free(message);
         SDL_free(message);
     }
     }
@@ -519,7 +519,7 @@ enum {
     CONSOLE_ATTACHED_ERROR = -1,
     CONSOLE_ATTACHED_ERROR = -1,
 } consoleAttached = CONSOLE_UNATTACHED;
 } consoleAttached = CONSOLE_UNATTACHED;
 
 
-/* Handle to stderr output of console. */
+// Handle to stderr output of console.
 static HANDLE stderrHandle = NULL;
 static HANDLE stderrHandle = NULL;
 #endif
 #endif
 
 
@@ -527,8 +527,8 @@ static void SDLCALL SDL_LogOutput(void *userdata, int category, SDL_LogPriority
                                   const char *message)
                                   const char *message)
 {
 {
 #if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINRT) || defined(SDL_PLATFORM_GDK)
 #if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINRT) || defined(SDL_PLATFORM_GDK)
-    /* Way too many allocations here, urgh */
-    /* Note: One can't call SDL_SetError here, since that function itself logs. */
+    // Way too many allocations here, urgh
+    // Note: One can't call SDL_SetError here, since that function itself logs.
     {
     {
         char *output;
         char *output;
         size_t length;
         size_t length;
@@ -543,27 +543,27 @@ static void SDLCALL SDL_LogOutput(void *userdata, int category, SDL_LogPriority
         DWORD charsWritten;
         DWORD charsWritten;
 #endif
 #endif
 
 
-        /* Maybe attach console and get stderr handle */
+        // Maybe attach console and get stderr handle
         if (consoleAttached == CONSOLE_UNATTACHED) {
         if (consoleAttached == CONSOLE_UNATTACHED) {
             attachResult = AttachConsole(ATTACH_PARENT_PROCESS);
             attachResult = AttachConsole(ATTACH_PARENT_PROCESS);
             if (!attachResult) {
             if (!attachResult) {
                 attachError = GetLastError();
                 attachError = GetLastError();
                 if (attachError == ERROR_INVALID_HANDLE) {
                 if (attachError == ERROR_INVALID_HANDLE) {
-                    /* This is expected when running from Visual Studio */
-                    /*OutputDebugString(TEXT("Parent process has no console\r\n"));*/
+                    // This is expected when running from Visual Studio
+                    // OutputDebugString(TEXT("Parent process has no console\r\n"));
                     consoleAttached = CONSOLE_ATTACHED_MSVC;
                     consoleAttached = CONSOLE_ATTACHED_MSVC;
                 } else if (attachError == ERROR_GEN_FAILURE) {
                 } else if (attachError == ERROR_GEN_FAILURE) {
                     OutputDebugString(TEXT("Could not attach to console of parent process\r\n"));
                     OutputDebugString(TEXT("Could not attach to console of parent process\r\n"));
                     consoleAttached = CONSOLE_ATTACHED_ERROR;
                     consoleAttached = CONSOLE_ATTACHED_ERROR;
                 } else if (attachError == ERROR_ACCESS_DENIED) {
                 } else if (attachError == ERROR_ACCESS_DENIED) {
-                    /* Already attached */
+                    // Already attached
                     consoleAttached = CONSOLE_ATTACHED_CONSOLE;
                     consoleAttached = CONSOLE_ATTACHED_CONSOLE;
                 } else {
                 } else {
                     OutputDebugString(TEXT("Error attaching console\r\n"));
                     OutputDebugString(TEXT("Error attaching console\r\n"));
                     consoleAttached = CONSOLE_ATTACHED_ERROR;
                     consoleAttached = CONSOLE_ATTACHED_ERROR;
                 }
                 }
             } else {
             } else {
-                /* Newly attached */
+                // Newly attached
                 consoleAttached = CONSOLE_ATTACHED_CONSOLE;
                 consoleAttached = CONSOLE_ATTACHED_CONSOLE;
             }
             }
 
 
@@ -571,12 +571,12 @@ static void SDLCALL SDL_LogOutput(void *userdata, int category, SDL_LogPriority
                 stderrHandle = GetStdHandle(STD_ERROR_HANDLE);
                 stderrHandle = GetStdHandle(STD_ERROR_HANDLE);
 
 
                 if (GetConsoleMode(stderrHandle, &consoleMode) == 0) {
                 if (GetConsoleMode(stderrHandle, &consoleMode) == 0) {
-                    /* WriteConsole fails if the output is redirected to a file. Must use WriteFile instead. */
+                    // WriteConsole fails if the output is redirected to a file. Must use WriteFile instead.
                     consoleAttached = CONSOLE_ATTACHED_FILE;
                     consoleAttached = CONSOLE_ATTACHED_FILE;
                 }
                 }
             }
             }
         }
         }
-#endif /* !defined(HAVE_STDIO_H) && !defined(SDL_PLATFORM_WINRT) && !defined(SDL_PLATFORM_GDK) */
+#endif // !defined(HAVE_STDIO_H) && !defined(SDL_PLATFORM_WINRT) && !defined(SDL_PLATFORM_GDK)
         length = SDL_strlen(SDL_GetLogPriorityPrefix(priority)) + SDL_strlen(message) + 1 + 1 + 1;
         length = SDL_strlen(SDL_GetLogPriorityPrefix(priority)) + SDL_strlen(message) + 1 + 1 + 1;
         output = SDL_small_alloc(char, length, &isstack);
         output = SDL_small_alloc(char, length, &isstack);
         (void)SDL_snprintf(output, length, "%s%s\r\n", SDL_GetLogPriorityPrefix(priority), message);
         (void)SDL_snprintf(output, length, "%s%s\r\n", SDL_GetLogPriorityPrefix(priority), message);
@@ -584,18 +584,18 @@ static void SDLCALL SDL_LogOutput(void *userdata, int category, SDL_LogPriority
 
 
 
 
 #if defined(HAVE_STDIO_H) && !defined(SDL_PLATFORM_WINRT) && !defined(SDL_PLATFORM_GDK)
 #if defined(HAVE_STDIO_H) && !defined(SDL_PLATFORM_WINRT) && !defined(SDL_PLATFORM_GDK)
-        /* When running in MSVC and using stdio, rely on forwarding of stderr to the debug stream */
+        // When running in MSVC and using stdio, rely on forwarding of stderr to the debug stream
         if (consoleAttached != CONSOLE_ATTACHED_MSVC) {
         if (consoleAttached != CONSOLE_ATTACHED_MSVC) {
-            /* Output to debugger */
+            // Output to debugger
             OutputDebugString(tstr);
             OutputDebugString(tstr);
         }
         }
 #else
 #else
-        /* Output to debugger */
+        // Output to debugger
         OutputDebugString(tstr);
         OutputDebugString(tstr);
 #endif
 #endif
 
 
 #if !defined(HAVE_STDIO_H) && !defined(SDL_PLATFORM_WINRT) && !defined(SDL_PLATFORM_GDK)
 #if !defined(HAVE_STDIO_H) && !defined(SDL_PLATFORM_WINRT) && !defined(SDL_PLATFORM_GDK)
-        /* Screen output to stderr, if console was attached. */
+        // Screen output to stderr, if console was attached.
         if (consoleAttached == CONSOLE_ATTACHED_CONSOLE) {
         if (consoleAttached == CONSOLE_ATTACHED_CONSOLE) {
             if (!WriteConsole(stderrHandle, tstr, (DWORD)SDL_tcslen(tstr), &charsWritten, NULL)) {
             if (!WriteConsole(stderrHandle, tstr, (DWORD)SDL_tcslen(tstr), &charsWritten, NULL)) {
                 OutputDebugString(TEXT("Error calling WriteConsole\r\n"));
                 OutputDebugString(TEXT("Error calling WriteConsole\r\n"));
@@ -609,7 +609,7 @@ static void SDLCALL SDL_LogOutput(void *userdata, int category, SDL_LogPriority
                 OutputDebugString(TEXT("Error calling WriteFile\r\n"));
                 OutputDebugString(TEXT("Error calling WriteFile\r\n"));
             }
             }
         }
         }
-#endif /* !defined(HAVE_STDIO_H) && !defined(SDL_PLATFORM_WINRT) && !defined(SDL_PLATFORM_GDK) */
+#endif // !defined(HAVE_STDIO_H) && !defined(SDL_PLATFORM_WINRT) && !defined(SDL_PLATFORM_GDK)
 
 
         SDL_free(tstr);
         SDL_free(tstr);
         SDL_small_free(output, isstack);
         SDL_small_free(output, isstack);

+ 2 - 2
src/SDL_log_c.h

@@ -20,7 +20,7 @@
 */
 */
 #include "SDL_internal.h"
 #include "SDL_internal.h"
 
 
-/* This file defines useful function for working with SDL logging */
+// This file defines useful function for working with SDL logging
 
 
 #ifndef SDL_log_c_h_
 #ifndef SDL_log_c_h_
 #define SDL_log_c_h_
 #define SDL_log_c_h_
@@ -28,4 +28,4 @@
 extern void SDL_InitLog(void);
 extern void SDL_InitLog(void);
 extern void SDL_QuitLog(void);
 extern void SDL_QuitLog(void);
 
 
-#endif /* SDL_log_c_h_ */
+#endif // SDL_log_c_h_

+ 2 - 2
src/SDL_properties.c

@@ -177,7 +177,7 @@ SDL_PropertiesID SDL_CreateProperties(void)
     SDL_UnlockMutex(SDL_properties_lock);
     SDL_UnlockMutex(SDL_properties_lock);
 
 
     if (inserted) {
     if (inserted) {
-        /* All done! */
+        // All done!
         return props;
         return props;
     }
     }
 
 
@@ -225,7 +225,7 @@ int SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst)
             SDL_Property *dst_property;
             SDL_Property *dst_property;
 
 
             if (src_property->cleanup) {
             if (src_property->cleanup) {
-                /* Can't copy properties with cleanup functions, we don't know how to duplicate the data */
+                // Can't copy properties with cleanup functions, we don't know how to duplicate the data
                 continue;
                 continue;
             }
             }
 
 

+ 13 - 13
src/SDL_utils.c

@@ -26,18 +26,18 @@
 #include <unistd.h>
 #include <unistd.h>
 #endif
 #endif
 
 
-/* Common utility functions that aren't in the public API */
+// Common utility functions that aren't in the public API
 
 
 int SDL_powerof2(int x)
 int SDL_powerof2(int x)
 {
 {
     int value;
     int value;
 
 
     if (x <= 0) {
     if (x <= 0) {
-        /* Return some sane value - we shouldn't hit this in our use cases */
+        // Return some sane value - we shouldn't hit this in our use cases
         return 1;
         return 1;
     }
     }
 
 
-    /* This trick works for 32-bit values */
+    // This trick works for 32-bit values
     {
     {
         SDL_COMPILE_TIME_ASSERT(SDL_powerof2, sizeof(x) == sizeof(Uint32));
         SDL_COMPILE_TIME_ASSERT(SDL_powerof2, sizeof(x) == sizeof(Uint32));
     }
     }
@@ -105,7 +105,7 @@ SDL_bool SDL_endswith(const char *string, const char *suffix)
     return SDL_FALSE;
     return SDL_FALSE;
 }
 }
 
 
-/* Assume we can wrap SDL_AtomicInt values and cast to Uint32 */
+// Assume we can wrap SDL_AtomicInt values and cast to Uint32
 SDL_COMPILE_TIME_ASSERT(sizeof_object_id, sizeof(int) == sizeof(Uint32));
 SDL_COMPILE_TIME_ASSERT(sizeof_object_id, sizeof(int) == sizeof(Uint32));
 
 
 Uint32 SDL_GetNextObjectID(void)
 Uint32 SDL_GetNextObjectID(void)
@@ -165,7 +165,7 @@ SDL_bool SDL_ObjectValid(void *object, SDL_ObjectType type)
 void SDL_SetObjectsInvalid(void)
 void SDL_SetObjectsInvalid(void)
 {
 {
     if (SDL_objects) {
     if (SDL_objects) {
-        /* Log any leaked objects */
+        // Log any leaked objects
         const void *object, *object_type;
         const void *object, *object_type;
         void *iter = NULL;
         void *iter = NULL;
         while (SDL_IterateHashTable(SDL_objects, &object, &object_type, &iter)) {
         while (SDL_IterateHashTable(SDL_objects, &object, &object_type, &iter)) {
@@ -223,13 +223,13 @@ static int SDL_URIDecode(const char *src, char *dst, int len)
     }
     }
     for (ri = 0, wi = 0, di = 0; ri < len && wi < len; ri += 1) {
     for (ri = 0, wi = 0, di = 0; ri < len && wi < len; ri += 1) {
         if (di == 0) {
         if (di == 0) {
-            /* start decoding */
+            // start decoding
             if (src[ri] == '%') {
             if (src[ri] == '%') {
                 decode = '\0';
                 decode = '\0';
                 di += 1;
                 di += 1;
                 continue;
                 continue;
             }
             }
-            /* normal write */
+            // normal write
             dst[wi] = src[ri];
             dst[wi] = src[ri];
             wi += 1;
             wi += 1;
         } else if (di == 1 || di == 2) {
         } else if (di == 1 || di == 2) {
@@ -238,7 +238,7 @@ static int SDL_URIDecode(const char *src, char *dst, int len)
             char isA = src[ri] >= 'A' && src[ri] <= 'F';
             char isA = src[ri] >= 'A' && src[ri] <= 'F';
             char isn = src[ri] >= '0' && src[ri] <= '9';
             char isn = src[ri] >= '0' && src[ri] <= '9';
             if (!(isa || isA || isn)) {
             if (!(isa || isA || isn)) {
-                /* not a hexadecimal */
+                // not a hexadecimal
                 int sri;
                 int sri;
                 for (sri = ri - di; sri <= ri; sri += 1) {
                 for (sri = ri - di; sri <= ri; sri += 1) {
                     dst[wi] = src[sri];
                     dst[wi] = src[sri];
@@ -247,7 +247,7 @@ static int SDL_URIDecode(const char *src, char *dst, int len)
                 di = 0;
                 di = 0;
                 continue;
                 continue;
             }
             }
-            /* itsy bitsy magicsy */
+            // itsy bitsy magicsy
             if (isn) {
             if (isn) {
                 off = 0 - '0';
                 off = 0 - '0';
             } else if (isa) {
             } else if (isa) {
@@ -272,14 +272,14 @@ static int SDL_URIDecode(const char *src, char *dst, int len)
 int SDL_URIToLocal(const char *src, char *dst)
 int SDL_URIToLocal(const char *src, char *dst)
 {
 {
     if (SDL_memcmp(src, "file:/", 6) == 0) {
     if (SDL_memcmp(src, "file:/", 6) == 0) {
-        src += 6; /* local file? */
+        src += 6; // local file?
     } else if (SDL_strstr(src, ":/") != NULL) {
     } else if (SDL_strstr(src, ":/") != NULL) {
-        return -1; /* wrong scheme */
+        return -1; // wrong scheme
     }
     }
 
 
     SDL_bool local = src[0] != '/' || (src[0] != '\0' && src[1] == '/');
     SDL_bool local = src[0] != '/' || (src[0] != '\0' && src[1] == '/');
 
 
-    /* Check the hostname, if present. RFC 3986 states that the hostname component of a URI is not case-sensitive. */
+    // Check the hostname, if present. RFC 3986 states that the hostname component of a URI is not case-sensitive.
     if (!local && src[0] == '/' && src[2] != '/') {
     if (!local && src[0] == '/' && src[2] != '/') {
         char *hostname_end = SDL_strchr(src + 1, '/');
         char *hostname_end = SDL_strchr(src + 1, '/');
         if (hostname_end) {
         if (hostname_end) {
@@ -310,7 +310,7 @@ int SDL_URIToLocal(const char *src, char *dst)
     }
     }
 
 
     if (local) {
     if (local) {
-        /* Convert URI escape sequences to real characters */
+        // Convert URI escape sequences to real characters
         if (src[0] == '/') {
         if (src[0] == '/') {
             src++;
             src++;
         } else {
         } else {

+ 3 - 3
src/SDL_utils_c.h

@@ -23,9 +23,9 @@
 #ifndef SDL_utils_h_
 #ifndef SDL_utils_h_
 #define SDL_utils_h_
 #define SDL_utils_h_
 
 
-/* Common utility functions that aren't in the public API */
+// Common utility functions that aren't in the public API
 
 
-/* Return the smallest power of 2 greater than or equal to 'x' */
+// Return the smallest power of 2 greater than or equal to 'x'
 extern int SDL_powerof2(int x);
 extern int SDL_powerof2(int x);
 
 
 extern void SDL_CalculateFraction(float x, int *numerator, int *denominator);
 extern void SDL_CalculateFraction(float x, int *numerator, int *denominator);
@@ -67,4 +67,4 @@ extern void SDL_SetObjectsInvalid(void);
 
 
 extern const char *SDL_GetPersistentString(const char *string);
 extern const char *SDL_GetPersistentString(const char *string);
 
 
-#endif /* SDL_utils_h_ */
+#endif // SDL_utils_h_

+ 9 - 9
src/atomic/SDL_atomic.c

@@ -25,7 +25,7 @@
 #define HAVE_MSC_ATOMICS 1
 #define HAVE_MSC_ATOMICS 1
 #endif
 #endif
 
 
-#ifdef SDL_PLATFORM_MACOS /* !!! FIXME: should we favor gcc atomics? */
+#ifdef SDL_PLATFORM_MACOS // !!! FIXME: should we favor gcc atomics?
 #include <libkern/OSAtomic.h>
 #include <libkern/OSAtomic.h>
 #endif
 #endif
 
 
@@ -33,7 +33,7 @@
 #include <atomic.h>
 #include <atomic.h>
 #endif
 #endif
 
 
-/* The __atomic_load_n() intrinsic showed up in different times for different compilers. */
+// The __atomic_load_n() intrinsic showed up in different times for different compilers.
 #ifdef __clang__
 #ifdef __clang__
 #if __has_builtin(__atomic_load_n) || defined(HAVE_GCC_ATOMICS)
 #if __has_builtin(__atomic_load_n) || defined(HAVE_GCC_ATOMICS)
 /* !!! FIXME: this advertises as available in the NDK but uses an external symbol we don't have.
 /* !!! FIXME: this advertises as available in the NDK but uses an external symbol we don't have.
@@ -48,7 +48,7 @@
 #endif
 #endif
 #endif
 #endif
 
 
-/* *INDENT-OFF* */ /* clang-format off */
+/* *INDENT-OFF* */ // clang-format off
 #if defined(__WATCOMC__) && defined(__386__)
 #if defined(__WATCOMC__) && defined(__386__)
 SDL_COMPILE_TIME_ASSERT(intsize, 4==sizeof(int));
 SDL_COMPILE_TIME_ASSERT(intsize, 4==sizeof(int));
 #define HAVE_WATCOM_ATOMICS
 #define HAVE_WATCOM_ATOMICS
@@ -74,8 +74,8 @@ extern __inline int _SDL_xadd_watcom(volatile int *a, int v);
   value [eax] \
   value [eax] \
   modify exact [eax];
   modify exact [eax];
 
 
-#endif /* __WATCOMC__ && __386__ */
-/* *INDENT-ON* */ /* clang-format on */
+#endif // __WATCOMC__ && __386__
+/* *INDENT-ON* */ // clang-format on
 
 
 /*
 /*
   If any of the operations are not provided then we must emulate some
   If any of the operations are not provided then we must emulate some
@@ -131,7 +131,7 @@ SDL_bool SDL_AtomicCompareAndSwap(SDL_AtomicInt *a, int oldval, int newval)
     return _SDL_cmpxchg_watcom(&a->value, newval, oldval);
     return _SDL_cmpxchg_watcom(&a->value, newval, oldval);
 #elif defined(HAVE_GCC_ATOMICS)
 #elif defined(HAVE_GCC_ATOMICS)
     return __sync_bool_compare_and_swap(&a->value, oldval, newval);
     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. */
+#elif defined(SDL_PLATFORM_MACOS) // this is deprecated in 10.12 sdk; favor gcc atomics.
     return OSAtomicCompareAndSwap32Barrier(oldval, newval, &a->value);
     return OSAtomicCompareAndSwap32Barrier(oldval, newval, &a->value);
 #elif defined(SDL_PLATFORM_SOLARIS)
 #elif defined(SDL_PLATFORM_SOLARIS)
     return ((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);
@@ -159,9 +159,9 @@ SDL_bool SDL_AtomicCompareAndSwapPointer(void **a, void *oldval, void *newval)
     return _SDL_cmpxchg_watcom((int *)a, (long)newval, (long)oldval);
     return _SDL_cmpxchg_watcom((int *)a, (long)newval, (long)oldval);
 #elif defined(HAVE_GCC_ATOMICS)
 #elif defined(HAVE_GCC_ATOMICS)
     return __sync_bool_compare_and_swap(a, oldval, newval);
     return __sync_bool_compare_and_swap(a, oldval, newval);
-#elif defined(SDL_PLATFORM_MACOS) && defined(__LP64__)  /* this is deprecated in 10.12 sdk; favor gcc atomics. */
+#elif defined(SDL_PLATFORM_MACOS) && defined(__LP64__)  // this is deprecated in 10.12 sdk; favor gcc atomics.
     return OSAtomicCompareAndSwap64Barrier((int64_t)oldval, (int64_t)newval, (int64_t *)a);
     return OSAtomicCompareAndSwap64Barrier((int64_t)oldval, (int64_t)newval, (int64_t *)a);
-#elif defined(SDL_PLATFORM_MACOS) && !defined(__LP64__) /* this is deprecated in 10.12 sdk; favor gcc atomics. */
+#elif defined(SDL_PLATFORM_MACOS) && !defined(__LP64__) // this is deprecated in 10.12 sdk; favor gcc atomics.
     return OSAtomicCompareAndSwap32Barrier((int32_t)oldval, (int32_t)newval, (int32_t *)a);
     return OSAtomicCompareAndSwap32Barrier((int32_t)oldval, (int32_t)newval, (int32_t *)a);
 #elif defined(SDL_PLATFORM_SOLARIS)
 #elif defined(SDL_PLATFORM_SOLARIS)
     return (atomic_cas_ptr(a, oldval, newval) == oldval);
     return (atomic_cas_ptr(a, oldval, newval) == oldval);
@@ -254,7 +254,7 @@ int SDL_AtomicGet(SDL_AtomicInt *a)
     return _SDL_xadd_watcom(&a->value, 0);
     return _SDL_xadd_watcom(&a->value, 0);
 #elif defined(HAVE_GCC_ATOMICS)
 #elif defined(HAVE_GCC_ATOMICS)
     return __sync_or_and_fetch(&a->value, 0);
     return __sync_or_and_fetch(&a->value, 0);
-#elif defined(SDL_PLATFORM_MACOS) /* this is deprecated in 10.12 sdk; favor gcc atomics. */
+#elif defined(SDL_PLATFORM_MACOS) // this is deprecated in 10.12 sdk; favor gcc atomics.
     return sizeof(a->value) == sizeof(uint32_t) ? OSAtomicOr32Barrier(0, (volatile uint32_t *)&a->value) : OSAtomicAdd64Barrier(0, (volatile int64_t *)&a->value);
     return sizeof(a->value) == sizeof(uint32_t) ? OSAtomicOr32Barrier(0, (volatile uint32_t *)&a->value) : OSAtomicAdd64Barrier(0, (volatile int64_t *)&a->value);
 #elif defined(SDL_PLATFORM_SOLARIS)
 #elif defined(SDL_PLATFORM_SOLARIS)
     return atomic_or_uint_nv((volatile uint_t *)&a->value, 0);
     return atomic_or_uint_nv((volatile uint_t *)&a->value, 0);

+ 12 - 12
src/atomic/SDL_spinlock.c

@@ -44,7 +44,7 @@
 #include <libkern/OSAtomic.h>
 #include <libkern/OSAtomic.h>
 #endif
 #endif
 
 
-/* *INDENT-OFF* */ /* clang-format off */
+/* *INDENT-OFF* */ // clang-format off
 #if defined(__WATCOMC__) && defined(__386__)
 #if defined(__WATCOMC__) && defined(__386__)
 SDL_COMPILE_TIME_ASSERT(locksize, 4==sizeof(SDL_SpinLock));
 SDL_COMPILE_TIME_ASSERT(locksize, 4==sizeof(SDL_SpinLock));
 extern __inline int _SDL_xchg_watcom(volatile int *a, int v);
 extern __inline int _SDL_xchg_watcom(volatile int *a, int v);
@@ -53,10 +53,10 @@ extern __inline int _SDL_xchg_watcom(volatile int *a, int v);
   parm [ecx] [eax] \
   parm [ecx] [eax] \
   value [eax] \
   value [eax] \
   modify exact [eax];
   modify exact [eax];
-#endif /* __WATCOMC__ && __386__ */
-/* *INDENT-ON* */ /* clang-format on */
+#endif // __WATCOMC__ && __386__
+/* *INDENT-ON* */ // clang-format on
 
 
-/* This function is where all the magic happens... */
+// This function is where all the magic happens...
 SDL_bool SDL_TryLockSpinlock(SDL_SpinLock *lock)
 SDL_bool SDL_TryLockSpinlock(SDL_SpinLock *lock)
 {
 {
 #if defined(HAVE_GCC_ATOMICS) || defined(HAVE_GCC_SYNC_LOCK_TEST_AND_SET)
 #if defined(HAVE_GCC_ATOMICS) || defined(HAVE_GCC_SYNC_LOCK_TEST_AND_SET)
@@ -116,15 +116,15 @@ SDL_bool SDL_TryLockSpinlock(SDL_SpinLock *lock)
     return result == 0;
     return result == 0;
 
 
 #elif defined(SDL_PLATFORM_MACOS) || defined(SDL_PLATFORM_IOS) || defined(SDL_PLATFORM_TVOS)
 #elif defined(SDL_PLATFORM_MACOS) || defined(SDL_PLATFORM_IOS) || defined(SDL_PLATFORM_TVOS)
-    /* Maybe used for PowerPC, but the Intel asm or gcc atomics are favored. */
+    // Maybe used for PowerPC, but the Intel asm or gcc atomics are favored.
     return OSAtomicCompareAndSwap32Barrier(0, 1, lock);
     return OSAtomicCompareAndSwap32Barrier(0, 1, lock);
 
 
 #elif defined(SDL_PLATFORM_SOLARIS) && defined(_LP64)
 #elif defined(SDL_PLATFORM_SOLARIS) && defined(_LP64)
-    /* Used for Solaris with non-gcc compilers. */
+    // Used for Solaris with non-gcc compilers.
     return ((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(SDL_PLATFORM_SOLARIS) && !defined(_LP64)
 #elif defined(SDL_PLATFORM_SOLARIS) && !defined(_LP64)
-    /* Used for Solaris with non-gcc compilers. */
+    // Used for Solaris with non-gcc compilers.
     return ((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)
 #elif defined(PS2)
     uint32_t oldintr;
     uint32_t oldintr;
@@ -142,11 +142,11 @@ SDL_bool SDL_TryLockSpinlock(SDL_SpinLock *lock)
     }
     }
     return res;
     return res;
 #else
 #else
-    /* Terrible terrible damage */
+    // Terrible terrible damage
     static SDL_Mutex *_spinlock_mutex;
     static SDL_Mutex *_spinlock_mutex;
 
 
     if (!_spinlock_mutex) {
     if (!_spinlock_mutex) {
-        /* Race condition on first lock... */
+        // Race condition on first lock...
         _spinlock_mutex = SDL_CreateMutex();
         _spinlock_mutex = SDL_CreateMutex();
     }
     }
     SDL_LockMutex(_spinlock_mutex);
     SDL_LockMutex(_spinlock_mutex);
@@ -164,13 +164,13 @@ SDL_bool SDL_TryLockSpinlock(SDL_SpinLock *lock)
 void SDL_LockSpinlock(SDL_SpinLock *lock)
 void SDL_LockSpinlock(SDL_SpinLock *lock)
 {
 {
     int iterations = 0;
     int iterations = 0;
-    /* FIXME: Should we have an eventual timeout? */
+    // FIXME: Should we have an eventual timeout?
     while (!SDL_TryLockSpinlock(lock)) {
     while (!SDL_TryLockSpinlock(lock)) {
         if (iterations < 32) {
         if (iterations < 32) {
             iterations++;
             iterations++;
             SDL_CPUPauseInstruction();
             SDL_CPUPauseInstruction();
         } else {
         } else {
-            /* !!! FIXME: this doesn't definitely give up the current timeslice, it does different things on various platforms. */
+            // !!! FIXME: this doesn't definitely give up the current timeslice, it does different things on various platforms.
             SDL_Delay(0);
             SDL_Delay(0);
         }
         }
     }
     }
@@ -193,7 +193,7 @@ void SDL_UnlockSpinlock(SDL_SpinLock *lock)
     *lock = 0;
     *lock = 0;
 
 
 #elif defined(SDL_PLATFORM_SOLARIS)
 #elif defined(SDL_PLATFORM_SOLARIS)
-    /* Used for Solaris when not using gcc. */
+    // Used for Solaris when not using gcc.
     *lock = 0;
     *lock = 0;
     membar_producer();
     membar_producer();
 
 

+ 1 - 1
src/audio/SDL_audio.c

@@ -1722,7 +1722,7 @@ SDL_AudioDeviceID SDL_OpenAudioDevice(SDL_AudioDeviceID devid, const SDL_AudioSp
             // uhoh, this device is undead, and just waiting to be cleaned up. Refuse explicit opens.
             // uhoh, this device is undead, and just waiting to be cleaned up. Refuse explicit opens.
             SDL_SetError("Device was already lost and can't accept new opens");
             SDL_SetError("Device was already lost and can't accept new opens");
         } else if ((logdev = (SDL_LogicalAudioDevice *) SDL_calloc(1, sizeof (SDL_LogicalAudioDevice))) == NULL) {
         } else if ((logdev = (SDL_LogicalAudioDevice *) SDL_calloc(1, sizeof (SDL_LogicalAudioDevice))) == NULL) {
-            /* SDL_calloc already called SDL_OutOfMemory */
+            // SDL_calloc already called SDL_OutOfMemory
         } else if (OpenPhysicalAudioDevice(device, spec) < 0) {  // if this is the first thing using this physical device, open at the OS level if necessary...
         } else if (OpenPhysicalAudioDevice(device, spec) < 0) {  // if this is the first thing using this physical device, open at the OS level if necessary...
             SDL_free(logdev);
             SDL_free(logdev);
         } else {
         } else {

+ 1 - 1
src/audio/SDL_audio_c.h

@@ -24,4 +24,4 @@
 
 
 extern void SDL_UpdateAudio(void);
 extern void SDL_UpdateAudio(void);
 
 
-#endif /* SDL_audio_c_h_ */
+#endif // SDL_audio_c_h_

+ 1 - 1
src/audio/SDL_audio_channel_converters.h

@@ -1055,7 +1055,7 @@ static void SDL_Convert71To61(float *dst, const float *src, int num_frames)
 
 
 }
 }
 
 
-static const SDL_AudioChannelConverter channel_converters[8][8] = {   /* [from][to] */
+static const SDL_AudioChannelConverter channel_converters[8][8] = {   // [from][to]
     { NULL, SDL_ConvertMonoToStereo, SDL_ConvertMonoTo21, SDL_ConvertMonoToQuad, SDL_ConvertMonoTo41, SDL_ConvertMonoTo51, SDL_ConvertMonoTo61, SDL_ConvertMonoTo71 },
     { NULL, SDL_ConvertMonoToStereo, SDL_ConvertMonoTo21, SDL_ConvertMonoToQuad, SDL_ConvertMonoTo41, SDL_ConvertMonoTo51, SDL_ConvertMonoTo61, SDL_ConvertMonoTo71 },
     { SDL_ConvertStereoToMono, NULL, SDL_ConvertStereoTo21, SDL_ConvertStereoToQuad, SDL_ConvertStereoTo41, SDL_ConvertStereoTo51, SDL_ConvertStereoTo61, SDL_ConvertStereoTo71 },
     { SDL_ConvertStereoToMono, NULL, SDL_ConvertStereoTo21, SDL_ConvertStereoToQuad, SDL_ConvertStereoTo41, SDL_ConvertStereoTo51, SDL_ConvertStereoTo61, SDL_ConvertStereoTo71 },
     { SDL_Convert21ToMono, SDL_Convert21ToStereo, NULL, SDL_Convert21ToQuad, SDL_Convert21To41, SDL_Convert21To51, SDL_Convert21To61, SDL_Convert21To71 },
     { SDL_Convert21ToMono, SDL_Convert21ToStereo, NULL, SDL_Convert21ToQuad, SDL_Convert21To41, SDL_Convert21To51, SDL_Convert21To61, SDL_Convert21To71 },

+ 124 - 124
src/audio/SDL_wave.c

@@ -24,14 +24,14 @@
 #include <limits.h>
 #include <limits.h>
 #endif
 #endif
 #ifndef INT_MAX
 #ifndef INT_MAX
-/* Make a lucky guess. */
+// Make a lucky guess.
 #define INT_MAX SDL_MAX_SINT32
 #define INT_MAX SDL_MAX_SINT32
 #endif
 #endif
 #ifndef SIZE_MAX
 #ifndef SIZE_MAX
 #define SIZE_MAX ((size_t)-1)
 #define SIZE_MAX ((size_t)-1)
 #endif
 #endif
 
 
-/* Microsoft WAVE file loading routines */
+// Microsoft WAVE file loading routines
 
 
 #include "SDL_wave.h"
 #include "SDL_wave.h"
 #include "SDL_sysaudio.h"
 #include "SDL_sysaudio.h"
@@ -52,17 +52,17 @@ static int SafeMult(size_t *f1, size_t f2)
 
 
 typedef struct ADPCM_DecoderState
 typedef struct ADPCM_DecoderState
 {
 {
-    Uint32 channels;        /* Number of channels. */
-    size_t blocksize;       /* Size of an ADPCM block in bytes. */
-    size_t blockheadersize; /* Size of an ADPCM block header in bytes. */
-    size_t samplesperblock; /* Number of samples per channel in an ADPCM block. */
-    size_t framesize;       /* Size of a sample frame (16-bit PCM) in bytes. */
-    Sint64 framestotal;     /* Total number of sample frames. */
-    Sint64 framesleft;      /* Number of sample frames still to be decoded. */
-    void *ddata;            /* Decoder data from initialization. */
-    void *cstate;           /* Decoding state for each channel. */
-
-    /* ADPCM data. */
+    Uint32 channels;        // Number of channels.
+    size_t blocksize;       // Size of an ADPCM block in bytes.
+    size_t blockheadersize; // Size of an ADPCM block header in bytes.
+    size_t samplesperblock; // Number of samples per channel in an ADPCM block.
+    size_t framesize;       // Size of a sample frame (16-bit PCM) in bytes.
+    Sint64 framestotal;     // Total number of sample frames.
+    Sint64 framesleft;      // Number of sample frames still to be decoded.
+    void *ddata;            // Decoder data from initialization.
+    void *cstate;           // Decoding state for each channel.
+
+    // ADPCM data.
     struct
     struct
     {
     {
         Uint8 *data;
         Uint8 *data;
@@ -70,7 +70,7 @@ typedef struct ADPCM_DecoderState
         size_t pos;
         size_t pos;
     } input;
     } input;
 
 
-    /* Current ADPCM block in the ADPCM data above. */
+    // Current ADPCM block in the ADPCM data above.
     struct
     struct
     {
     {
         Uint8 *data;
         Uint8 *data;
@@ -78,7 +78,7 @@ typedef struct ADPCM_DecoderState
         size_t pos;
         size_t pos;
     } block;
     } block;
 
 
-    /* Decoded 16-bit PCM data. */
+    // Decoded 16-bit PCM data.
     struct
     struct
     {
     {
         Sint16 *data;
         Sint16 *data;
@@ -91,7 +91,7 @@ typedef struct MS_ADPCM_CoeffData
 {
 {
     Uint16 coeffcount;
     Uint16 coeffcount;
     Sint16 *coeff;
     Sint16 *coeff;
-    Sint16 aligndummy; /* Has to be last member. */
+    Sint16 aligndummy; // Has to be last member.
 } MS_ADPCM_CoeffData;
 } MS_ADPCM_CoeffData;
 
 
 typedef struct MS_ADPCM_ChannelState
 typedef struct MS_ADPCM_ChannelState
@@ -342,18 +342,18 @@ static int MS_ADPCM_CalculateSampleFrames(WaveFile *file, size_t datalength)
     const size_t trailingdata = datalength % file->format.blockalign;
     const size_t trailingdata = datalength % file->format.blockalign;
 
 
     if (file->trunchint == TruncVeryStrict || file->trunchint == TruncStrict) {
     if (file->trunchint == TruncVeryStrict || file->trunchint == TruncStrict) {
-        /* The size of the data chunk must be a multiple of the block size. */
+        // The size of the data chunk must be a multiple of the block size.
         if (datalength < blockheadersize || trailingdata > 0) {
         if (datalength < blockheadersize || trailingdata > 0) {
             return SDL_SetError("Truncated MS ADPCM block");
             return SDL_SetError("Truncated MS ADPCM block");
         }
         }
     }
     }
 
 
-    /* Calculate number of sample frames that will be decoded. */
+    // Calculate number of sample frames that will be decoded.
     file->sampleframes = (Sint64)availableblocks * format->samplesperblock;
     file->sampleframes = (Sint64)availableblocks * format->samplesperblock;
     if (trailingdata > 0) {
     if (trailingdata > 0) {
-        /* The last block is truncated. Check if we can get any samples out of it. */
+        // The last block is truncated. Check if we can get any samples out of it.
         if (file->trunchint == TruncDropFrame) {
         if (file->trunchint == TruncDropFrame) {
-            /* Drop incomplete sample frame. */
+            // Drop incomplete sample frame.
             if (trailingdata >= blockheadersize) {
             if (trailingdata >= blockheadersize) {
                 size_t trailingsamples = 2 + (trailingdata - blockheadersize) * 8 / blockframebitsize;
                 size_t trailingsamples = 2 + (trailingdata - blockheadersize) * 8 / blockframebitsize;
                 if (trailingsamples > format->samplesperblock) {
                 if (trailingsamples > format->samplesperblock) {
@@ -384,7 +384,7 @@ static int MS_ADPCM_Init(WaveFile *file, size_t datalength)
     size_t i, coeffcount;
     size_t i, coeffcount;
     MS_ADPCM_CoeffData *coeffdata;
     MS_ADPCM_CoeffData *coeffdata;
 
 
-    /* Sanity checks. */
+    // Sanity checks.
 
 
     /* While it's clear how IMA ADPCM handles more than two channels, the nibble
     /* While it's clear how IMA ADPCM handles more than two channels, the nibble
      * order of MS ADPCM makes it awkward. The Standards Update does not talk
      * order of MS ADPCM makes it awkward. The Standards Update does not talk
@@ -398,7 +398,7 @@ static int MS_ADPCM_Init(WaveFile *file, size_t datalength)
         return SDL_SetError("Invalid MS ADPCM bits per sample of %u", (unsigned int)format->bitspersample);
         return SDL_SetError("Invalid MS ADPCM bits per sample of %u", (unsigned int)format->bitspersample);
     }
     }
 
 
-    /* The block size must be big enough to contain the block header. */
+    // The block size must be big enough to contain the block header.
     if (format->blockalign < blockheadersize) {
     if (format->blockalign < blockheadersize) {
         return SDL_SetError("Invalid MS ADPCM block size (nBlockAlign)");
         return SDL_SetError("Invalid MS ADPCM block size (nBlockAlign)");
     }
     }
@@ -419,7 +419,7 @@ static int MS_ADPCM_Init(WaveFile *file, size_t datalength)
     }
     }
 
 
     format->samplesperblock = chunk->data[18] | ((Uint16)chunk->data[19] << 8);
     format->samplesperblock = chunk->data[18] | ((Uint16)chunk->data[19] << 8);
-    /* Number of coefficient pairs. A pair has two 16-bit integers. */
+    // Number of coefficient pairs. A pair has two 16-bit integers.
     coeffcount = chunk->data[20] | ((size_t)chunk->data[21] << 8);
     coeffcount = chunk->data[20] | ((size_t)chunk->data[21] << 8);
     /* bPredictor, the integer offset into the coefficients array, is only
     /* bPredictor, the integer offset into the coefficients array, is only
      * 8 bits. It can only address the first 256 coefficients. Let's limit
      * 8 bits. It can only address the first 256 coefficients. Let's limit
@@ -438,14 +438,14 @@ static int MS_ADPCM_Init(WaveFile *file, size_t datalength)
     }
     }
 
 
     coeffdata = (MS_ADPCM_CoeffData *)SDL_malloc(sizeof(MS_ADPCM_CoeffData) + coeffcount * 4);
     coeffdata = (MS_ADPCM_CoeffData *)SDL_malloc(sizeof(MS_ADPCM_CoeffData) + coeffcount * 4);
-    file->decoderdata = coeffdata; /* Freed in cleanup. */
+    file->decoderdata = coeffdata; // Freed in cleanup.
     if (!coeffdata) {
     if (!coeffdata) {
         return -1;
         return -1;
     }
     }
     coeffdata->coeff = &coeffdata->aligndummy;
     coeffdata->coeff = &coeffdata->aligndummy;
     coeffdata->coeffcount = (Uint16)coeffcount;
     coeffdata->coeffcount = (Uint16)coeffcount;
 
 
-    /* Copy the 16-bit pairs. */
+    // Copy the 16-bit pairs.
     for (i = 0; i < coeffcount * 2; i++) {
     for (i = 0; i < coeffcount * 2; i++) {
         Sint32 c = chunk->data[22 + i * 2] | ((Sint32)chunk->data[23 + i * 2] << 8);
         Sint32 c = chunk->data[22 + i * 2] | ((Sint32)chunk->data[23 + i * 2] << 8);
         if (c >= 0x8000) {
         if (c >= 0x8000) {
@@ -504,7 +504,7 @@ static Sint16 MS_ADPCM_ProcessNibble(MS_ADPCM_ChannelState *cstate, Sint32 sampl
     Uint32 delta = cstate->delta;
     Uint32 delta = cstate->delta;
 
 
     new_sample = (sample1 * cstate->coeff1 + sample2 * cstate->coeff2) / 256;
     new_sample = (sample1 * cstate->coeff1 + sample2 * cstate->coeff2) / 256;
-    /* The nibble is a signed 4-bit error delta. */
+    // The nibble is a signed 4-bit error delta.
     errordelta = (Sint32)nybble - (nybble >= 0x08 ? 0x10 : 0);
     errordelta = (Sint32)nybble - (nybble >= 0x08 ? 0x10 : 0);
     new_sample += (Sint32)delta * errordelta;
     new_sample += (Sint32)delta * errordelta;
     if (new_sample < min_audioval) {
     if (new_sample < min_audioval) {
@@ -538,7 +538,7 @@ static int MS_ADPCM_DecodeBlockHeader(ADPCM_DecoderState *state)
     for (c = 0; c < channels; c++) {
     for (c = 0; c < channels; c++) {
         size_t o = c;
         size_t o = c;
 
 
-        /* Load the coefficient pair into the channel state. */
+        // Load the coefficient pair into the channel state.
         coeffindex = state->block.data[o];
         coeffindex = state->block.data[o];
         if (coeffindex > ddata->coeffcount) {
         if (coeffindex > ddata->coeffcount) {
             return SDL_SetError("Invalid MS ADPCM coefficient index in block header");
             return SDL_SetError("Invalid MS ADPCM coefficient index in block header");
@@ -546,7 +546,7 @@ static int MS_ADPCM_DecodeBlockHeader(ADPCM_DecoderState *state)
         cstate[c].coeff1 = ddata->coeff[coeffindex * 2];
         cstate[c].coeff1 = ddata->coeff[coeffindex * 2];
         cstate[c].coeff2 = ddata->coeff[coeffindex * 2 + 1];
         cstate[c].coeff2 = ddata->coeff[coeffindex * 2 + 1];
 
 
-        /* Initial delta value. */
+        // Initial delta value.
         o = (size_t)channels + c * 2;
         o = (size_t)channels + c * 2;
         cstate[c].delta = state->block.data[o] | ((Uint16)state->block.data[o + 1] << 8);
         cstate[c].delta = state->block.data[o] | ((Uint16)state->block.data[o + 1] << 8);
 
 
@@ -572,10 +572,10 @@ static int MS_ADPCM_DecodeBlockHeader(ADPCM_DecoderState *state)
 
 
     state->block.pos += state->blockheadersize;
     state->block.pos += state->blockheadersize;
 
 
-    /* Skip second sample frame that came from the header. */
+    // Skip second sample frame that came from the header.
     state->output.pos += state->channels;
     state->output.pos += state->channels;
 
 
-    /* Header provided two sample frames. */
+    // Header provided two sample frames.
     state->framesleft -= 2;
     state->framesleft -= 2;
 
 
     return 0;
     return 0;
@@ -611,12 +611,12 @@ static int MS_ADPCM_DecodeBlockData(ADPCM_DecoderState *state)
             } else if (blockpos < blocksize) {
             } else if (blockpos < blocksize) {
                 nybble = state->block.data[blockpos++] | 0x4000;
                 nybble = state->block.data[blockpos++] | 0x4000;
             } else {
             } else {
-                /* Out of input data. Drop the incomplete frame and return. */
+                // Out of input data. Drop the incomplete frame and return.
                 state->output.pos = outpos - c;
                 state->output.pos = outpos - c;
                 return -1;
                 return -1;
             }
             }
 
 
-            /* Load previous samples which may come from the block header. */
+            // Load previous samples which may come from the block header.
             sample1 = state->output.data[outpos - channels];
             sample1 = state->output.data[outpos - channels];
             sample2 = state->output.data[outpos - channels * 2];
             sample2 = state->output.data[outpos - channels * 2];
 
 
@@ -645,13 +645,13 @@ static int MS_ADPCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len)
     SDL_zeroa(cstate);
     SDL_zeroa(cstate);
 
 
     if (chunk->size != chunk->length) {
     if (chunk->size != chunk->length) {
-        /* Could not read everything. Recalculate number of sample frames. */
+        // Could not read everything. Recalculate number of sample frames.
         if (MS_ADPCM_CalculateSampleFrames(file, chunk->size) < 0) {
         if (MS_ADPCM_CalculateSampleFrames(file, chunk->size) < 0) {
             return -1;
             return -1;
         }
         }
     }
     }
 
 
-    /* Nothing to decode, nothing to return. */
+    // Nothing to decode, nothing to return.
     if (file->sampleframes == 0) {
     if (file->sampleframes == 0) {
         *audio_buf = NULL;
         *audio_buf = NULL;
         *audio_len = 0;
         *audio_len = 0;
@@ -671,7 +671,7 @@ static int MS_ADPCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len)
     state.input.size = chunk->size;
     state.input.size = chunk->size;
     state.input.pos = 0;
     state.input.pos = 0;
 
 
-    /* The output size in bytes. May get modified if data is truncated. */
+    // The output size in bytes. May get modified if data is truncated.
     outputsize = (size_t)state.framestotal;
     outputsize = (size_t)state.framestotal;
     if (SafeMult(&outputsize, state.framesize)) {
     if (SafeMult(&outputsize, state.framesize)) {
         return SDL_SetError("WAVE file too big");
         return SDL_SetError("WAVE file too big");
@@ -688,7 +688,7 @@ static int MS_ADPCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len)
 
 
     state.cstate = cstate;
     state.cstate = cstate;
 
 
-    /* Decode block by block. A truncated block will stop the decoding. */
+    // Decode block by block. A truncated block will stop the decoding.
     bytesleft = state.input.size - state.input.pos;
     bytesleft = state.input.size - state.input.pos;
     while (state.framesleft > 0 && bytesleft >= state.blockheadersize) {
     while (state.framesleft > 0 && bytesleft >= state.blockheadersize) {
         state.block.data = state.input.data + state.input.pos;
         state.block.data = state.input.data + state.input.pos;
@@ -696,29 +696,29 @@ static int MS_ADPCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len)
         state.block.pos = 0;
         state.block.pos = 0;
 
 
         if (state.output.size - state.output.pos < (Uint64)state.framesleft * state.channels) {
         if (state.output.size - state.output.pos < (Uint64)state.framesleft * state.channels) {
-            /* Somehow didn't allocate enough space for the output. */
+            // Somehow didn't allocate enough space for the output.
             SDL_free(state.output.data);
             SDL_free(state.output.data);
             return SDL_SetError("Unexpected overflow in MS ADPCM decoder");
             return SDL_SetError("Unexpected overflow in MS ADPCM decoder");
         }
         }
 
 
-        /* Initialize decoder with the values from the block header. */
+        // Initialize decoder with the values from the block header.
         result = MS_ADPCM_DecodeBlockHeader(&state);
         result = MS_ADPCM_DecodeBlockHeader(&state);
         if (result < 0) {
         if (result < 0) {
             SDL_free(state.output.data);
             SDL_free(state.output.data);
             return -1;
             return -1;
         }
         }
 
 
-        /* Decode the block data. It stores the samples directly in the output. */
+        // Decode the block data. It stores the samples directly in the output.
         result = MS_ADPCM_DecodeBlockData(&state);
         result = MS_ADPCM_DecodeBlockData(&state);
         if (result < 0) {
         if (result < 0) {
-            /* Unexpected end. Stop decoding and return partial data if necessary. */
+            // Unexpected end. Stop decoding and return partial data if necessary.
             if (file->trunchint == TruncVeryStrict || file->trunchint == TruncStrict) {
             if (file->trunchint == TruncVeryStrict || file->trunchint == TruncStrict) {
                 SDL_free(state.output.data);
                 SDL_free(state.output.data);
                 return SDL_SetError("Truncated data chunk");
                 return SDL_SetError("Truncated data chunk");
             } else if (file->trunchint != TruncDropFrame) {
             } else if (file->trunchint != TruncDropFrame) {
                 state.output.pos -= state.output.pos % (state.samplesperblock * state.channels);
                 state.output.pos -= state.output.pos % (state.samplesperblock * state.channels);
             }
             }
-            outputsize = state.output.pos * sizeof(Sint16); /* Can't overflow, is always smaller. */
+            outputsize = state.output.pos * sizeof(Sint16); // Can't overflow, is always smaller.
             break;
             break;
         }
         }
 
 
@@ -741,16 +741,16 @@ static int IMA_ADPCM_CalculateSampleFrames(WaveFile *file, size_t datalength)
     const size_t trailingdata = datalength % format->blockalign;
     const size_t trailingdata = datalength % format->blockalign;
 
 
     if (file->trunchint == TruncVeryStrict || file->trunchint == TruncStrict) {
     if (file->trunchint == TruncVeryStrict || file->trunchint == TruncStrict) {
-        /* The size of the data chunk must be a multiple of the block size. */
+        // The size of the data chunk must be a multiple of the block size.
         if (datalength < blockheadersize || trailingdata > 0) {
         if (datalength < blockheadersize || trailingdata > 0) {
             return SDL_SetError("Truncated IMA ADPCM block");
             return SDL_SetError("Truncated IMA ADPCM block");
         }
         }
     }
     }
 
 
-    /* Calculate number of sample frames that will be decoded. */
+    // Calculate number of sample frames that will be decoded.
     file->sampleframes = (Uint64)availableblocks * format->samplesperblock;
     file->sampleframes = (Uint64)availableblocks * format->samplesperblock;
     if (trailingdata > 0) {
     if (trailingdata > 0) {
-        /* The last block is truncated. Check if we can get any samples out of it. */
+        // The last block is truncated. Check if we can get any samples out of it.
         if (file->trunchint == TruncDropFrame && trailingdata > blockheadersize - 2) {
         if (file->trunchint == TruncDropFrame && trailingdata > blockheadersize - 2) {
             /* The sample frame in the header of the truncated block is present.
             /* The sample frame in the header of the truncated block is present.
              * Drop incomplete sample frames.
              * Drop incomplete sample frames.
@@ -758,7 +758,7 @@ static int IMA_ADPCM_CalculateSampleFrames(WaveFile *file, size_t datalength)
             size_t trailingsamples = 1;
             size_t trailingsamples = 1;
 
 
             if (trailingdata > blockheadersize) {
             if (trailingdata > blockheadersize) {
-                /* More data following after the header. */
+                // More data following after the header.
                 const size_t trailingblockdata = trailingdata - blockheadersize;
                 const size_t trailingblockdata = trailingdata - blockheadersize;
                 const size_t trailingsubblockdata = trailingblockdata % subblockframesize;
                 const size_t trailingsubblockdata = trailingblockdata % subblockframesize;
                 trailingsamples += (trailingblockdata / subblockframesize) * 8;
                 trailingsamples += (trailingblockdata / subblockframesize) * 8;
@@ -794,9 +794,9 @@ static int IMA_ADPCM_Init(WaveFile *file, size_t datalength)
     const size_t blockframebitsize = (size_t)format->bitspersample * format->channels;
     const size_t blockframebitsize = (size_t)format->bitspersample * format->channels;
     const size_t blockdatasamples = (blockdatasize * 8) / blockframebitsize;
     const size_t blockdatasamples = (blockdatasize * 8) / blockframebitsize;
 
 
-    /* Sanity checks. */
+    // Sanity checks.
 
 
-    /* IMA ADPCM can also have 3-bit samples, but it's not supported by SDL at this time. */
+    // IMA ADPCM can also have 3-bit samples, but it's not supported by SDL at this time.
     if (format->bitspersample == 3) {
     if (format->bitspersample == 3) {
         return SDL_SetError("3-bit IMA ADPCM currently not supported");
         return SDL_SetError("3-bit IMA ADPCM currently not supported");
     } else if (format->bitspersample != 4) {
     } else if (format->bitspersample != 4) {
@@ -815,7 +815,7 @@ static int IMA_ADPCM_Init(WaveFile *file, size_t datalength)
          * format because the extensible header has wSampePerBlocks too.
          * format because the extensible header has wSampePerBlocks too.
          */
          */
     } else {
     } else {
-        /* The Standards Update says there 'should' be 2 bytes for wSamplesPerBlock. */
+        // The Standards Update says there 'should' be 2 bytes for wSamplesPerBlock.
         if (chunk->size >= 20 && format->extsize >= 2) {
         if (chunk->size >= 20 && format->extsize >= 2) {
             format->samplesperblock = chunk->data[18] | ((Uint16)chunk->data[19] << 8);
             format->samplesperblock = chunk->data[18] | ((Uint16)chunk->data[19] << 8);
         }
         }
@@ -874,17 +874,17 @@ static Sint16 IMA_ADPCM_ProcessNibble(Sint8 *cindex, Sint16 lastsample, Uint8 ny
     Sint32 sample, delta;
     Sint32 sample, delta;
     Sint8 index = *cindex;
     Sint8 index = *cindex;
 
 
-    /* Clamp index into valid range. */
+    // Clamp index into valid range.
     if (index > 88) {
     if (index > 88) {
         index = 88;
         index = 88;
     } else if (index < 0) {
     } else if (index < 0) {
         index = 0;
         index = 0;
     }
     }
 
 
-    /* explicit cast to avoid gcc warning about using 'char' as array index */
+    // explicit cast to avoid gcc warning about using 'char' as array index
     step = step_table[(size_t)index];
     step = step_table[(size_t)index];
 
 
-    /* Update index value */
+    // Update index value
     *cindex = index + index_table_4b[nybble];
     *cindex = index + index_table_4b[nybble];
 
 
     /* This calculation uses shifts and additions because multiplications were
     /* This calculation uses shifts and additions because multiplications were
@@ -909,7 +909,7 @@ static Sint16 IMA_ADPCM_ProcessNibble(Sint8 *cindex, Sint16 lastsample, Uint8 ny
 
 
     sample = lastsample + delta;
     sample = lastsample + delta;
 
 
-    /* Clamp output sample */
+    // Clamp output sample
     if (sample > max_audioval) {
     if (sample > max_audioval) {
         sample = max_audioval;
         sample = max_audioval;
     } else if (sample < min_audioval) {
     } else if (sample < min_audioval) {
@@ -928,18 +928,18 @@ static int IMA_ADPCM_DecodeBlockHeader(ADPCM_DecoderState *state)
     for (c = 0; c < state->channels; c++) {
     for (c = 0; c < state->channels; c++) {
         size_t o = state->block.pos + c * 4;
         size_t o = state->block.pos + c * 4;
 
 
-        /* Extract the sample from the header. */
+        // Extract the sample from the header.
         Sint32 sample = state->block.data[o] | ((Sint32)state->block.data[o + 1] << 8);
         Sint32 sample = state->block.data[o] | ((Sint32)state->block.data[o + 1] << 8);
         if (sample >= 0x8000) {
         if (sample >= 0x8000) {
             sample -= 0x10000;
             sample -= 0x10000;
         }
         }
         state->output.data[state->output.pos++] = (Sint16)sample;
         state->output.data[state->output.pos++] = (Sint16)sample;
 
 
-        /* Channel step index. */
+        // Channel step index.
         step = (Sint16)state->block.data[o + 2];
         step = (Sint16)state->block.data[o + 2];
         cstate[c] = (Sint8)(step > 0x80 ? step - 0x100 : step);
         cstate[c] = (Sint8)(step > 0x80 ? step - 0x100 : step);
 
 
-        /* Reserved byte in block header, should be 0. */
+        // Reserved byte in block header, should be 0.
         if (state->block.data[o + 3] != 0) {
         if (state->block.data[o + 3] != 0) {
             /* Uh oh, corrupt data?  Buggy code? */;
             /* Uh oh, corrupt data?  Buggy code? */;
         }
         }
@@ -947,7 +947,7 @@ static int IMA_ADPCM_DecodeBlockHeader(ADPCM_DecoderState *state)
 
 
     state->block.pos += state->blockheadersize;
     state->block.pos += state->blockheadersize;
 
 
-    /* Header provided one sample frame. */
+    // Header provided one sample frame.
     state->framesleft--;
     state->framesleft--;
 
 
     return 0;
     return 0;
@@ -980,14 +980,14 @@ static int IMA_ADPCM_DecodeBlockData(ADPCM_DecoderState *state)
 
 
     bytesrequired = (blockframesleft + 7) / 8 * subblockframesize;
     bytesrequired = (blockframesleft + 7) / 8 * subblockframesize;
     if (blockleft < bytesrequired) {
     if (blockleft < bytesrequired) {
-        /* Data truncated. Calculate how many samples we can get out if it. */
+        // Data truncated. Calculate how many samples we can get out if it.
         const size_t guaranteedframes = blockleft / subblockframesize;
         const size_t guaranteedframes = blockleft / subblockframesize;
         const size_t remainingbytes = blockleft % subblockframesize;
         const size_t remainingbytes = blockleft % subblockframesize;
         blockframesleft = guaranteedframes;
         blockframesleft = guaranteedframes;
         if (remainingbytes > subblockframesize - 4) {
         if (remainingbytes > subblockframesize - 4) {
             blockframesleft += (Sint64)(remainingbytes % 4) * 2;
             blockframesleft += (Sint64)(remainingbytes % 4) * 2;
         }
         }
-        /* Signal the truncation. */
+        // Signal the truncation.
         retval = -1;
         retval = -1;
     }
     }
 
 
@@ -1001,7 +1001,7 @@ static int IMA_ADPCM_DecodeBlockData(ADPCM_DecoderState *state)
 
 
         for (c = 0; c < channels; c++) {
         for (c = 0; c < channels; c++) {
             Uint8 nybble = 0;
             Uint8 nybble = 0;
-            /* Load previous sample which may come from the block header. */
+            // Load previous sample which may come from the block header.
             Sint16 sample = state->output.data[outpos + c - channels];
             Sint16 sample = state->output.data[outpos + c - channels];
 
 
             for (i = 0; i < subblocksamples; i++) {
             for (i = 0; i < subblocksamples; i++) {
@@ -1036,13 +1036,13 @@ static int IMA_ADPCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len
     Sint8 *cstate;
     Sint8 *cstate;
 
 
     if (chunk->size != chunk->length) {
     if (chunk->size != chunk->length) {
-        /* Could not read everything. Recalculate number of sample frames. */
+        // Could not read everything. Recalculate number of sample frames.
         if (IMA_ADPCM_CalculateSampleFrames(file, chunk->size) < 0) {
         if (IMA_ADPCM_CalculateSampleFrames(file, chunk->size) < 0) {
             return -1;
             return -1;
         }
         }
     }
     }
 
 
-    /* Nothing to decode, nothing to return. */
+    // Nothing to decode, nothing to return.
     if (file->sampleframes == 0) {
     if (file->sampleframes == 0) {
         *audio_buf = NULL;
         *audio_buf = NULL;
         *audio_len = 0;
         *audio_len = 0;
@@ -1062,7 +1062,7 @@ static int IMA_ADPCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len
     state.input.size = chunk->size;
     state.input.size = chunk->size;
     state.input.pos = 0;
     state.input.pos = 0;
 
 
-    /* The output size in bytes. May get modified if data is truncated. */
+    // The output size in bytes. May get modified if data is truncated.
     outputsize = (size_t)state.framestotal;
     outputsize = (size_t)state.framestotal;
     if (SafeMult(&outputsize, state.framesize)) {
     if (SafeMult(&outputsize, state.framesize)) {
         return SDL_SetError("WAVE file too big");
         return SDL_SetError("WAVE file too big");
@@ -1084,7 +1084,7 @@ static int IMA_ADPCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len
     }
     }
     state.cstate = cstate;
     state.cstate = cstate;
 
 
-    /* Decode block by block. A truncated block will stop the decoding. */
+    // Decode block by block. A truncated block will stop the decoding.
     bytesleft = state.input.size - state.input.pos;
     bytesleft = state.input.size - state.input.pos;
     while (state.framesleft > 0 && bytesleft >= state.blockheadersize) {
     while (state.framesleft > 0 && bytesleft >= state.blockheadersize) {
         state.block.data = state.input.data + state.input.pos;
         state.block.data = state.input.data + state.input.pos;
@@ -1092,21 +1092,21 @@ static int IMA_ADPCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len
         state.block.pos = 0;
         state.block.pos = 0;
 
 
         if (state.output.size - state.output.pos < (Uint64)state.framesleft * state.channels) {
         if (state.output.size - state.output.pos < (Uint64)state.framesleft * state.channels) {
-            /* Somehow didn't allocate enough space for the output. */
+            // Somehow didn't allocate enough space for the output.
             SDL_free(state.output.data);
             SDL_free(state.output.data);
             SDL_free(cstate);
             SDL_free(cstate);
             return SDL_SetError("Unexpected overflow in IMA ADPCM decoder");
             return SDL_SetError("Unexpected overflow in IMA ADPCM decoder");
         }
         }
 
 
-        /* Initialize decoder with the values from the block header. */
+        // Initialize decoder with the values from the block header.
         result = IMA_ADPCM_DecodeBlockHeader(&state);
         result = IMA_ADPCM_DecodeBlockHeader(&state);
         if (result == 0) {
         if (result == 0) {
-            /* Decode the block data. It stores the samples directly in the output. */
+            // Decode the block data. It stores the samples directly in the output.
             result = IMA_ADPCM_DecodeBlockData(&state);
             result = IMA_ADPCM_DecodeBlockData(&state);
         }
         }
 
 
         if (result < 0) {
         if (result < 0) {
-            /* Unexpected end. Stop decoding and return partial data if necessary. */
+            // Unexpected end. Stop decoding and return partial data if necessary.
             if (file->trunchint == TruncVeryStrict || file->trunchint == TruncStrict) {
             if (file->trunchint == TruncVeryStrict || file->trunchint == TruncStrict) {
                 SDL_free(state.output.data);
                 SDL_free(state.output.data);
                 SDL_free(cstate);
                 SDL_free(cstate);
@@ -1114,7 +1114,7 @@ static int IMA_ADPCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len
             } else if (file->trunchint != TruncDropFrame) {
             } else if (file->trunchint != TruncDropFrame) {
                 state.output.pos -= state.output.pos % (state.samplesperblock * state.channels);
                 state.output.pos -= state.output.pos % (state.samplesperblock * state.channels);
             }
             }
-            outputsize = state.output.pos * sizeof(Sint16); /* Can't overflow, is always smaller. */
+            outputsize = state.output.pos * sizeof(Sint16); // Can't overflow, is always smaller.
             break;
             break;
         }
         }
 
 
@@ -1134,12 +1134,12 @@ static int LAW_Init(WaveFile *file, size_t datalength)
 {
 {
     WaveFormat *format = &file->format;
     WaveFormat *format = &file->format;
 
 
-    /* Standards Update requires this to be 8. */
+    // Standards Update requires this to be 8.
     if (format->bitspersample != 8) {
     if (format->bitspersample != 8) {
         return SDL_SetError("Invalid companded bits per sample of %u", (unsigned int)format->bitspersample);
         return SDL_SetError("Invalid companded bits per sample of %u", (unsigned int)format->bitspersample);
     }
     }
 
 
-    /* Not going to bother with weird padding. */
+    // Not going to bother with weird padding.
     if (format->blockalign != format->channels) {
     if (format->blockalign != format->channels) {
         return SDL_SetError("Unsupported block alignment");
         return SDL_SetError("Unsupported block alignment");
     }
     }
@@ -1212,7 +1212,7 @@ static int LAW_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len)
         }
         }
     }
     }
 
 
-    /* Nothing to decode, nothing to return. */
+    // Nothing to decode, nothing to return.
     if (file->sampleframes == 0) {
     if (file->sampleframes == 0) {
         *audio_buf = NULL;
         *audio_buf = NULL;
         *audio_len = 0;
         *audio_len = 0;
@@ -1231,7 +1231,7 @@ static int LAW_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len)
         return SDL_SetError("WAVE file too big");
         return SDL_SetError("WAVE file too big");
     }
     }
 
 
-    /* 1 to avoid allocating zero bytes, to keep static analysis happy. */
+    // 1 to avoid allocating zero bytes, to keep static analysis happy.
     src = (Uint8 *)SDL_realloc(chunk->data, expanded_len ? expanded_len : 1);
     src = (Uint8 *)SDL_realloc(chunk->data, expanded_len ? expanded_len : 1);
     if (!src) {
     if (!src) {
         return -1;
         return -1;
@@ -1310,7 +1310,7 @@ static int PCM_Init(WaveFile *file, size_t datalength)
         case 16:
         case 16:
         case 24:
         case 24:
         case 32:
         case 32:
-            /* These are supported. */
+            // These are supported.
             break;
             break;
         default:
         default:
             return SDL_SetError("%u-bit PCM format not supported", (unsigned int)format->bitspersample);
             return SDL_SetError("%u-bit PCM format not supported", (unsigned int)format->bitspersample);
@@ -1324,7 +1324,7 @@ static int PCM_Init(WaveFile *file, size_t datalength)
     /* It wouldn't be that hard to support more exotic block sizes, but
     /* It wouldn't be that hard to support more exotic block sizes, but
      * the most common formats should do for now.
      * the most common formats should do for now.
      */
      */
-    /* Make sure we're a multiple of the blockalign, at least. */
+    // Make sure we're a multiple of the blockalign, at least.
     if ((format->channels * format->bitspersample) % (format->blockalign * 8)) {
     if ((format->channels * format->bitspersample) % (format->blockalign * 8)) {
         return SDL_SetError("Unsupported block alignment");
         return SDL_SetError("Unsupported block alignment");
     }
     }
@@ -1362,20 +1362,20 @@ static int PCM_ConvertSint24ToSint32(WaveFile *file, Uint8 **audio_buf, Uint32 *
         return SDL_SetError("WAVE file too big");
         return SDL_SetError("WAVE file too big");
     }
     }
 
 
-    /* 1 to avoid allocating zero bytes, to keep static analysis happy. */
+    // 1 to avoid allocating zero bytes, to keep static analysis happy.
     ptr = (Uint8 *)SDL_realloc(chunk->data, expanded_len ? expanded_len : 1);
     ptr = (Uint8 *)SDL_realloc(chunk->data, expanded_len ? expanded_len : 1);
     if (!ptr) {
     if (!ptr) {
         return -1;
         return -1;
     }
     }
 
 
-    /* This pointer is now invalid. */
+    // This pointer is now invalid.
     chunk->data = NULL;
     chunk->data = NULL;
     chunk->size = 0;
     chunk->size = 0;
 
 
     *audio_buf = ptr;
     *audio_buf = ptr;
     *audio_len = (Uint32)expanded_len;
     *audio_len = (Uint32)expanded_len;
 
 
-    /* work from end to start, since we're expanding in-place. */
+    // work from end to start, since we're expanding in-place.
     for (i = sample_count; i > 0; i--) {
     for (i = sample_count; i > 0; i--) {
         const size_t o = i - 1;
         const size_t o = i - 1;
         uint8_t b[4];
         uint8_t b[4];
@@ -1407,14 +1407,14 @@ static int PCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len)
         }
         }
     }
     }
 
 
-    /* Nothing to decode, nothing to return. */
+    // Nothing to decode, nothing to return.
     if (file->sampleframes == 0) {
     if (file->sampleframes == 0) {
         *audio_buf = NULL;
         *audio_buf = NULL;
         *audio_len = 0;
         *audio_len = 0;
         return 0;
         return 0;
     }
     }
 
 
-    /* 24-bit samples get shifted to 32 bits. */
+    // 24-bit samples get shifted to 32 bits.
     if (format->encoding == PCM_CODE && format->bitspersample == 24) {
     if (format->encoding == PCM_CODE && format->bitspersample == 24) {
         return PCM_ConvertSint24ToSint32(file, audio_buf, audio_len);
         return PCM_ConvertSint24ToSint32(file, audio_buf, audio_len);
     }
     }
@@ -1429,7 +1429,7 @@ static int PCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len)
     *audio_buf = chunk->data;
     *audio_buf = chunk->data;
     *audio_len = (Uint32)outputsize;
     *audio_len = (Uint32)outputsize;
 
 
-    /* This pointer is going to be returned to the caller. Prevent free in cleanup. */
+    // This pointer is going to be returned to the caller. Prevent free in cleanup.
     chunk->data = NULL;
     chunk->data = NULL;
     chunk->size = 0;
     chunk->size = 0;
 
 
@@ -1507,21 +1507,21 @@ static int WaveNextChunk(SDL_IOStream *src, WaveChunk *chunk)
     Uint32 chunkheader[2];
     Uint32 chunkheader[2];
     Sint64 nextposition = chunk->position + chunk->length;
     Sint64 nextposition = chunk->position + chunk->length;
 
 
-    /* Data is no longer valid after this function returns. */
+    // Data is no longer valid after this function returns.
     WaveFreeChunkData(chunk);
     WaveFreeChunkData(chunk);
 
 
-    /* Error on overflows. */
+    // Error on overflows.
     if (SDL_MAX_SINT64 - chunk->length < chunk->position || SDL_MAX_SINT64 - 8 < nextposition) {
     if (SDL_MAX_SINT64 - chunk->length < chunk->position || SDL_MAX_SINT64 - 8 < nextposition) {
         return -1;
         return -1;
     }
     }
 
 
-    /* RIFF chunks have a 2-byte alignment. Skip padding byte. */
+    // RIFF chunks have a 2-byte alignment. Skip padding byte.
     if (chunk->length & 1) {
     if (chunk->length & 1) {
         nextposition++;
         nextposition++;
     }
     }
 
 
     if (SDL_SeekIO(src, nextposition, SDL_IO_SEEK_SET) != nextposition) {
     if (SDL_SeekIO(src, nextposition, SDL_IO_SEEK_SET) != nextposition) {
-        /* Not sure how we ended up here. Just abort. */
+        // Not sure how we ended up here. Just abort.
         return -2;
         return -2;
     } else if (SDL_ReadIO(src, chunkheader, sizeof(Uint32) * 2) != (sizeof(Uint32) * 2)) {
     } else if (SDL_ReadIO(src, chunkheader, sizeof(Uint32) * 2) != (sizeof(Uint32) * 2)) {
         return -1;
         return -1;
@@ -1549,13 +1549,13 @@ static int WaveReadPartialChunkData(SDL_IOStream *src, WaveChunk *chunk, size_t
         }
         }
 
 
         if (SDL_SeekIO(src, chunk->position, SDL_IO_SEEK_SET) != chunk->position) {
         if (SDL_SeekIO(src, chunk->position, SDL_IO_SEEK_SET) != chunk->position) {
-            /* Not sure how we ended up here. Just abort. */
+            // Not sure how we ended up here. Just abort.
             return -2;
             return -2;
         }
         }
 
 
         chunk->size = SDL_ReadIO(src, chunk->data, length);
         chunk->size = SDL_ReadIO(src, chunk->data, length);
         if (chunk->size != length) {
         if (chunk->size != length) {
-            /* Expected to be handled by the caller. */
+            // Expected to be handled by the caller.
         }
         }
     }
     }
 
 
@@ -1573,7 +1573,7 @@ typedef struct WaveExtensibleGUID
     Uint8 guid[16];
     Uint8 guid[16];
 } WaveExtensibleGUID;
 } WaveExtensibleGUID;
 
 
-/* Some of the GUIDs that are used by WAVEFORMATEXTENSIBLE. */
+// Some of the GUIDs that are used by WAVEFORMATEXTENSIBLE.
 #define WAVE_FORMATTAG_GUID(tag)                                                     \
 #define WAVE_FORMATTAG_GUID(tag)                                                     \
     {                                                                                \
     {                                                                                \
         (tag) & 0xff, (tag) >> 8, 0, 0, 0, 0, 16, 0, 128, 0, 0, 170, 0, 56, 155, 113 \
         (tag) & 0xff, (tag) >> 8, 0, 0, 0, 0, 16, 0, 128, 0, 0, 170, 0, 56, 155, 113 \
@@ -1606,7 +1606,7 @@ static int WaveReadFormat(WaveFile *file)
     size_t fmtlen = chunk->size;
     size_t fmtlen = chunk->size;
 
 
     if (fmtlen > SDL_MAX_SINT32) {
     if (fmtlen > SDL_MAX_SINT32) {
-        /* Limit given by SDL_IOFromConstMem. */
+        // Limit given by SDL_IOFromConstMem.
         return SDL_SetError("Data of WAVE fmt chunk too big");
         return SDL_SetError("Data of WAVE fmt chunk too big");
     }
     }
     fmtsrc = SDL_IOFromConstMem(chunk->data, (int)chunk->size);
     fmtsrc = SDL_IOFromConstMem(chunk->data, (int)chunk->size);
@@ -1623,7 +1623,7 @@ static int WaveReadFormat(WaveFile *file)
     }
     }
     format->encoding = format->formattag;
     format->encoding = format->formattag;
 
 
-    /* This is PCM specific in the first version of the specification. */
+    // This is PCM specific in the first version of the specification.
     if (fmtlen >= 16) {
     if (fmtlen >= 16) {
         if (!SDL_ReadU16LE(fmtsrc, &format->bitspersample)) {
         if (!SDL_ReadU16LE(fmtsrc, &format->bitspersample)) {
             return -1;
             return -1;
@@ -1633,7 +1633,7 @@ static int WaveReadFormat(WaveFile *file)
         return SDL_SetError("Missing wBitsPerSample field in WAVE fmt chunk");
         return SDL_SetError("Missing wBitsPerSample field in WAVE fmt chunk");
     }
     }
 
 
-    /* The earlier versions also don't have this field. */
+    // The earlier versions also don't have this field.
     if (fmtlen >= 18) {
     if (fmtlen >= 18) {
         if (!SDL_ReadU16LE(fmtsrc, &format->extsize)) {
         if (!SDL_ReadU16LE(fmtsrc, &format->extsize)) {
             return -1;
             return -1;
@@ -1647,7 +1647,7 @@ static int WaveReadFormat(WaveFile *file)
          * to be useful working when they use this format flag.
          * to be useful working when they use this format flag.
          */
          */
 
 
-        /* Extensible header must be at least 22 bytes. */
+        // Extensible header must be at least 22 bytes.
         if (fmtlen < 40 || format->extsize < 22) {
         if (fmtlen < 40 || format->extsize < 22) {
             SDL_CloseIO(fmtsrc);
             SDL_CloseIO(fmtsrc);
             return SDL_SetError("Extensible WAVE header too small");
             return SDL_SetError("Extensible WAVE header too small");
@@ -1670,7 +1670,7 @@ static int WaveCheckFormat(WaveFile *file, size_t datalength)
 {
 {
     WaveFormat *format = &file->format;
     WaveFormat *format = &file->format;
 
 
-    /* Check for some obvious issues. */
+    // Check for some obvious issues.
 
 
     if (format->channels == 0) {
     if (format->channels == 0) {
         return SDL_SetError("Invalid number of channels");
         return SDL_SetError("Invalid number of channels");
@@ -1682,7 +1682,7 @@ static int WaveCheckFormat(WaveFile *file, size_t datalength)
         return SDL_SetError("Sample rate exceeds limit of %d", INT_MAX);
         return SDL_SetError("Sample rate exceeds limit of %d", INT_MAX);
     }
     }
 
 
-    /* Reject invalid fact chunks in strict mode. */
+    // Reject invalid fact chunks in strict mode.
     if (file->facthint == FactStrict && file->fact.status == -1) {
     if (file->facthint == FactStrict && file->fact.status == -1) {
         return SDL_SetError("Invalid fact chunk in WAVE file");
         return SDL_SetError("Invalid fact chunk in WAVE file");
     }
     }
@@ -1697,22 +1697,22 @@ static int WaveCheckFormat(WaveFile *file, size_t datalength)
     case MULAW_CODE:
     case MULAW_CODE:
     case MS_ADPCM_CODE:
     case MS_ADPCM_CODE:
     case IMA_ADPCM_CODE:
     case IMA_ADPCM_CODE:
-        /* These formats require a fact chunk. */
+        // These formats require a fact chunk.
         if (file->facthint == FactStrict && file->fact.status <= 0) {
         if (file->facthint == FactStrict && file->fact.status <= 0) {
             return SDL_SetError("Missing fact chunk in WAVE file");
             return SDL_SetError("Missing fact chunk in WAVE file");
         }
         }
         SDL_FALLTHROUGH;
         SDL_FALLTHROUGH;
     case PCM_CODE:
     case PCM_CODE:
-        /* All supported formats require a non-zero bit depth. */
+        // All supported formats require a non-zero bit depth.
         if (file->chunk.size < 16) {
         if (file->chunk.size < 16) {
             return SDL_SetError("Missing wBitsPerSample field in WAVE fmt chunk");
             return SDL_SetError("Missing wBitsPerSample field in WAVE fmt chunk");
         } else if (format->bitspersample == 0) {
         } else if (format->bitspersample == 0) {
             return SDL_SetError("Invalid bits per sample");
             return SDL_SetError("Invalid bits per sample");
         }
         }
 
 
-        /* All supported formats must have a proper block size. */
+        // All supported formats must have a proper block size.
         if (format->blockalign == 0) {
         if (format->blockalign == 0) {
-            format->blockalign = 1;  /* force it to 1 if it was unset. */
+            format->blockalign = 1;  // force it to 1 if it was unset.
         }
         }
 
 
         /* If the fact chunk is valid and the appropriate hint is set, the
         /* If the fact chunk is valid and the appropriate hint is set, the
@@ -1727,7 +1727,7 @@ static int WaveCheckFormat(WaveFile *file, size_t datalength)
         }
         }
     }
     }
 
 
-    /* Check the format for encoding specific issues and initialize decoders. */
+    // Check the format for encoding specific issues and initialize decoders.
     switch (format->encoding) {
     switch (format->encoding) {
     case PCM_CODE:
     case PCM_CODE:
     case IEEE_FLOAT_CODE:
     case IEEE_FLOAT_CODE:
@@ -1805,24 +1805,24 @@ static int WaveLoad(SDL_IOStream *src, WaveFile *file, SDL_AudioSpec *spec, Uint
         return SDL_SetError("Could not read RIFF header");
         return SDL_SetError("Could not read RIFF header");
     }
     }
 
 
-    /* Check main WAVE file identifiers. */
+    // Check main WAVE file identifiers.
     if (RIFFchunk.fourcc == RIFF) {
     if (RIFFchunk.fourcc == RIFF) {
         Uint32 formtype;
         Uint32 formtype;
-        /* Read the form type. "WAVE" expected. */
+        // Read the form type. "WAVE" expected.
         if (!SDL_ReadU32LE(src, &formtype)) {
         if (!SDL_ReadU32LE(src, &formtype)) {
             return SDL_SetError("Could not read RIFF form type");
             return SDL_SetError("Could not read RIFF form type");
         } else if (formtype != WAVE) {
         } else if (formtype != WAVE) {
             return SDL_SetError("RIFF form type is not WAVE (not a Waveform file)");
             return SDL_SetError("RIFF form type is not WAVE (not a Waveform file)");
         }
         }
     } else if (RIFFchunk.fourcc == WAVE) {
     } else if (RIFFchunk.fourcc == WAVE) {
-        /* RIFF chunk missing or skipped. Length unknown. */
+        // RIFF chunk missing or skipped. Length unknown.
         RIFFchunk.position = 0;
         RIFFchunk.position = 0;
         RIFFchunk.length = 0;
         RIFFchunk.length = 0;
     } else {
     } else {
         return SDL_SetError("Could not find RIFF or WAVE identifiers (not a Waveform file)");
         return SDL_SetError("Could not find RIFF or WAVE identifiers (not a Waveform file)");
     }
     }
 
 
-    /* The 4-byte form type is immediately followed by the first chunk.*/
+    // The 4-byte form type is immediately followed by the first chunk.
     chunk->position = RIFFchunk.position + 4;
     chunk->position = RIFFchunk.position + 4;
 
 
     /* Use the RIFF chunk size to limit the search for the chunks. This is not
     /* Use the RIFF chunk size to limit the search for the chunks. This is not
@@ -1854,18 +1854,18 @@ static int WaveLoad(SDL_IOStream *src, WaveFile *file, SDL_AudioSpec *spec, Uint
      * currently also ignores cue, list, and slnt chunks.
      * currently also ignores cue, list, and slnt chunks.
      */
      */
     while ((Uint64)RIFFend > (Uint64)chunk->position + chunk->length + (chunk->length & 1)) {
     while ((Uint64)RIFFend > (Uint64)chunk->position + chunk->length + (chunk->length & 1)) {
-        /* Abort after too many chunks or else corrupt files may waste time. */
+        // Abort after too many chunks or else corrupt files may waste time.
         if (chunkcount++ >= chunkcountlimit) {
         if (chunkcount++ >= chunkcountlimit) {
             return SDL_SetError("Chunk count in WAVE file exceeds limit of %" SDL_PRIu32, chunkcountlimit);
             return SDL_SetError("Chunk count in WAVE file exceeds limit of %" SDL_PRIu32, chunkcountlimit);
         }
         }
 
 
         result = WaveNextChunk(src, chunk);
         result = WaveNextChunk(src, chunk);
         if (result < 0) {
         if (result < 0) {
-            /* Unexpected EOF. Corrupt file or I/O issues. */
+            // Unexpected EOF. Corrupt file or I/O issues.
             if (file->trunchint == TruncVeryStrict) {
             if (file->trunchint == TruncVeryStrict) {
                 return SDL_SetError("Unexpected end of WAVE file");
                 return SDL_SetError("Unexpected end of WAVE file");
             }
             }
-            /* Let the checks after this loop sort this issue out. */
+            // Let the checks after this loop sort this issue out.
             break;
             break;
         } else if (result == -2) {
         } else if (result == -2) {
             return SDL_SetError("Could not seek to WAVE chunk header");
             return SDL_SetError("Could not seek to WAVE chunk header");
@@ -1873,9 +1873,9 @@ static int WaveLoad(SDL_IOStream *src, WaveFile *file, SDL_AudioSpec *spec, Uint
 
 
         if (chunk->fourcc == FMT) {
         if (chunk->fourcc == FMT) {
             if (fmtchunk.fourcc == FMT) {
             if (fmtchunk.fourcc == FMT) {
-                /* Multiple fmt chunks. Ignore or error? */
+                // Multiple fmt chunks. Ignore or error?
             } else {
             } else {
-                /* The fmt chunk must occur before the data chunk. */
+                // The fmt chunk must occur before the data chunk.
                 if (datachunk.fourcc == DATA) {
                 if (datachunk.fourcc == DATA) {
                     return SDL_SetError("fmt chunk after data chunk in WAVE file");
                     return SDL_SetError("fmt chunk after data chunk in WAVE file");
                 }
                 }
@@ -1896,7 +1896,7 @@ static int WaveLoad(SDL_IOStream *src, WaveFile *file, SDL_AudioSpec *spec, Uint
                 if (chunk->length < 4) {
                 if (chunk->length < 4) {
                     file->fact.status = -1;
                     file->fact.status = -1;
                 } else {
                 } else {
-                    /* Let's use src directly, it's just too convenient. */
+                    // Let's use src directly, it's just too convenient.
                     Sint64 position = SDL_SeekIO(src, chunk->position, SDL_IO_SEEK_SET);
                     Sint64 position = SDL_SeekIO(src, chunk->position, SDL_IO_SEEK_SET);
                     if (position == chunk->position && SDL_ReadU32LE(src, &file->fact.samplelength)) {
                     if (position == chunk->position && SDL_ReadU32LE(src, &file->fact.samplelength)) {
                         file->fact.status = 1;
                         file->fact.status = 1;
@@ -1926,17 +1926,17 @@ static int WaveLoad(SDL_IOStream *src, WaveFile *file, SDL_AudioSpec *spec, Uint
      */
      */
     lastchunkpos = chunk->position + chunk->length;
     lastchunkpos = chunk->position + chunk->length;
 
 
-    /* The fmt chunk is mandatory. */
+    // The fmt chunk is mandatory.
     if (fmtchunk.fourcc != FMT) {
     if (fmtchunk.fourcc != FMT) {
         return SDL_SetError("Missing fmt chunk in WAVE file");
         return SDL_SetError("Missing fmt chunk in WAVE file");
     }
     }
-    /* A data chunk must be present. */
+    // A data chunk must be present.
     if (datachunk.fourcc != DATA) {
     if (datachunk.fourcc != DATA) {
         return SDL_SetError("Missing data chunk in WAVE file");
         return SDL_SetError("Missing data chunk in WAVE file");
     }
     }
-    /* Check if the last chunk has all of its data in verystrict mode. */
+    // Check if the last chunk has all of its data in verystrict mode.
     if (file->trunchint == TruncVeryStrict) {
     if (file->trunchint == TruncVeryStrict) {
-        /* data chunk is handled later. */
+        // data chunk is handled later.
         if (chunk->fourcc != DATA && chunk->length > 0) {
         if (chunk->fourcc != DATA && chunk->length > 0) {
             Uint8 tmp;
             Uint8 tmp;
             Uint64 position = (Uint64)chunk->position + chunk->length - 1;
             Uint64 position = (Uint64)chunk->position + chunk->length - 1;
@@ -1948,7 +1948,7 @@ static int WaveLoad(SDL_IOStream *src, WaveFile *file, SDL_AudioSpec *spec, Uint
         }
         }
     }
     }
 
 
-    /* Process fmt chunk. */
+    // Process fmt chunk.
     *chunk = fmtchunk;
     *chunk = fmtchunk;
 
 
     /* No need to read more than 1046 bytes of the fmt chunk data with the
     /* No need to read more than 1046 bytes of the fmt chunk data with the
@@ -1980,7 +1980,7 @@ static int WaveLoad(SDL_IOStream *src, WaveFile *file, SDL_AudioSpec *spec, Uint
 
 
     WaveFreeChunkData(chunk);
     WaveFreeChunkData(chunk);
 
 
-    /* Process data chunk. */
+    // Process data chunk.
     *chunk = datachunk;
     *chunk = datachunk;
 
 
     if (chunk->length > 0) {
     if (chunk->length > 0) {
@@ -1993,14 +1993,14 @@ static int WaveLoad(SDL_IOStream *src, WaveFile *file, SDL_AudioSpec *spec, Uint
     }
     }
 
 
     if (chunk->length != chunk->size) {
     if (chunk->length != chunk->size) {
-        /* I/O issues or corrupt file. */
+        // I/O issues or corrupt file.
         if (file->trunchint == TruncVeryStrict || file->trunchint == TruncStrict) {
         if (file->trunchint == TruncVeryStrict || file->trunchint == TruncStrict) {
             return SDL_SetError("Could not read data of WAVE data chunk");
             return SDL_SetError("Could not read data of WAVE data chunk");
         }
         }
-        /* The decoders handle this truncation. */
+        // The decoders handle this truncation.
     }
     }
 
 
-    /* Decode or convert the data if necessary. */
+    // Decode or convert the data if necessary.
     switch (format->encoding) {
     switch (format->encoding) {
     case PCM_CODE:
     case PCM_CODE:
     case IEEE_FLOAT_CODE:
     case IEEE_FLOAT_CODE:
@@ -2038,7 +2038,7 @@ static int WaveLoad(SDL_IOStream *src, WaveFile *file, SDL_AudioSpec *spec, Uint
     case IMA_ADPCM_CODE:
     case IMA_ADPCM_CODE:
     case ALAW_CODE:
     case ALAW_CODE:
     case MULAW_CODE:
     case MULAW_CODE:
-        /* These can be easily stored in the byte order of the system. */
+        // These can be easily stored in the byte order of the system.
         spec->format = SDL_AUDIO_S16;
         spec->format = SDL_AUDIO_S16;
         break;
         break;
     case IEEE_FLOAT_CODE:
     case IEEE_FLOAT_CODE:
@@ -2052,12 +2052,12 @@ static int WaveLoad(SDL_IOStream *src, WaveFile *file, SDL_AudioSpec *spec, Uint
         case 16:
         case 16:
             spec->format = SDL_AUDIO_S16LE;
             spec->format = SDL_AUDIO_S16LE;
             break;
             break;
-        case 24: /* Has been shifted to 32 bits. */
+        case 24: // Has been shifted to 32 bits.
         case 32:
         case 32:
             spec->format = SDL_AUDIO_S32LE;
             spec->format = SDL_AUDIO_S32LE;
             break;
             break;
         default:
         default:
-            /* Just in case something unexpected happened in the checks. */
+            // Just in case something unexpected happened in the checks.
             return SDL_SetError("Unexpected %u-bit PCM data format", (unsigned int)format->bitspersample);
             return SDL_SetError("Unexpected %u-bit PCM data format", (unsigned int)format->bitspersample);
         }
         }
         break;
         break;
@@ -2065,7 +2065,7 @@ static int WaveLoad(SDL_IOStream *src, WaveFile *file, SDL_AudioSpec *spec, Uint
         return SDL_SetError("Unexpected data format");
         return SDL_SetError("Unexpected data format");
     }
     }
 
 
-    /* Report the end position back to the cleanup code. */
+    // Report the end position back to the cleanup code.
     if (RIFFlengthknown) {
     if (RIFFlengthknown) {
         chunk->position = RIFFend;
         chunk->position = RIFFend;
     } else {
     } else {
@@ -2090,9 +2090,9 @@ int SDL_LoadWAV_IO(SDL_IOStream *src, SDL_bool closeio, SDL_AudioSpec *spec, Uin
         *audio_len = 0;
         *audio_len = 0;
     }
     }
 
 
-    /* Make sure we are passed a valid data source */
+    // Make sure we are passed a valid data source
     if (!src) {
     if (!src) {
-        goto done;  /* Error may come from SDL_IOStream. */
+        goto done;  // Error may come from SDL_IOStream.
     } else if (!spec) {
     } else if (!spec) {
         SDL_InvalidParamError("spec");
         SDL_InvalidParamError("spec");
         goto done;
         goto done;
@@ -2116,7 +2116,7 @@ int SDL_LoadWAV_IO(SDL_IOStream *src, SDL_bool closeio, SDL_AudioSpec *spec, Uin
         audio_len = 0;
         audio_len = 0;
     }
     }
 
 
-    /* Cleanup */
+    // Cleanup
     if (!closeio) {
     if (!closeio) {
         SDL_SeekIO(src, file.chunk.position, SDL_IO_SEEK_SET);
         SDL_SeekIO(src, file.chunk.position, SDL_IO_SEEK_SET);
     }
     }

+ 35 - 35
src/audio/SDL_wave.h

@@ -20,21 +20,21 @@
 */
 */
 #include "SDL_internal.h"
 #include "SDL_internal.h"
 
 
-/* RIFF WAVE files are little-endian */
+// RIFF WAVE files are little-endian
 
 
 /*******************************************/
 /*******************************************/
-/* Define values for Microsoft WAVE format */
+// Define values for Microsoft WAVE format
 /*******************************************/
 /*******************************************/
-/* FOURCC */
-#define RIFF 0x46464952 /* "RIFF" */
-#define WAVE 0x45564157 /* "WAVE" */
-#define FACT 0x74636166 /* "fact" */
-#define LIST 0x5453494c /* "LIST" */
-#define BEXT 0x74786562 /* "bext" */
-#define JUNK 0x4B4E554A /* "JUNK" */
-#define FMT  0x20746D66 /* "fmt " */
-#define DATA 0x61746164 /* "data" */
-/* Format tags */
+// FOURCC
+#define RIFF 0x46464952 // "RIFF"
+#define WAVE 0x45564157 // "WAVE"
+#define FACT 0x74636166 // "fact"
+#define LIST 0x5453494c // "LIST"
+#define BEXT 0x74786562 // "bext"
+#define JUNK 0x4B4E554A // "JUNK"
+#define FMT  0x20746D66 // "fmt "
+#define DATA 0x61746164 // "data"
+// Format tags
 #define UNKNOWN_CODE    0x0000
 #define UNKNOWN_CODE    0x0000
 #define PCM_CODE        0x0001
 #define PCM_CODE        0x0001
 #define MS_ADPCM_CODE   0x0002
 #define MS_ADPCM_CODE   0x0002
@@ -46,30 +46,30 @@
 #define MPEGLAYER3_CODE 0x0055
 #define MPEGLAYER3_CODE 0x0055
 #define EXTENSIBLE_CODE 0xFFFE
 #define EXTENSIBLE_CODE 0xFFFE
 
 
-/* Stores the WAVE format information. */
+// Stores the WAVE format information.
 typedef struct WaveFormat
 typedef struct WaveFormat
 {
 {
-    Uint16 formattag;     /* Raw value of the first field in the fmt chunk data. */
-    Uint16 encoding;      /* Actual encoding, possibly from the extensible header. */
-    Uint16 channels;      /* Number of channels. */
-    Uint32 frequency;     /* Sampling rate in Hz. */
-    Uint32 byterate;      /* Average bytes per second. */
-    Uint16 blockalign;    /* Bytes per block. */
-    Uint16 bitspersample; /* Currently supported are 8, 16, 24, 32, and 4 for ADPCM. */
+    Uint16 formattag;     // Raw value of the first field in the fmt chunk data.
+    Uint16 encoding;      // Actual encoding, possibly from the extensible header.
+    Uint16 channels;      // Number of channels.
+    Uint32 frequency;     // Sampling rate in Hz.
+    Uint32 byterate;      // Average bytes per second.
+    Uint16 blockalign;    // Bytes per block.
+    Uint16 bitspersample; // Currently supported are 8, 16, 24, 32, and 4 for ADPCM.
 
 
     /* Extra information size. Number of extra bytes starting at byte 18 in the
     /* Extra information size. Number of extra bytes starting at byte 18 in the
      * fmt chunk data. This is at least 22 for the extensible header.
      * fmt chunk data. This is at least 22 for the extensible header.
      */
      */
     Uint16 extsize;
     Uint16 extsize;
 
 
-    /* Extensible WAVE header fields */
+    // Extensible WAVE header fields
     Uint16 validsamplebits;
     Uint16 validsamplebits;
-    Uint32 samplesperblock; /* For compressed formats. Can be zero. Actually 16 bits in the header. */
+    Uint32 samplesperblock; // For compressed formats. Can be zero. Actually 16 bits in the header.
     Uint32 channelmask;
     Uint32 channelmask;
-    Uint8 subformat[16]; /* A format GUID. */
+    Uint8 subformat[16]; // A format GUID.
 } WaveFormat;
 } WaveFormat;
 
 
-/* Stores information on the fact chunk. */
+// Stores information on the fact chunk.
 typedef struct WaveFact
 typedef struct WaveFact
 {
 {
     /* Represents the state of the fact chunk in the WAVE file.
     /* Represents the state of the fact chunk in the WAVE file.
@@ -88,20 +88,20 @@ typedef struct WaveFact
      * because a compressed block is usually decoded to a fixed number of
      * because a compressed block is usually decoded to a fixed number of
      * sample frames.
      * sample frames.
      */
      */
-    Uint32 samplelength; /* Raw sample length value from the fact chunk. */
+    Uint32 samplelength; // Raw sample length value from the fact chunk.
 } WaveFact;
 } WaveFact;
 
 
-/* Generic struct for the chunks in the WAVE file. */
+// Generic struct for the chunks in the WAVE file.
 typedef struct WaveChunk
 typedef struct WaveChunk
 {
 {
-    Uint32 fourcc;   /* FOURCC of the chunk. */
-    Uint32 length;   /* Size of the chunk data. */
-    Sint64 position; /* Position of the data in the stream. */
-    Uint8 *data;     /* When allocated, this points to the chunk data. length is used for the memory allocation size. */
-    size_t size;     /* Number of bytes in data that could be read from the stream. Can be smaller than length. */
+    Uint32 fourcc;   // FOURCC of the chunk.
+    Uint32 length;   // Size of the chunk data.
+    Sint64 position; // Position of the data in the stream.
+    Uint8 *data;     // When allocated, this points to the chunk data. length is used for the memory allocation size.
+    size_t size;     // Number of bytes in data that could be read from the stream. Can be smaller than length.
 } WaveChunk;
 } WaveChunk;
 
 
-/* Controls how the size of the RIFF chunk affects the loading of a WAVE file. */
+// Controls how the size of the RIFF chunk affects the loading of a WAVE file.
 typedef enum WaveRiffSizeHint
 typedef enum WaveRiffSizeHint
 {
 {
     RiffSizeNoHint,
     RiffSizeNoHint,
@@ -111,7 +111,7 @@ typedef enum WaveRiffSizeHint
     RiffSizeMaximum
     RiffSizeMaximum
 } WaveRiffSizeHint;
 } WaveRiffSizeHint;
 
 
-/* Controls how a truncated WAVE file is handled. */
+// Controls how a truncated WAVE file is handled.
 typedef enum WaveTruncationHint
 typedef enum WaveTruncationHint
 {
 {
     TruncNoHint,
     TruncNoHint,
@@ -121,7 +121,7 @@ typedef enum WaveTruncationHint
     TruncDropBlock
     TruncDropBlock
 } WaveTruncationHint;
 } WaveTruncationHint;
 
 
-/* Controls how the fact chunk affects the loading of a WAVE file. */
+// Controls how the fact chunk affects the loading of a WAVE file.
 typedef enum WaveFactChunkHint
 typedef enum WaveFactChunkHint
 {
 {
     FactNoHint,
     FactNoHint,
@@ -143,7 +143,7 @@ typedef struct WaveFile
      */
      */
     Sint64 sampleframes;
     Sint64 sampleframes;
 
 
-    void *decoderdata; /* Some decoders require extra data for a state. */
+    void *decoderdata; // Some decoders require extra data for a state.
 
 
     WaveRiffSizeHint riffhint;
     WaveRiffSizeHint riffhint;
     WaveTruncationHint trunchint;
     WaveTruncationHint trunchint;

+ 1 - 1
src/audio/coreaudio/SDL_coreaudio.m

@@ -883,7 +883,7 @@ static int COREAUDIO_OpenDevice(SDL_AudioDevice *device)
         }
         }
         #else
         #else
         // Calling setPreferredOutputNumberOfChannels seems to break audio output on iOS
         // Calling setPreferredOutputNumberOfChannels seems to break audio output on iOS
-        #endif /* SDL_PLATFORM_TVOS */
+        #endif // SDL_PLATFORM_TVOS
     }
     }
     #endif
     #endif
 
 

+ 2 - 2
src/audio/emscripten/SDL_emscriptenaudio.c

@@ -29,7 +29,7 @@
 
 
 // just turn off clang-format for this whole file, this INDENT_OFF stuff on
 // just turn off clang-format for this whole file, this INDENT_OFF stuff on
 //  each EM_ASM section is ugly.
 //  each EM_ASM section is ugly.
-/* *INDENT-OFF* */ /* clang-format off */
+/* *INDENT-OFF* */ // clang-format off
 
 
 static Uint8 *EMSCRIPTENAUDIO_GetDeviceBuf(SDL_AudioDevice *device, int *buffer_size)
 static Uint8 *EMSCRIPTENAUDIO_GetDeviceBuf(SDL_AudioDevice *device, int *buffer_size)
 {
 {
@@ -346,6 +346,6 @@ AudioBootStrap EMSCRIPTENAUDIO_bootstrap = {
     "emscripten", "SDL emscripten audio driver", EMSCRIPTENAUDIO_Init, SDL_FALSE
     "emscripten", "SDL emscripten audio driver", EMSCRIPTENAUDIO_Init, SDL_FALSE
 };
 };
 
 
-/* *INDENT-ON* */ /* clang-format on */
+/* *INDENT-ON* */ // clang-format on
 
 
 #endif // SDL_AUDIO_DRIVER_EMSCRIPTEN
 #endif // SDL_AUDIO_DRIVER_EMSCRIPTEN

+ 2 - 2
src/audio/netbsd/SDL_netbsdaudio.c

@@ -47,7 +47,7 @@ static void NETBSDAUDIO_DetectDevices(SDL_AudioDevice **default_playback, SDL_Au
 static void NETBSDAUDIO_Status(SDL_AudioDevice *device)
 static void NETBSDAUDIO_Status(SDL_AudioDevice *device)
 {
 {
 #ifdef DEBUG_AUDIO
 #ifdef DEBUG_AUDIO
-    /* *INDENT-OFF* */ /* clang-format off */
+    /* *INDENT-OFF* */ // clang-format off
     audio_info_t info;
     audio_info_t info;
     const struct audio_prinfo *prinfo;
     const struct audio_prinfo *prinfo;
 
 
@@ -109,7 +109,7 @@ static void NETBSDAUDIO_Status(SDL_AudioDevice *device)
             "",
             "",
             device->spec.format,
             device->spec.format,
             device->buffer_size);
             device->buffer_size);
-    /* *INDENT-ON* */ /* clang-format on */
+    /* *INDENT-ON* */ // clang-format on
 
 
 #endif // DEBUG_AUDIO
 #endif // DEBUG_AUDIO
 }
 }

+ 1 - 1
src/audio/wasapi/SDL_wasapi.c

@@ -48,7 +48,7 @@ static const IID SDL_IID_IAudioRenderClient = { 0xf294acfc, 0x3146, 0x4483, { 0x
 static const IID SDL_IID_IAudioCaptureClient = { 0xc8adbd64, 0xe71e, 0x48a0, { 0xa4, 0xde, 0x18, 0x5c, 0x39, 0x5c, 0xd3, 0x17 } };
 static const IID SDL_IID_IAudioCaptureClient = { 0xc8adbd64, 0xe71e, 0x48a0, { 0xa4, 0xde, 0x18, 0x5c, 0x39, 0x5c, 0xd3, 0x17 } };
 #ifdef __IAudioClient3_INTERFACE_DEFINED__
 #ifdef __IAudioClient3_INTERFACE_DEFINED__
 static const IID SDL_IID_IAudioClient3 = { 0x7ed4ee07, 0x8e67, 0x4cd4, { 0x8c, 0x1a, 0x2b, 0x7a, 0x59, 0x87, 0xad, 0x42 } };
 static const IID SDL_IID_IAudioClient3 = { 0x7ed4ee07, 0x8e67, 0x4cd4, { 0x8c, 0x1a, 0x2b, 0x7a, 0x59, 0x87, 0xad, 0x42 } };
-#endif /**/
+#endif //
 
 
 
 
 // WASAPI is _really_ particular about various things happening on the same thread, for COM and such,
 // WASAPI is _really_ particular about various things happening on the same thread, for COM and such,

+ 2 - 2
src/camera/emscripten/SDL_camera_emscripten.c

@@ -30,7 +30,7 @@
 
 
 // just turn off clang-format for this whole file, this INDENT_OFF stuff on
 // just turn off clang-format for this whole file, this INDENT_OFF stuff on
 //  each EM_ASM section is ugly.
 //  each EM_ASM section is ugly.
-/* *INDENT-OFF* */ /* clang-format off */
+/* *INDENT-OFF* */ // clang-format off
 
 
 EM_JS_DEPS(sdlcamera, "$dynCall");
 EM_JS_DEPS(sdlcamera, "$dynCall");
 
 
@@ -261,7 +261,7 @@ CameraBootStrap EMSCRIPTENCAMERA_bootstrap = {
     "emscripten", "SDL Emscripten MediaStream camera driver", EMSCRIPTENCAMERA_Init, SDL_FALSE
     "emscripten", "SDL Emscripten MediaStream camera driver", EMSCRIPTENCAMERA_Init, SDL_FALSE
 };
 };
 
 
-/* *INDENT-ON* */ /* clang-format on */
+/* *INDENT-ON* */ // clang-format on
 
 
 #endif // SDL_CAMERA_DRIVER_EMSCRIPTEN
 #endif // SDL_CAMERA_DRIVER_EMSCRIPTEN
 
 

+ 4 - 4
src/camera/mediafoundation/SDL_camera_mediafoundation.c

@@ -449,7 +449,7 @@ static int MEDIAFOUNDATION_AcquireFrame(SDL_Camera *device, SDL_Surface *frame,
         *timestampNS = timestamp100NS * 100;  // the timestamps are in 100-nanosecond increments; move to full nanoseconds.
         *timestampNS = timestamp100NS * 100;  // the timestamps are in 100-nanosecond increments; move to full nanoseconds.
     }
     }
 
 
-    ret = (retval < 0) ? E_FAIL : IMFSample_ConvertToContiguousBuffer(objs->sample, &objs->buffer);  /*IMFSample_GetBufferByIndex(objs->sample, 0, &objs->buffer);*/
+    ret = (retval < 0) ? E_FAIL : IMFSample_ConvertToContiguousBuffer(objs->sample, &objs->buffer);  // IMFSample_GetBufferByIndex(objs->sample, 0, &objs->buffer);
 
 
     if (FAILED(ret)) {
     if (FAILED(ret)) {
         SDL_free(objs);
         SDL_free(objs);
@@ -546,7 +546,7 @@ static int MEDIAFOUNDATION_AcquireFrame(SDL_Camera *device, SDL_Surface *frame,
     }
     }
 
 
     IMFMediaBuffer *buffer = NULL;
     IMFMediaBuffer *buffer = NULL;
-    ret = (retval < 0) ? E_FAIL : IMFSample_ConvertToContiguousBuffer(sample, &buffer); /*IMFSample_GetBufferByIndex(sample, 0, &buffer);*/
+    ret = (retval < 0) ? E_FAIL : IMFSample_ConvertToContiguousBuffer(sample, &buffer); // IMFSample_GetBufferByIndex(sample, 0, &buffer);
 
 
     if (FAILED(ret)) {
     if (FAILED(ret)) {
         retval = -1;
         retval = -1;
@@ -660,7 +660,7 @@ static HRESULT GetDefaultStride(IMFMediaType *pType, LONG *plStride)
 
 
         GUID subtype = GUID_NULL;
         GUID subtype = GUID_NULL;
         UINT32 width = 0;
         UINT32 width = 0;
-        /* UINT32 height = 0; */
+        // UINT32 height = 0;
         UINT64 val = 0;
         UINT64 val = 0;
 
 
         // Get the subtype and the image size.
         // Get the subtype and the image size.
@@ -675,7 +675,7 @@ static HRESULT GetDefaultStride(IMFMediaType *pType, LONG *plStride)
         }
         }
 
 
         width = (UINT32) (val >> 32);
         width = (UINT32) (val >> 32);
-        /* height = (UINT32) val; */
+        // height = (UINT32) val;
 
 
         ret = pMFGetStrideForBitmapInfoHeader(subtype.Data1, width, &lStride);
         ret = pMFGetStrideForBitmapInfoHeader(subtype.Data1, width, &lStride);
         if (FAILED(ret)) {
         if (FAILED(ret)) {

+ 5 - 5
src/core/SDL_core_unsupported.c

@@ -77,7 +77,7 @@ int SDL_RegisterApp(const char *name, Uint32 style, void *hInst)
     return SDL_Unsupported();
     return SDL_Unsupported();
 }
 }
 
 
-SDL_DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(void *callback, void *userdata); /* SDL_WindowsMessageHook callback */
+SDL_DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(void *callback, void *userdata); // SDL_WindowsMessageHook callback
 void SDL_SetWindowsMessageHook(void *callback, void *userdata)
 void SDL_SetWindowsMessageHook(void *callback, void *userdata)
 {
 {
     (void)callback;
     (void)callback;
@@ -95,15 +95,15 @@ void SDL_UnregisterApp(void)
 
 
 #ifndef SDL_PLATFORM_WINRT
 #ifndef SDL_PLATFORM_WINRT
 
 
-/* Returns SDL_WinRT_DeviceFamily enum */
+// Returns SDL_WinRT_DeviceFamily enum
 SDL_DECLSPEC int SDLCALL SDL_GetWinRTDeviceFamily(void);
 SDL_DECLSPEC int SDLCALL SDL_GetWinRTDeviceFamily(void);
 int SDL_GetWinRTDeviceFamily(void)
 int SDL_GetWinRTDeviceFamily(void)
 {
 {
     SDL_Unsupported();
     SDL_Unsupported();
-    return 0; /* SDL_WINRT_DEVICEFAMILY_UNKNOWN */
+    return 0; // SDL_WINRT_DEVICEFAMILY_UNKNOWN
 }
 }
 
 
-SDL_DECLSPEC const char *SDLCALL SDL_GetWinRTFSPath(int pathType); /* SDL_WinRT_Path pathType */
+SDL_DECLSPEC const char *SDLCALL SDL_GetWinRTFSPath(int pathType); // SDL_WinRT_Path pathType
 const char *SDL_GetWinRTFSPath(int pathType)
 const char *SDL_GetWinRTFSPath(int pathType)
 {
 {
     (void)pathType;
     (void)pathType;
@@ -224,6 +224,6 @@ Sint32 JNI_OnLoad(void *vm, void *reserved)
     (void)vm;
     (void)vm;
     (void)reserved;
     (void)reserved;
     SDL_Unsupported();
     SDL_Unsupported();
-    return -1; /* JNI_ERR */
+    return -1; // JNI_ERR
 }
 }
 #endif
 #endif

File diff suppressed because it is too large
+ 134 - 134
src/core/android/SDL_android.c


+ 21 - 21
src/core/android/SDL_android.h

@@ -23,7 +23,7 @@
 #ifndef SDL_android_h
 #ifndef SDL_android_h
 #define SDL_android_h
 #define SDL_android_h
 
 
-/* Set up for C function definitions, even when using C++ */
+// Set up for C function definitions, even when using C++
 #ifdef __cplusplus
 #ifdef __cplusplus
 /* *INDENT-OFF* */
 /* *INDENT-OFF* */
 extern "C" {
 extern "C" {
@@ -38,7 +38,7 @@ extern "C" {
 // this appears to be broken right now (on Android, not SDL, I think...?).
 // this appears to be broken right now (on Android, not SDL, I think...?).
 #define ALLOW_MULTIPLE_ANDROID_AUDIO_DEVICES 0
 #define ALLOW_MULTIPLE_ANDROID_AUDIO_DEVICES 0
 
 
-/* Life cycle */
+// Life cycle
 typedef enum
 typedef enum
 {
 {
     SDL_ANDROID_LIFECYCLE_WAKE,
     SDL_ANDROID_LIFECYCLE_WAKE,
@@ -55,7 +55,7 @@ SDL_bool Android_WaitLifecycleEvent(SDL_AndroidLifecycleEvent *event, Sint64 tim
 void Android_LockActivityMutex(void);
 void Android_LockActivityMutex(void);
 void Android_UnlockActivityMutex(void);
 void Android_UnlockActivityMutex(void);
 
 
-/* Interface from the SDL library into the Android Java activity */
+// Interface from the SDL library into the Android Java activity
 extern void Android_JNI_SetActivityTitle(const char *title);
 extern void Android_JNI_SetActivityTitle(const char *title);
 extern void Android_JNI_SetWindowStyle(SDL_bool fullscreen);
 extern void Android_JNI_SetWindowStyle(SDL_bool fullscreen);
 extern void Android_JNI_SetOrientation(int w, int h, int resizable, const char *hint);
 extern void Android_JNI_SetOrientation(int w, int h, int resizable, const char *hint);
@@ -71,12 +71,12 @@ extern ANativeWindow *Android_JNI_GetNativeWindow(void);
 extern SDL_DisplayOrientation Android_JNI_GetDisplayNaturalOrientation(void);
 extern SDL_DisplayOrientation Android_JNI_GetDisplayNaturalOrientation(void);
 extern SDL_DisplayOrientation Android_JNI_GetDisplayCurrentOrientation(void);
 extern SDL_DisplayOrientation Android_JNI_GetDisplayCurrentOrientation(void);
 
 
-/* Audio support */
+// Audio support
 void Android_StartAudioHotplug(SDL_AudioDevice **default_playback, SDL_AudioDevice **default_recording);
 void Android_StartAudioHotplug(SDL_AudioDevice **default_playback, SDL_AudioDevice **default_recording);
 void Android_StopAudioHotplug(void);
 void Android_StopAudioHotplug(void);
 extern void Android_AudioThreadInit(SDL_AudioDevice *device);
 extern void Android_AudioThreadInit(SDL_AudioDevice *device);
 
 
-/* Detecting device type */
+// Detecting device type
 extern SDL_bool Android_IsDeXMode(void);
 extern SDL_bool Android_IsDeXMode(void);
 extern SDL_bool Android_IsChromebook(void);
 extern SDL_bool Android_IsChromebook(void);
 
 
@@ -87,58 +87,58 @@ size_t Android_JNI_FileRead(void *userdata, void *buffer, size_t size, SDL_IOSta
 size_t Android_JNI_FileWrite(void *userdata, const void *buffer, size_t size, SDL_IOStatus *status);
 size_t Android_JNI_FileWrite(void *userdata, const void *buffer, size_t size, SDL_IOStatus *status);
 int Android_JNI_FileClose(void *userdata);
 int Android_JNI_FileClose(void *userdata);
 
 
-/* Environment support */
+// Environment support
 void Android_JNI_GetManifestEnvironmentVariables(void);
 void Android_JNI_GetManifestEnvironmentVariables(void);
 int Android_JNI_OpenFileDescriptor(const char *uri, const char *mode);
 int Android_JNI_OpenFileDescriptor(const char *uri, const char *mode);
 
 
-/* Clipboard support */
+// Clipboard support
 int Android_JNI_SetClipboardText(const char *text);
 int Android_JNI_SetClipboardText(const char *text);
 char *Android_JNI_GetClipboardText(void);
 char *Android_JNI_GetClipboardText(void);
 SDL_bool Android_JNI_HasClipboardText(void);
 SDL_bool Android_JNI_HasClipboardText(void);
 
 
-/* Power support */
+// Power support
 int Android_JNI_GetPowerInfo(int *plugged, int *charged, int *battery, int *seconds, int *percent);
 int Android_JNI_GetPowerInfo(int *plugged, int *charged, int *battery, int *seconds, int *percent);
 
 
-/* Joystick support */
+// Joystick support
 void Android_JNI_PollInputDevices(void);
 void Android_JNI_PollInputDevices(void);
 
 
-/* Haptic support */
+// Haptic support
 void Android_JNI_PollHapticDevices(void);
 void Android_JNI_PollHapticDevices(void);
 void Android_JNI_HapticRun(int device_id, float intensity, int length);
 void Android_JNI_HapticRun(int device_id, float intensity, int length);
 void Android_JNI_HapticRumble(int device_id, float low_frequency_intensity, float high_frequency_intensity, int length);
 void Android_JNI_HapticRumble(int device_id, float low_frequency_intensity, float high_frequency_intensity, int length);
 void Android_JNI_HapticStop(int device_id);
 void Android_JNI_HapticStop(int device_id);
 
 
-/* Video */
+// Video
 int Android_JNI_SuspendScreenSaver(SDL_bool suspend);
 int Android_JNI_SuspendScreenSaver(SDL_bool suspend);
 
 
-/* Touch support */
+// Touch support
 void Android_JNI_InitTouch(void);
 void Android_JNI_InitTouch(void);
 
 
-/* Threads */
+// Threads
 #include <jni.h>
 #include <jni.h>
 JNIEnv *Android_JNI_GetEnv(void);
 JNIEnv *Android_JNI_GetEnv(void);
 int Android_JNI_SetupThread(void);
 int Android_JNI_SetupThread(void);
 
 
-/* Locale */
+// Locale
 int Android_JNI_GetLocale(char *buf, size_t buflen);
 int Android_JNI_GetLocale(char *buf, size_t buflen);
 
 
-/* Generic messages */
+// Generic messages
 int Android_JNI_SendMessage(int command, int param);
 int Android_JNI_SendMessage(int command, int param);
 
 
-/* MessageBox */
+// MessageBox
 int Android_JNI_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonID);
 int Android_JNI_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonID);
 
 
-/* Cursor support */
+// Cursor support
 int Android_JNI_CreateCustomCursor(SDL_Surface *surface, int hot_x, int hot_y);
 int Android_JNI_CreateCustomCursor(SDL_Surface *surface, int hot_x, int hot_y);
 void Android_JNI_DestroyCustomCursor(int cursorID);
 void Android_JNI_DestroyCustomCursor(int cursorID);
 SDL_bool Android_JNI_SetCustomCursor(int cursorID);
 SDL_bool Android_JNI_SetCustomCursor(int cursorID);
 SDL_bool Android_JNI_SetSystemCursor(int cursorID);
 SDL_bool Android_JNI_SetSystemCursor(int cursorID);
 
 
-/* Relative mouse support */
+// Relative mouse support
 SDL_bool Android_JNI_SupportsRelativeMouse(void);
 SDL_bool Android_JNI_SupportsRelativeMouse(void);
 SDL_bool Android_JNI_SetRelativeMouseEnabled(SDL_bool enabled);
 SDL_bool Android_JNI_SetRelativeMouseEnabled(SDL_bool enabled);
 
 
-/* Show toast notification */
+// Show toast notification
 int Android_JNI_ShowToast(const char *message, int duration, int gravity, int xOffset, int yOffset);
 int Android_JNI_ShowToast(const char *message, int duration, int gravity, int xOffset, int yOffset);
 
 
 int Android_JNI_OpenURL(const char *url);
 int Android_JNI_OpenURL(const char *url);
@@ -150,12 +150,12 @@ SDL_bool SDL_IsAndroidTV(void);
 SDL_bool SDL_IsChromebook(void);
 SDL_bool SDL_IsChromebook(void);
 SDL_bool SDL_IsDeXMode(void);
 SDL_bool SDL_IsDeXMode(void);
 
 
-/* File Dialogs */
+// File Dialogs
 SDL_bool Android_JNI_OpenFileDialog(SDL_DialogFileCallback callback, void* userdata,
 SDL_bool Android_JNI_OpenFileDialog(SDL_DialogFileCallback callback, void* userdata,
     const SDL_DialogFileFilter *filters, int nfilters, SDL_bool forwrite,
     const SDL_DialogFileFilter *filters, int nfilters, SDL_bool forwrite,
     SDL_bool multiple);
     SDL_bool multiple);
 
 
-/* Ends C function definitions when using C++ */
+// Ends C function definitions when using C++
 #ifdef __cplusplus
 #ifdef __cplusplus
 /* *INDENT-OFF* */
 /* *INDENT-OFF* */
 }
 }

+ 25 - 25
src/core/freebsd/SDL_evdev_kbd_default_keyaccmap.h

@@ -1,6 +1,6 @@
 #include <sys/kbio.h>
 #include <sys/kbio.h>
 
 
-/* *INDENT-OFF* */ /* clang-format off */
+/* *INDENT-OFF* */ // clang-format off
 /*
 /*
  * Automatically generated from /usr/share/vt/keymaps/us.acc.kbd.
  * Automatically generated from /usr/share/vt/keymaps/us.acc.kbd.
  * DO NOT EDIT!
  * DO NOT EDIT!
@@ -123,45 +123,45 @@ static keymap_t keymap_default_us_acc = { 0x6d, {
 } };
 } };
 
 
 static accentmap_t accentmap_default_us_acc = { 11, {
 static accentmap_t accentmap_default_us_acc = { 11, {
-    /* dgra=0 */
+    // dgra=0
     {  '`', { {  'a',0xe0 }, {  'A',0xc0 }, {  'e',0xe8 }, {  'E',0xc8 },
     {  '`', { {  'a',0xe0 }, {  'A',0xc0 }, {  'e',0xe8 }, {  'E',0xc8 },
 	      {  'i',0xec }, {  'I',0xcc }, {  'o',0xf2 }, {  'O',0xd2 },
 	      {  'i',0xec }, {  'I',0xcc }, {  'o',0xf2 }, {  'O',0xd2 },
 	      {  'u',0xf9 }, {  'U',0xd9 }, }, },
 	      {  'u',0xf9 }, {  'U',0xd9 }, }, },
-    /* dacu=1 */
+    // dacu=1
     { 0xb4, { {  'a',0xe1 }, {  'A',0xc1 }, {  'e',0xe9 }, {  'E',0xc9 },
     { 0xb4, { {  'a',0xe1 }, {  'A',0xc1 }, {  'e',0xe9 }, {  'E',0xc9 },
 	      {  'i',0xed }, {  'I',0xcd }, {  'o',0xf3 }, {  'O',0xd3 },
 	      {  'i',0xed }, {  'I',0xcd }, {  'o',0xf3 }, {  'O',0xd3 },
 	      {  'u',0xfa }, {  'U',0xda }, {  'y',0xfd }, {  'Y',0xdd }, }, },
 	      {  'u',0xfa }, {  'U',0xda }, {  'y',0xfd }, {  'Y',0xdd }, }, },
-    /* dcir=2 */
+    // dcir=2
     {  '^', { {  'a',0xe2 }, {  'A',0xc2 }, {  'e',0xea }, {  'E',0xca },
     {  '^', { {  'a',0xe2 }, {  'A',0xc2 }, {  'e',0xea }, {  'E',0xca },
 	      {  'i',0xee }, {  'I',0xce }, {  'o',0xf4 }, {  'O',0xd4 },
 	      {  'i',0xee }, {  'I',0xce }, {  'o',0xf4 }, {  'O',0xd4 },
 	      {  'u',0xfb }, {  'U',0xdb }, }, },
 	      {  'u',0xfb }, {  'U',0xdb }, }, },
-    /* dtil=3 */
+    // dtil=3
     {  '~', { {  'a',0xe3 }, {  'A',0xc3 }, {  'n',0xf1 }, {  'N',0xd1 },
     {  '~', { {  'a',0xe3 }, {  'A',0xc3 }, {  'n',0xf1 }, {  'N',0xd1 },
 	      {  'o',0xf5 }, {  'O',0xd5 }, }, },
 	      {  'o',0xf5 }, {  'O',0xd5 }, }, },
-    /* dmac=4 */
-    { 0x00 }, 
-    /* dbre=5 */
-    { 0x00 }, 
-    /* ddot=6 */
-    { 0x00 }, 
-    /* duml=7 */
+    // dmac=4
+    { 0x00 },
+    // dbre=5
+    { 0x00 },
+    // ddot=6
+    { 0x00 },
+    // duml=7
     { 0xa8, { {  'a',0xe4 }, {  'A',0xc4 }, {  'e',0xeb }, {  'E',0xcb },
     { 0xa8, { {  'a',0xe4 }, {  'A',0xc4 }, {  'e',0xeb }, {  'E',0xcb },
 	      {  'i',0xef }, {  'I',0xcf }, {  'o',0xf6 }, {  'O',0xd6 },
 	      {  'i',0xef }, {  'I',0xcf }, {  'o',0xf6 }, {  'O',0xd6 },
 	      {  'u',0xfc }, {  'U',0xdc }, {  'y',0xff }, }, },
 	      {  'u',0xfc }, {  'U',0xdc }, {  'y',0xff }, }, },
-    /* dsla=8 */
-    { 0x00 }, 
-    /* drin=9 */
+    // dsla=8
+    { 0x00 },
+    // drin=9
     { 0xb0, { {  'a',0xe5 }, {  'A',0xc5 }, }, },
     { 0xb0, { {  'a',0xe5 }, {  'A',0xc5 }, }, },
-    /* dced=10 */
+    // dced=10
     { 0xb8, { {  'c',0xe7 }, {  'C',0xc7 }, }, },
     { 0xb8, { {  'c',0xe7 }, {  'C',0xc7 }, }, },
-    /* dapo=11 */
-    { 0x00 }, 
-    /* ddac=12 */
-    { 0x00 }, 
-    /* dogo=13 */
-    { 0x00 }, 
-    /* dcar=14 */
-    { 0x00 }, 
+    // dapo=11
+    { 0x00 },
+    // ddac=12
+    { 0x00 },
+    // dogo=13
+    { 0x00 },
+    // dcar=14
+    { 0x00 },
 } };
 } };
 
 
-/* *INDENT-ON* */ /* clang-format on */
+/* *INDENT-ON* */ // clang-format on

+ 44 - 44
src/core/freebsd/SDL_evdev_kbd_freebsd.c

@@ -25,7 +25,7 @@
 
 
 #ifdef SDL_INPUT_FBSDKBIO
 #ifdef SDL_INPUT_FBSDKBIO
 
 
-/* This logic is adapted from drivers/tty/vt/keyboard.c in the Linux kernel source, slightly modified to work with FreeBSD */
+// This logic is adapted from drivers/tty/vt/keyboard.c in the Linux kernel source, slightly modified to work with FreeBSD
 
 
 #include <unistd.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <fcntl.h>
@@ -52,12 +52,12 @@ struct SDL_EVDEV_keyboard_state
     unsigned short **key_maps;
     unsigned short **key_maps;
     keymap_t *key_map;
     keymap_t *key_map;
     keyboard_info_t *kbInfo;
     keyboard_info_t *kbInfo;
-    unsigned char shift_down[4]; /* shift state counters.. */
+    unsigned char shift_down[4]; // shift state counters..
     SDL_bool dead_key_next;
     SDL_bool dead_key_next;
-    int npadch; /* -1 or number assembled on pad */
+    int npadch; // -1 or number assembled on pad
     accentmap_t *accents;
     accentmap_t *accents;
     unsigned int diacr;
     unsigned int diacr;
-    SDL_bool rep; /* flag telling character repeat */
+    SDL_bool rep; // flag telling character repeat
     unsigned char lockstate;
     unsigned char lockstate;
     unsigned char ledflagstate;
     unsigned char ledflagstate;
     char shift_state;
     char shift_state;
@@ -77,7 +77,7 @@ static int kbd_cleanup_atexit_installed = 0;
 static struct sigaction old_sigaction[NSIG];
 static struct sigaction old_sigaction[NSIG];
 
 
 static int fatal_signals[] = {
 static int fatal_signals[] = {
-    /* Handlers for SIGTERM and SIGINT are installed in SDL_InitQuit. */
+    // Handlers for SIGTERM and SIGINT are installed in SDL_InitQuit.
     SIGHUP, SIGQUIT, SIGILL, SIGABRT,
     SIGHUP, SIGQUIT, SIGILL, SIGABRT,
     SIGFPE, SIGSEGV, SIGPIPE, SIGBUS,
     SIGFPE, SIGSEGV, SIGPIPE, SIGBUS,
     SIGSYS
     SIGSYS
@@ -114,22 +114,22 @@ static void kbd_cleanup_signal_action(int signum, siginfo_t *info, void *ucontex
     struct sigaction *old_action_p = &(old_sigaction[signum]);
     struct sigaction *old_action_p = &(old_sigaction[signum]);
     sigset_t sigset;
     sigset_t sigset;
 
 
-    /* Restore original signal handler before going any further. */
+    // Restore original signal handler before going any further.
     sigaction(signum, old_action_p, NULL);
     sigaction(signum, old_action_p, NULL);
 
 
-    /* Unmask current signal. */
+    // Unmask current signal.
     sigemptyset(&sigset);
     sigemptyset(&sigset);
     sigaddset(&sigset, signum);
     sigaddset(&sigset, signum);
     sigprocmask(SIG_UNBLOCK, &sigset, NULL);
     sigprocmask(SIG_UNBLOCK, &sigset, NULL);
 
 
-    /* Save original signal info and context for archeologists. */
+    // Save original signal info and context for archeologists.
     SDL_EVDEV_kdb_cleanup_siginfo = info;
     SDL_EVDEV_kdb_cleanup_siginfo = info;
     SDL_EVDEV_kdb_cleanup_ucontext = ucontext;
     SDL_EVDEV_kdb_cleanup_ucontext = ucontext;
 
 
-    /* Restore keyboard. */
+    // Restore keyboard.
     kbd_cleanup();
     kbd_cleanup();
 
 
-    /* Reraise signal. */
+    // Reraise signal.
     SDL_EVDEV_kbd_reraise_signal(signum);
     SDL_EVDEV_kbd_reraise_signal(signum);
 }
 }
 
 
@@ -150,27 +150,27 @@ static void kbd_unregister_emerg_cleanup(void)
         int signum = fatal_signals[tabidx];
         int signum = fatal_signals[tabidx];
         old_action_p = &(old_sigaction[signum]);
         old_action_p = &(old_sigaction[signum]);
 
 
-        /* Examine current signal action */
+        // Examine current signal action
         if (sigaction(signum, NULL, &cur_action)) {
         if (sigaction(signum, NULL, &cur_action)) {
             continue;
             continue;
         }
         }
 
 
-        /* Check if action installed and not modified */
+        // Check if action installed and not modified
         if (!(cur_action.sa_flags & SA_SIGINFO) || cur_action.sa_sigaction != &kbd_cleanup_signal_action) {
         if (!(cur_action.sa_flags & SA_SIGINFO) || cur_action.sa_sigaction != &kbd_cleanup_signal_action) {
             continue;
             continue;
         }
         }
 
 
-        /* Restore original action */
+        // Restore original action
         sigaction(signum, old_action_p, NULL);
         sigaction(signum, old_action_p, NULL);
     }
     }
 }
 }
 
 
 static void kbd_cleanup_atexit(void)
 static void kbd_cleanup_atexit(void)
 {
 {
-    /* Restore keyboard. */
+    // Restore keyboard.
     kbd_cleanup();
     kbd_cleanup();
 
 
-    /* Try to restore signal handlers in case shared library is being unloaded */
+    // Try to restore signal handlers in case shared library is being unloaded
     kbd_unregister_emerg_cleanup();
     kbd_unregister_emerg_cleanup();
 }
 }
 
 
@@ -236,7 +236,7 @@ SDL_EVDEV_keyboard_state *SDL_EVDEV_kbd_init(void)
 
 
     kbd->npadch = -1;
     kbd->npadch = -1;
 
 
-    /* This might fail if we're not connected to a tty (e.g. on the Steam Link) */
+    // This might fail if we're not connected to a tty (e.g. on the Steam Link)
     kbd->keyboard_fd = kbd->console_fd = open("/dev/tty", O_RDONLY | O_CLOEXEC);
     kbd->keyboard_fd = kbd->console_fd = open("/dev/tty", O_RDONLY | O_CLOEXEC);
 
 
     kbd->shift_state = 0;
     kbd->shift_state = 0;
@@ -258,7 +258,7 @@ SDL_EVDEV_keyboard_state *SDL_EVDEV_kbd_init(void)
     }
     }
 
 
     if (ioctl(kbd->console_fd, KDGKBMODE, &kbd->old_kbd_mode) == 0) {
     if (ioctl(kbd->console_fd, KDGKBMODE, &kbd->old_kbd_mode) == 0) {
-        /* Set the keyboard in XLATE mode and load the keymaps */
+        // Set the keyboard in XLATE mode and load the keymaps
         ioctl(kbd->console_fd, KDSKBMODE, (unsigned long)(K_XLATE));
         ioctl(kbd->console_fd, KDSKBMODE, (unsigned long)(K_XLATE));
         if (!SDL_EVDEV_kbd_load_keymaps(kbd)) {
         if (!SDL_EVDEV_kbd_load_keymaps(kbd)) {
             SDL_free(kbd->key_map);
             SDL_free(kbd->key_map);
@@ -306,7 +306,7 @@ void SDL_EVDEV_kbd_quit(SDL_EVDEV_keyboard_state *kbd)
     kbd_unregister_emerg_cleanup();
     kbd_unregister_emerg_cleanup();
 
 
     if (kbd->keyboard_fd >= 0) {
     if (kbd->keyboard_fd >= 0) {
-        /* Restore the original keyboard mode */
+        // Restore the original keyboard mode
         ioctl(kbd->keyboard_fd, KDSKBMODE, kbd->old_kbd_mode);
         ioctl(kbd->keyboard_fd, KDSKBMODE, kbd->old_kbd_mode);
 
 
         close(kbd->keyboard_fd);
         close(kbd->keyboard_fd);
@@ -337,7 +337,7 @@ void SDL_EVDEV_kbd_update(SDL_EVDEV_keyboard_state *state)
  */
  */
 static void put_queue(SDL_EVDEV_keyboard_state *kbd, uint c)
 static void put_queue(SDL_EVDEV_keyboard_state *kbd, uint c)
 {
 {
-    /* c is already part of a UTF-8 sequence and safe to add as a character */
+    // c is already part of a UTF-8 sequence and safe to add as a character
     if (kbd->text_len < (sizeof(kbd->text) - 1)) {
     if (kbd->text_len < (sizeof(kbd->text) - 1)) {
         kbd->text[kbd->text_len++] = (char)c;
         kbd->text[kbd->text_len++] = (char)c;
     }
     }
@@ -389,7 +389,7 @@ static unsigned int handle_diacr(SDL_EVDEV_keyboard_state *kbd, unsigned int ch)
     for (i = 0; i < kbd->accents->n_accs; i++) {
     for (i = 0; i < kbd->accents->n_accs; i++) {
         if (kbd->accents->acc[i].accchar == d) {
         if (kbd->accents->acc[i].accchar == d) {
             for (j = 0; j < NUM_ACCENTCHARS; ++j) {
             for (j = 0; j < NUM_ACCENTCHARS; ++j) {
-                if (kbd->accents->acc[i].map[j][0] == 0) { /* end of table */
+                if (kbd->accents->acc[i].map[j][0] == 0) { // end of table
                     break;
                     break;
                 }
                 }
                 if (kbd->accents->acc[i].map[j][0] == ch) {
                 if (kbd->accents->acc[i].map[j][0] == ch) {
@@ -426,7 +426,7 @@ static void chg_vc_kbd_led(SDL_EVDEV_keyboard_state *kbd, int flag)
 static void k_self(SDL_EVDEV_keyboard_state *kbd, unsigned int value, char up_flag)
 static void k_self(SDL_EVDEV_keyboard_state *kbd, unsigned int value, char up_flag)
 {
 {
     if (up_flag) {
     if (up_flag) {
-        return; /* no action, if this is a key release */
+        return; // no action, if this is a key release
     }
     }
 
 
     if (kbd->diacr) {
     if (kbd->diacr) {
@@ -472,7 +472,7 @@ static void k_shift(SDL_EVDEV_keyboard_state *kbd, unsigned char value, char up_
     else
     else
         kbd->shift_state &= ~(1 << value);
         kbd->shift_state &= ~(1 << value);
 
 
-    /* kludge */
+    // kludge
     if (up_flag && kbd->shift_state != old_state && kbd->npadch != -1) {
     if (up_flag && kbd->shift_state != old_state && kbd->npadch != -1) {
         put_utf8(kbd, kbd->npadch);
         put_utf8(kbd, kbd->npadch);
         kbd->npadch = -1;
         kbd->npadch = -1;
@@ -496,7 +496,7 @@ void SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *kbd, unsigned int keycode,
 
 
     if (keycode < NUM_KEYS) {
     if (keycode < NUM_KEYS) {
         if (keycode >= 89 && keycode <= 95) {
         if (keycode >= 89 && keycode <= 95) {
-            /* These constitute unprintable language-related keys, so ignore them. */
+            // These constitute unprintable language-related keys, so ignore them.
             return;
             return;
         }
         }
         if (keycode > 95) {
         if (keycode > 95) {
@@ -520,69 +520,69 @@ void SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *kbd, unsigned int keycode,
 
 
     map_from_key_sym = keysym.map[final_key_state];
     map_from_key_sym = keysym.map[final_key_state];
     if ((keysym.spcl & (0x80 >> final_key_state)) || (map_from_key_sym & SPCLKEY)) {
     if ((keysym.spcl & (0x80 >> final_key_state)) || (map_from_key_sym & SPCLKEY)) {
-        /* Special function.*/
+        // Special function.
         if (map_from_key_sym == 0)
         if (map_from_key_sym == 0)
-            return; /* Nothing to do. */
+            return; // Nothing to do.
         if (map_from_key_sym & SPCLKEY) {
         if (map_from_key_sym & SPCLKEY) {
             map_from_key_sym &= ~SPCLKEY;
             map_from_key_sym &= ~SPCLKEY;
         }
         }
         if (map_from_key_sym >= F_ACC && map_from_key_sym <= L_ACC) {
         if (map_from_key_sym >= F_ACC && map_from_key_sym <= L_ACC) {
-            /* Accent function.*/
+            // Accent function.
             unsigned int accent_index = map_from_key_sym - F_ACC;
             unsigned int accent_index = map_from_key_sym - F_ACC;
             if (kbd->accents->acc[accent_index].accchar != 0) {
             if (kbd->accents->acc[accent_index].accchar != 0) {
                 k_deadunicode(kbd, kbd->accents->acc[accent_index].accchar, !down);
                 k_deadunicode(kbd, kbd->accents->acc[accent_index].accchar, !down);
             }
             }
         } else {
         } else {
             switch (map_from_key_sym) {
             switch (map_from_key_sym) {
-            case ASH: /* alt/meta shift */
+            case ASH: // alt/meta shift
                 k_shift(kbd, 3, down == 0);
                 k_shift(kbd, 3, down == 0);
                 break;
                 break;
-            case LSHA: /* left shift + alt lock */
-            case RSHA: /* right shift + alt lock */
+            case LSHA: // left shift + alt lock
+            case RSHA: // right shift + alt lock
                 if (down == 0) {
                 if (down == 0) {
                     chg_vc_kbd_led(kbd, ALKED);
                     chg_vc_kbd_led(kbd, ALKED);
                 }
                 }
                 SDL_FALLTHROUGH;
                 SDL_FALLTHROUGH;
-            case LSH: /* left shift */
-            case RSH: /* right shift */
+            case LSH: // left shift
+            case RSH: // right shift
                 k_shift(kbd, 0, down == 0);
                 k_shift(kbd, 0, down == 0);
                 break;
                 break;
-            case LCTRA: /* left ctrl + alt lock */
-            case RCTRA: /* right ctrl + alt lock */
+            case LCTRA: // left ctrl + alt lock
+            case RCTRA: // right ctrl + alt lock
                 if (down == 0) {
                 if (down == 0) {
                     chg_vc_kbd_led(kbd, ALKED);
                     chg_vc_kbd_led(kbd, ALKED);
                 }
                 }
                 SDL_FALLTHROUGH;
                 SDL_FALLTHROUGH;
-            case LCTR: /* left ctrl */
-            case RCTR: /* right ctrl */
+            case LCTR: // left ctrl
+            case RCTR: // right ctrl
                 k_shift(kbd, 1, down == 0);
                 k_shift(kbd, 1, down == 0);
                 break;
                 break;
-            case LALTA: /* left alt + alt lock */
-            case RALTA: /* right alt + alt lock */
+            case LALTA: // left alt + alt lock
+            case RALTA: // right alt + alt lock
                 if (down == 0) {
                 if (down == 0) {
                     chg_vc_kbd_led(kbd, ALKED);
                     chg_vc_kbd_led(kbd, ALKED);
                 }
                 }
                 SDL_FALLTHROUGH;
                 SDL_FALLTHROUGH;
-            case LALT: /* left alt */
-            case RALT: /* right alt */
+            case LALT: // left alt
+            case RALT: // right alt
                 k_shift(kbd, 2, down == 0);
                 k_shift(kbd, 2, down == 0);
                 break;
                 break;
-            case ALK: /* alt lock */
+            case ALK: // alt lock
                 if (down == 1) {
                 if (down == 1) {
                     chg_vc_kbd_led(kbd, ALKED);
                     chg_vc_kbd_led(kbd, ALKED);
                 }
                 }
                 break;
                 break;
-            case CLK: /* caps lock*/
+            case CLK: // caps lock
                 if (down == 1) {
                 if (down == 1) {
                     chg_vc_kbd_led(kbd, CLKED);
                     chg_vc_kbd_led(kbd, CLKED);
                 }
                 }
                 break;
                 break;
-            case NLK: /* num lock */
+            case NLK: // num lock
                 if (down == 1) {
                 if (down == 1) {
                     chg_vc_kbd_led(kbd, NLKED);
                     chg_vc_kbd_led(kbd, NLKED);
                 }
                 }
                 break;
                 break;
-            case SLK: /* scroll lock */
+            case SLK: // scroll lock
                 if (down == 1) {
                 if (down == 1) {
                     chg_vc_kbd_led(kbd, SLKED);
                     chg_vc_kbd_led(kbd, SLKED);
                 }
                 }
@@ -610,4 +610,4 @@ void SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *kbd, unsigned int keycode,
     }
     }
 }
 }
 
 
-#endif /* SDL_INPUT_FBSDKBIO */
+#endif // SDL_INPUT_FBSDKBIO

+ 8 - 8
src/core/gdk/SDL_gdk.cpp

@@ -37,7 +37,7 @@ HANDLE plmSuspendComplete = nullptr;
 extern "C"
 extern "C"
 int SDL_GetGDKTaskQueue(XTaskQueueHandle *outTaskQueue)
 int SDL_GetGDKTaskQueue(XTaskQueueHandle *outTaskQueue)
 {
 {
-    /* If this is the first call, first create the global task queue. */
+    // If this is the first call, first create the global task queue.
     if (!GDK_GlobalTaskQueue) {
     if (!GDK_GlobalTaskQueue) {
         HRESULT hr;
         HRESULT hr;
 
 
@@ -48,10 +48,10 @@ int SDL_GetGDKTaskQueue(XTaskQueueHandle *outTaskQueue)
             return SDL_SetError("[GDK] Could not create global task queue");
             return SDL_SetError("[GDK] Could not create global task queue");
         }
         }
 
 
-        /* The initial call gets the non-duplicated handle so they can clean it up */
+        // The initial call gets the non-duplicated handle so they can clean it up
         *outTaskQueue = GDK_GlobalTaskQueue;
         *outTaskQueue = GDK_GlobalTaskQueue;
     } else {
     } else {
-        /* Duplicate the global task queue handle into outTaskQueue */
+        // Duplicate the global task queue handle into outTaskQueue
         if (FAILED(XTaskQueueDuplicateHandle(GDK_GlobalTaskQueue, outTaskQueue))) {
         if (FAILED(XTaskQueueDuplicateHandle(GDK_GlobalTaskQueue, outTaskQueue))) {
             return SDL_SetError("[GDK] Unable to acquire global task queue");
             return SDL_SetError("[GDK] Unable to acquire global task queue");
         }
         }
@@ -67,7 +67,7 @@ void GDK_DispatchTaskQueue(void)
      * This gives the option to opt-out for those who want to handle everything themselves.
      * This gives the option to opt-out for those who want to handle everything themselves.
      */
      */
     if (GDK_GlobalTaskQueue) {
     if (GDK_GlobalTaskQueue) {
-        /* Dispatch any callbacks which are ready. */
+        // Dispatch any callbacks which are ready.
         while (XTaskQueueDispatch(GDK_GlobalTaskQueue, XTaskQueuePort::Completion, 0))
         while (XTaskQueueDispatch(GDK_GlobalTaskQueue, XTaskQueuePort::Completion, 0))
             ;
             ;
     }
     }
@@ -76,7 +76,7 @@ void GDK_DispatchTaskQueue(void)
 extern "C"
 extern "C"
 int GDK_RegisterChangeNotifications(void)
 int GDK_RegisterChangeNotifications(void)
 {
 {
-    /* Register suspend/resume handling */
+    // Register suspend/resume handling
     plmSuspendComplete = CreateEventEx(nullptr, nullptr, 0, EVENT_MODIFY_STATE | SYNCHRONIZE);
     plmSuspendComplete = CreateEventEx(nullptr, nullptr, 0, EVENT_MODIFY_STATE | SYNCHRONIZE);
     if (!plmSuspendComplete) {
     if (!plmSuspendComplete) {
         SDL_SetError("[GDK] Unable to create plmSuspendComplete event");
         SDL_SetError("[GDK] Unable to create plmSuspendComplete event");
@@ -102,7 +102,7 @@ int GDK_RegisterChangeNotifications(void)
         return -1;
         return -1;
     }
     }
 
 
-    /* Register constrain/unconstrain handling */
+    // Register constrain/unconstrain handling
     auto raccn = [](BOOLEAN constrained, PVOID context) {
     auto raccn = [](BOOLEAN constrained, PVOID context) {
         SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "[GDK] in RegisterAppConstrainedChangeNotification handler");
         SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "[GDK] in RegisterAppConstrainedChangeNotification handler");
         SDL_VideoDevice *_this = SDL_GetVideoDevice();
         SDL_VideoDevice *_this = SDL_GetVideoDevice();
@@ -125,11 +125,11 @@ int GDK_RegisterChangeNotifications(void)
 extern "C"
 extern "C"
 void GDK_UnregisterChangeNotifications(void)
 void GDK_UnregisterChangeNotifications(void)
 {
 {
-    /* Unregister suspend/resume handling */
+    // Unregister suspend/resume handling
     UnregisterAppStateChangeNotification(hPLM);
     UnregisterAppStateChangeNotification(hPLM);
     CloseHandle(plmSuspendComplete);
     CloseHandle(plmSuspendComplete);
 
 
-    /* Unregister constrain/unconstrain handling */
+    // Unregister constrain/unconstrain handling
     UnregisterAppConstrainedChangeNotification(hCPLM);
     UnregisterAppConstrainedChangeNotification(hCPLM);
 }
 }
 
 

+ 1 - 1
src/core/gdk/SDL_gdk.h

@@ -20,7 +20,7 @@
 */
 */
 #include "SDL_internal.h"
 #include "SDL_internal.h"
 
 
-/* This is called from WIN_PumpEvents on GDK */
+// This is called from WIN_PumpEvents on GDK
 extern void GDK_DispatchTaskQueue(void);
 extern void GDK_DispatchTaskQueue(void);
 
 
 extern int GDK_RegisterChangeNotifications(void);
 extern int GDK_RegisterChangeNotifications(void);

+ 31 - 31
src/core/haiku/SDL_BApp.h

@@ -36,7 +36,7 @@ extern "C" {
 
 
 #include "SDL_internal.h"
 #include "SDL_internal.h"
 
 
-/* Local includes */
+// Local includes
 #include "../../events/SDL_events_c.h"
 #include "../../events/SDL_events_c.h"
 #include "../../video/haiku/SDL_bframebuffer.h"
 #include "../../video/haiku/SDL_bframebuffer.h"
 
 
@@ -47,27 +47,27 @@ extern "C" {
 #include <vector>
 #include <vector>
 
 
 
 
-/* Forward declarations */
+// Forward declarations
 class SDL_BLooper;
 class SDL_BLooper;
 class SDL_BWin;
 class SDL_BWin;
 
 
-/* Message constants */
+// Message constants
 enum ToSDL
 enum ToSDL
 {
 {
-    /* Intercepted by BWindow on its way to BView */
+    // Intercepted by BWindow on its way to BView
     BAPP_MOUSE_MOVED,
     BAPP_MOUSE_MOVED,
     BAPP_MOUSE_BUTTON,
     BAPP_MOUSE_BUTTON,
     BAPP_MOUSE_WHEEL,
     BAPP_MOUSE_WHEEL,
     BAPP_KEY,
     BAPP_KEY,
-    BAPP_REPAINT, /* from _UPDATE_ */
-    /* From BWindow */
-    BAPP_MAXIMIZE, /* from B_ZOOM */
+    BAPP_REPAINT, // from _UPDATE_
+    // From BWindow
+    BAPP_MAXIMIZE, // from B_ZOOM
     BAPP_MINIMIZE,
     BAPP_MINIMIZE,
-    BAPP_RESTORE, /* TODO: IMPLEMENT! */
+    BAPP_RESTORE, // TODO: IMPLEMENT!
     BAPP_SHOW,
     BAPP_SHOW,
     BAPP_HIDE,
     BAPP_HIDE,
-    BAPP_MOUSE_FOCUS,    /* caused by MOUSE_MOVE */
-    BAPP_KEYBOARD_FOCUS, /* from WINDOW_ACTIVATED */
+    BAPP_MOUSE_FOCUS,    // caused by MOUSE_MOVE
+    BAPP_KEYBOARD_FOCUS, // from WINDOW_ACTIVATED
     BAPP_WINDOW_CLOSE_REQUESTED,
     BAPP_WINDOW_CLOSE_REQUESTED,
     BAPP_WINDOW_MOVED,
     BAPP_WINDOW_MOVED,
     BAPP_WINDOW_RESIZED,
     BAPP_WINDOW_RESIZED,
@@ -78,7 +78,7 @@ enum ToSDL
 extern "C" SDL_BLooper *SDL_Looper;
 extern "C" SDL_BLooper *SDL_Looper;
 
 
 
 
-/* Create a descendant of BLooper */
+// Create a descendant of BLooper
 class SDL_BLooper : public BLooper
 class SDL_BLooper : public BLooper
 {
 {
   public:
   public:
@@ -93,10 +93,10 @@ class SDL_BLooper : public BLooper
     {
     {
     }
     }
 
 
-    /* Event-handling functions */
+    // Event-handling functions
     virtual void MessageReceived(BMessage *message)
     virtual void MessageReceived(BMessage *message)
     {
     {
-        /* Sort out SDL-related messages */
+        // Sort out SDL-related messages
         switch (message->what) {
         switch (message->what) {
         case BAPP_MOUSE_MOVED:
         case BAPP_MOUSE_MOVED:
             _HandleMouseMove(message);
             _HandleMouseMove(message);
@@ -159,7 +159,7 @@ class SDL_BLooper : public BLooper
             break;
             break;
 
 
         case BAPP_SCREEN_CHANGED:
         case BAPP_SCREEN_CHANGED:
-            /* TODO: Handle screen resize or workspace change */
+            // TODO: Handle screen resize or workspace change
             break;
             break;
 
 
         default:
         default:
@@ -168,7 +168,7 @@ class SDL_BLooper : public BLooper
         }
         }
     }
     }
 
 
-    /* Window creation/destruction methods */
+    // Window creation/destruction methods
     int32 GetID(SDL_Window *win)
     int32 GetID(SDL_Window *win)
     {
     {
         int32 i;
         int32 i;
@@ -179,19 +179,19 @@ class SDL_BLooper : public BLooper
             }
             }
         }
         }
 
 
-        /* Expand the vector if all slots are full */
+        // Expand the vector if all slots are full
         if (i == _GetNumWindowSlots()) {
         if (i == _GetNumWindowSlots()) {
             _PushBackWindow(win);
             _PushBackWindow(win);
             return i;
             return i;
         }
         }
 
 
-        /* TODO: error handling */
+        // TODO: error handling
         return 0;
         return 0;
     }
     }
 
 
     /* FIXME: Bad coding practice, but I can't include SDL_BWin.h here.  Is
     /* FIXME: Bad coding practice, but I can't include SDL_BWin.h here.  Is
        there another way to do this? */
        there another way to do this? */
-    void ClearID(SDL_BWin *bwin); /* Defined in SDL_BeApp.cc */
+    void ClearID(SDL_BWin *bwin); // Defined in SDL_BeApp.cc
 
 
     SDL_Window *GetSDLWindow(int32 winID)
     SDL_Window *GetSDLWindow(int32 winID)
     {
     {
@@ -215,7 +215,7 @@ class SDL_BLooper : public BLooper
 #endif
 #endif
 
 
   private:
   private:
-    /* Event management */
+    // Event management
     void _HandleBasicWindowEvent(BMessage *msg, SDL_EventType sdlEventType)
     void _HandleBasicWindowEvent(BMessage *msg, SDL_EventType sdlEventType)
     {
     {
         SDL_Window *win;
         SDL_Window *win;
@@ -235,8 +235,8 @@ class SDL_BLooper : public BLooper
         int32 x = 0, y = 0;
         int32 x = 0, y = 0;
         if (
         if (
             !_GetWinID(msg, &winID) ||
             !_GetWinID(msg, &winID) ||
-            msg->FindInt32("x", &x) != B_OK || /* x movement */
-            msg->FindInt32("y", &y) != B_OK    /* y movement */
+            msg->FindInt32("x", &x) != B_OK || // x movement
+            msg->FindInt32("y", &y) != B_OK    // y movement
         ) {
         ) {
             return;
             return;
         }
         }
@@ -264,7 +264,7 @@ class SDL_BLooper : public BLooper
     {
     {
         SDL_Window *win;
         SDL_Window *win;
         int32 winID;
         int32 winID;
-        int32 button, state; /* left/middle/right, pressed/released */
+        int32 button, state; // left/middle/right, pressed/released
         if (
         if (
             !_GetWinID(msg, &winID) ||
             !_GetWinID(msg, &winID) ||
             msg->FindInt32("button-id", &button) != B_OK ||
             msg->FindInt32("button-id", &button) != B_OK ||
@@ -294,7 +294,7 @@ class SDL_BLooper : public BLooper
     {
     {
         SDL_Window *win;
         SDL_Window *win;
         int32 winID;
         int32 winID;
-        int32 scancode, state; /* scancode, pressed/released */
+        int32 scancode, state; // scancode, pressed/released
         if (
         if (
             !_GetWinID(msg, &winID) ||
             !_GetWinID(msg, &winID) ||
             msg->FindInt32("key-state", &state) != B_OK ||
             msg->FindInt32("key-state", &state) != B_OK ||
@@ -321,7 +321,7 @@ class SDL_BLooper : public BLooper
     {
     {
         SDL_Window *win;
         SDL_Window *win;
         int32 winID;
         int32 winID;
-        bool bSetFocus; /* If false, lose focus */
+        bool bSetFocus; // If false, lose focus
         if (
         if (
             !_GetWinID(msg, &winID) ||
             !_GetWinID(msg, &winID) ||
             msg->FindBool("focusGained", &bSetFocus) != B_OK) {
             msg->FindBool("focusGained", &bSetFocus) != B_OK) {
@@ -331,7 +331,7 @@ class SDL_BLooper : public BLooper
         if (bSetFocus) {
         if (bSetFocus) {
             SDL_SetMouseFocus(win);
             SDL_SetMouseFocus(win);
         } else if (SDL_GetMouseFocus() == win) {
         } else if (SDL_GetMouseFocus() == win) {
-            /* Only lose all focus if this window was the current focus */
+            // Only lose all focus if this window was the current focus
             SDL_SetMouseFocus(NULL);
             SDL_SetMouseFocus(NULL);
         }
         }
     }
     }
@@ -340,7 +340,7 @@ class SDL_BLooper : public BLooper
     {
     {
         SDL_Window *win;
         SDL_Window *win;
         int32 winID;
         int32 winID;
-        bool bSetFocus; /* If false, lose focus */
+        bool bSetFocus; // If false, lose focus
         if (
         if (
             !_GetWinID(msg, &winID) ||
             !_GetWinID(msg, &winID) ||
             msg->FindBool("focusGained", &bSetFocus) != B_OK) {
             msg->FindBool("focusGained", &bSetFocus) != B_OK) {
@@ -350,7 +350,7 @@ class SDL_BLooper : public BLooper
         if (bSetFocus) {
         if (bSetFocus) {
             SDL_SetKeyboardFocus(win);
             SDL_SetKeyboardFocus(win);
         } else if (SDL_GetKeyboardFocus() == win) {
         } else if (SDL_GetKeyboardFocus() == win) {
-            /* Only lose all focus if this window was the current focus */
+            // Only lose all focus if this window was the current focus
             SDL_SetKeyboardFocus(NULL);
             SDL_SetKeyboardFocus(NULL);
         }
         }
     }
     }
@@ -360,7 +360,7 @@ class SDL_BLooper : public BLooper
         SDL_Window *win;
         SDL_Window *win;
         int32 winID;
         int32 winID;
         int32 xPos, yPos;
         int32 xPos, yPos;
-        /* Get the window id and new x/y position of the window */
+        // Get the window id and new x/y position of the window
         if (
         if (
             !_GetWinID(msg, &winID) ||
             !_GetWinID(msg, &winID) ||
             msg->FindInt32("window-x", &xPos) != B_OK ||
             msg->FindInt32("window-x", &xPos) != B_OK ||
@@ -376,7 +376,7 @@ class SDL_BLooper : public BLooper
         SDL_Window *win;
         SDL_Window *win;
         int32 winID;
         int32 winID;
         int32 w, h;
         int32 w, h;
-        /* Get the window id ]and new x/y position of the window */
+        // Get the window id ]and new x/y position of the window
         if (
         if (
             !_GetWinID(msg, &winID) ||
             !_GetWinID(msg, &winID) ||
             msg->FindInt32("window-w", &w) != B_OK ||
             msg->FindInt32("window-w", &w) != B_OK ||
@@ -414,8 +414,8 @@ class SDL_BLooper : public BLooper
         _window_map.push_back(win);
         _window_map.push_back(win);
     }
     }
 
 
-    /* Members */
-    std::vector<SDL_Window *> _window_map; /* Keeps track of SDL_Windows by index-id */
+    // Members
+    std::vector<SDL_Window *> _window_map; // Keeps track of SDL_Windows by index-id
 
 
 #ifdef SDL_VIDEO_OPENGL
 #ifdef SDL_VIDEO_OPENGL
     BGLView *_current_context;
     BGLView *_current_context;

+ 17 - 17
src/core/haiku/SDL_BeApp.cc

@@ -22,7 +22,7 @@
 
 
 #ifdef SDL_PLATFORM_HAIKU
 #ifdef SDL_PLATFORM_HAIKU
 
 
-/* Handle the BeApp specific portions of the application */
+// Handle the BeApp specific portions of the application
 
 
 #include <AppKit.h>
 #include <AppKit.h>
 #include <storage/AppFileInfo.h>
 #include <storage/AppFileInfo.h>
@@ -32,7 +32,7 @@
 #include <unistd.h>
 #include <unistd.h>
 #include <memory>
 #include <memory>
 
 
-#include "SDL_BApp.h"   /* SDL_BLooper class definition */
+#include "SDL_BApp.h"   // SDL_BLooper class definition
 #include "SDL_BeApp.h"
 #include "SDL_BeApp.h"
 
 
 #include "../../video/haiku/SDL_BWin.h"
 #include "../../video/haiku/SDL_BWin.h"
@@ -43,17 +43,17 @@ extern "C" {
 
 
 #include "../../thread/SDL_systhread.h"
 #include "../../thread/SDL_systhread.h"
 
 
-/* Flag to tell whether or not the Be application and looper are active or not */
+// Flag to tell whether or not the Be application and looper are active or not
 static int SDL_BeAppActive = 0;
 static int SDL_BeAppActive = 0;
 static SDL_Thread *SDL_AppThread = NULL;
 static SDL_Thread *SDL_AppThread = NULL;
 SDL_BLooper *SDL_Looper = NULL;
 SDL_BLooper *SDL_Looper = NULL;
 
 
 
 
-/* Default application signature */
+// Default application signature
 const char *SDL_signature = "application/x-SDL-executable";
 const char *SDL_signature = "application/x-SDL-executable";
 
 
 
 
-/* Create a descendant of BApplication */
+// Create a descendant of BApplication
 class SDL_BApp : public BApplication {
 class SDL_BApp : public BApplication {
 public:
 public:
     SDL_BApp(const char* signature) :
     SDL_BApp(const char* signature) :
@@ -123,43 +123,43 @@ static int StartBeLooper()
 }
 }
 
 
 
 
-/* Initialize the Be Application, if it's not already started */
+// Initialize the Be Application, if it's not already started
 int SDL_InitBeApp(void)
 int SDL_InitBeApp(void)
 {
 {
-    /* Create the BApplication that handles appserver interaction */
+    // Create the BApplication that handles appserver interaction
     if (SDL_BeAppActive <= 0) {
     if (SDL_BeAppActive <= 0) {
         StartBeLooper();
         StartBeLooper();
 
 
-        /* Mark the application active */
+        // Mark the application active
         SDL_BeAppActive = 0;
         SDL_BeAppActive = 0;
     }
     }
 
 
-    /* Increment the application reference count */
+    // Increment the application reference count
     ++SDL_BeAppActive;
     ++SDL_BeAppActive;
 
 
-    /* The app is running, and we're ready to go */
+    // The app is running, and we're ready to go
     return 0;
     return 0;
 }
 }
 
 
-/* Quit the Be Application, if there's nothing left to do */
+// Quit the Be Application, if there's nothing left to do
 void SDL_QuitBeApp(void)
 void SDL_QuitBeApp(void)
 {
 {
-    /* Decrement the application reference count */
+    // Decrement the application reference count
     --SDL_BeAppActive;
     --SDL_BeAppActive;
 
 
-    /* If the reference count reached zero, clean up the app */
+    // If the reference count reached zero, clean up the app
     if (SDL_BeAppActive == 0) {
     if (SDL_BeAppActive == 0) {
         SDL_Looper->Lock();
         SDL_Looper->Lock();
         SDL_Looper->Quit();
         SDL_Looper->Quit();
         SDL_Looper = NULL;
         SDL_Looper = NULL;
         if (SDL_AppThread) {
         if (SDL_AppThread) {
-            if (be_app != NULL) {       /* Not tested */
+            if (be_app != NULL) {       // Not tested
                 be_app->PostMessage(B_QUIT_REQUESTED);
                 be_app->PostMessage(B_QUIT_REQUESTED);
             }
             }
             SDL_WaitThread(SDL_AppThread, NULL);
             SDL_WaitThread(SDL_AppThread, NULL);
             SDL_AppThread = NULL;
             SDL_AppThread = NULL;
         }
         }
-        /* be_app should now be NULL since be_app has quit */
+        // be_app should now be NULL since be_app has quit
     }
     }
 }
 }
 
 
@@ -167,7 +167,7 @@ void SDL_QuitBeApp(void)
 }
 }
 #endif
 #endif
 
 
-/* SDL_BApp functions */
+// SDL_BApp functions
 void SDL_BLooper::ClearID(SDL_BWin *bwin) {
 void SDL_BLooper::ClearID(SDL_BWin *bwin) {
     _SetSDLWindow(NULL, bwin->GetID());
     _SetSDLWindow(NULL, bwin->GetID());
     int32 i = _GetNumWindowSlots() - 1;
     int32 i = _GetNumWindowSlots() - 1;
@@ -177,4 +177,4 @@ void SDL_BLooper::ClearID(SDL_BWin *bwin) {
     }
     }
 }
 }
 
 
-#endif /* SDL_PLATFORM_HAIKU */
+#endif // SDL_PLATFORM_HAIKU

+ 4 - 4
src/core/haiku/SDL_BeApp.h

@@ -23,15 +23,15 @@
 #ifdef __cplusplus
 #ifdef __cplusplus
 extern "C" {
 extern "C" {
 #endif
 #endif
-/* Handle the BeApp specific portions of the application */
+// Handle the BeApp specific portions of the application
 
 
-/* Initialize the Be Application, if it's not already started */
+// Initialize the Be Application, if it's not already started
 extern int SDL_InitBeApp(void);
 extern int SDL_InitBeApp(void);
 
 
-/* Quit the Be Application, if there's nothing left to do */
+// Quit the Be Application, if there's nothing left to do
 extern void SDL_QuitBeApp(void);
 extern void SDL_QuitBeApp(void);
 
 
-/* Be Application Signature*/
+// Be Application Signature
 extern const char *SDL_signature;
 extern const char *SDL_signature;
 
 
 
 

+ 25 - 25
src/core/linux/SDL_dbus.c

@@ -24,7 +24,7 @@
 #include "../../stdlib/SDL_vacopy.h"
 #include "../../stdlib/SDL_vacopy.h"
 
 
 #ifdef SDL_USE_LIBDBUS
 #ifdef SDL_USE_LIBDBUS
-/* we never link directly to libdbus. */
+// we never link directly to libdbus.
 static const char *dbus_library = "libdbus-1.so.3";
 static const char *dbus_library = "libdbus-1.so.3";
 static void *dbus_handle = NULL;
 static void *dbus_handle = NULL;
 static char *inhibit_handle = NULL;
 static char *inhibit_handle = NULL;
@@ -111,7 +111,7 @@ static int LoadDBUSLibrary(void)
         dbus_handle = SDL_LoadObject(dbus_library);
         dbus_handle = SDL_LoadObject(dbus_library);
         if (!dbus_handle) {
         if (!dbus_handle) {
             retval = -1;
             retval = -1;
-            /* Don't call SDL_SetError(): SDL_LoadObject already did. */
+            // Don't call SDL_SetError(): SDL_LoadObject already did.
         } else {
         } else {
             retval = LoadDBUSSyms();
             retval = LoadDBUSSyms();
             if (retval < 0) {
             if (retval < 0) {
@@ -125,19 +125,19 @@ static int LoadDBUSLibrary(void)
 
 
 static SDL_SpinLock spinlock_dbus_init = 0;
 static SDL_SpinLock spinlock_dbus_init = 0;
 
 
-/* you must hold spinlock_dbus_init before calling this! */
+// you must hold spinlock_dbus_init before calling this!
 static void SDL_DBus_Init_Spinlocked(void)
 static void SDL_DBus_Init_Spinlocked(void)
 {
 {
     static SDL_bool is_dbus_available = SDL_TRUE;
     static SDL_bool is_dbus_available = SDL_TRUE;
     if (!is_dbus_available) {
     if (!is_dbus_available) {
-        return; /* don't keep trying if this fails. */
+        return; // don't keep trying if this fails.
     }
     }
 
 
     if (!dbus.session_conn) {
     if (!dbus.session_conn) {
         DBusError err;
         DBusError err;
 
 
         if (LoadDBUSLibrary() == -1) {
         if (LoadDBUSLibrary() == -1) {
-            is_dbus_available = SDL_FALSE; /* can't load at all? Don't keep trying. */
+            is_dbus_available = SDL_FALSE; // can't load at all? Don't keep trying.
             return;
             return;
         }
         }
 
 
@@ -147,18 +147,18 @@ static void SDL_DBus_Init_Spinlocked(void)
         }
         }
 
 
         dbus.error_init(&err);
         dbus.error_init(&err);
-        /* session bus is required */
+        // session bus is required
 
 
         dbus.session_conn = dbus.bus_get_private(DBUS_BUS_SESSION, &err);
         dbus.session_conn = dbus.bus_get_private(DBUS_BUS_SESSION, &err);
         if (dbus.error_is_set(&err)) {
         if (dbus.error_is_set(&err)) {
             dbus.error_free(&err);
             dbus.error_free(&err);
             SDL_DBus_Quit();
             SDL_DBus_Quit();
             is_dbus_available = SDL_FALSE;
             is_dbus_available = SDL_FALSE;
-            return; /* oh well */
+            return; // oh well
         }
         }
         dbus.connection_set_exit_on_disconnect(dbus.session_conn, 0);
         dbus.connection_set_exit_on_disconnect(dbus.session_conn, 0);
 
 
-        /* system bus is optional */
+        // system bus is optional
         dbus.system_conn = dbus.bus_get_private(DBUS_BUS_SYSTEM, &err);
         dbus.system_conn = dbus.bus_get_private(DBUS_BUS_SYSTEM, &err);
         if (!dbus.error_is_set(&err)) {
         if (!dbus.error_is_set(&err)) {
             dbus.connection_set_exit_on_disconnect(dbus.system_conn, 0);
             dbus.connection_set_exit_on_disconnect(dbus.system_conn, 0);
@@ -170,7 +170,7 @@ static void SDL_DBus_Init_Spinlocked(void)
 
 
 void SDL_DBus_Init(void)
 void SDL_DBus_Init(void)
 {
 {
-    SDL_LockSpinlock(&spinlock_dbus_init); /* make sure two threads can't init at same time, since this can happen before SDL_Init. */
+    SDL_LockSpinlock(&spinlock_dbus_init); // make sure two threads can't init at same time, since this can happen before SDL_Init.
     SDL_DBus_Init_Spinlocked();
     SDL_DBus_Init_Spinlocked();
     SDL_UnlockSpinlock(&spinlock_dbus_init);
     SDL_UnlockSpinlock(&spinlock_dbus_init);
 }
 }
@@ -216,14 +216,14 @@ static SDL_bool SDL_DBus_CallMethodInternal(DBusConnection *conn, const char *no
         if (msg) {
         if (msg) {
             int firstarg;
             int firstarg;
             va_list ap_reply;
             va_list ap_reply;
-            va_copy(ap_reply, ap); /* copy the arg list so we don't compete with D-Bus for it */
+            va_copy(ap_reply, ap); // copy the arg list so we don't compete with D-Bus for it
             firstarg = va_arg(ap, int);
             firstarg = va_arg(ap, int);
             if ((firstarg == DBUS_TYPE_INVALID) || dbus.message_append_args_valist(msg, firstarg, ap)) {
             if ((firstarg == DBUS_TYPE_INVALID) || dbus.message_append_args_valist(msg, firstarg, ap)) {
                 DBusMessage *reply = dbus.connection_send_with_reply_and_block(conn, msg, 300, NULL);
                 DBusMessage *reply = dbus.connection_send_with_reply_and_block(conn, msg, 300, NULL);
                 if (reply) {
                 if (reply) {
-                    /* skip any input args, get to output args. */
+                    // skip any input args, get to output args.
                     while ((firstarg = va_arg(ap_reply, int)) != DBUS_TYPE_INVALID) {
                     while ((firstarg = va_arg(ap_reply, int)) != DBUS_TYPE_INVALID) {
-                        /* we assume D-Bus already validated all this. */
+                        // we assume D-Bus already validated all this.
                         {
                         {
                             void *dumpptr = va_arg(ap_reply, void *);
                             void *dumpptr = va_arg(ap_reply, void *);
                             (void)dumpptr;
                             (void)dumpptr;
@@ -361,8 +361,8 @@ SDL_bool SDL_DBus_QueryProperty(const char *node, const char *path, const char *
 
 
 void SDL_DBus_ScreensaverTickle(void)
 void SDL_DBus_ScreensaverTickle(void)
 {
 {
-    if (screensaver_cookie == 0 && !inhibit_handle) { /* no need to tickle if we're inhibiting. */
-        /* org.gnome.ScreenSaver is the legacy interface, but it'll either do nothing or just be a second harmless tickle on newer systems, so we leave it for now. */
+    if (screensaver_cookie == 0 && !inhibit_handle) { // no need to tickle if we're inhibiting.
+        // org.gnome.ScreenSaver is the legacy interface, but it'll either do nothing or just be a second harmless tickle on newer systems, so we leave it for now.
         SDL_DBus_CallVoidMethod("org.gnome.ScreenSaver", "/org/gnome/ScreenSaver", "org.gnome.ScreenSaver", "SimulateUserActivity", DBUS_TYPE_INVALID);
         SDL_DBus_CallVoidMethod("org.gnome.ScreenSaver", "/org/gnome/ScreenSaver", "org.gnome.ScreenSaver", "SimulateUserActivity", DBUS_TYPE_INVALID);
         SDL_DBus_CallVoidMethod("org.freedesktop.ScreenSaver", "/org/freedesktop/ScreenSaver", "org.freedesktop.ScreenSaver", "SimulateUserActivity", DBUS_TYPE_INVALID);
         SDL_DBus_CallVoidMethod("org.freedesktop.ScreenSaver", "/org/freedesktop/ScreenSaver", "org.freedesktop.ScreenSaver", "SimulateUserActivity", DBUS_TYPE_INVALID);
     }
     }
@@ -443,8 +443,8 @@ SDL_bool SDL_DBus_ScreensaverInhibit(SDL_bool inhibit)
         const char *bus_name = "org.freedesktop.portal.Desktop";
         const char *bus_name = "org.freedesktop.portal.Desktop";
         const char *path = "/org/freedesktop/portal/desktop";
         const char *path = "/org/freedesktop/portal/desktop";
         const char *interface = "org.freedesktop.portal.Inhibit";
         const char *interface = "org.freedesktop.portal.Inhibit";
-        const char *window = "";                    /* As a future improvement we could gather the X11 XID or Wayland surface identifier */
-        static const unsigned int INHIBIT_IDLE = 8; /* Taken from the portal API reference */
+        const char *window = "";                    // As a future improvement we could gather the X11 XID or Wayland surface identifier
+        static const unsigned int INHIBIT_IDLE = 8; // Taken from the portal API reference
         DBusMessageIter iterInit;
         DBusMessageIter iterInit;
 
 
         if (inhibit) {
         if (inhibit) {
@@ -469,7 +469,7 @@ SDL_bool SDL_DBus_ScreensaverInhibit(SDL_bool inhibit)
 
 
             dbus.message_iter_init_append(msg, &iterInit);
             dbus.message_iter_init_append(msg, &iterInit);
 
 
-            /* a{sv} */
+            // a{sv}
             if (!SDL_DBus_AppendDictWithKeyValue(&iterInit, key, reason)) {
             if (!SDL_DBus_AppendDictWithKeyValue(&iterInit, key, reason)) {
                 dbus.message_unref(msg);
                 dbus.message_unref(msg);
                 return SDL_FALSE;
                 return SDL_FALSE;
@@ -524,7 +524,7 @@ void SDL_DBus_PumpEvents(void)
         dbus.connection_read_write(dbus.session_conn, 0);
         dbus.connection_read_write(dbus.session_conn, 0);
 
 
         while (dbus.connection_dispatch(dbus.session_conn) == DBUS_DISPATCH_DATA_REMAINS) {
         while (dbus.connection_dispatch(dbus.session_conn) == DBUS_DISPATCH_DATA_REMAINS) {
-            /* Do nothing, actual work happens in DBus_MessageFilter */
+            // Do nothing, actual work happens in DBus_MessageFilter
             SDL_DelayNS(SDL_US_TO_NS(10));
             SDL_DelayNS(SDL_US_TO_NS(10));
         }
         }
     }
     }
@@ -541,7 +541,7 @@ char *SDL_DBus_GetLocalMachineId(void)
     dbus.error_init(&err);
     dbus.error_init(&err);
 
 
     if (dbus.try_get_local_machine_id) {
     if (dbus.try_get_local_machine_id) {
-        /* Available since dbus 1.12.0, has proper error-handling */
+        // Available since dbus 1.12.0, has proper error-handling
         result = dbus.try_get_local_machine_id(&err);
         result = dbus.try_get_local_machine_id(&err);
     } else {
     } else {
         /* Available since time immemorial, but has no error-handling:
         /* Available since time immemorial, but has no error-handling:
@@ -575,12 +575,12 @@ char **SDL_DBus_DocumentsPortalRetrieveFiles(const char *key, int *path_count)
     DBusMessageIter iter, iterDict;
     DBusMessageIter iter, iterDict;
     char **paths = NULL;
     char **paths = NULL;
     DBusMessage *reply = NULL;
     DBusMessage *reply = NULL;
-    DBusMessage *msg = dbus.message_new_method_call("org.freedesktop.portal.Documents",    /* Node */
-                                                    "/org/freedesktop/portal/documents",   /* Path */
-                                                    "org.freedesktop.portal.FileTransfer", /* Interface */
-                                                    "RetrieveFiles");                      /* Method */
+    DBusMessage *msg = dbus.message_new_method_call("org.freedesktop.portal.Documents",    // Node
+                                                    "/org/freedesktop/portal/documents",   // Path
+                                                    "org.freedesktop.portal.FileTransfer", // Interface
+                                                    "RetrieveFiles");                      // Method
 
 
-    /* Make sure we have a connection to the dbus session bus */
+    // Make sure we have a connection to the dbus session bus
     if (!SDL_DBus_GetContext() || !dbus.session_conn) {
     if (!SDL_DBus_GetContext() || !dbus.session_conn) {
         /* We either cannot connect to the session bus or were unable to
         /* We either cannot connect to the session bus or were unable to
          * load the D-Bus library at all. */
          * load the D-Bus library at all. */
@@ -589,7 +589,7 @@ char **SDL_DBus_DocumentsPortalRetrieveFiles(const char *key, int *path_count)
 
 
     dbus.error_init(&err);
     dbus.error_init(&err);
 
 
-    /* First argument is a "application/vnd.portal.filetransfer" key from a DnD or clipboard event */
+    // First argument is a "application/vnd.portal.filetransfer" key from a DnD or clipboard event
     if (!dbus.message_append_args(msg, DBUS_TYPE_STRING, &key, DBUS_TYPE_INVALID)) {
     if (!dbus.message_append_args(msg, DBUS_TYPE_STRING, &key, DBUS_TYPE_INVALID)) {
         SDL_OutOfMemory();
         SDL_OutOfMemory();
         dbus.message_unref(msg);
         dbus.message_unref(msg);

+ 4 - 4
src/core/linux/SDL_dbus.h

@@ -91,12 +91,12 @@ extern void SDL_DBus_Init(void);
 extern void SDL_DBus_Quit(void);
 extern void SDL_DBus_Quit(void);
 extern SDL_DBusContext *SDL_DBus_GetContext(void);
 extern SDL_DBusContext *SDL_DBus_GetContext(void);
 
 
-/* These use the built-in Session connection. */
+// These use the built-in Session connection.
 extern SDL_bool SDL_DBus_CallMethod(const char *node, const char *path, const char *interface, const char *method, ...);
 extern SDL_bool SDL_DBus_CallMethod(const char *node, const char *path, const char *interface, const char *method, ...);
 extern SDL_bool SDL_DBus_CallVoidMethod(const char *node, const char *path, const char *interface, const char *method, ...);
 extern SDL_bool SDL_DBus_CallVoidMethod(const char *node, const char *path, const char *interface, const char *method, ...);
 extern SDL_bool SDL_DBus_QueryProperty(const char *node, const char *path, const char *interface, const char *property, const int expectedtype, void *result);
 extern SDL_bool SDL_DBus_QueryProperty(const char *node, const char *path, const char *interface, const char *property, const int expectedtype, void *result);
 
 
-/* These use whatever connection you like. */
+// These use whatever connection you like.
 extern SDL_bool SDL_DBus_CallMethodOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *method, ...);
 extern SDL_bool SDL_DBus_CallMethodOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *method, ...);
 extern SDL_bool SDL_DBus_CallVoidMethodOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *method, ...);
 extern SDL_bool SDL_DBus_CallVoidMethodOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *method, ...);
 extern SDL_bool SDL_DBus_QueryPropertyOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *property, const int expectedtype, void *result);
 extern SDL_bool SDL_DBus_QueryPropertyOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *property, const int expectedtype, void *result);
@@ -109,6 +109,6 @@ extern char *SDL_DBus_GetLocalMachineId(void);
 
 
 extern char **SDL_DBus_DocumentsPortalRetrieveFiles(const char *key, int *files_count);
 extern char **SDL_DBus_DocumentsPortalRetrieveFiles(const char *key, int *files_count);
 
 
-#endif /* HAVE_DBUS_DBUS_H */
+#endif // HAVE_DBUS_DBUS_H
 
 
-#endif /* SDL_dbus_h_ */
+#endif // SDL_dbus_h_

+ 41 - 41
src/core/linux/SDL_evdev.c

@@ -22,7 +22,7 @@
 
 
 #ifdef SDL_INPUT_LINUXEV
 #ifdef SDL_INPUT_LINUXEV
 
 
-/* This is based on the linux joystick driver */
+// This is based on the linux joystick driver
 /* References: https://www.kernel.org/doc/Documentation/input/input.txt
 /* References: https://www.kernel.org/doc/Documentation/input/input.txt
  *             https://www.kernel.org/doc/Documentation/input/event-codes.txt
  *             https://www.kernel.org/doc/Documentation/input/event-codes.txt
  *             /usr/include/linux/input.h
  *             /usr/include/linux/input.h
@@ -43,7 +43,7 @@
 #include "../../core/linux/SDL_evdev_capabilities.h"
 #include "../../core/linux/SDL_evdev_capabilities.h"
 #include "../../core/linux/SDL_udev.h"
 #include "../../core/linux/SDL_udev.h"
 
 
-/* These are not defined in older Linux kernel headers */
+// These are not defined in older Linux kernel headers
 #ifndef SYN_DROPPED
 #ifndef SYN_DROPPED
 #define SYN_DROPPED 3
 #define SYN_DROPPED 3
 #endif
 #endif
@@ -59,12 +59,12 @@
 #define REL_HWHEEL_HI_RES 0x0c
 #define REL_HWHEEL_HI_RES 0x0c
 #endif
 #endif
 
 
-/* The field to look up in struct input_event for integer seconds */
+// The field to look up in struct input_event for integer seconds
 #ifndef input_event_sec
 #ifndef input_event_sec
 #define input_event_sec time.tv_sec
 #define input_event_sec time.tv_sec
 #endif
 #endif
 
 
-/* The field to look up in struct input_event for fractional seconds */
+// The field to look up in struct input_event for fractional seconds
 #ifndef input_event_usec
 #ifndef input_event_usec
 #define input_event_usec time.tv_usec
 #define input_event_usec time.tv_usec
 #endif
 #endif
@@ -75,7 +75,7 @@ typedef struct SDL_evdevlist_item
     int fd;
     int fd;
     int udev_class;
     int udev_class;
 
 
-    /* TODO: use this for every device, not just touchscreen */
+    // TODO: use this for every device, not just touchscreen
     SDL_bool out_of_sync;
     SDL_bool out_of_sync;
 
 
     /* TODO: expand on this to have data for every possible class (mouse,
     /* TODO: expand on this to have data for every possible class (mouse,
@@ -107,7 +107,7 @@ typedef struct SDL_evdevlist_item
 
 
     } *touchscreen_data;
     } *touchscreen_data;
 
 
-    /* Mouse state */
+    // Mouse state
     SDL_bool high_res_wheel;
     SDL_bool high_res_wheel;
     SDL_bool high_res_hwheel;
     SDL_bool high_res_hwheel;
     SDL_bool relative_mouse;
     SDL_bool relative_mouse;
@@ -137,22 +137,22 @@ static int SDL_EVDEV_device_removed(const char *dev_path);
 static int SDL_EVDEV_device_added(const char *dev_path, int udev_class);
 static int SDL_EVDEV_device_added(const char *dev_path, int udev_class);
 #ifdef SDL_USE_LIBUDEV
 #ifdef SDL_USE_LIBUDEV
 static void SDL_EVDEV_udev_callback(SDL_UDEV_deviceevent udev_event, int udev_class, const char *dev_path);
 static void SDL_EVDEV_udev_callback(SDL_UDEV_deviceevent udev_event, int udev_class, const char *dev_path);
-#endif /* SDL_USE_LIBUDEV */
+#endif // SDL_USE_LIBUDEV
 
 
 static Uint8 EVDEV_MouseButtons[] = {
 static Uint8 EVDEV_MouseButtons[] = {
-    SDL_BUTTON_LEFT,   /*  BTN_LEFT        0x110 */
-    SDL_BUTTON_RIGHT,  /*  BTN_RIGHT       0x111 */
-    SDL_BUTTON_MIDDLE, /*  BTN_MIDDLE      0x112 */
-    SDL_BUTTON_X1,     /*  BTN_SIDE        0x113 */
-    SDL_BUTTON_X2,     /*  BTN_EXTRA       0x114 */
-    SDL_BUTTON_X2 + 1, /*  BTN_FORWARD     0x115 */
-    SDL_BUTTON_X2 + 2, /*  BTN_BACK        0x116 */
-    SDL_BUTTON_X2 + 3  /*  BTN_TASK        0x117 */
+    SDL_BUTTON_LEFT,   // BTN_LEFT        0x110
+    SDL_BUTTON_RIGHT,  // BTN_RIGHT       0x111
+    SDL_BUTTON_MIDDLE, // BTN_MIDDLE      0x112
+    SDL_BUTTON_X1,     // BTN_SIDE        0x113
+    SDL_BUTTON_X2,     // BTN_EXTRA       0x114
+    SDL_BUTTON_X2 + 1, // BTN_FORWARD     0x115
+    SDL_BUTTON_X2 + 2, // BTN_BACK        0x116
+    SDL_BUTTON_X2 + 3  // BTN_TASK        0x117
 };
 };
 
 
 static int SDL_EVDEV_SetRelativeMouseMode(SDL_bool enabled)
 static int SDL_EVDEV_SetRelativeMouseMode(SDL_bool enabled)
 {
 {
-    /* Mice already send relative events through this interface */
+    // Mice already send relative events through this interface
     return 0;
     return 0;
 }
 }
 
 
@@ -180,7 +180,7 @@ int SDL_EVDEV_Init(void)
             return -1;
             return -1;
         }
         }
 
 
-        /* Set up the udev callback */
+        // Set up the udev callback
         if (SDL_UDEV_AddCallback(SDL_EVDEV_udev_callback) < 0) {
         if (SDL_UDEV_AddCallback(SDL_EVDEV_udev_callback) < 0) {
             SDL_UDEV_Quit();
             SDL_UDEV_Quit();
             SDL_free(_this);
             SDL_free(_this);
@@ -188,7 +188,7 @@ int SDL_EVDEV_Init(void)
             return -1;
             return -1;
         }
         }
 
 
-        /* Force a scan to build the initial device list */
+        // Force a scan to build the initial device list
         SDL_UDEV_Scan();
         SDL_UDEV_Scan();
 #else
 #else
         {
         {
@@ -212,10 +212,10 @@ int SDL_EVDEV_Init(void)
                     }
                     }
                 }
                 }
             } else {
             } else {
-                /* TODO: Scan the devices manually, like a caveman */
+                // TODO: Scan the devices manually, like a caveman
             }
             }
         }
         }
-#endif /* SDL_USE_LIBUDEV */
+#endif // SDL_USE_LIBUDEV
 
 
         _this->kbd = SDL_EVDEV_kbd_init();
         _this->kbd = SDL_EVDEV_kbd_init();
 
 
@@ -241,9 +241,9 @@ void SDL_EVDEV_Quit(void)
 #ifdef SDL_USE_LIBUDEV
 #ifdef SDL_USE_LIBUDEV
         SDL_UDEV_DelCallback(SDL_EVDEV_udev_callback);
         SDL_UDEV_DelCallback(SDL_EVDEV_udev_callback);
         SDL_UDEV_Quit();
         SDL_UDEV_Quit();
-#endif /* SDL_USE_LIBUDEV */
+#endif // SDL_USE_LIBUDEV
 
 
-        /* Remove existing devices */
+        // Remove existing devices
         while (_this->first) {
         while (_this->first) {
             SDL_EVDEV_device_removed(_this->first->path);
             SDL_EVDEV_device_removed(_this->first->path);
         }
         }
@@ -286,7 +286,7 @@ static void SDL_EVDEV_udev_callback(SDL_UDEV_deviceevent udev_event, int udev_cl
         break;
         break;
     }
     }
 }
 }
-#endif /* SDL_USE_LIBUDEV */
+#endif // SDL_USE_LIBUDEV
 
 
 void SDL_EVDEV_SetVTSwitchCallbacks(void (*release_callback)(void*), void *release_callback_data,
 void SDL_EVDEV_SetVTSwitchCallbacks(void (*release_callback)(void*), void *release_callback_data,
                                     void (*acquire_callback)(void*), void *acquire_callback_data)
                                     void (*acquire_callback)(void*), void *acquire_callback_data)
@@ -371,7 +371,7 @@ void SDL_EVDEV_Poll(void)
                         break;
                         break;
                     }
                     }
 
 
-                    /* Probably keyboard */
+                    // Probably keyboard
                     scancode = SDL_EVDEV_translate_keycode(event->code);
                     scancode = SDL_EVDEV_translate_keycode(event->code);
                     if (event->value == 0) {
                     if (event->value == 0) {
                         SDL_SendKeyboardKey(SDL_EVDEV_GetEventTimestamp(event), (SDL_KeyboardID)item->fd, event->code, scancode, SDL_RELEASED);
                         SDL_SendKeyboardKey(SDL_EVDEV_GetEventTimestamp(event), (SDL_KeyboardID)item->fd, event->code, scancode, SDL_RELEASED);
@@ -383,13 +383,13 @@ void SDL_EVDEV_Poll(void)
                 case EV_ABS:
                 case EV_ABS:
                     switch (event->code) {
                     switch (event->code) {
                     case ABS_MT_SLOT:
                     case ABS_MT_SLOT:
-                        if (!item->is_touchscreen) { /* FIXME: temp hack */
+                        if (!item->is_touchscreen) { // FIXME: temp hack
                             break;
                             break;
                         }
                         }
                         item->touchscreen_data->current_slot = event->value;
                         item->touchscreen_data->current_slot = event->value;
                         break;
                         break;
                     case ABS_MT_TRACKING_ID:
                     case ABS_MT_TRACKING_ID:
-                        if (!item->is_touchscreen) { /* FIXME: temp hack */
+                        if (!item->is_touchscreen) { // FIXME: temp hack
                             break;
                             break;
                         }
                         }
                         if (event->value >= 0) {
                         if (event->value >= 0) {
@@ -400,7 +400,7 @@ void SDL_EVDEV_Poll(void)
                         }
                         }
                         break;
                         break;
                     case ABS_MT_POSITION_X:
                     case ABS_MT_POSITION_X:
-                        if (!item->is_touchscreen) { /* FIXME: temp hack */
+                        if (!item->is_touchscreen) { // FIXME: temp hack
                             break;
                             break;
                         }
                         }
                         item->touchscreen_data->slots[item->touchscreen_data->current_slot].x = event->value;
                         item->touchscreen_data->slots[item->touchscreen_data->current_slot].x = event->value;
@@ -409,7 +409,7 @@ void SDL_EVDEV_Poll(void)
                         }
                         }
                         break;
                         break;
                     case ABS_MT_POSITION_Y:
                     case ABS_MT_POSITION_Y:
-                        if (!item->is_touchscreen) { /* FIXME: temp hack */
+                        if (!item->is_touchscreen) { // FIXME: temp hack
                             break;
                             break;
                         }
                         }
                         item->touchscreen_data->slots[item->touchscreen_data->current_slot].y = event->value;
                         item->touchscreen_data->slots[item->touchscreen_data->current_slot].y = event->value;
@@ -418,7 +418,7 @@ void SDL_EVDEV_Poll(void)
                         }
                         }
                         break;
                         break;
                     case ABS_MT_PRESSURE:
                     case ABS_MT_PRESSURE:
-                        if (!item->is_touchscreen) { /* FIXME: temp hack */
+                        if (!item->is_touchscreen) { // FIXME: temp hack
                             break;
                             break;
                         }
                         }
                         item->touchscreen_data->slots[item->touchscreen_data->current_slot].pressure = event->value;
                         item->touchscreen_data->slots[item->touchscreen_data->current_slot].pressure = event->value;
@@ -487,7 +487,7 @@ void SDL_EVDEV_Poll(void)
                 case EV_SYN:
                 case EV_SYN:
                     switch (event->code) {
                     switch (event->code) {
                     case SYN_REPORT:
                     case SYN_REPORT:
-                        /* Send mouse axis changes together to ensure consistency and reduce event processing overhead */
+                        // Send mouse axis changes together to ensure consistency and reduce event processing overhead
                         if (item->relative_mouse) {
                         if (item->relative_mouse) {
                             if (item->mouse_x != 0 || item->mouse_y != 0) {
                             if (item->mouse_x != 0 || item->mouse_y != 0) {
                                 SDL_SendMouseMotion(SDL_EVDEV_GetEventTimestamp(event), mouse->focus, (SDL_MouseID)item->fd, item->relative_mouse, (float)item->mouse_x, (float)item->mouse_y);
                                 SDL_SendMouseMotion(SDL_EVDEV_GetEventTimestamp(event), mouse->focus, (SDL_MouseID)item->fd, item->relative_mouse, (float)item->mouse_x, (float)item->mouse_y);
@@ -521,7 +521,7 @@ void SDL_EVDEV_Poll(void)
                             item->mouse_wheel = item->mouse_hwheel = 0;
                             item->mouse_wheel = item->mouse_hwheel = 0;
                         }
                         }
 
 
-                        if (!item->is_touchscreen) { /* FIXME: temp hack */
+                        if (!item->is_touchscreen) { // FIXME: temp hack
                             break;
                             break;
                         }
                         }
 
 
@@ -535,7 +535,7 @@ void SDL_EVDEV_Poll(void)
                                 norm_pressure = (float)(item->touchscreen_data->slots[j].pressure - item->touchscreen_data->min_pressure) /
                                 norm_pressure = (float)(item->touchscreen_data->slots[j].pressure - item->touchscreen_data->min_pressure) /
                                                 (float)item->touchscreen_data->range_pressure;
                                                 (float)item->touchscreen_data->range_pressure;
                             } else {
                             } else {
-                                /* This touchscreen does not support pressure */
+                                // This touchscreen does not support pressure
                                 norm_pressure = 1.0f;
                                 norm_pressure = 1.0f;
                             }
                             }
 
 
@@ -598,7 +598,7 @@ static SDL_Scancode SDL_EVDEV_translate_keycode(int keycode)
                     keycode);
                     keycode);
         }
         }
     }
     }
-#endif /* DEBUG_SCANCODES */
+#endif // DEBUG_SCANCODES
 
 
     return scancode;
     return scancode;
 }
 }
@@ -741,7 +741,7 @@ static int SDL_EVDEV_init_touchscreen(SDL_evdevlist_item *item, int udev_class)
         return -1;
         return -1;
     }
     }
 
 
-    ret = SDL_AddTouch(item->fd, /* I guess our fd is unique enough */
+    ret = SDL_AddTouch(item->fd, // I guess our fd is unique enough
                        (udev_class & SDL_UDEV_DEVICE_TOUCHPAD) ? SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE : SDL_TOUCH_DEVICE_DIRECT,
                        (udev_class & SDL_UDEV_DEVICE_TOUCHPAD) ? SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE : SDL_TOUCH_DEVICE_DIRECT,
                        item->touchscreen_data->name);
                        item->touchscreen_data->name);
     if (ret < 0) {
     if (ret < 0) {
@@ -783,7 +783,7 @@ static void SDL_EVDEV_sync_device(SDL_evdevlist_item *item)
     Sint32 *mt_req_values;
     Sint32 *mt_req_values;
     size_t mt_req_size;
     size_t mt_req_size;
 
 
-    /* TODO: sync devices other than touchscreen */
+    // TODO: sync devices other than touchscreen
     if (!item->is_touchscreen) {
     if (!item->is_touchscreen) {
         return;
         return;
     }
     }
@@ -888,7 +888,7 @@ static void SDL_EVDEV_sync_device(SDL_evdevlist_item *item)
 
 
     SDL_free(mt_req_code);
     SDL_free(mt_req_code);
 
 
-#endif /* EVIOCGMTSLOTS */
+#endif // EVIOCGMTSLOTS
 }
 }
 
 
 static int SDL_EVDEV_device_added(const char *dev_path, int udev_class)
 static int SDL_EVDEV_device_added(const char *dev_path, int udev_class)
@@ -896,10 +896,10 @@ static int SDL_EVDEV_device_added(const char *dev_path, int udev_class)
     SDL_evdevlist_item *item;
     SDL_evdevlist_item *item;
     unsigned long relbit[NBITS(REL_MAX)] = { 0 };
     unsigned long relbit[NBITS(REL_MAX)] = { 0 };
 
 
-    /* Check to make sure it's not already in list. */
+    // Check to make sure it's not already in list.
     for (item = _this->first; item; item = item->next) {
     for (item = _this->first; item; item = item->next) {
         if (SDL_strcmp(dev_path, item->path) == 0) {
         if (SDL_strcmp(dev_path, item->path) == 0) {
-            return -1; /* already have this one */
+            return -1; // already have this one
         }
         }
     }
     }
 
 
@@ -929,7 +929,7 @@ static int SDL_EVDEV_device_added(const char *dev_path, int udev_class)
         item->high_res_hwheel = test_bit(REL_HWHEEL_HI_RES, relbit);
         item->high_res_hwheel = test_bit(REL_HWHEEL_HI_RES, relbit);
     }
     }
 
 
-    /* For now, we just treat a touchpad like a touchscreen */
+    // For now, we just treat a touchpad like a touchscreen
     if (udev_class & (SDL_UDEV_DEVICE_TOUCHSCREEN | SDL_UDEV_DEVICE_TOUCHPAD)) {
     if (udev_class & (SDL_UDEV_DEVICE_TOUCHSCREEN | SDL_UDEV_DEVICE_TOUCHPAD)) {
         int ret;
         int ret;
         item->is_touchscreen = SDL_TRUE;
         item->is_touchscreen = SDL_TRUE;
@@ -978,7 +978,7 @@ static int SDL_EVDEV_device_removed(const char *dev_path)
     SDL_evdevlist_item *prev = NULL;
     SDL_evdevlist_item *prev = NULL;
 
 
     for (item = _this->first; item; item = item->next) {
     for (item = _this->first; item; item = item->next) {
-        /* found it, remove it. */
+        // found it, remove it.
         if (SDL_strcmp(dev_path, item->path) == 0) {
         if (SDL_strcmp(dev_path, item->path) == 0) {
             if (prev) {
             if (prev) {
                 prev->next = item->next;
                 prev->next = item->next;
@@ -1033,4 +1033,4 @@ Uint64 SDL_EVDEV_GetEventTimestamp(struct input_event *event)
     return timestamp;
     return timestamp;
 }
 }
 
 
-#endif /* SDL_INPUT_LINUXEV */
+#endif // SDL_INPUT_LINUXEV

+ 2 - 2
src/core/linux/SDL_evdev.h

@@ -36,6 +36,6 @@ extern int SDL_EVDEV_GetDeviceCount(int device_class);
 extern void SDL_EVDEV_Poll(void);
 extern void SDL_EVDEV_Poll(void);
 extern Uint64 SDL_EVDEV_GetEventTimestamp(struct input_event *event);
 extern Uint64 SDL_EVDEV_GetEventTimestamp(struct input_event *event);
 
 
-#endif /* SDL_INPUT_LINUXEV */
+#endif // SDL_INPUT_LINUXEV
 
 
-#endif /* SDL_evdev_h_ */
+#endif // SDL_evdev_h_

+ 16 - 16
src/core/linux/SDL_evdev_capabilities.c

@@ -25,7 +25,7 @@
 
 
 #ifdef HAVE_LINUX_INPUT_H
 #ifdef HAVE_LINUX_INPUT_H
 
 
-/* missing defines in older Linux kernel headers */
+// missing defines in older Linux kernel headers
 #ifndef BTN_TRIGGER_HAPPY
 #ifndef BTN_TRIGGER_HAPPY
 #define BTN_TRIGGER_HAPPY 0x2c0
 #define BTN_TRIGGER_HAPPY 0x2c0
 #endif
 #endif
@@ -49,7 +49,7 @@ SDL_EVDEV_GuessDeviceClass(const unsigned long bitmask_props[NBITS(INPUT_PROP_MA
         unsigned end;
         unsigned end;
     };
     };
 
 
-    /* key code ranges above BTN_MISC (start is inclusive, stop is exclusive)*/
+    // key code ranges above BTN_MISC (start is inclusive, stop is exclusive)
     static const struct range high_key_blocks[] = {
     static const struct range high_key_blocks[] = {
         { KEY_OK, BTN_DPAD_UP },
         { KEY_OK, BTN_DPAD_UP },
         { KEY_ALS_TOGGLE, BTN_TRIGGER_HAPPY }
         { KEY_ALS_TOGGLE, BTN_TRIGGER_HAPPY }
@@ -58,24 +58,24 @@ SDL_EVDEV_GuessDeviceClass(const unsigned long bitmask_props[NBITS(INPUT_PROP_MA
     int devclass = 0;
     int devclass = 0;
     unsigned long keyboard_mask;
     unsigned long keyboard_mask;
 
 
-    /* If the kernel specifically says it's an accelerometer, believe it */
+    // If the kernel specifically says it's an accelerometer, believe it
     if (test_bit(INPUT_PROP_ACCELEROMETER, bitmask_props)) {
     if (test_bit(INPUT_PROP_ACCELEROMETER, bitmask_props)) {
         return SDL_UDEV_DEVICE_ACCELEROMETER;
         return SDL_UDEV_DEVICE_ACCELEROMETER;
     }
     }
 
 
-    /* We treat pointing sticks as indistinguishable from mice */
+    // We treat pointing sticks as indistinguishable from mice
     if (test_bit(INPUT_PROP_POINTING_STICK, bitmask_props)) {
     if (test_bit(INPUT_PROP_POINTING_STICK, bitmask_props)) {
         return SDL_UDEV_DEVICE_MOUSE;
         return SDL_UDEV_DEVICE_MOUSE;
     }
     }
 
 
-    /* We treat buttonpads as equivalent to touchpads */
+    // We treat buttonpads as equivalent to touchpads
     if (test_bit(INPUT_PROP_TOPBUTTONPAD, bitmask_props) ||
     if (test_bit(INPUT_PROP_TOPBUTTONPAD, bitmask_props) ||
         test_bit(INPUT_PROP_BUTTONPAD, bitmask_props) ||
         test_bit(INPUT_PROP_BUTTONPAD, bitmask_props) ||
         test_bit(INPUT_PROP_SEMI_MT, bitmask_props)) {
         test_bit(INPUT_PROP_SEMI_MT, bitmask_props)) {
         return SDL_UDEV_DEVICE_TOUCHPAD;
         return SDL_UDEV_DEVICE_TOUCHPAD;
     }
     }
 
 
-    /* X, Y, Z axes but no buttons probably means an accelerometer */
+    // X, Y, Z axes but no buttons probably means an accelerometer
     if (test_bit(EV_ABS, bitmask_ev) &&
     if (test_bit(EV_ABS, bitmask_ev) &&
         test_bit(ABS_X, bitmask_abs) &&
         test_bit(ABS_X, bitmask_abs) &&
         test_bit(ABS_Y, bitmask_abs) &&
         test_bit(ABS_Y, bitmask_abs) &&
@@ -97,15 +97,15 @@ SDL_EVDEV_GuessDeviceClass(const unsigned long bitmask_props[NBITS(INPUT_PROP_MA
     if (test_bit(EV_ABS, bitmask_ev) &&
     if (test_bit(EV_ABS, bitmask_ev) &&
         test_bit(ABS_X, bitmask_abs) && test_bit(ABS_Y, bitmask_abs)) {
         test_bit(ABS_X, bitmask_abs) && test_bit(ABS_Y, bitmask_abs)) {
         if (test_bit(BTN_STYLUS, bitmask_key) || test_bit(BTN_TOOL_PEN, bitmask_key)) {
         if (test_bit(BTN_STYLUS, bitmask_key) || test_bit(BTN_TOOL_PEN, bitmask_key)) {
-            ; /* ID_INPUT_TABLET */
+            ; // ID_INPUT_TABLET
         } else if (test_bit(BTN_TOOL_FINGER, bitmask_key) && !test_bit(BTN_TOOL_PEN, bitmask_key)) {
         } else if (test_bit(BTN_TOOL_FINGER, bitmask_key) && !test_bit(BTN_TOOL_PEN, bitmask_key)) {
-            devclass |= SDL_UDEV_DEVICE_TOUCHPAD; /* ID_INPUT_TOUCHPAD */
+            devclass |= SDL_UDEV_DEVICE_TOUCHPAD; // ID_INPUT_TOUCHPAD
         } else if (test_bit(BTN_MOUSE, bitmask_key)) {
         } else if (test_bit(BTN_MOUSE, bitmask_key)) {
-            devclass |= SDL_UDEV_DEVICE_MOUSE; /* ID_INPUT_MOUSE */
+            devclass |= SDL_UDEV_DEVICE_MOUSE; // ID_INPUT_MOUSE
         } else if (test_bit(BTN_TOUCH, bitmask_key)) {
         } else if (test_bit(BTN_TOUCH, bitmask_key)) {
             /* TODO: better determining between touchscreen and multitouch touchpad,
             /* TODO: better determining between touchscreen and multitouch touchpad,
                see https://github.com/systemd/systemd/blob/master/src/udev/udev-builtin-input_id.c */
                see https://github.com/systemd/systemd/blob/master/src/udev/udev-builtin-input_id.c */
-            devclass |= SDL_UDEV_DEVICE_TOUCHSCREEN; /* ID_INPUT_TOUCHSCREEN */
+            devclass |= SDL_UDEV_DEVICE_TOUCHSCREEN; // ID_INPUT_TOUCHSCREEN
         }
         }
 
 
         if (test_bit(BTN_TRIGGER, bitmask_key) ||
         if (test_bit(BTN_TRIGGER, bitmask_key) ||
@@ -119,14 +119,14 @@ SDL_EVDEV_GuessDeviceClass(const unsigned long bitmask_props[NBITS(INPUT_PROP_MA
             test_bit(ABS_WHEEL, bitmask_abs) ||
             test_bit(ABS_WHEEL, bitmask_abs) ||
             test_bit(ABS_GAS, bitmask_abs) ||
             test_bit(ABS_GAS, bitmask_abs) ||
             test_bit(ABS_BRAKE, bitmask_abs)) {
             test_bit(ABS_BRAKE, bitmask_abs)) {
-            devclass |= SDL_UDEV_DEVICE_JOYSTICK; /* ID_INPUT_JOYSTICK */
+            devclass |= SDL_UDEV_DEVICE_JOYSTICK; // ID_INPUT_JOYSTICK
         }
         }
     }
     }
 
 
     if (test_bit(EV_REL, bitmask_ev) &&
     if (test_bit(EV_REL, bitmask_ev) &&
         test_bit(REL_X, bitmask_rel) && test_bit(REL_Y, bitmask_rel) &&
         test_bit(REL_X, bitmask_rel) && test_bit(REL_Y, bitmask_rel) &&
         test_bit(BTN_MOUSE, bitmask_key)) {
         test_bit(BTN_MOUSE, bitmask_key)) {
-        devclass |= SDL_UDEV_DEVICE_MOUSE; /* ID_INPUT_MOUSE */
+        devclass |= SDL_UDEV_DEVICE_MOUSE; // ID_INPUT_MOUSE
     }
     }
 
 
     if (test_bit(EV_KEY, bitmask_ev)) {
     if (test_bit(EV_KEY, bitmask_ev)) {
@@ -136,7 +136,7 @@ SDL_EVDEV_GuessDeviceClass(const unsigned long bitmask_props[NBITS(INPUT_PROP_MA
         for (i = 0; i < BTN_MISC / BITS_PER_LONG; ++i) {
         for (i = 0; i < BTN_MISC / BITS_PER_LONG; ++i) {
             found |= bitmask_key[i];
             found |= bitmask_key[i];
         }
         }
-        /* If there are no keys in the lower block, check the higher blocks */
+        // If there are no keys in the lower block, check the higher blocks
         if (!found) {
         if (!found) {
             unsigned block;
             unsigned block;
             for (block = 0; block < (sizeof(high_key_blocks) / sizeof(struct range)); ++block) {
             for (block = 0; block < (sizeof(high_key_blocks) / sizeof(struct range)); ++block) {
@@ -150,7 +150,7 @@ SDL_EVDEV_GuessDeviceClass(const unsigned long bitmask_props[NBITS(INPUT_PROP_MA
         }
         }
 
 
         if (found > 0) {
         if (found > 0) {
-            devclass |= SDL_UDEV_DEVICE_HAS_KEYS; /* ID_INPUT_KEY */
+            devclass |= SDL_UDEV_DEVICE_HAS_KEYS; // ID_INPUT_KEY
         }
         }
     }
     }
 
 
@@ -159,10 +159,10 @@ SDL_EVDEV_GuessDeviceClass(const unsigned long bitmask_props[NBITS(INPUT_PROP_MA
      * do not test KEY_RESERVED, though */
      * do not test KEY_RESERVED, though */
     keyboard_mask = 0xFFFFFFFE;
     keyboard_mask = 0xFFFFFFFE;
     if ((bitmask_key[0] & keyboard_mask) == keyboard_mask) {
     if ((bitmask_key[0] & keyboard_mask) == keyboard_mask) {
-        devclass |= SDL_UDEV_DEVICE_KEYBOARD; /* ID_INPUT_KEYBOARD */
+        devclass |= SDL_UDEV_DEVICE_KEYBOARD; // ID_INPUT_KEYBOARD
     }
     }
 
 
     return devclass;
     return devclass;
 }
 }
 
 
-#endif /* HAVE_LINUX_INPUT_H */
+#endif // HAVE_LINUX_INPUT_H

+ 3 - 3
src/core/linux/SDL_evdev_capabilities.h

@@ -44,7 +44,7 @@
 #define INPUT_PROP_MAX 0x1f
 #define INPUT_PROP_MAX 0x1f
 #endif
 #endif
 
 
-/* A device can be any combination of these classes */
+// A device can be any combination of these classes
 typedef enum
 typedef enum
 {
 {
     SDL_UDEV_DEVICE_UNKNOWN = 0x0000,
     SDL_UDEV_DEVICE_UNKNOWN = 0x0000,
@@ -71,6 +71,6 @@ extern int SDL_EVDEV_GuessDeviceClass(const unsigned long bitmask_props[NBITS(IN
                                       const unsigned long bitmask_key[NBITS(KEY_MAX)],
                                       const unsigned long bitmask_key[NBITS(KEY_MAX)],
                                       const unsigned long bitmask_rel[NBITS(REL_MAX)]);
                                       const unsigned long bitmask_rel[NBITS(REL_MAX)]);
 
 
-#endif /* HAVE_LINUX_INPUT_H */
+#endif // HAVE_LINUX_INPUT_H
 
 
-#endif /* SDL_evdev_capabilities_h_ */
+#endif // SDL_evdev_capabilities_h_

+ 36 - 36
src/core/linux/SDL_evdev_kbd.c

@@ -24,7 +24,7 @@
 
 
 #ifdef SDL_INPUT_LINUXKD
 #ifdef SDL_INPUT_LINUXKD
 
 
-/* This logic is adapted from drivers/tty/vt/keyboard.c in the Linux kernel source */
+// This logic is adapted from drivers/tty/vt/keyboard.c in the Linux kernel source
 
 
 #include <unistd.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <fcntl.h>
@@ -32,7 +32,7 @@
 #include <linux/kd.h>
 #include <linux/kd.h>
 #include <linux/keyboard.h>
 #include <linux/keyboard.h>
 #include <linux/vt.h>
 #include <linux/vt.h>
-#include <linux/tiocl.h> /* for TIOCL_GETSHIFTSTATE */
+#include <linux/tiocl.h> // for TIOCL_GETSHIFTSTATE
 
 
 #include <signal.h>
 #include <signal.h>
 
 
@@ -40,7 +40,7 @@
 #include "SDL_evdev_kbd_default_accents.h"
 #include "SDL_evdev_kbd_default_accents.h"
 #include "SDL_evdev_kbd_default_keymap.h"
 #include "SDL_evdev_kbd_default_keymap.h"
 
 
-/* These are not defined in older Linux kernel headers */
+// These are not defined in older Linux kernel headers
 #ifndef K_UNICODE
 #ifndef K_UNICODE
 #define K_UNICODE 0x03
 #define K_UNICODE 0x03
 #endif
 #endif
@@ -87,12 +87,12 @@ struct SDL_EVDEV_keyboard_state
     SDL_bool muted;
     SDL_bool muted;
     int old_kbd_mode;
     int old_kbd_mode;
     unsigned short **key_maps;
     unsigned short **key_maps;
-    unsigned char shift_down[NR_SHIFT]; /* shift state counters.. */
+    unsigned char shift_down[NR_SHIFT]; // shift state counters..
     SDL_bool dead_key_next;
     SDL_bool dead_key_next;
-    int npadch; /* -1 or number assembled on pad */
+    int npadch; // -1 or number assembled on pad
     struct kbdiacrs *accents;
     struct kbdiacrs *accents;
     unsigned int diacr;
     unsigned int diacr;
-    SDL_bool rep; /* flag telling character repeat */
+    SDL_bool rep; // flag telling character repeat
     unsigned char lockstate;
     unsigned char lockstate;
     unsigned char slockstate;
     unsigned char slockstate;
     unsigned char ledflagstate;
     unsigned char ledflagstate;
@@ -125,7 +125,7 @@ static void SDL_EVDEV_dump_accents(SDL_EVDEV_keyboard_state *kbd)
     printf("    }\n");
     printf("    }\n");
     printf("};\n");
     printf("};\n");
 }
 }
-#endif /* DUMP_ACCENTS */
+#endif // DUMP_ACCENTS
 
 
 #ifdef DUMP_KEYMAP
 #ifdef DUMP_KEYMAP
 static void SDL_EVDEV_dump_keymap(SDL_EVDEV_keyboard_state *kbd)
 static void SDL_EVDEV_dump_keymap(SDL_EVDEV_keyboard_state *kbd)
@@ -155,7 +155,7 @@ static void SDL_EVDEV_dump_keymap(SDL_EVDEV_keyboard_state *kbd)
     }
     }
     printf("};\n");
     printf("};\n");
 }
 }
-#endif /* DUMP_KEYMAP */
+#endif // DUMP_KEYMAP
 
 
 static SDL_EVDEV_keyboard_state *kbd_cleanup_state = NULL;
 static SDL_EVDEV_keyboard_state *kbd_cleanup_state = NULL;
 static int kbd_cleanup_sigactions_installed = 0;
 static int kbd_cleanup_sigactions_installed = 0;
@@ -164,7 +164,7 @@ static int kbd_cleanup_atexit_installed = 0;
 static struct sigaction old_sigaction[NSIG];
 static struct sigaction old_sigaction[NSIG];
 
 
 static int fatal_signals[] = {
 static int fatal_signals[] = {
-    /* Handlers for SIGTERM and SIGINT are installed in SDL_InitQuit. */
+    // Handlers for SIGTERM and SIGINT are installed in SDL_InitQuit.
     SIGHUP, SIGQUIT, SIGILL, SIGABRT,
     SIGHUP, SIGQUIT, SIGILL, SIGABRT,
     SIGFPE, SIGSEGV, SIGPIPE, SIGBUS,
     SIGFPE, SIGSEGV, SIGPIPE, SIGBUS,
     SIGSYS
     SIGSYS
@@ -194,22 +194,22 @@ static void kbd_cleanup_signal_action(int signum, siginfo_t *info, void *ucontex
     struct sigaction *old_action_p = &(old_sigaction[signum]);
     struct sigaction *old_action_p = &(old_sigaction[signum]);
     sigset_t sigset;
     sigset_t sigset;
 
 
-    /* Restore original signal handler before going any further. */
+    // Restore original signal handler before going any further.
     sigaction(signum, old_action_p, NULL);
     sigaction(signum, old_action_p, NULL);
 
 
-    /* Unmask current signal. */
+    // Unmask current signal.
     sigemptyset(&sigset);
     sigemptyset(&sigset);
     sigaddset(&sigset, signum);
     sigaddset(&sigset, signum);
     sigprocmask(SIG_UNBLOCK, &sigset, NULL);
     sigprocmask(SIG_UNBLOCK, &sigset, NULL);
 
 
-    /* Save original signal info and context for archeologists. */
+    // Save original signal info and context for archeologists.
     SDL_EVDEV_kdb_cleanup_siginfo = info;
     SDL_EVDEV_kdb_cleanup_siginfo = info;
     SDL_EVDEV_kdb_cleanup_ucontext = ucontext;
     SDL_EVDEV_kdb_cleanup_ucontext = ucontext;
 
 
-    /* Restore keyboard. */
+    // Restore keyboard.
     kbd_cleanup();
     kbd_cleanup();
 
 
-    /* Reraise signal. */
+    // Reraise signal.
     SDL_EVDEV_kbd_reraise_signal(signum);
     SDL_EVDEV_kbd_reraise_signal(signum);
 }
 }
 
 
@@ -230,27 +230,27 @@ static void kbd_unregister_emerg_cleanup(void)
         int signum = fatal_signals[tabidx];
         int signum = fatal_signals[tabidx];
         old_action_p = &(old_sigaction[signum]);
         old_action_p = &(old_sigaction[signum]);
 
 
-        /* Examine current signal action */
+        // Examine current signal action
         if (sigaction(signum, NULL, &cur_action)) {
         if (sigaction(signum, NULL, &cur_action)) {
             continue;
             continue;
         }
         }
 
 
-        /* Check if action installed and not modified */
+        // Check if action installed and not modified
         if (!(cur_action.sa_flags & SA_SIGINFO) || cur_action.sa_sigaction != &kbd_cleanup_signal_action) {
         if (!(cur_action.sa_flags & SA_SIGINFO) || cur_action.sa_sigaction != &kbd_cleanup_signal_action) {
             continue;
             continue;
         }
         }
 
 
-        /* Restore original action */
+        // Restore original action
         sigaction(signum, old_action_p, NULL);
         sigaction(signum, old_action_p, NULL);
     }
     }
 }
 }
 
 
 static void kbd_cleanup_atexit(void)
 static void kbd_cleanup_atexit(void)
 {
 {
-    /* Restore keyboard. */
+    // Restore keyboard.
     kbd_cleanup();
     kbd_cleanup();
 
 
-    /* Try to restore signal handlers in case shared library is being unloaded */
+    // Try to restore signal handlers in case shared library is being unloaded
     kbd_unregister_emerg_cleanup();
     kbd_unregister_emerg_cleanup();
 }
 }
 
 
@@ -333,7 +333,7 @@ static SDL_bool setup_vt_signal(int signum, signal_handler handler)
         return SDL_FALSE;
         return SDL_FALSE;
     }
     }
     if (old_action_p->sa_handler != SIG_DFL) {
     if (old_action_p->sa_handler != SIG_DFL) {
-        /* This signal is already in use */
+        // This signal is already in use
         sigaction(signum, old_action_p, NULL);
         sigaction(signum, old_action_p, NULL);
         return SDL_FALSE;
         return SDL_FALSE;
     }
     }
@@ -432,7 +432,7 @@ SDL_EVDEV_keyboard_state *SDL_EVDEV_kbd_init(void)
         return NULL;
         return NULL;
     }
     }
 
 
-    /* This might fail if we're not connected to a tty (e.g. on the Steam Link) */
+    // This might fail if we're not connected to a tty (e.g. on the Steam Link)
     kbd->console_fd = open("/dev/tty", O_RDONLY | O_CLOEXEC);
     kbd->console_fd = open("/dev/tty", O_RDONLY | O_CLOEXEC);
     if (!((ioctl(kbd->console_fd, KDGKBTYPE, &kbtype) == 0) && ((kbtype == KB_101) || (kbtype == KB_84)))) {
     if (!((ioctl(kbd->console_fd, KDGKBTYPE, &kbtype) == 0) && ((kbtype == KB_101) || (kbtype == KB_84)))) {
         close(kbd->console_fd);
         close(kbd->console_fd);
@@ -453,7 +453,7 @@ SDL_EVDEV_keyboard_state *SDL_EVDEV_kbd_init(void)
     kbd->key_maps = default_key_maps;
     kbd->key_maps = default_key_maps;
 
 
     if (ioctl(kbd->console_fd, KDGKBMODE, &kbd->old_kbd_mode) == 0) {
     if (ioctl(kbd->console_fd, KDGKBMODE, &kbd->old_kbd_mode) == 0) {
-        /* Set the keyboard in UNICODE mode and load the keymaps */
+        // Set the keyboard in UNICODE mode and load the keymaps
         ioctl(kbd->console_fd, KDSKBMODE, K_UNICODE);
         ioctl(kbd->console_fd, KDSKBMODE, K_UNICODE);
     }
     }
 
 
@@ -489,7 +489,7 @@ void SDL_EVDEV_kbd_set_muted(SDL_EVDEV_keyboard_state *state, SDL_bool muted)
     } else {
     } else {
         kbd_unregister_emerg_cleanup();
         kbd_unregister_emerg_cleanup();
 
 
-        /* Restore the original keyboard mode */
+        // Restore the original keyboard mode
         ioctl(state->console_fd, KDSKBMODE, state->old_kbd_mode);
         ioctl(state->console_fd, KDSKBMODE, state->old_kbd_mode);
     }
     }
     state->muted = muted;
     state->muted = muted;
@@ -549,7 +549,7 @@ void SDL_EVDEV_kbd_quit(SDL_EVDEV_keyboard_state *state)
  */
  */
 static void put_queue(SDL_EVDEV_keyboard_state *kbd, uint c)
 static void put_queue(SDL_EVDEV_keyboard_state *kbd, uint c)
 {
 {
-    /* c is already part of a UTF-8 sequence and safe to add as a character */
+    // c is already part of a UTF-8 sequence and safe to add as a character
     if (kbd->text_len < (sizeof(kbd->text) - 1)) {
     if (kbd->text_len < (sizeof(kbd->text) - 1)) {
         kbd->text[kbd->text_len++] = (char)c;
         kbd->text[kbd->text_len++] = (char)c;
     }
     }
@@ -599,7 +599,7 @@ static unsigned int handle_diacr(SDL_EVDEV_keyboard_state *kbd, unsigned int ch)
 
 
     if (kbd->console_fd >= 0)
     if (kbd->console_fd >= 0)
         if (ioctl(kbd->console_fd, KDGKBDIACR, kbd->accents) < 0) {
         if (ioctl(kbd->console_fd, KDGKBDIACR, kbd->accents) < 0) {
-            /* No worries, we'll use the default accent table */
+            // No worries, we'll use the default accent table
         }
         }
 
 
     for (i = 0; i < kbd->accents->kb_cnt; i++) {
     for (i = 0; i < kbd->accents->kb_cnt; i++) {
@@ -721,7 +721,7 @@ static void k_lowercase(SDL_EVDEV_keyboard_state *kbd, unsigned char value, char
 static void k_self(SDL_EVDEV_keyboard_state *kbd, unsigned char value, char up_flag)
 static void k_self(SDL_EVDEV_keyboard_state *kbd, unsigned char value, char up_flag)
 {
 {
     if (up_flag) {
     if (up_flag) {
-        return; /* no action, if this is a key release */
+        return; // no action, if this is a key release
     }
     }
 
 
     if (kbd->diacr) {
     if (kbd->diacr) {
@@ -774,11 +774,11 @@ static void k_pad(SDL_EVDEV_keyboard_state *kbd, unsigned char value, char up_fl
     static const char pad_chars[] = "0123456789+-*/\015,.?()#";
     static const char pad_chars[] = "0123456789+-*/\015,.?()#";
 
 
     if (up_flag) {
     if (up_flag) {
-        return; /* no action, if this is a key release */
+        return; // no action, if this is a key release
     }
     }
 
 
     if (!vc_kbd_led(kbd, K_NUMLOCK)) {
     if (!vc_kbd_led(kbd, K_NUMLOCK)) {
-        /* unprintable action */
+        // unprintable action
         return;
         return;
     }
     }
 
 
@@ -821,7 +821,7 @@ static void k_shift(SDL_EVDEV_keyboard_state *kbd, unsigned char value, char up_
         kbd->shift_state &= ~(1 << value);
         kbd->shift_state &= ~(1 << value);
     }
     }
 
 
-    /* kludge */
+    // kludge
     if (up_flag && kbd->shift_state != old_state && kbd->npadch != -1) {
     if (up_flag && kbd->shift_state != old_state && kbd->npadch != -1) {
         put_utf8(kbd, kbd->npadch);
         put_utf8(kbd, kbd->npadch);
         kbd->npadch = -1;
         kbd->npadch = -1;
@@ -841,10 +841,10 @@ static void k_ascii(SDL_EVDEV_keyboard_state *kbd, unsigned char value, char up_
     }
     }
 
 
     if (value < 10) {
     if (value < 10) {
-        /* decimal input of code, while Alt depressed */
+        // decimal input of code, while Alt depressed
         base = 10;
         base = 10;
     } else {
     } else {
-        /* hexadecimal input of code, while AltGr depressed */
+        // hexadecimal input of code, while AltGr depressed
         value -= 10;
         value -= 10;
         base = 16;
         base = 16;
     }
     }
@@ -873,7 +873,7 @@ static void k_slock(SDL_EVDEV_keyboard_state *kbd, unsigned char value, char up_
     }
     }
 
 
     chg_vc_kbd_slock(kbd, value);
     chg_vc_kbd_slock(kbd, value);
-    /* try to make Alt, oops, AltGr and such work */
+    // try to make Alt, oops, AltGr and such work
     if (!kbd->key_maps[kbd->lockstate ^ kbd->slockstate]) {
     if (!kbd->key_maps[kbd->lockstate ^ kbd->slockstate]) {
         kbd->slockstate = 0;
         kbd->slockstate = 0;
         chg_vc_kbd_slock(kbd, value);
         chg_vc_kbd_slock(kbd, value);
@@ -900,7 +900,7 @@ void SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *state, unsigned int keycode
     shift_final = (state->shift_state | state->slockstate) ^ state->lockstate;
     shift_final = (state->shift_state | state->slockstate) ^ state->lockstate;
     key_map = state->key_maps[shift_final];
     key_map = state->key_maps[shift_final];
     if (!key_map) {
     if (!key_map) {
-        /* Unsupported shift state (e.g. ctrl = 4, alt = 8), just reset to the default state */
+        // Unsupported shift state (e.g. ctrl = 4, alt = 8), just reset to the default state
         state->shift_state = 0;
         state->shift_state = 0;
         state->slockstate = 0;
         state->slockstate = 0;
         state->lockstate = 0;
         state->lockstate = 0;
@@ -932,7 +932,7 @@ void SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *state, unsigned int keycode
     } else {
     } else {
         type -= 0xf0;
         type -= 0xf0;
 
 
-        /* if type is KT_LETTER then it can be affected by Caps Lock */
+        // if type is KT_LETTER then it can be affected by Caps Lock
         if (type == KT_LETTER) {
         if (type == KT_LETTER) {
             type = KT_LATIN;
             type = KT_LATIN;
 
 
@@ -967,7 +967,7 @@ void SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *state, unsigned int keycode
     }
     }
 }
 }
 
 
-#elif !defined(SDL_INPUT_FBSDKBIO) /* !SDL_INPUT_LINUXKD */
+#elif !defined(SDL_INPUT_FBSDKBIO) // !SDL_INPUT_LINUXKD
 
 
 SDL_EVDEV_keyboard_state *SDL_EVDEV_kbd_init(void)
 SDL_EVDEV_keyboard_state *SDL_EVDEV_kbd_init(void)
 {
 {
@@ -994,4 +994,4 @@ void SDL_EVDEV_kbd_quit(SDL_EVDEV_keyboard_state *state)
 {
 {
 }
 }
 
 
-#endif /* SDL_INPUT_LINUXKD */
+#endif // SDL_INPUT_LINUXKD

+ 1 - 1
src/core/linux/SDL_evdev_kbd.h

@@ -32,4 +32,4 @@ extern void SDL_EVDEV_kbd_update(SDL_EVDEV_keyboard_state *state);
 extern void SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *state, unsigned int keycode, int down);
 extern void SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *state, unsigned int keycode, int down);
 extern void SDL_EVDEV_kbd_quit(SDL_EVDEV_keyboard_state *state);
 extern void SDL_EVDEV_kbd_quit(SDL_EVDEV_keyboard_state *state);
 
 
-#endif /* SDL_evdev_kbd_h_ */
+#endif // SDL_evdev_kbd_h_

+ 14 - 14
src/core/linux/SDL_fcitx.c

@@ -76,7 +76,7 @@ static char *GetAppName(void)
             return SDL_strdup(linkfile);
             return SDL_strdup(linkfile);
         }
         }
     }
     }
-#endif /* SDL_PLATFORM_LINUX || SDL_PLATFORM_FREEBSD */
+#endif // SDL_PLATFORM_LINUX || SDL_PLATFORM_FREEBSD
 
 
     return SDL_strdup("SDL_App");
     return SDL_strdup("SDL_App");
 }
 }
@@ -94,10 +94,10 @@ static size_t Fcitx_GetPreeditString(SDL_DBusContext *dbus,
     Sint32 p_end_pos = -1;
     Sint32 p_end_pos = -1;
 
 
     dbus->message_iter_init(msg, &iter);
     dbus->message_iter_init(msg, &iter);
-    /* Message type is a(si)i, we only need string part */
+    // Message type is a(si)i, we only need string part
     if (dbus->message_iter_get_arg_type(&iter) == DBUS_TYPE_ARRAY) {
     if (dbus->message_iter_get_arg_type(&iter) == DBUS_TYPE_ARRAY) {
         size_t pos = 0;
         size_t pos = 0;
-        /* First pass: calculate string length */
+        // First pass: calculate string length
         dbus->message_iter_recurse(&iter, &array);
         dbus->message_iter_recurse(&iter, &array);
         while (dbus->message_iter_get_arg_type(&array) == DBUS_TYPE_STRUCT) {
         while (dbus->message_iter_get_arg_type(&array) == DBUS_TYPE_STRUCT) {
             dbus->message_iter_recurse(&array, &sub);
             dbus->message_iter_recurse(&array, &sub);
@@ -110,12 +110,12 @@ static size_t Fcitx_GetPreeditString(SDL_DBusContext *dbus,
             }
             }
             dbus->message_iter_next(&sub);
             dbus->message_iter_next(&sub);
             if (dbus->message_iter_get_arg_type(&sub) == DBUS_TYPE_INT32 && p_end_pos == -1) {
             if (dbus->message_iter_get_arg_type(&sub) == DBUS_TYPE_INT32 && p_end_pos == -1) {
-                /* Type is a bit field defined as follows:                */
-                /* bit 3: Underline, bit 4: HighLight, bit 5: DontCommit, */
-                /* bit 6: Bold,      bit 7: Strike,    bit 8: Italic      */
+                // Type is a bit field defined as follows:
+                // bit 3: Underline, bit 4: HighLight, bit 5: DontCommit,
+                // bit 6: Bold,      bit 7: Strike,    bit 8: Italic
                 Sint32 type;
                 Sint32 type;
                 dbus->message_iter_get_basic(&sub, &type);
                 dbus->message_iter_get_basic(&sub, &type);
-                /* We only consider highlight */
+                // We only consider highlight
                 if (type & (1 << 4)) {
                 if (type & (1 << 4)) {
                     if (p_start_pos == -1) {
                     if (p_start_pos == -1) {
                         p_start_pos = pos;
                         p_start_pos = pos;
@@ -138,7 +138,7 @@ static size_t Fcitx_GetPreeditString(SDL_DBusContext *dbus,
 
 
         if (text) {
         if (text) {
             char *pivot = text;
             char *pivot = text;
-            /* Second pass: join all the sub string */
+            // Second pass: join all the sub string
             dbus->message_iter_recurse(&iter, &array);
             dbus->message_iter_recurse(&iter, &array);
             while (dbus->message_iter_get_arg_type(&array) == DBUS_TYPE_STRUCT) {
             while (dbus->message_iter_get_arg_type(&array) == DBUS_TYPE_STRUCT) {
                 dbus->message_iter_recurse(&array, &sub);
                 dbus->message_iter_recurse(&array, &sub);
@@ -239,8 +239,8 @@ static void SDLCALL Fcitx_SetCapabilities(void *data,
     }
     }
 
 
     if (hint && SDL_strstr(hint, "composition")) {
     if (hint && SDL_strstr(hint, "composition")) {
-        caps |= (1 << 1); /* Preedit Flag */
-        caps |= (1 << 4); /* Formatted Preedit Flag */
+        caps |= (1 << 1); // Preedit Flag
+        caps |= (1 << 4); // Formatted Preedit Flag
     }
     }
     if (hint && SDL_strstr(hint, "candidates")) {
     if (hint && SDL_strstr(hint, "candidates")) {
         // FIXME, turn off native candidate rendering
         // FIXME, turn off native candidate rendering
@@ -285,9 +285,9 @@ static SDL_bool FcitxClientCreateIC(FcitxClient *client)
     char *ic_path = NULL;
     char *ic_path = NULL;
     SDL_DBusContext *dbus = client->dbus;
     SDL_DBusContext *dbus = client->dbus;
 
 
-    /* SDL_DBus_CallMethod cannot handle a(ss) type, call dbus function directly */
+    // SDL_DBus_CallMethod cannot handle a(ss) type, call dbus function directly
     if (!FcitxCreateInputContext(dbus, appname, &ic_path)) {
     if (!FcitxCreateInputContext(dbus, appname, &ic_path)) {
-        ic_path = NULL; /* just in case. */
+        ic_path = NULL; // just in case.
     }
     }
 
 
     SDL_free(appname);
     SDL_free(appname);
@@ -433,7 +433,7 @@ void SDL_Fcitx_UpdateTextInputArea(SDL_Window *window)
 #endif
 #endif
 
 
     if (cursor->x == -1 && cursor->y == -1 && cursor->w == 0 && cursor->h == 0) {
     if (cursor->x == -1 && cursor->y == -1 && cursor->w == 0 && cursor->h == 0) {
-        /* move to bottom left */
+        // move to bottom left
         int w = 0, h = 0;
         int w = 0, h = 0;
         SDL_GetWindowSize(window, &w, &h);
         SDL_GetWindowSize(window, &w, &h);
         cursor->x = 0;
         cursor->x = 0;
@@ -455,6 +455,6 @@ void SDL_Fcitx_PumpEvents(void)
     dbus->connection_read_write(conn, 0);
     dbus->connection_read_write(conn, 0);
 
 
     while (dbus->connection_dispatch(conn) == DBUS_DISPATCH_DATA_REMAINS) {
     while (dbus->connection_dispatch(conn) == DBUS_DISPATCH_DATA_REMAINS) {
-        /* Do nothing, actual work happens in DBus_MessageFilter */
+        // Do nothing, actual work happens in DBus_MessageFilter
     }
     }
 }
 }

+ 1 - 1
src/core/linux/SDL_fcitx.h

@@ -32,4 +32,4 @@ extern SDL_bool SDL_Fcitx_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 s
 extern void SDL_Fcitx_UpdateTextInputArea(SDL_Window *window);
 extern void SDL_Fcitx_UpdateTextInputArea(SDL_Window *window);
 extern void SDL_Fcitx_PumpEvents(void);
 extern void SDL_Fcitx_PumpEvents(void);
 
 
-#endif /* SDL_fcitx_h_ */
+#endif // SDL_fcitx_h_

+ 17 - 17
src/core/linux/SDL_ibus.c

@@ -62,7 +62,7 @@ static Uint32 IBus_ModState(void)
     Uint32 ibus_mods = 0;
     Uint32 ibus_mods = 0;
     SDL_Keymod sdl_mods = SDL_GetModState();
     SDL_Keymod sdl_mods = SDL_GetModState();
 
 
-    /* Not sure about MOD3, MOD4 and HYPER mappings */
+    // Not sure about MOD3, MOD4 and HYPER mappings
     if (sdl_mods & SDL_KMOD_LSHIFT) {
     if (sdl_mods & SDL_KMOD_LSHIFT) {
         ibus_mods |= IBUS_SHIFT_MASK;
         ibus_mods |= IBUS_SHIFT_MASK;
     }
     }
@@ -152,16 +152,16 @@ static SDL_bool IBus_GetDecorationPosition(DBusConnection *conn, DBusMessageIter
             dbus->message_iter_next(&sub);
             dbus->message_iter_next(&sub);
             dbus->message_iter_next(&sub);
             dbus->message_iter_next(&sub);
 
 
-            /* From here on, the structure looks like this:                    */
-            /* Uint32 type: 1=underline, 2=foreground, 3=background            */
-            /* Uint32 value: for underline it's 0=NONE, 1=SINGLE, 2=DOUBLE,    */
-            /*                                    3=LOW,  4=ERROR              */
-            /*                 for foreground and background it's a color      */
-            /* Uint32 start_index: starting position for the style (utf8-char) */
-            /* Uint32 end_index: end position for the style (utf8-char)        */
+            // From here on, the structure looks like this:
+            // Uint32 type: 1=underline, 2=foreground, 3=background
+            // Uint32 value: for underline it's 0=NONE, 1=SINGLE, 2=DOUBLE,
+            // 3=LOW,  4=ERROR
+            // for foreground and background it's a color
+            // Uint32 start_index: starting position for the style (utf8-char)
+            // Uint32 end_index: end position for the style (utf8-char)
 
 
             dbus->message_iter_get_basic(&sub, &type);
             dbus->message_iter_get_basic(&sub, &type);
-            /* We only use the background type to determine the selection */
+            // We only use the background type to determine the selection
             if (type == 3) {
             if (type == 3) {
                 Uint32 start = -1;
                 Uint32 start = -1;
                 dbus->message_iter_next(&sub);
                 dbus->message_iter_next(&sub);
@@ -184,7 +184,7 @@ static SDL_bool IBus_GetDecorationPosition(DBusConnection *conn, DBusMessageIter
 
 
 static const char *IBus_GetVariantText(DBusConnection *conn, DBusMessageIter *iter, SDL_DBusContext *dbus)
 static const char *IBus_GetVariantText(DBusConnection *conn, DBusMessageIter *iter, SDL_DBusContext *dbus)
 {
 {
-    /* The text we need is nested weirdly, use dbus-monitor to see the structure better */
+    // The text we need is nested weirdly, use dbus-monitor to see the structure better
     const char *text = NULL;
     const char *text = NULL;
     DBusMessageIter sub;
     DBusMessageIter sub;
 
 
@@ -330,7 +330,7 @@ static char *IBus_GetDBusAddressFilename(void)
         return NULL;
         return NULL;
     }
     }
 
 
-    /* Use this environment variable if it exists. */
+    // Use this environment variable if it exists.
     addr = SDL_getenv("IBUS_ADDRESS");
     addr = SDL_getenv("IBUS_ADDRESS");
     if (addr && *addr) {
     if (addr && *addr) {
         return SDL_strdup(addr);
         return SDL_strdup(addr);
@@ -453,7 +453,7 @@ static SDL_bool IBus_SetupConnection(SDL_DBusContext *dbus, const char *addr)
         ibus_conn = dbus->connection_open_private(addr, NULL);
         ibus_conn = dbus->connection_open_private(addr, NULL);
 
 
         if (!ibus_conn) {
         if (!ibus_conn) {
-            return SDL_FALSE; /* oh well. */
+            return SDL_FALSE; // oh well.
         }
         }
 
 
         dbus->connection_flush(ibus_conn);
         dbus->connection_flush(ibus_conn);
@@ -469,7 +469,7 @@ static SDL_bool IBus_SetupConnection(SDL_DBusContext *dbus, const char *addr)
                                                  DBUS_TYPE_STRING, &client_name, DBUS_TYPE_INVALID,
                                                  DBUS_TYPE_STRING, &client_name, DBUS_TYPE_INVALID,
                                                  DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID);
                                                  DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID);
     } else {
     } else {
-        /* re-using dbus->session_conn */
+        // re-using dbus->session_conn
         dbus->connection_ref(ibus_conn);
         dbus->connection_ref(ibus_conn);
     }
     }
 
 
@@ -584,7 +584,7 @@ SDL_bool SDL_IBus_Init(void)
         result = IBus_SetupConnection(dbus, addr);
         result = IBus_SetupConnection(dbus, addr);
         SDL_free(addr);
         SDL_free(addr);
 
 
-        /* don't use the addr_file if using the portal interface. */
+        // don't use the addr_file if using the portal interface.
         if (result && ibus_is_portal_interface) {
         if (result && ibus_is_portal_interface) {
             if (inotify_fd > 0) {
             if (inotify_fd > 0) {
                 if (inotify_wd > 0) {
                 if (inotify_wd > 0) {
@@ -616,7 +616,7 @@ void SDL_IBus_Quit(void)
 
 
     dbus = SDL_DBus_GetContext();
     dbus = SDL_DBus_GetContext();
 
 
-    /* if using portal, ibus_conn == session_conn; don't release it here. */
+    // if using portal, ibus_conn == session_conn; don't release it here.
     if (dbus && ibus_conn && !ibus_is_portal_interface) {
     if (dbus && ibus_conn && !ibus_is_portal_interface) {
         dbus->connection_close(ibus_conn);
         dbus->connection_close(ibus_conn);
         dbus->connection_unref(ibus_conn);
         dbus->connection_unref(ibus_conn);
@@ -633,7 +633,7 @@ void SDL_IBus_Quit(void)
         inotify_wd = -1;
         inotify_wd = -1;
     }
     }
 
 
-    /* !!! FIXME: should we close(inotify_fd) here? */
+    // !!! FIXME: should we close(inotify_fd) here?
 
 
     SDL_DelHintCallback(SDL_HINT_IME_IMPLEMENTED_UI, IBus_SetCapabilities, NULL);
     SDL_DelHintCallback(SDL_HINT_IME_IMPLEMENTED_UI, IBus_SetCapabilities, NULL);
 
 
@@ -733,7 +733,7 @@ void SDL_IBus_PumpEvents(void)
         dbus->connection_read_write(ibus_conn, 0);
         dbus->connection_read_write(ibus_conn, 0);
 
 
         while (dbus->connection_dispatch(ibus_conn) == DBUS_DISPATCH_DATA_REMAINS) {
         while (dbus->connection_dispatch(ibus_conn) == DBUS_DISPATCH_DATA_REMAINS) {
-            /* Do nothing, actual work happens in IBus_MessageHandler */
+            // Do nothing, actual work happens in IBus_MessageHandler
         }
         }
     }
     }
 }
 }

+ 4 - 4
src/core/linux/SDL_ibus.h

@@ -31,10 +31,10 @@
 extern SDL_bool SDL_IBus_Init(void);
 extern SDL_bool SDL_IBus_Init(void);
 extern void SDL_IBus_Quit(void);
 extern void SDL_IBus_Quit(void);
 
 
-/* Lets the IBus server know about changes in window focus */
+// Lets the IBus server know about changes in window focus
 extern void SDL_IBus_SetFocus(SDL_bool focused);
 extern void SDL_IBus_SetFocus(SDL_bool focused);
 
 
-/* Closes the candidate list and resets any text currently being edited */
+// Closes the candidate list and resets any text currently being edited
 extern void SDL_IBus_Reset(void);
 extern void SDL_IBus_Reset(void);
 
 
 /* Sends a keypress event to IBus, returns SDL_TRUE if IBus used this event to
 /* Sends a keypress event to IBus, returns SDL_TRUE if IBus used this event to
@@ -50,6 +50,6 @@ extern void SDL_IBus_UpdateTextInputArea(SDL_Window *window);
    SDL_SendEditingText for each event it finds */
    SDL_SendEditingText for each event it finds */
 extern void SDL_IBus_PumpEvents(void);
 extern void SDL_IBus_PumpEvents(void);
 
 
-#endif /* HAVE_IBUS_IBUS_H */
+#endif // HAVE_IBUS_IBUS_H
 
 
-#endif /* SDL_ibus_h_ */
+#endif // SDL_ibus_h_

+ 5 - 5
src/core/linux/SDL_ime.c

@@ -54,7 +54,7 @@ static void InitIME(void)
 
 
     inited = SDL_TRUE;
     inited = SDL_TRUE;
 
 
-    /* See if fcitx IME support is being requested */
+    // See if fcitx IME support is being requested
 #ifdef HAVE_FCITX
 #ifdef HAVE_FCITX
     if (!SDL_IME_Init_Real &&
     if (!SDL_IME_Init_Real &&
         ((im_module && SDL_strcmp(im_module, "fcitx") == 0) ||
         ((im_module && SDL_strcmp(im_module, "fcitx") == 0) ||
@@ -67,9 +67,9 @@ static void InitIME(void)
         SDL_IME_UpdateTextInputArea_Real = SDL_Fcitx_UpdateTextInputArea;
         SDL_IME_UpdateTextInputArea_Real = SDL_Fcitx_UpdateTextInputArea;
         SDL_IME_PumpEvents_Real = SDL_Fcitx_PumpEvents;
         SDL_IME_PumpEvents_Real = SDL_Fcitx_PumpEvents;
     }
     }
-#endif /* HAVE_FCITX */
+#endif // HAVE_FCITX
 
 
-    /* default to IBus */
+    // default to IBus
 #ifdef HAVE_IBUS_IBUS_H
 #ifdef HAVE_IBUS_IBUS_H
     if (!SDL_IME_Init_Real) {
     if (!SDL_IME_Init_Real) {
         SDL_IME_Init_Real = SDL_IBus_Init;
         SDL_IME_Init_Real = SDL_IBus_Init;
@@ -80,7 +80,7 @@ static void InitIME(void)
         SDL_IME_UpdateTextInputArea_Real = SDL_IBus_UpdateTextInputArea;
         SDL_IME_UpdateTextInputArea_Real = SDL_IBus_UpdateTextInputArea;
         SDL_IME_PumpEvents_Real = SDL_IBus_PumpEvents;
         SDL_IME_PumpEvents_Real = SDL_IBus_PumpEvents;
     }
     }
-#endif /* HAVE_IBUS_IBUS_H */
+#endif // HAVE_IBUS_IBUS_H
 }
 }
 
 
 SDL_bool SDL_IME_Init(void)
 SDL_bool SDL_IME_Init(void)
@@ -92,7 +92,7 @@ SDL_bool SDL_IME_Init(void)
             return SDL_TRUE;
             return SDL_TRUE;
         }
         }
 
 
-        /* uhoh, the IME implementation's init failed! Disable IME support. */
+        // uhoh, the IME implementation's init failed! Disable IME support.
         SDL_IME_Init_Real = NULL;
         SDL_IME_Init_Real = NULL;
         SDL_IME_Quit_Real = NULL;
         SDL_IME_Quit_Real = NULL;
         SDL_IME_SetFocus_Real = NULL;
         SDL_IME_SetFocus_Real = NULL;

+ 1 - 1
src/core/linux/SDL_ime.h

@@ -32,4 +32,4 @@ extern SDL_bool SDL_IME_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 sta
 extern void SDL_IME_UpdateTextInputArea(SDL_Window *window);
 extern void SDL_IME_UpdateTextInputArea(SDL_Window *window);
 extern void SDL_IME_PumpEvents(void);
 extern void SDL_IME_PumpEvents(void);
 
 
-#endif /* SDL_ime_h_ */
+#endif // SDL_ime_h_

+ 2 - 2
src/core/linux/SDL_sandbox.h

@@ -31,7 +31,7 @@ typedef enum
     SDL_SANDBOX_SNAP,
     SDL_SANDBOX_SNAP,
 } SDL_Sandbox;
 } SDL_Sandbox;
 
 
-/* Return the sandbox type currently in use, if any */
+// Return the sandbox type currently in use, if any
 SDL_Sandbox SDL_DetectSandbox(void);
 SDL_Sandbox SDL_DetectSandbox(void);
 
 
-#endif /* SDL_SANDBOX_H */
+#endif // SDL_SANDBOX_H

+ 2 - 2
src/core/linux/SDL_system_theme.c

@@ -77,7 +77,7 @@ static DBusHandlerResult DBus_MessageFilter(DBusConnection *conn, DBusMessage *m
         const char *namespace, *key;
         const char *namespace, *key;
 
 
         dbus->message_iter_init(msg, &signal_iter);
         dbus->message_iter_init(msg, &signal_iter);
-        /* Check if the parameters are what we expect */
+        // Check if the parameters are what we expect
         if (dbus->message_iter_get_arg_type(&signal_iter) != DBUS_TYPE_STRING)
         if (dbus->message_iter_get_arg_type(&signal_iter) != DBUS_TYPE_STRING)
             goto not_our_signal;
             goto not_our_signal;
         dbus->message_iter_get_basic(&signal_iter, &namespace);
         dbus->message_iter_get_basic(&signal_iter, &namespace);
@@ -127,7 +127,7 @@ SDL_bool SDL_SystemTheme_Init(void)
                 DBusMessageIter reply_iter, variant_outer_iter;
                 DBusMessageIter reply_iter, variant_outer_iter;
 
 
                 dbus->message_iter_init(reply, &reply_iter);
                 dbus->message_iter_init(reply, &reply_iter);
-                /* The response has signature <<u>> */
+                // The response has signature <<u>>
                 if (dbus->message_iter_get_arg_type(&reply_iter) != DBUS_TYPE_VARIANT)
                 if (dbus->message_iter_get_arg_type(&reply_iter) != DBUS_TYPE_VARIANT)
                     goto incorrect_type;
                     goto incorrect_type;
                 dbus->message_iter_recurse(&reply_iter, &variant_outer_iter);
                 dbus->message_iter_recurse(&reply_iter, &variant_outer_iter);

+ 1 - 1
src/core/linux/SDL_system_theme.h

@@ -27,4 +27,4 @@
 extern SDL_bool SDL_SystemTheme_Init(void);
 extern SDL_bool SDL_SystemTheme_Init(void);
 extern SDL_SystemTheme SDL_SystemTheme_Get(void);
 extern SDL_SystemTheme SDL_SystemTheme_Get(void);
 
 
-#endif /* SDL_system_theme_h_ */
+#endif // SDL_system_theme_h_

+ 14 - 14
src/core/linux/SDL_threadprio.c

@@ -29,11 +29,11 @@
 #include <sched.h>
 #include <sched.h>
 #include <unistd.h>
 #include <unistd.h>
 
 
-/* RLIMIT_RTTIME requires kernel >= 2.6.25 and is in glibc >= 2.14 */
+// RLIMIT_RTTIME requires kernel >= 2.6.25 and is in glibc >= 2.14
 #ifndef RLIMIT_RTTIME
 #ifndef RLIMIT_RTTIME
 #define RLIMIT_RTTIME 15
 #define RLIMIT_RTTIME 15
 #endif
 #endif
-/* SCHED_RESET_ON_FORK is in kernel >= 2.6.32. */
+// SCHED_RESET_ON_FORK is in kernel >= 2.6.32.
 #ifndef SCHED_RESET_ON_FORK
 #ifndef SCHED_RESET_ON_FORK
 #define SCHED_RESET_ON_FORK 0x40000000
 #define SCHED_RESET_ON_FORK 0x40000000
 #endif
 #endif
@@ -42,12 +42,12 @@
 
 
 #ifdef SDL_USE_LIBDBUS
 #ifdef SDL_USE_LIBDBUS
 
 
-/* d-bus queries to org.freedesktop.RealtimeKit1. */
+// d-bus queries to org.freedesktop.RealtimeKit1.
 #define RTKIT_DBUS_NODE      "org.freedesktop.RealtimeKit1"
 #define RTKIT_DBUS_NODE      "org.freedesktop.RealtimeKit1"
 #define RTKIT_DBUS_PATH      "/org/freedesktop/RealtimeKit1"
 #define RTKIT_DBUS_PATH      "/org/freedesktop/RealtimeKit1"
 #define RTKIT_DBUS_INTERFACE "org.freedesktop.RealtimeKit1"
 #define RTKIT_DBUS_INTERFACE "org.freedesktop.RealtimeKit1"
 
 
-/* d-bus queries to the XDG portal interface to RealtimeKit1 */
+// d-bus queries to the XDG portal interface to RealtimeKit1
 #define XDG_PORTAL_DBUS_NODE      "org.freedesktop.portal.Desktop"
 #define XDG_PORTAL_DBUS_NODE      "org.freedesktop.portal.Desktop"
 #define XDG_PORTAL_DBUS_PATH      "/org/freedesktop/portal/desktop"
 #define XDG_PORTAL_DBUS_PATH      "/org/freedesktop/portal/desktop"
 #define XDG_PORTAL_DBUS_INTERFACE "org.freedesktop.portal.Realtime"
 #define XDG_PORTAL_DBUS_INTERFACE "org.freedesktop.portal.Realtime"
@@ -78,13 +78,13 @@ static void set_rtkit_interface(void)
 {
 {
     SDL_DBusContext *dbus = SDL_DBus_GetContext();
     SDL_DBusContext *dbus = SDL_DBus_GetContext();
 
 
-    /* xdg-desktop-portal works in all instances, so check for it first. */
+    // xdg-desktop-portal works in all instances, so check for it first.
     if (dbus && realtime_portal_supported(dbus->session_conn)) {
     if (dbus && realtime_portal_supported(dbus->session_conn)) {
         rtkit_use_session_conn = SDL_TRUE;
         rtkit_use_session_conn = SDL_TRUE;
         rtkit_dbus_node = XDG_PORTAL_DBUS_NODE;
         rtkit_dbus_node = XDG_PORTAL_DBUS_NODE;
         rtkit_dbus_path = XDG_PORTAL_DBUS_PATH;
         rtkit_dbus_path = XDG_PORTAL_DBUS_PATH;
         rtkit_dbus_interface = XDG_PORTAL_DBUS_INTERFACE;
         rtkit_dbus_interface = XDG_PORTAL_DBUS_INTERFACE;
-    } else { /* Fall back to the standard rtkit interface in all other cases. */
+    } else { // Fall back to the standard rtkit interface in all other cases.
         rtkit_use_session_conn = SDL_FALSE;
         rtkit_use_session_conn = SDL_FALSE;
         rtkit_dbus_node = RTKIT_DBUS_NODE;
         rtkit_dbus_node = RTKIT_DBUS_NODE;
         rtkit_dbus_path = RTKIT_DBUS_PATH;
         rtkit_dbus_path = RTKIT_DBUS_PATH;
@@ -110,19 +110,19 @@ static void rtkit_initialize(void)
     set_rtkit_interface();
     set_rtkit_interface();
     dbus_conn = get_rtkit_dbus_connection();
     dbus_conn = get_rtkit_dbus_connection();
 
 
-    /* Try getting minimum nice level: this is often greater than PRIO_MIN (-20). */
+    // Try getting minimum nice level: this is often greater than PRIO_MIN (-20).
     if (!dbus_conn || !SDL_DBus_QueryPropertyOnConnection(dbus_conn, rtkit_dbus_node, rtkit_dbus_path, rtkit_dbus_interface, "MinNiceLevel",
     if (!dbus_conn || !SDL_DBus_QueryPropertyOnConnection(dbus_conn, rtkit_dbus_node, rtkit_dbus_path, rtkit_dbus_interface, "MinNiceLevel",
                                                                  DBUS_TYPE_INT32, &rtkit_min_nice_level)) {
                                                                  DBUS_TYPE_INT32, &rtkit_min_nice_level)) {
         rtkit_min_nice_level = -20;
         rtkit_min_nice_level = -20;
     }
     }
 
 
-    /* Try getting maximum realtime priority: this can be less than the POSIX default (99). */
+    // Try getting maximum realtime priority: this can be less than the POSIX default (99).
     if (!dbus_conn || !SDL_DBus_QueryPropertyOnConnection(dbus_conn, rtkit_dbus_node, rtkit_dbus_path, rtkit_dbus_interface, "MaxRealtimePriority",
     if (!dbus_conn || !SDL_DBus_QueryPropertyOnConnection(dbus_conn, rtkit_dbus_node, rtkit_dbus_path, rtkit_dbus_interface, "MaxRealtimePriority",
                                                                  DBUS_TYPE_INT32, &rtkit_max_realtime_priority)) {
                                                                  DBUS_TYPE_INT32, &rtkit_max_realtime_priority)) {
         rtkit_max_realtime_priority = 99;
         rtkit_max_realtime_priority = 99;
     }
     }
 
 
-    /* Try getting maximum rttime allowed by rtkit: exceeding this value will result in SIGKILL */
+    // Try getting maximum rttime allowed by rtkit: exceeding this value will result in SIGKILL
     if (!dbus_conn || !SDL_DBus_QueryPropertyOnConnection(dbus_conn, rtkit_dbus_node, rtkit_dbus_path, rtkit_dbus_interface, "RTTimeUSecMax",
     if (!dbus_conn || !SDL_DBus_QueryPropertyOnConnection(dbus_conn, rtkit_dbus_node, rtkit_dbus_path, rtkit_dbus_interface, "RTTimeUSecMax",
                                                                  DBUS_TYPE_INT64, &rtkit_max_rttime_usec)) {
                                                                  DBUS_TYPE_INT64, &rtkit_max_rttime_usec)) {
         rtkit_max_rttime_usec = 200000;
         rtkit_max_rttime_usec = 200000;
@@ -245,10 +245,10 @@ static SDL_bool rtkit_setpriority_realtime(pid_t thread, int rt_priority)
 
 
 #define rtkit_max_realtime_priority 99
 #define rtkit_max_realtime_priority 99
 
 
-#endif /* dbus */
-#endif /* threads */
+#endif // dbus
+#endif // threads
 
 
-/* this is a public symbol, so it has to exist even if threads are disabled. */
+// this is a public symbol, so it has to exist even if threads are disabled.
 int SDL_SetLinuxThreadPriority(Sint64 threadID, int priority)
 int SDL_SetLinuxThreadPriority(Sint64 threadID, int priority)
 {
 {
 #ifdef SDL_THREADS_DISABLED
 #ifdef SDL_THREADS_DISABLED
@@ -280,7 +280,7 @@ int SDL_SetLinuxThreadPriority(Sint64 threadID, int priority)
 #endif
 #endif
 }
 }
 
 
-/* this is a public symbol, so it has to exist even if threads are disabled. */
+// this is a public symbol, so it has to exist even if threads are disabled.
 int SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy)
 int SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy)
 {
 {
 #ifdef SDL_THREADS_DISABLED
 #ifdef SDL_THREADS_DISABLED
@@ -342,4 +342,4 @@ int SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int sc
 #endif
 #endif
 }
 }
 
 
-#endif /* SDL_PLATFORM_LINUX */
+#endif // SDL_PLATFORM_LINUX

+ 12 - 12
src/core/linux/SDL_udev.c

@@ -52,7 +52,7 @@ static SDL_bool SDL_UDEV_load_sym(const char *fn, void **addr)
 {
 {
     *addr = SDL_LoadFunction(_this->udev_handle, fn);
     *addr = SDL_LoadFunction(_this->udev_handle, fn);
     if (!*addr) {
     if (!*addr) {
-        /* Don't call SDL_SetError(): SDL_LoadFunction already did. */
+        // Don't call SDL_SetError(): SDL_LoadFunction already did.
         return SDL_FALSE;
         return SDL_FALSE;
     }
     }
 
 
@@ -146,7 +146,7 @@ int SDL_UDEV_Init(void)
         _this->syms.udev_monitor_filter_add_match_subsystem_devtype(_this->udev_mon, "video4linux", NULL);
         _this->syms.udev_monitor_filter_add_match_subsystem_devtype(_this->udev_mon, "video4linux", NULL);
         _this->syms.udev_monitor_enable_receiving(_this->udev_mon);
         _this->syms.udev_monitor_enable_receiving(_this->udev_mon);
 
 
-        /* Do an initial scan of existing devices */
+        // Do an initial scan of existing devices
         SDL_UDEV_Scan();
         SDL_UDEV_Scan();
     }
     }
 
 
@@ -174,7 +174,7 @@ void SDL_UDEV_Quit(void)
             _this->udev = NULL;
             _this->udev = NULL;
         }
         }
 
 
-        /* Remove existing devices */
+        // Remove existing devices
         while (_this->first) {
         while (_this->first) {
             SDL_UDEV_CallbackList *item = _this->first;
             SDL_UDEV_CallbackList *item = _this->first;
             _this->first = _this->first->next;
             _this->first = _this->first->next;
@@ -299,13 +299,13 @@ int SDL_UDEV_LoadLibrary(void)
         return SDL_SetError("UDEV not initialized");
         return SDL_SetError("UDEV not initialized");
     }
     }
 
 
-    /* See if there is a udev library already loaded */
+    // See if there is a udev library already loaded
     if (SDL_UDEV_load_syms() == 0) {
     if (SDL_UDEV_load_syms() == 0) {
         return 0;
         return 0;
     }
     }
 
 
 #ifdef SDL_UDEV_DYNAMIC
 #ifdef SDL_UDEV_DYNAMIC
-    /* Check for the build environment's libudev first */
+    // Check for the build environment's libudev first
     if (!_this->udev_handle) {
     if (!_this->udev_handle) {
         _this->udev_handle = SDL_LoadObject(SDL_UDEV_DYNAMIC);
         _this->udev_handle = SDL_LoadObject(SDL_UDEV_DYNAMIC);
         if (_this->udev_handle) {
         if (_this->udev_handle) {
@@ -332,7 +332,7 @@ int SDL_UDEV_LoadLibrary(void)
 
 
         if (!_this->udev_handle) {
         if (!_this->udev_handle) {
             retval = -1;
             retval = -1;
-            /* Don't call SDL_SetError(): SDL_LoadObject already did. */
+            // Don't call SDL_SetError(): SDL_LoadObject already did.
         }
         }
     }
     }
 
 
@@ -420,7 +420,7 @@ static int device_class(struct udev_device *dev)
             devclass = SDL_UDEV_DEVICE_VIDEO_CAPTURE;
             devclass = SDL_UDEV_DEVICE_VIDEO_CAPTURE;
         }
         }
     } else if (SDL_strcmp(subsystem, "input") == 0) {
     } else if (SDL_strcmp(subsystem, "input") == 0) {
-        /* udev rules reference: http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-input_id.c */
+        // udev rules reference: http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-input_id.c
 
 
         val = _this->syms.udev_device_get_property_value(dev, "ID_INPUT_JOYSTICK");
         val = _this->syms.udev_device_get_property_value(dev, "ID_INPUT_JOYSTICK");
         if (val && SDL_strcmp(val, "1") == 0) {
         if (val && SDL_strcmp(val, "1") == 0) {
@@ -459,7 +459,7 @@ static int device_class(struct udev_device *dev)
         }
         }
 
 
         if (devclass == 0) {
         if (devclass == 0) {
-            /* Fall back to old style input classes */
+            // Fall back to old style input classes
             val = _this->syms.udev_device_get_property_value(dev, "ID_CLASS");
             val = _this->syms.udev_device_get_property_value(dev, "ID_CLASS");
             if (val) {
             if (val) {
                 if (SDL_strcmp(val, "joystick") == 0) {
                 if (SDL_strcmp(val, "joystick") == 0) {
@@ -470,7 +470,7 @@ static int device_class(struct udev_device *dev)
                     devclass = SDL_UDEV_DEVICE_HAS_KEYS | SDL_UDEV_DEVICE_KEYBOARD;
                     devclass = SDL_UDEV_DEVICE_HAS_KEYS | SDL_UDEV_DEVICE_KEYBOARD;
                 }
                 }
             } else {
             } else {
-                /* We could be linked with libudev on a system that doesn't have udev running */
+                // We could be linked with libudev on a system that doesn't have udev running
                 devclass = guess_device_class(dev);
                 devclass = guess_device_class(dev);
             }
             }
         }
         }
@@ -495,7 +495,7 @@ static void device_event(SDL_UDEV_deviceevent type, struct udev_device *dev)
          return;
          return;
     }
     }
 
 
-    /* Process callbacks */
+    // Process callbacks
     for (item = _this->first; item; item = item->next) {
     for (item = _this->first; item; item = item->next) {
         item->callback(type, devclass, path);
         item->callback(type, devclass, path);
     }
     }
@@ -559,7 +559,7 @@ void SDL_UDEV_DelCallback(SDL_UDEV_Callback cb)
     }
     }
 
 
     for (item = _this->first; item; item = item->next) {
     for (item = _this->first; item; item = item->next) {
-        /* found it, remove it. */
+        // found it, remove it.
         if (item->callback == cb) {
         if (item->callback == cb) {
             if (prev) {
             if (prev) {
                 prev->next = item->next;
                 prev->next = item->next;
@@ -592,4 +592,4 @@ void SDL_UDEV_ReleaseUdevSyms(void)
     SDL_UDEV_Quit();
     SDL_UDEV_Quit();
 }
 }
 
 
-#endif /* SDL_USE_LIBUDEV */
+#endif // SDL_USE_LIBUDEV

+ 3 - 3
src/core/linux/SDL_udev.h

@@ -92,7 +92,7 @@ typedef struct SDL_UDEV_PrivateData
     int ref_count;
     int ref_count;
     SDL_UDEV_CallbackList *first, *last;
     SDL_UDEV_CallbackList *first, *last;
 
 
-    /* Function pointers */
+    // Function pointers
     SDL_UDEV_Symbols syms;
     SDL_UDEV_Symbols syms;
 } SDL_UDEV_PrivateData;
 } SDL_UDEV_PrivateData;
 
 
@@ -108,6 +108,6 @@ extern void SDL_UDEV_DelCallback(SDL_UDEV_Callback cb);
 extern const SDL_UDEV_Symbols *SDL_UDEV_GetUdevSyms(void);
 extern const SDL_UDEV_Symbols *SDL_UDEV_GetUdevSyms(void);
 extern void SDL_UDEV_ReleaseUdevSyms(void);
 extern void SDL_UDEV_ReleaseUdevSyms(void);
 
 
-#endif /* HAVE_LIBUDEV_H && HAVE_LINUX_INPUT_H */
+#endif // HAVE_LIBUDEV_H && HAVE_LINUX_INPUT_H
 
 
-#endif /* SDL_udev_h_ */
+#endif // SDL_udev_h_

+ 39 - 39
src/core/openbsd/SDL_wscons_kbd.c

@@ -53,44 +53,44 @@ extern SDL_WSCONS_mouse_input_data *SDL_WSCONS_Init_Mouse();
 extern void updateMouse(SDL_WSCONS_mouse_input_data *input);
 extern void updateMouse(SDL_WSCONS_mouse_input_data *input);
 extern void SDL_WSCONS_Quit_Mouse(SDL_WSCONS_mouse_input_data *input);
 extern void SDL_WSCONS_Quit_Mouse(SDL_WSCONS_mouse_input_data *input);
 
 
-/* Conversion table courtesy of /usr/src/sys/dev/wscons/wskbdutil.c */
+// Conversion table courtesy of /usr/src/sys/dev/wscons/wskbdutil.c
 static const unsigned char latin1_to_upper[256] = {
 static const unsigned char latin1_to_upper[256] = {
-    /*      0  8  1  9  2  a  3  b  4  c  5  d  6  e  7  f               */
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0 */
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0 */
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 1 */
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 1 */
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 2 */
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 2 */
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 3 */
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 3 */
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 4 */
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 4 */
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 5 */
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 5 */
-    0x00, 'A', 'B', 'C', 'D', 'E', 'F', 'G',        /* 6 */
-    'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',         /* 6 */
-    'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',         /* 7 */
-    'X', 'Y', 'Z', 0x00, 0x00, 0x00, 0x00, 0x00,    /* 7 */
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 8 */
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 8 */
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 9 */
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 9 */
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* a */
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* a */
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* b */
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* b */
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* c */
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* c */
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* d */
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* d */
-    0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* e */
-    0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* e */
-    0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0x00, /* f */
-    0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0x00, /* f */
+    // 0  8  1  9  2  a  3  b  4  c  5  d  6  e  7  f
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 1
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 1
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 2
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 2
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 3
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 3
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 4
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 4
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 5
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 5
+    0x00, 'A', 'B', 'C', 'D', 'E', 'F', 'G',        // 6
+    'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',         // 6
+    'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',         // 7
+    'X', 'Y', 'Z', 0x00, 0x00, 0x00, 0x00, 0x00,    // 7
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 8
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 8
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 9
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 9
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // a
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // a
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // b
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // b
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // c
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // c
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // d
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // d
+    0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, // e
+    0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, // e
+    0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0x00, // f
+    0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0x00, // f
 };
 };
 
 
-/* Compose table courtesy of /usr/src/sys/dev/wscons/wskbdutil.c */
+// Compose table courtesy of /usr/src/sys/dev/wscons/wskbdutil.c
 static struct SDL_wscons_compose_tab_s
 static struct SDL_wscons_compose_tab_s
 {
 {
     keysym_t elem[2];
     keysym_t elem[2];
@@ -487,7 +487,7 @@ void SDL_WSCONS_Quit(void)
 
 
 static void put_queue(SDL_WSCONS_input_data *kbd, uint c)
 static void put_queue(SDL_WSCONS_input_data *kbd, uint c)
 {
 {
-    /* c is already part of a UTF-8 sequence and safe to add as a character */
+    // c is already part of a UTF-8 sequence and safe to add as a character
     if (kbd->text_len < (sizeof(kbd->text) - 1)) {
     if (kbd->text_len < (sizeof(kbd->text) - 1)) {
         kbd->text[kbd->text_len++] = (char)(c);
         kbd->text[kbd->text_len++] = (char)(c);
     }
     }
@@ -535,7 +535,7 @@ static void Translate_to_text(SDL_WSCONS_input_data *input, keysym_t ksym)
     case KS_BackSpace:
     case KS_BackSpace:
     case KS_Return:
     case KS_Return:
     case KS_Linefeed:
     case KS_Linefeed:
-        /* All of these are unprintable characters. Ignore them */
+        // All of these are unprintable characters. Ignore them
         break;
         break;
     default:
     default:
         put_utf8(input, ksym);
         put_utf8(input, ksym);
@@ -544,7 +544,7 @@ static void Translate_to_text(SDL_WSCONS_input_data *input, keysym_t ksym)
     if (input->text_len > 0) {
     if (input->text_len > 0) {
         input->text[input->text_len] = '\0';
         input->text[input->text_len] = '\0';
         SDL_SendKeyboardText(input->text);
         SDL_SendKeyboardText(input->text);
-        /*SDL_memset(input->text, 0, sizeof(input->text));*/
+        // SDL_memset(input->text, 0, sizeof(input->text));
         input->text_len = 0;
         input->text_len = 0;
         input->text[0] = 0;
         input->text[0] = 0;
     }
     }
@@ -556,7 +556,7 @@ static void Translate_to_keycode(SDL_WSCONS_input_data *input, int type, keysym_
     keysym_t *group = &keyDesc.group1[KS_GROUP(keyDesc.group1[0]) == KS_GROUP_Keypad && IS_NUMLOCK_ON ? !IS_SHIFT_HELD : 0];
     keysym_t *group = &keyDesc.group1[KS_GROUP(keyDesc.group1[0]) == KS_GROUP_Keypad && IS_NUMLOCK_ON ? !IS_SHIFT_HELD : 0];
     int i = 0;
     int i = 0;
 
 
-    /* Check command first, then group[0]*/
+    // Check command first, then group[0]
     switch (keyDesc.command) {
     switch (keyDesc.command) {
     case KS_Cmd_ScrollBack:
     case KS_Cmd_ScrollBack:
     {
     {

+ 6 - 6
src/core/openbsd/SDL_wscons_mouse.c

@@ -78,13 +78,13 @@ void updateMouse(SDL_WSCONS_mouse_input_data *input)
             case WSCONS_EVENT_MOUSE_DOWN:
             case WSCONS_EVENT_MOUSE_DOWN:
             {
             {
                 switch (events[i].value) {
                 switch (events[i].value) {
-                case 0: /* Left Mouse Button. */
+                case 0: // Left Mouse Button.
                     SDL_SendMouseButton(0, mouse->focus, input->mouseID, SDL_PRESSED, SDL_BUTTON_LEFT);
                     SDL_SendMouseButton(0, mouse->focus, input->mouseID, SDL_PRESSED, SDL_BUTTON_LEFT);
                     break;
                     break;
-                case 1: /* Middle Mouse Button. */
+                case 1: // Middle Mouse Button.
                     SDL_SendMouseButton(0, mouse->focus, input->mouseID, SDL_PRESSED, SDL_BUTTON_MIDDLE);
                     SDL_SendMouseButton(0, mouse->focus, input->mouseID, SDL_PRESSED, SDL_BUTTON_MIDDLE);
                     break;
                     break;
-                case 2: /* Right Mouse Button. */
+                case 2: // Right Mouse Button.
                     SDL_SendMouseButton(0, mouse->focus, input->mouseID, SDL_PRESSED, SDL_BUTTON_RIGHT);
                     SDL_SendMouseButton(0, mouse->focus, input->mouseID, SDL_PRESSED, SDL_BUTTON_RIGHT);
                     break;
                     break;
                 }
                 }
@@ -92,13 +92,13 @@ void updateMouse(SDL_WSCONS_mouse_input_data *input)
             case WSCONS_EVENT_MOUSE_UP:
             case WSCONS_EVENT_MOUSE_UP:
             {
             {
                 switch (events[i].value) {
                 switch (events[i].value) {
-                case 0: /* Left Mouse Button. */
+                case 0: // Left Mouse Button.
                     SDL_SendMouseButton(0, mouse->focus, input->mouseID, SDL_RELEASED, SDL_BUTTON_LEFT);
                     SDL_SendMouseButton(0, mouse->focus, input->mouseID, SDL_RELEASED, SDL_BUTTON_LEFT);
                     break;
                     break;
-                case 1: /* Middle Mouse Button. */
+                case 1: // Middle Mouse Button.
                     SDL_SendMouseButton(0, mouse->focus, input->mouseID, SDL_RELEASED, SDL_BUTTON_MIDDLE);
                     SDL_SendMouseButton(0, mouse->focus, input->mouseID, SDL_RELEASED, SDL_BUTTON_MIDDLE);
                     break;
                     break;
-                case 2: /* Right Mouse Button. */
+                case 2: // Right Mouse Button.
                     SDL_SendMouseButton(0, mouse->focus, input->mouseID, SDL_RELEASED, SDL_BUTTON_RIGHT);
                     SDL_SendMouseButton(0, mouse->focus, input->mouseID, SDL_RELEASED, SDL_BUTTON_RIGHT);
                     break;
                     break;
                 }
                 }

+ 3 - 3
src/core/unix/SDL_appid.c

@@ -28,7 +28,7 @@ const char *SDL_GetExeName(void)
 {
 {
     static const char *proc_name = NULL;
     static const char *proc_name = NULL;
 
 
-    /* TODO: Use a fallback if BSD has no mounted procfs (OpenBSD has no procfs at all) */
+    // TODO: Use a fallback if BSD has no mounted procfs (OpenBSD has no procfs at all)
     if (!proc_name) {
     if (!proc_name) {
 #if defined(SDL_PLATFORM_LINUX) || defined(SDL_PLATFORM_FREEBSD) || defined (SDL_PLATFORM_NETBSD)
 #if defined(SDL_PLATFORM_LINUX) || defined(SDL_PLATFORM_FREEBSD) || defined (SDL_PLATFORM_NETBSD)
         static char linkfile[1024];
         static char linkfile[1024];
@@ -62,12 +62,12 @@ const char *SDL_GetAppID(void)
     const char *id_str = SDL_GetAppMetadataProperty(SDL_PROP_APP_METADATA_IDENTIFIER_STRING);
     const char *id_str = SDL_GetAppMetadataProperty(SDL_PROP_APP_METADATA_IDENTIFIER_STRING);
 
 
     if (!id_str) {
     if (!id_str) {
-        /* If the hint isn't set, try to use the application's executable name */
+        // If the hint isn't set, try to use the application's executable name
         id_str = SDL_GetExeName();
         id_str = SDL_GetExeName();
     }
     }
 
 
     if (!id_str) {
     if (!id_str) {
-        /* Finally, use the default we've used forever */
+        // Finally, use the default we've used forever
         id_str = "SDL_App";
         id_str = "SDL_App";
     }
     }
 
 

+ 1 - 1
src/core/unix/SDL_appid.h

@@ -27,4 +27,4 @@ freely, subject to the following restrictions:
 extern const char *SDL_GetExeName();
 extern const char *SDL_GetExeName();
 extern const char *SDL_GetAppID();
 extern const char *SDL_GetAppID();
 
 
-#endif /* SDL_appid_h_ */
+#endif // SDL_appid_h_

+ 4 - 4
src/core/unix/SDL_poll.c

@@ -38,7 +38,7 @@ int SDL_IOReady(int fd, int flags, Sint64 timeoutNS)
 
 
     SDL_assert(flags & (SDL_IOR_READ | SDL_IOR_WRITE));
     SDL_assert(flags & (SDL_IOR_READ | SDL_IOR_WRITE));
 
 
-    /* Note: We don't bother to account for elapsed time if we get EINTR */
+    // Note: We don't bother to account for elapsed time if we get EINTR
     do {
     do {
 #ifdef HAVE_POLL
 #ifdef HAVE_POLL
         struct pollfd info;
         struct pollfd info;
@@ -52,7 +52,7 @@ int SDL_IOReady(int fd, int flags, Sint64 timeoutNS)
         if (flags & SDL_IOR_WRITE) {
         if (flags & SDL_IOR_WRITE) {
             info.events |= POLLOUT;
             info.events |= POLLOUT;
         }
         }
-        /* FIXME: Add support for ppoll() for nanosecond precision */
+        // FIXME: Add support for ppoll() for nanosecond precision
         if (timeoutNS > 0) {
         if (timeoutNS > 0) {
             timeoutMS = (int)SDL_NS_TO_MS(timeoutNS);
             timeoutMS = (int)SDL_NS_TO_MS(timeoutNS);
         } else if (timeoutNS == 0) {
         } else if (timeoutNS == 0) {
@@ -66,7 +66,7 @@ int SDL_IOReady(int fd, int flags, Sint64 timeoutNS)
         fd_set wfdset, *wfdp = NULL;
         fd_set wfdset, *wfdp = NULL;
         struct timeval tv, *tvp = NULL;
         struct timeval tv, *tvp = NULL;
 
 
-        /* If this assert triggers we'll corrupt memory here */
+        // If this assert triggers we'll corrupt memory here
         SDL_assert(fd >= 0 && fd < FD_SETSIZE);
         SDL_assert(fd >= 0 && fd < FD_SETSIZE);
 
 
         if (flags & SDL_IOR_READ) {
         if (flags & SDL_IOR_READ) {
@@ -87,7 +87,7 @@ int SDL_IOReady(int fd, int flags, Sint64 timeoutNS)
         }
         }
 
 
         result = select(fd + 1, rfdp, wfdp, NULL, tvp);
         result = select(fd + 1, rfdp, wfdp, NULL, tvp);
-#endif /* HAVE_POLL */
+#endif // HAVE_POLL
 
 
     } while (result < 0 && errno == EINTR && !(flags & SDL_IOR_NO_RETRY));
     } while (result < 0 && errno == EINTR && !(flags & SDL_IOR_NO_RETRY));
 
 

+ 1 - 1
src/core/unix/SDL_poll.h

@@ -30,4 +30,4 @@
 
 
 extern int SDL_IOReady(int fd, int flags, Sint64 timeoutNS);
 extern int SDL_IOReady(int fd, int flags, Sint64 timeoutNS);
 
 
-#endif /* SDL_poll_h_ */
+#endif // SDL_poll_h_

+ 8 - 8
src/core/windows/SDL_directx.h

@@ -23,7 +23,7 @@
 #ifndef SDL_directx_h_
 #ifndef SDL_directx_h_
 #define SDL_directx_h_
 #define SDL_directx_h_
 
 
-/* Include all of the DirectX 8.0 headers and adds any necessary tweaks */
+// Include all of the DirectX 8.0 headers and adds any necessary tweaks
 
 
 #include "SDL_windows.h"
 #include "SDL_windows.h"
 #include <mmsystem.h>
 #include <mmsystem.h>
@@ -32,12 +32,12 @@
 #endif
 #endif
 #undef WINNT
 #undef WINNT
 
 
-/* Far pointers don't exist in 32-bit code */
+// Far pointers don't exist in 32-bit code
 #ifndef FAR
 #ifndef FAR
 #define FAR
 #define FAR
 #endif
 #endif
 
 
-/* Error codes not yet included in Win32 API header files */
+// Error codes not yet included in Win32 API header files
 #ifndef MAKE_HRESULT
 #ifndef MAKE_HRESULT
 #define MAKE_HRESULT(sev, fac, code) \
 #define MAKE_HRESULT(sev, fac, code) \
     ((HRESULT)(((unsigned long)(sev) << 31) | ((unsigned long)(fac) << 16) | ((unsigned long)(code))))
     ((HRESULT)(((unsigned long)(sev) << 31) | ((unsigned long)(fac) << 16) | ((unsigned long)(code))))
@@ -73,12 +73,12 @@
 #define REGDB_E_CLASSNOTREG (HRESULT)0x80040154L
 #define REGDB_E_CLASSNOTREG (HRESULT)0x80040154L
 #endif
 #endif
 
 
-/* Severity codes */
+// Severity codes
 #ifndef SEVERITY_ERROR
 #ifndef SEVERITY_ERROR
 #define SEVERITY_ERROR 1
 #define SEVERITY_ERROR 1
 #endif
 #endif
 
 
-/* Error facility codes */
+// Error facility codes
 #ifndef FACILITY_WIN32
 #ifndef FACILITY_WIN32
 #define FACILITY_WIN32 7
 #define FACILITY_WIN32 7
 #endif
 #endif
@@ -89,10 +89,10 @@
 
 
 /* DirectX headers (if it isn't included, I haven't tested it yet)
 /* DirectX headers (if it isn't included, I haven't tested it yet)
  */
  */
-/* We need these defines to mark what version of DirectX API we use */
+// We need these defines to mark what version of DirectX API we use
 #define DIRECTDRAW_VERSION  0x0700
 #define DIRECTDRAW_VERSION  0x0700
 #define DIRECTSOUND_VERSION 0x0800
 #define DIRECTSOUND_VERSION 0x0800
-#define DIRECTINPUT_VERSION 0x0800 /* Need version 7 for force feedback. Need version 8 so IDirectInput8_EnumDevices doesn't leak like a sieve... */
+#define DIRECTINPUT_VERSION 0x0800 // Need version 7 for force feedback. Need version 8 so IDirectInput8_EnumDevices doesn't leak like a sieve...
 
 
 #ifdef HAVE_DDRAW_H
 #ifdef HAVE_DDRAW_H
 #include <ddraw.h>
 #include <ddraw.h>
@@ -109,4 +109,4 @@ typedef struct
 } DIDEVICEINSTANCE;
 } DIDEVICEINSTANCE;
 #endif
 #endif
 
 
-#endif /* SDL_directx_h_ */
+#endif // SDL_directx_h_

+ 4 - 4
src/core/windows/SDL_hid.c

@@ -41,7 +41,7 @@ int WIN_LoadHIDDLL(void)
     if (s_pHIDDLL) {
     if (s_pHIDDLL) {
         SDL_assert(s_HIDDLLRefCount > 0);
         SDL_assert(s_HIDDLLRefCount > 0);
         s_HIDDLLRefCount++;
         s_HIDDLLRefCount++;
-        return 0; /* already loaded */
+        return 0; // already loaded
     }
     }
 
 
     s_pHIDDLL = LoadLibrary(TEXT("hid.dll"));
     s_pHIDDLL = LoadLibrary(TEXT("hid.dll"));
@@ -82,11 +82,11 @@ void WIN_UnloadHIDDLL(void)
     }
     }
 }
 }
 
 
-#endif /* !SDL_PLATFORM_WINRT */
+#endif // !SDL_PLATFORM_WINRT
 
 
 #if !defined(SDL_PLATFORM_WINRT) && !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)
 #if !defined(SDL_PLATFORM_WINRT) && !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)
 
 
-/* CM_Register_Notification definitions */
+// CM_Register_Notification definitions
 
 
 #define CR_SUCCESS 0
 #define CR_SUCCESS 0
 
 
@@ -224,7 +224,7 @@ void WIN_QuitDeviceNotification(void)
     if (--s_DeviceNotificationsRequested > 0) {
     if (--s_DeviceNotificationsRequested > 0) {
         return;
         return;
     }
     }
-    /* Make sure we have balanced calls to init/quit */
+    // Make sure we have balanced calls to init/quit
     SDL_assert(s_DeviceNotificationsRequested == 0);
     SDL_assert(s_DeviceNotificationsRequested == 0);
 
 
     if (cfgmgr32_lib_handle) {
     if (cfgmgr32_lib_handle) {

+ 2 - 2
src/core/windows/SDL_hid.h

@@ -208,11 +208,11 @@ extern HidP_GetValueCaps_t SDL_HidP_GetValueCaps;
 extern HidP_MaxDataListLength_t SDL_HidP_MaxDataListLength;
 extern HidP_MaxDataListLength_t SDL_HidP_MaxDataListLength;
 extern HidP_GetData_t SDL_HidP_GetData;
 extern HidP_GetData_t SDL_HidP_GetData;
 
 
-#endif /* !SDL_PLATFORM_WINRT */
+#endif // !SDL_PLATFORM_WINRT
 
 
 
 
 void WIN_InitDeviceNotification(void);
 void WIN_InitDeviceNotification(void);
 Uint64 WIN_GetLastDeviceNotification(void);
 Uint64 WIN_GetLastDeviceNotification(void);
 void WIN_QuitDeviceNotification(void);
 void WIN_QuitDeviceNotification(void);
 
 
-#endif /* SDL_hid_h_ */
+#endif // SDL_hid_h_

+ 14 - 14
src/core/windows/SDL_immdevice.c

@@ -25,7 +25,7 @@
 #include "SDL_windows.h"
 #include "SDL_windows.h"
 #include "SDL_immdevice.h"
 #include "SDL_immdevice.h"
 #include "../../audio/SDL_sysaudio.h"
 #include "../../audio/SDL_sysaudio.h"
-#include <objbase.h> /* For CLSIDFromString */
+#include <objbase.h> // For CLSIDFromString
 
 
 typedef struct SDL_IMMDevice_HandleData
 typedef struct SDL_IMMDevice_HandleData
 {
 {
@@ -33,20 +33,20 @@ typedef struct SDL_IMMDevice_HandleData
     GUID directsound_guid;
     GUID directsound_guid;
 } SDL_IMMDevice_HandleData;
 } SDL_IMMDevice_HandleData;
 
 
-static const ERole SDL_IMMDevice_role = eConsole; /* !!! FIXME: should this be eMultimedia? Should be a hint? */
+static const ERole SDL_IMMDevice_role = eConsole; // !!! FIXME: should this be eMultimedia? Should be a hint?
 
 
-/* This is global to the WASAPI target, to handle hotplug and default device lookup. */
+// This is global to the WASAPI target, to handle hotplug and default device lookup.
 static IMMDeviceEnumerator *enumerator = NULL;
 static IMMDeviceEnumerator *enumerator = NULL;
 static SDL_IMMDevice_callbacks immcallbacks;
 static SDL_IMMDevice_callbacks immcallbacks;
 
 
-/* PropVariantInit() is an inline function/macro in PropIdl.h that calls the C runtime's memset() directly. Use ours instead, to avoid dependency. */
+// PropVariantInit() is an inline function/macro in PropIdl.h that calls the C runtime's memset() directly. Use ours instead, to avoid dependency.
 #ifdef PropVariantInit
 #ifdef PropVariantInit
 #undef PropVariantInit
 #undef PropVariantInit
 #endif
 #endif
 #define PropVariantInit(p) SDL_zerop(p)
 #define PropVariantInit(p) SDL_zerop(p)
 
 
-/* Some GUIDs we need to know without linking to libraries that aren't available before Vista. */
-/* *INDENT-OFF* */ /* clang-format off */
+// Some GUIDs we need to know without linking to libraries that aren't available before Vista.
+/* *INDENT-OFF* */ // clang-format off
 static const CLSID SDL_CLSID_MMDeviceEnumerator = { 0xbcde0395, 0xe52f, 0x467c,{ 0x8e, 0x3d, 0xc4, 0x57, 0x92, 0x91, 0x69, 0x2e } };
 static const CLSID SDL_CLSID_MMDeviceEnumerator = { 0xbcde0395, 0xe52f, 0x467c,{ 0x8e, 0x3d, 0xc4, 0x57, 0x92, 0x91, 0x69, 0x2e } };
 static const IID SDL_IID_IMMDeviceEnumerator = { 0xa95664d2, 0x9614, 0x4f35,{ 0xa7, 0x46, 0xde, 0x8d, 0xb6, 0x36, 0x17, 0xe6 } };
 static const IID SDL_IID_IMMDeviceEnumerator = { 0xa95664d2, 0x9614, 0x4f35,{ 0xa7, 0x46, 0xde, 0x8d, 0xb6, 0x36, 0x17, 0xe6 } };
 static const IID SDL_IID_IMMNotificationClient = { 0x7991eec9, 0x7e89, 0x4d85,{ 0x83, 0x90, 0x6c, 0x70, 0x3c, 0xec, 0x60, 0xc0 } };
 static const IID SDL_IID_IMMNotificationClient = { 0x7991eec9, 0x7e89, 0x4d85,{ 0x83, 0x90, 0x6c, 0x70, 0x3c, 0xec, 0x60, 0xc0 } };
@@ -54,7 +54,7 @@ static const IID SDL_IID_IMMEndpoint = { 0x1be09788, 0x6894, 0x4089,{ 0x85, 0x86
 static const PROPERTYKEY SDL_PKEY_Device_FriendlyName = { { 0xa45c254e, 0xdf1c, 0x4efd,{ 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, } }, 14 };
 static const PROPERTYKEY SDL_PKEY_Device_FriendlyName = { { 0xa45c254e, 0xdf1c, 0x4efd,{ 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, } }, 14 };
 static const PROPERTYKEY SDL_PKEY_AudioEngine_DeviceFormat = { { 0xf19f064d, 0x82c, 0x4e27,{ 0xbc, 0x73, 0x68, 0x82, 0xa1, 0xbb, 0x8e, 0x4c, } }, 0 };
 static const PROPERTYKEY SDL_PKEY_AudioEngine_DeviceFormat = { { 0xf19f064d, 0x82c, 0x4e27,{ 0xbc, 0x73, 0x68, 0x82, 0xa1, 0xbb, 0x8e, 0x4c, } }, 0 };
 static const PROPERTYKEY SDL_PKEY_AudioEndpoint_GUID = { { 0x1da5d803, 0xd492, 0x4edd,{ 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, } }, 4 };
 static const PROPERTYKEY SDL_PKEY_AudioEndpoint_GUID = { { 0x1da5d803, 0xd492, 0x4edd,{ 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, } }, 4 };
-/* *INDENT-ON* */ /* clang-format on */
+/* *INDENT-ON* */ // clang-format on
 
 
 static SDL_bool FindByDevIDCallback(SDL_AudioDevice *device, void *userdata)
 static SDL_bool FindByDevIDCallback(SDL_AudioDevice *device, void *userdata)
 {
 {
@@ -205,11 +205,11 @@ static ULONG STDMETHODCALLTYPE SDLMMNotificationClient_AddRef(IMMNotificationCli
 
 
 static ULONG STDMETHODCALLTYPE SDLMMNotificationClient_Release(IMMNotificationClient *iclient)
 static ULONG STDMETHODCALLTYPE SDLMMNotificationClient_Release(IMMNotificationClient *iclient)
 {
 {
-    /* client is a static object; we don't ever free it. */
+    // client is a static object; we don't ever free it.
     SDLMMNotificationClient *client = (SDLMMNotificationClient *)iclient;
     SDLMMNotificationClient *client = (SDLMMNotificationClient *)iclient;
     const ULONG retval = SDL_AtomicDecRef(&client->refcount);
     const ULONG retval = SDL_AtomicDecRef(&client->refcount);
     if (retval == 0) {
     if (retval == 0) {
-        SDL_AtomicSet(&client->refcount, 0); /* uhh... */
+        SDL_AtomicSet(&client->refcount, 0); // uhh...
         return 0;
         return 0;
     }
     }
     return retval - 1;
     return retval - 1;
@@ -292,7 +292,7 @@ int SDL_IMMDevice_Init(const SDL_IMMDevice_callbacks *callbacks)
 {
 {
     HRESULT ret;
     HRESULT ret;
 
 
-    /* just skip the discussion with COM here. */
+    // just skip the discussion with COM here.
     if (!WIN_IsWindowsVistaOrGreater()) {
     if (!WIN_IsWindowsVistaOrGreater()) {
         return SDL_SetError("IMMDevice support requires Windows Vista or later");
         return SDL_SetError("IMMDevice support requires Windows Vista or later");
     }
     }
@@ -338,7 +338,7 @@ void SDL_IMMDevice_Quit(void)
 
 
 int SDL_IMMDevice_Get(SDL_AudioDevice *device, IMMDevice **immdevice, SDL_bool recording)
 int SDL_IMMDevice_Get(SDL_AudioDevice *device, IMMDevice **immdevice, SDL_bool recording)
 {
 {
-    const Uint64 timeout = SDL_GetTicks() + 8000;  /* intel's audio drivers can fail for up to EIGHT SECONDS after a device is connected or we wake from sleep. */
+    const Uint64 timeout = SDL_GetTicks() + 8000;  // intel's audio drivers can fail for up to EIGHT SECONDS after a device is connected or we wake from sleep.
 
 
     SDL_assert(device != NULL);
     SDL_assert(device != NULL);
     SDL_assert(immdevice != NULL);
     SDL_assert(immdevice != NULL);
@@ -351,7 +351,7 @@ int SDL_IMMDevice_Get(SDL_AudioDevice *device, IMMDevice **immdevice, SDL_bool r
         const Uint64 now = SDL_GetTicks();
         const Uint64 now = SDL_GetTicks();
         if (timeout > now) {
         if (timeout > now) {
             const Uint64 ticksleft = timeout - now;
             const Uint64 ticksleft = timeout - now;
-            SDL_Delay((Uint32)SDL_min(ticksleft, 300));   /* wait awhile and try again. */
+            SDL_Delay((Uint32)SDL_min(ticksleft, 300));   // wait awhile and try again.
             continue;
             continue;
         }
         }
         break;
         break;
@@ -425,8 +425,8 @@ void SDL_IMMDevice_EnumerateEndpoints(SDL_AudioDevice **default_playback, SDL_Au
     EnumerateEndpointsForFlow(SDL_FALSE, default_playback);
     EnumerateEndpointsForFlow(SDL_FALSE, default_playback);
     EnumerateEndpointsForFlow(SDL_TRUE, default_recording);
     EnumerateEndpointsForFlow(SDL_TRUE, default_recording);
 
 
-    /* if this fails, we just won't get hotplug events. Carry on anyhow. */
+    // if this fails, we just won't get hotplug events. Carry on anyhow.
     IMMDeviceEnumerator_RegisterEndpointNotificationCallback(enumerator, (IMMNotificationClient *)&notification_client);
     IMMDeviceEnumerator_RegisterEndpointNotificationCallback(enumerator, (IMMNotificationClient *)&notification_client);
 }
 }
 
 
-#endif /* (defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)) && defined(HAVE_MMDEVICEAPI_H) */
+#endif // (defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)) && defined(HAVE_MMDEVICEAPI_H)

+ 1 - 1
src/core/windows/SDL_immdevice.h

@@ -42,4 +42,4 @@ LPGUID SDL_IMMDevice_GetDirectSoundGUID(SDL_AudioDevice *device);
 LPCWSTR SDL_IMMDevice_GetDevID(SDL_AudioDevice *device);
 LPCWSTR SDL_IMMDevice_GetDevID(SDL_AudioDevice *device);
 void SDL_IMMDevice_FreeDeviceHandle(SDL_AudioDevice *device);
 void SDL_IMMDevice_FreeDeviceHandle(SDL_AudioDevice *device);
 
 
-#endif /* SDL_IMMDEVICE_H */
+#endif // SDL_IMMDEVICE_H

+ 24 - 24
src/core/windows/SDL_windows.c

@@ -24,9 +24,9 @@
 
 
 #include "SDL_windows.h"
 #include "SDL_windows.h"
 
 
-#include <objbase.h> /* for CoInitialize/CoUninitialize (Win32 only) */
+#include <objbase.h> // for CoInitialize/CoUninitialize (Win32 only)
 #ifdef HAVE_ROAPI_H
 #ifdef HAVE_ROAPI_H
-#include <roapi.h> /* For RoInitialize/RoUninitialize (Win32 only) */
+#include <roapi.h> // For RoInitialize/RoUninitialize (Win32 only)
 #else
 #else
 typedef enum RO_INIT_TYPE
 typedef enum RO_INIT_TYPE
 {
 {
@@ -53,7 +53,7 @@ typedef enum RO_INIT_TYPE
 #define WC_ERR_INVALID_CHARS 0x00000080
 #define WC_ERR_INVALID_CHARS 0x00000080
 #endif
 #endif
 
 
-/* Sets an error message based on an HRESULT */
+// Sets an error message based on an HRESULT
 int WIN_SetErrorFromHRESULT(const char *prefix, HRESULT hr)
 int WIN_SetErrorFromHRESULT(const char *prefix, HRESULT hr)
 {
 {
     TCHAR buffer[1024];
     TCHAR buffer[1024];
@@ -62,7 +62,7 @@ int WIN_SetErrorFromHRESULT(const char *prefix, HRESULT hr)
     DWORD c = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, hr, 0,
     DWORD c = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, hr, 0,
                             buffer, SDL_arraysize(buffer), NULL);
                             buffer, SDL_arraysize(buffer), NULL);
     buffer[c] = 0;
     buffer[c] = 0;
-    /* kill CR/LF that FormatMessage() sticks at the end */
+    // kill CR/LF that FormatMessage() sticks at the end
     while (*p) {
     while (*p) {
         if (*p == '\r') {
         if (*p == '\r') {
             *p = 0;
             *p = 0;
@@ -76,7 +76,7 @@ int WIN_SetErrorFromHRESULT(const char *prefix, HRESULT hr)
     return -1;
     return -1;
 }
 }
 
 
-/* Sets an error message based on GetLastError() */
+// Sets an error message based on GetLastError()
 int WIN_SetError(const char *prefix)
 int WIN_SetError(const char *prefix)
 {
 {
     return WIN_SetErrorFromHRESULT(prefix, GetLastError());
     return WIN_SetErrorFromHRESULT(prefix, GetLastError());
@@ -98,7 +98,7 @@ WIN_CoInitialize(void)
     */
     */
     return S_OK;
     return S_OK;
 #elif defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES)
 #elif defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES)
-    /* On Xbox, there's no need to call CoInitializeEx (and it's not implemented) */
+    // On Xbox, there's no need to call CoInitializeEx (and it's not implemented)
     return S_OK;
     return S_OK;
 #else
 #else
     HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
     HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
@@ -106,8 +106,8 @@ WIN_CoInitialize(void)
         hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
         hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
     }
     }
 
 
-    /* S_FALSE means success, but someone else already initialized. */
-    /* You still need to call CoUninitialize in this case! */
+    // S_FALSE means success, but someone else already initialized.
+    // You still need to call CoUninitialize in this case!
     if (hr == S_FALSE) {
     if (hr == S_FALSE) {
         return S_OK;
         return S_OK;
     }
     }
@@ -150,14 +150,14 @@ WIN_RoInitialize(void)
     typedef HRESULT(WINAPI * RoInitialize_t)(RO_INIT_TYPE initType);
     typedef HRESULT(WINAPI * RoInitialize_t)(RO_INIT_TYPE initType);
     RoInitialize_t RoInitializeFunc = (RoInitialize_t)WIN_LoadComBaseFunction("RoInitialize");
     RoInitialize_t RoInitializeFunc = (RoInitialize_t)WIN_LoadComBaseFunction("RoInitialize");
     if (RoInitializeFunc) {
     if (RoInitializeFunc) {
-        /* RO_INIT_SINGLETHREADED is equivalent to COINIT_APARTMENTTHREADED */
+        // RO_INIT_SINGLETHREADED is equivalent to COINIT_APARTMENTTHREADED
         HRESULT hr = RoInitializeFunc(RO_INIT_SINGLETHREADED);
         HRESULT hr = RoInitializeFunc(RO_INIT_SINGLETHREADED);
         if (hr == RPC_E_CHANGED_MODE) {
         if (hr == RPC_E_CHANGED_MODE) {
             hr = RoInitializeFunc(RO_INIT_MULTITHREADED);
             hr = RoInitializeFunc(RO_INIT_MULTITHREADED);
         }
         }
 
 
-        /* S_FALSE means success, but someone else already initialized. */
-        /* You still need to call RoUninitialize in this case! */
+        // S_FALSE means success, but someone else already initialized.
+        // You still need to call RoUninitialize in this case!
         if (hr == S_FALSE) {
         if (hr == S_FALSE) {
             return S_OK;
             return S_OK;
         }
         }
@@ -266,7 +266,7 @@ WASAPI doesn't need this. This is just for DirectSound/WinMM.
 char *WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid)
 char *WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid)
 {
 {
 #if defined(SDL_PLATFORM_WINRT) || defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES)
 #if defined(SDL_PLATFORM_WINRT) || defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES)
-    return WIN_StringToUTF8W(name); /* No registry access on WinRT/UWP and Xbox, go with what we've got. */
+    return WIN_StringToUTF8W(name); // No registry access on WinRT/UWP and Xbox, go with what we've got.
 #else
 #else
     static const GUID nullguid = { 0 };
     static const GUID nullguid = { 0 };
     const unsigned char *ptr;
     const unsigned char *ptr;
@@ -278,7 +278,7 @@ char *WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid)
     char *retval = NULL;
     char *retval = NULL;
 
 
     if (WIN_IsEqualGUID(guid, &nullguid)) {
     if (WIN_IsEqualGUID(guid, &nullguid)) {
-        return WIN_StringToUTF8(name); /* No GUID, go with what we've got. */
+        return WIN_StringToUTF8(name); // No GUID, go with what we've got.
     }
     }
 
 
     ptr = (const unsigned char *)guid;
     ptr = (const unsigned char *)guid;
@@ -291,34 +291,34 @@ char *WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid)
     rc = (RegOpenKeyExW(HKEY_LOCAL_MACHINE, strw, 0, KEY_QUERY_VALUE, &hkey) == ERROR_SUCCESS);
     rc = (RegOpenKeyExW(HKEY_LOCAL_MACHINE, strw, 0, KEY_QUERY_VALUE, &hkey) == ERROR_SUCCESS);
     SDL_free(strw);
     SDL_free(strw);
     if (!rc) {
     if (!rc) {
-        return WIN_StringToUTF8(name); /* oh well. */
+        return WIN_StringToUTF8(name); // oh well.
     }
     }
 
 
     rc = (RegQueryValueExW(hkey, L"Name", NULL, NULL, NULL, &len) == ERROR_SUCCESS);
     rc = (RegQueryValueExW(hkey, L"Name", NULL, NULL, NULL, &len) == ERROR_SUCCESS);
     if (!rc) {
     if (!rc) {
         RegCloseKey(hkey);
         RegCloseKey(hkey);
-        return WIN_StringToUTF8(name); /* oh well. */
+        return WIN_StringToUTF8(name); // oh well.
     }
     }
 
 
     strw = (WCHAR *)SDL_malloc(len + sizeof(WCHAR));
     strw = (WCHAR *)SDL_malloc(len + sizeof(WCHAR));
     if (!strw) {
     if (!strw) {
         RegCloseKey(hkey);
         RegCloseKey(hkey);
-        return WIN_StringToUTF8(name); /* oh well. */
+        return WIN_StringToUTF8(name); // oh well.
     }
     }
 
 
     rc = (RegQueryValueExW(hkey, L"Name", NULL, NULL, (LPBYTE)strw, &len) == ERROR_SUCCESS);
     rc = (RegQueryValueExW(hkey, L"Name", NULL, NULL, (LPBYTE)strw, &len) == ERROR_SUCCESS);
     RegCloseKey(hkey);
     RegCloseKey(hkey);
     if (!rc) {
     if (!rc) {
         SDL_free(strw);
         SDL_free(strw);
-        return WIN_StringToUTF8(name); /* oh well. */
+        return WIN_StringToUTF8(name); // oh well.
     }
     }
 
 
-    strw[len / 2] = 0; /* make sure it's null-terminated. */
+    strw[len / 2] = 0; // make sure it's null-terminated.
 
 
     retval = WIN_StringToUTF8(strw);
     retval = WIN_StringToUTF8(strw);
     SDL_free(strw);
     SDL_free(strw);
     return retval ? retval : WIN_StringToUTF8(name);
     return retval ? retval : WIN_StringToUTF8(name);
-#endif /* if SDL_PLATFORM_WINRT / else */
+#endif // if SDL_PLATFORM_WINRT / else
 }
 }
 
 
 BOOL WIN_IsEqualGUID(const GUID *a, const GUID *b)
 BOOL WIN_IsEqualGUID(const GUID *a, const GUID *b)
@@ -349,15 +349,15 @@ void WIN_RectToRECT(const SDL_Rect *sdlrect, RECT *winrect)
 
 
 BOOL WIN_IsRectEmpty(const RECT *rect)
 BOOL WIN_IsRectEmpty(const RECT *rect)
 {
 {
-    /* Calculating this manually because UWP and Xbox do not support Win32 IsRectEmpty. */
+    // Calculating this manually because UWP and Xbox do not support Win32 IsRectEmpty.
     return (rect->right <= rect->left) || (rect->bottom <= rect->top);
     return (rect->right <= rect->left) || (rect->bottom <= rect->top);
 }
 }
 
 
-/* Some GUIDs we need to know without linking to libraries that aren't available before Vista. */
-/* *INDENT-OFF* */ /* clang-format off */
+// Some GUIDs we need to know without linking to libraries that aren't available before Vista.
+/* *INDENT-OFF* */ // clang-format off
 static const GUID SDL_KSDATAFORMAT_SUBTYPE_PCM = { 0x00000001, 0x0000, 0x0010,{ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } };
 static const GUID SDL_KSDATAFORMAT_SUBTYPE_PCM = { 0x00000001, 0x0000, 0x0010,{ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } };
 static const GUID SDL_KSDATAFORMAT_SUBTYPE_IEEE_FLOAT = { 0x00000003, 0x0000, 0x0010,{ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } };
 static const GUID SDL_KSDATAFORMAT_SUBTYPE_IEEE_FLOAT = { 0x00000003, 0x0000, 0x0010,{ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } };
-/* *INDENT-ON* */ /* clang-format on */
+/* *INDENT-ON* */ // clang-format on
 
 
 SDL_AudioFormat SDL_WaveFormatExToSDLFormat(WAVEFORMATEX *waveformat)
 SDL_AudioFormat SDL_WaveFormatExToSDLFormat(WAVEFORMATEX *waveformat)
 {
 {
@@ -389,4 +389,4 @@ int WIN_WideCharToMultiByte(UINT CodePage, DWORD dwFlags, LPCWCH lpWideCharStr,
     return WideCharToMultiByte(CodePage, dwFlags, lpWideCharStr, cchWideChar, lpMultiByteStr, cbMultiByte, lpDefaultChar, lpUsedDefaultChar);
     return WideCharToMultiByte(CodePage, dwFlags, lpWideCharStr, cchWideChar, lpMultiByteStr, cbMultiByte, lpDefaultChar, lpUsedDefaultChar);
 }
 }
 
 
-#endif /* defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINRT) || defined(SDL_PLATFORM_GDK) */
+#endif // defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINRT) || defined(SDL_PLATFORM_GDK)

+ 26 - 26
src/core/windows/SDL_windows.h

@@ -19,7 +19,7 @@
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
-/* This is an include file for windows.h with the SDL build settings */
+// This is an include file for windows.h with the SDL build settings
 
 
 #ifndef _INCLUDED_WINDOWS_H
 #ifndef _INCLUDED_WINDOWS_H
 #define _INCLUDED_WINDOWS_H
 #define _INCLUDED_WINDOWS_H
@@ -37,11 +37,11 @@
 #undef WINVER
 #undef WINVER
 #undef _WIN32_WINNT
 #undef _WIN32_WINNT
 #if SDL_VIDEO_RENDER_D3D12 || defined(HAVE_DXGI1_6_H)
 #if SDL_VIDEO_RENDER_D3D12 || defined(HAVE_DXGI1_6_H)
-#define _WIN32_WINNT 0xA00 /* For D3D12, 0xA00 is required */
+#define _WIN32_WINNT 0xA00 // For D3D12, 0xA00 is required
 #elif defined(HAVE_SHELLSCALINGAPI_H)
 #elif defined(HAVE_SHELLSCALINGAPI_H)
-#define _WIN32_WINNT 0x603 /* For DPI support */
+#define _WIN32_WINNT 0x603 // For DPI support
 #else
 #else
-#define _WIN32_WINNT 0x501 /* Need 0x410 for AlphaBlend() and 0x500 for EnumDisplayDevices(), 0x501 for raw input */
+#define _WIN32_WINNT 0x501 // Need 0x410 for AlphaBlend() and 0x500 for EnumDisplayDevices(), 0x501 for raw input
 #endif
 #endif
 #define WINVER _WIN32_WINNT
 #define WINVER _WIN32_WINNT
 
 
@@ -76,8 +76,8 @@
 #define WINVER       _WIN32_WINNT
 #define WINVER       _WIN32_WINNT
 #endif
 #endif
 
 
-/* See https://github.com/libsdl-org/SDL/pull/7607  */
-/* force_align_arg_pointer attribute requires gcc >= 4.2.x.  */
+// See https://github.com/libsdl-org/SDL/pull/7607
+// force_align_arg_pointer attribute requires gcc >= 4.2.x.
 #if defined(__clang__)
 #if defined(__clang__)
 #define HAVE_FORCE_ALIGN_ARG_POINTER
 #define HAVE_FORCE_ALIGN_ARG_POINTER
 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2))
 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2))
@@ -90,13 +90,13 @@
 #endif
 #endif
 
 
 #include <windows.h>
 #include <windows.h>
-#include <basetyps.h> /* for REFIID with broken mingw.org headers */
+#include <basetyps.h> // for REFIID with broken mingw.org headers
 #include <mmreg.h>
 #include <mmreg.h>
 
 
-/* Routines to convert from UTF8 to native Windows text */
+// Routines to convert from UTF8 to native Windows text
 #define WIN_StringToUTF8W(S) SDL_iconv_string("UTF-8", "UTF-16LE", (const char *)(S), (SDL_wcslen(S) + 1) * sizeof(WCHAR))
 #define WIN_StringToUTF8W(S) SDL_iconv_string("UTF-8", "UTF-16LE", (const char *)(S), (SDL_wcslen(S) + 1) * sizeof(WCHAR))
 #define WIN_UTF8ToStringW(S) (WCHAR *)SDL_iconv_string("UTF-16LE", "UTF-8", (const char *)(S), SDL_strlen(S) + 1)
 #define WIN_UTF8ToStringW(S) (WCHAR *)SDL_iconv_string("UTF-16LE", "UTF-8", (const char *)(S), SDL_strlen(S) + 1)
-/* !!! FIXME: UTF8ToString() can just be a SDL_strdup() here. */
+// !!! FIXME: UTF8ToString() can just be a SDL_strdup() here.
 #define WIN_StringToUTF8A(S) SDL_iconv_string("UTF-8", "ASCII", (const char *)(S), (SDL_strlen(S) + 1))
 #define WIN_StringToUTF8A(S) SDL_iconv_string("UTF-8", "ASCII", (const char *)(S), (SDL_strlen(S) + 1))
 #define WIN_UTF8ToStringA(S) SDL_iconv_string("ASCII", "UTF-8", (const char *)(S), SDL_strlen(S) + 1)
 #define WIN_UTF8ToStringA(S) SDL_iconv_string("ASCII", "UTF-8", (const char *)(S), SDL_strlen(S) + 1)
 #if UNICODE
 #if UNICODE
@@ -111,64 +111,64 @@
 #define SDL_tcsstr       SDL_strstr
 #define SDL_tcsstr       SDL_strstr
 #endif
 #endif
 
 
-/* Set up for C function definitions, even when using C++ */
+// Set up for C function definitions, even when using C++
 #ifdef __cplusplus
 #ifdef __cplusplus
 extern "C" {
 extern "C" {
 #endif
 #endif
 
 
-/* Sets an error message based on a given HRESULT */
+// Sets an error message based on a given HRESULT
 extern int WIN_SetErrorFromHRESULT(const char *prefix, HRESULT hr);
 extern int WIN_SetErrorFromHRESULT(const char *prefix, HRESULT hr);
 
 
-/* Sets an error message based on GetLastError(). Always return -1. */
+// Sets an error message based on GetLastError(). Always return -1.
 extern int WIN_SetError(const char *prefix);
 extern int WIN_SetError(const char *prefix);
 
 
 #ifndef SDL_PLATFORM_WINRT
 #ifndef SDL_PLATFORM_WINRT
-/* Load a function from combase.dll */
+// Load a function from combase.dll
 FARPROC WIN_LoadComBaseFunction(const char *name);
 FARPROC WIN_LoadComBaseFunction(const char *name);
 #endif
 #endif
 
 
-/* Wrap up the oddities of CoInitialize() into a common function. */
+// Wrap up the oddities of CoInitialize() into a common function.
 extern HRESULT WIN_CoInitialize(void);
 extern HRESULT WIN_CoInitialize(void);
 extern void WIN_CoUninitialize(void);
 extern void WIN_CoUninitialize(void);
 
 
-/* Wrap up the oddities of RoInitialize() into a common function. */
+// Wrap up the oddities of RoInitialize() into a common function.
 extern HRESULT WIN_RoInitialize(void);
 extern HRESULT WIN_RoInitialize(void);
 extern void WIN_RoUninitialize(void);
 extern void WIN_RoUninitialize(void);
 
 
-/* Returns SDL_TRUE if we're running on Windows XP (any service pack). DOES NOT CHECK XP "OR GREATER"! */
+// Returns SDL_TRUE if we're running on Windows XP (any service pack). DOES NOT CHECK XP "OR GREATER"!
 extern BOOL WIN_IsWindowsXP(void);
 extern BOOL WIN_IsWindowsXP(void);
 
 
-/* Returns SDL_TRUE if we're running on Windows Vista and newer */
+// Returns SDL_TRUE if we're running on Windows Vista and newer
 extern BOOL WIN_IsWindowsVistaOrGreater(void);
 extern BOOL WIN_IsWindowsVistaOrGreater(void);
 
 
-/* Returns SDL_TRUE if we're running on Windows 7 and newer */
+// Returns SDL_TRUE if we're running on Windows 7 and newer
 extern BOOL WIN_IsWindows7OrGreater(void);
 extern BOOL WIN_IsWindows7OrGreater(void);
 
 
-/* Returns SDL_TRUE if we're running on Windows 8 and newer */
+// Returns SDL_TRUE if we're running on Windows 8 and newer
 extern BOOL WIN_IsWindows8OrGreater(void);
 extern BOOL WIN_IsWindows8OrGreater(void);
 
 
-/* You need to SDL_free() the result of this call. */
+// You need to SDL_free() the result of this call.
 extern char *WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid);
 extern char *WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid);
 
 
-/* Checks to see if two GUID are the same. */
+// Checks to see if two GUID are the same.
 extern BOOL WIN_IsEqualGUID(const GUID *a, const GUID *b);
 extern BOOL WIN_IsEqualGUID(const GUID *a, const GUID *b);
 extern BOOL WIN_IsEqualIID(REFIID a, REFIID b);
 extern BOOL WIN_IsEqualIID(REFIID a, REFIID b);
 
 
-/* Convert between SDL_rect and RECT */
+// Convert between SDL_rect and RECT
 extern void WIN_RECTToRect(const RECT *winrect, SDL_Rect *sdlrect);
 extern void WIN_RECTToRect(const RECT *winrect, SDL_Rect *sdlrect);
 extern void WIN_RectToRECT(const SDL_Rect *sdlrect, RECT *winrect);
 extern void WIN_RectToRECT(const SDL_Rect *sdlrect, RECT *winrect);
 
 
-/* Returns SDL_TRUE if the rect is empty */
+// Returns SDL_TRUE if the rect is empty
 extern BOOL WIN_IsRectEmpty(const RECT *rect);
 extern BOOL WIN_IsRectEmpty(const RECT *rect);
 
 
 extern SDL_AudioFormat SDL_WaveFormatExToSDLFormat(WAVEFORMATEX *waveformat);
 extern SDL_AudioFormat SDL_WaveFormatExToSDLFormat(WAVEFORMATEX *waveformat);
 
 
-/* WideCharToMultiByte, but with some WinXP manangement. */
+// WideCharToMultiByte, but with some WinXP manangement.
 extern int WIN_WideCharToMultiByte(UINT CodePage, DWORD dwFlags, LPCWCH lpWideCharStr, int cchWideChar, LPSTR lpMultiByteStr, int cbMultiByte, LPCCH lpDefaultChar, LPBOOL lpUsedDefaultChar);
 extern int WIN_WideCharToMultiByte(UINT CodePage, DWORD dwFlags, LPCWCH lpWideCharStr, int cchWideChar, LPSTR lpMultiByteStr, int cbMultiByte, LPCCH lpDefaultChar, LPBOOL lpUsedDefaultChar);
 
 
-/* Ends C function definitions when using C++ */
+// Ends C function definitions when using C++
 #ifdef __cplusplus
 #ifdef __cplusplus
 }
 }
 #endif
 #endif
 
 
-#endif /* _INCLUDED_WINDOWS_H */
+#endif // _INCLUDED_WINDOWS_H

+ 11 - 11
src/core/windows/SDL_xinput.c

@@ -22,7 +22,7 @@
 
 
 #include "SDL_xinput.h"
 #include "SDL_xinput.h"
 
 
-/* Set up for C function definitions, even when using C++ */
+// Set up for C function definitions, even when using C++
 #ifdef __cplusplus
 #ifdef __cplusplus
 extern "C" {
 extern "C" {
 #endif
 #endif
@@ -58,7 +58,7 @@ int WIN_LoadXInputDLL(void)
     SDL_XInputGetCapabilities = (XInputGetCapabilities_t)XInputGetCapabilities;
     SDL_XInputGetCapabilities = (XInputGetCapabilities_t)XInputGetCapabilities;
     SDL_XInputGetBatteryInformation = (XInputGetBatteryInformation_t)XInputGetBatteryInformation;
     SDL_XInputGetBatteryInformation = (XInputGetBatteryInformation_t)XInputGetBatteryInformation;
 
 
-    /* XInput 1.4 ships with Windows 8 and 8.1: */
+    // XInput 1.4 ships with Windows 8 and 8.1:
     SDL_XInputVersion = (1 << 16) | 4;
     SDL_XInputVersion = (1 << 16) | 4;
 
 
     return 0;
     return 0;
@@ -68,7 +68,7 @@ void WIN_UnloadXInputDLL(void)
 {
 {
 }
 }
 
 
-#else /* !(defined(SDL_PLATFORM_WINRT) || defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES)) */
+#else // !(defined(SDL_PLATFORM_WINRT) || defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES))
 
 
 int WIN_LoadXInputDLL(void)
 int WIN_LoadXInputDLL(void)
 {
 {
@@ -77,7 +77,7 @@ int WIN_LoadXInputDLL(void)
     if (s_pXInputDLL) {
     if (s_pXInputDLL) {
         SDL_assert(s_XInputDLLRefCount > 0);
         SDL_assert(s_XInputDLLRefCount > 0);
         s_XInputDLLRefCount++;
         s_XInputDLLRefCount++;
-        return 0; /* already loaded */
+        return 0; // already loaded
     }
     }
 
 
     /* NOTE: Don't load XinputUap.dll
     /* NOTE: Don't load XinputUap.dll
@@ -85,16 +85,16 @@ int WIN_LoadXInputDLL(void)
      * limitations of that API (no devices at startup, no background input, etc.)
      * limitations of that API (no devices at startup, no background input, etc.)
      */
      */
     version = (1 << 16) | 4;
     version = (1 << 16) | 4;
-    s_pXInputDLL = LoadLibrary(TEXT("XInput1_4.dll")); /* 1.4 Ships with Windows 8. */
+    s_pXInputDLL = LoadLibrary(TEXT("XInput1_4.dll")); // 1.4 Ships with Windows 8.
     if (!s_pXInputDLL) {
     if (!s_pXInputDLL) {
         version = (1 << 16) | 3;
         version = (1 << 16) | 3;
-        s_pXInputDLL = LoadLibrary(TEXT("XInput1_3.dll")); /* 1.3 can be installed as a redistributable component. */
+        s_pXInputDLL = LoadLibrary(TEXT("XInput1_3.dll")); // 1.3 can be installed as a redistributable component.
     }
     }
     if (!s_pXInputDLL) {
     if (!s_pXInputDLL) {
         s_pXInputDLL = LoadLibrary(TEXT("bin\\XInput1_3.dll"));
         s_pXInputDLL = LoadLibrary(TEXT("bin\\XInput1_3.dll"));
     }
     }
     if (!s_pXInputDLL) {
     if (!s_pXInputDLL) {
-        /* "9.1.0" Ships with Vista and Win7, and is more limited than 1.3+ (e.g. XInputGetStateEx is not available.)  */
+        // "9.1.0" Ships with Vista and Win7, and is more limited than 1.3+ (e.g. XInputGetStateEx is not available.)
         s_pXInputDLL = LoadLibrary(TEXT("XInput9_1_0.dll"));
         s_pXInputDLL = LoadLibrary(TEXT("XInput9_1_0.dll"));
     }
     }
     if (!s_pXInputDLL) {
     if (!s_pXInputDLL) {
@@ -105,14 +105,14 @@ int WIN_LoadXInputDLL(void)
     SDL_XInputVersion = version;
     SDL_XInputVersion = version;
     s_XInputDLLRefCount = 1;
     s_XInputDLLRefCount = 1;
 
 
-    /* 100 is the ordinal for _XInputGetStateEx, which returns the same struct as XinputGetState, but with extra data in wButtons for the guide button, we think... */
+    // 100 is the ordinal for _XInputGetStateEx, which returns the same struct as XinputGetState, but with extra data in wButtons for the guide button, we think...
     SDL_XInputGetState = (XInputGetState_t)GetProcAddress(s_pXInputDLL, (LPCSTR)100);
     SDL_XInputGetState = (XInputGetState_t)GetProcAddress(s_pXInputDLL, (LPCSTR)100);
     if (!SDL_XInputGetState) {
     if (!SDL_XInputGetState) {
         SDL_XInputGetState = (XInputGetState_t)GetProcAddress(s_pXInputDLL, "XInputGetState");
         SDL_XInputGetState = (XInputGetState_t)GetProcAddress(s_pXInputDLL, "XInputGetState");
     }
     }
     SDL_XInputSetState = (XInputSetState_t)GetProcAddress(s_pXInputDLL, "XInputSetState");
     SDL_XInputSetState = (XInputSetState_t)GetProcAddress(s_pXInputDLL, "XInputSetState");
     SDL_XInputGetCapabilities = (XInputGetCapabilities_t)GetProcAddress(s_pXInputDLL, "XInputGetCapabilities");
     SDL_XInputGetCapabilities = (XInputGetCapabilities_t)GetProcAddress(s_pXInputDLL, "XInputGetCapabilities");
-    /* 108 is the ordinal for _XInputGetCapabilitiesEx, which additionally returns VID/PID of the controller. */
+    // 108 is the ordinal for _XInputGetCapabilitiesEx, which additionally returns VID/PID of the controller.
     SDL_XInputGetCapabilitiesEx = (XInputGetCapabilitiesEx_t)GetProcAddress(s_pXInputDLL, (LPCSTR)108);
     SDL_XInputGetCapabilitiesEx = (XInputGetCapabilitiesEx_t)GetProcAddress(s_pXInputDLL, (LPCSTR)108);
     SDL_XInputGetBatteryInformation = (XInputGetBatteryInformation_t)GetProcAddress(s_pXInputDLL, "XInputGetBatteryInformation");
     SDL_XInputGetBatteryInformation = (XInputGetBatteryInformation_t)GetProcAddress(s_pXInputDLL, "XInputGetBatteryInformation");
     if (!SDL_XInputGetState || !SDL_XInputSetState || !SDL_XInputGetCapabilities) {
     if (!SDL_XInputGetState || !SDL_XInputSetState || !SDL_XInputGetCapabilities) {
@@ -136,9 +136,9 @@ void WIN_UnloadXInputDLL(void)
     }
     }
 }
 }
 
 
-#endif /* SDL_PLATFORM_WINRT */
+#endif // SDL_PLATFORM_WINRT
 
 
-/* Ends C function definitions when using C++ */
+// Ends C function definitions when using C++
 #ifdef __cplusplus
 #ifdef __cplusplus
 }
 }
 #endif
 #endif

+ 24 - 24
src/core/windows/SDL_xinput.h

@@ -27,14 +27,14 @@
 
 
 #ifdef HAVE_XINPUT_H
 #ifdef HAVE_XINPUT_H
 #if defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES)
 #if defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES)
-/* Xbox supports an XInput wrapper which is a C++-only header... */
-#include <math.h> /* Required to compile with recent MSVC... */
+// Xbox supports an XInput wrapper which is a C++-only header...
+#include <math.h> // Required to compile with recent MSVC...
 #include <XInputOnGameInput.h>
 #include <XInputOnGameInput.h>
 using namespace XInputOnGameInput;
 using namespace XInputOnGameInput;
 #else
 #else
 #include <xinput.h>
 #include <xinput.h>
 #endif
 #endif
-#endif /* HAVE_XINPUT_H */
+#endif // HAVE_XINPUT_H
 
 
 #ifndef XUSER_MAX_COUNT
 #ifndef XUSER_MAX_COUNT
 #define XUSER_MAX_COUNT 4
 #define XUSER_MAX_COUNT 4
@@ -160,15 +160,15 @@ using namespace XInputOnGameInput;
 #define BATTERY_LEVEL_FULL 0x03
 #define BATTERY_LEVEL_FULL 0x03
 #endif
 #endif
 
 
-/* Set up for C function definitions, even when using C++ */
+// Set up for C function definitions, even when using C++
 #ifdef __cplusplus
 #ifdef __cplusplus
 extern "C" {
 extern "C" {
 #endif
 #endif
 
 
-/* typedef's for XInput structs we use */
+// typedef's for XInput structs we use
 
 
 
 
-/* This is the same as XINPUT_BATTERY_INFORMATION, but always defined instead of just if WIN32_WINNT >= _WIN32_WINNT_WIN8 */
+// This is the same as XINPUT_BATTERY_INFORMATION, but always defined instead of just if WIN32_WINNT >= _WIN32_WINNT_WIN8
 typedef struct
 typedef struct
 {
 {
     BYTE BatteryType;
     BYTE BatteryType;
@@ -209,9 +209,9 @@ typedef struct
     XINPUT_VIBRATION Vibration;
     XINPUT_VIBRATION Vibration;
 } XINPUT_CAPABILITIES;
 } XINPUT_CAPABILITIES;
 
 
-#endif /* HAVE_XINPUT_H */
+#endif // HAVE_XINPUT_H
 
 
-/* This struct is not defined in XInput headers. */
+// This struct is not defined in XInput headers.
 typedef struct
 typedef struct
 {
 {
     XINPUT_CAPABILITIES Capabilities;
     XINPUT_CAPABILITIES Capabilities;
@@ -222,29 +222,29 @@ typedef struct
     DWORD unk2;
     DWORD unk2;
 } SDL_XINPUT_CAPABILITIES_EX;
 } SDL_XINPUT_CAPABILITIES_EX;
 
 
-/* Forward decl's for XInput API's we load dynamically and use if available */
+// Forward decl's for XInput API's we load dynamically and use if available
 typedef DWORD(WINAPI *XInputGetState_t)(
 typedef DWORD(WINAPI *XInputGetState_t)(
-    DWORD dwUserIndex,      /* [in] Index of the gamer associated with the device */
-    XINPUT_STATE *pState    /* [out] Receives the current state */
+    DWORD dwUserIndex,      // [in] Index of the gamer associated with the device
+    XINPUT_STATE *pState    // [out] Receives the current state
 );
 );
 
 
 typedef DWORD(WINAPI *XInputSetState_t)(
 typedef DWORD(WINAPI *XInputSetState_t)(
-    DWORD dwUserIndex,           /* [in] Index of the gamer associated with the device */
-    XINPUT_VIBRATION *pVibration /* [in, out] The vibration information to send to the controller */
+    DWORD dwUserIndex,           // [in] Index of the gamer associated with the device
+    XINPUT_VIBRATION *pVibration // [in, out] The vibration information to send to the controller
 );
 );
 
 
 typedef DWORD(WINAPI *XInputGetCapabilities_t)(
 typedef DWORD(WINAPI *XInputGetCapabilities_t)(
-    DWORD dwUserIndex,                 /* [in] Index of the gamer associated with the device */
-    DWORD dwFlags,                     /* [in] Input flags that identify the device type */
-    XINPUT_CAPABILITIES *pCapabilities /* [out] Receives the capabilities */
+    DWORD dwUserIndex,                 // [in] Index of the gamer associated with the device
+    DWORD dwFlags,                     // [in] Input flags that identify the device type
+    XINPUT_CAPABILITIES *pCapabilities // [out] Receives the capabilities
 );
 );
 
 
-/* Only available in XInput 1.4 that is shipped with Windows 8 and newer. */
+// Only available in XInput 1.4 that is shipped with Windows 8 and newer.
 typedef DWORD(WINAPI *XInputGetCapabilitiesEx_t)(
 typedef DWORD(WINAPI *XInputGetCapabilitiesEx_t)(
-    DWORD dwReserved,                       /* [in] Must be 1 */
-    DWORD dwUserIndex,                      /* [in] Index of the gamer associated with the device */
-    DWORD dwFlags,                          /* [in] Input flags that identify the device type */
-    SDL_XINPUT_CAPABILITIES_EX *pCapabilitiesEx /* [out] Receives the capabilities */
+    DWORD dwReserved,                       // [in] Must be 1
+    DWORD dwUserIndex,                      // [in] Index of the gamer associated with the device
+    DWORD dwFlags,                          // [in] Input flags that identify the device type
+    SDL_XINPUT_CAPABILITIES_EX *pCapabilitiesEx // [out] Receives the capabilities
 );
 );
 
 
 typedef DWORD(WINAPI *XInputGetBatteryInformation_t)(
 typedef DWORD(WINAPI *XInputGetBatteryInformation_t)(
@@ -260,9 +260,9 @@ extern XInputSetState_t SDL_XInputSetState;
 extern XInputGetCapabilities_t SDL_XInputGetCapabilities;
 extern XInputGetCapabilities_t SDL_XInputGetCapabilities;
 extern XInputGetCapabilitiesEx_t SDL_XInputGetCapabilitiesEx;
 extern XInputGetCapabilitiesEx_t SDL_XInputGetCapabilitiesEx;
 extern XInputGetBatteryInformation_t SDL_XInputGetBatteryInformation;
 extern XInputGetBatteryInformation_t SDL_XInputGetBatteryInformation;
-extern DWORD SDL_XInputVersion; /* ((major << 16) & 0xFF00) | (minor & 0xFF) */
+extern DWORD SDL_XInputVersion; // ((major << 16) & 0xFF00) | (minor & 0xFF)
 
 
-/* Ends C function definitions when using C++ */
+// Ends C function definitions when using C++
 #ifdef __cplusplus
 #ifdef __cplusplus
 }
 }
 #endif
 #endif
@@ -273,4 +273,4 @@ extern DWORD SDL_XInputVersion; /* ((major << 16) & 0xFF00) | (minor & 0xFF) */
 #define XINPUTGETCAPABILITIESEX     SDL_XInputGetCapabilitiesEx
 #define XINPUTGETCAPABILITIESEX     SDL_XInputGetCapabilitiesEx
 #define XINPUTGETBATTERYINFORMATION SDL_XInputGetBatteryInformation
 #define XINPUTGETBATTERYINFORMATION SDL_XInputGetBatteryInformation
 
 
-#endif /* SDL_xinput_h_ */
+#endif // SDL_xinput_h_

+ 1 - 1
src/core/winrt/SDL_winrtapp_common.cpp

@@ -27,7 +27,7 @@ int (*WINRT_SDLAppEntryPoint)(int, char **) = NULL;
 extern "C"
 extern "C"
 SDL_WinRT_DeviceFamily SDL_GetWinRTDeviceFamily()
 SDL_WinRT_DeviceFamily SDL_GetWinRTDeviceFamily()
 {
 {
-#if NTDDI_VERSION >= NTDDI_WIN10 /* !!! FIXME: I have no idea if this is the right test. This is a UWP API, I think. Older windows should...just return "mobile"? I don't know. --ryan. */
+#if NTDDI_VERSION >= NTDDI_WIN10 // !!! FIXME: I have no idea if this is the right test. This is a UWP API, I think. Older windows should...just return "mobile"? I don't know. --ryan.
     Platform::String ^ deviceFamily = Windows::System::Profile::AnalyticsInfo::VersionInfo->DeviceFamily;
     Platform::String ^ deviceFamily = Windows::System::Profile::AnalyticsInfo::VersionInfo->DeviceFamily;
 
 
     if (deviceFamily->Equals("Windows.Desktop")) {
     if (deviceFamily->Equals("Windows.Desktop")) {

+ 5 - 5
src/core/winrt/SDL_winrtapp_direct3d.cpp

@@ -20,7 +20,7 @@
 */
 */
 #include "SDL_internal.h"
 #include "SDL_internal.h"
 
 
-/* Windows includes */
+// Windows includes
 #include "ppltasks.h"
 #include "ppltasks.h"
 using namespace concurrency;
 using namespace concurrency;
 using namespace Windows::ApplicationModel;
 using namespace Windows::ApplicationModel;
@@ -37,7 +37,7 @@ using namespace Windows::UI::Input;
 using namespace Windows::Phone::UI::Input;
 using namespace Windows::Phone::UI::Input;
 #endif
 #endif
 
 
-/* SDL includes */
+// SDL includes
 extern "C" {
 extern "C" {
 #include "../../video/SDL_sysvideo.h"
 #include "../../video/SDL_sysvideo.h"
 #include "../../events/SDL_events_c.h"
 #include "../../events/SDL_events_c.h"
@@ -354,7 +354,7 @@ static bool IsSDLWindowEventPending(SDL_EventType windowEventID)
 
 
 bool SDL_WinRTApp::ShouldWaitForAppResumeEvents()
 bool SDL_WinRTApp::ShouldWaitForAppResumeEvents()
 {
 {
-    /* Don't wait if the app is visible: */
+    // Don't wait if the app is visible:
     if (m_windowVisible) {
     if (m_windowVisible) {
         return false;
         return false;
     }
     }
@@ -541,10 +541,10 @@ void SDL_WinRTApp::OnWindowActivated(CoreWindow ^ sender, WindowActivatedEventAr
             SDL_SendMouseMotion(0, window, SDL_GLOBAL_MOUSE_ID, SDL_FALSE, cursorPos.X, cursorPos.Y);
             SDL_SendMouseMotion(0, window, SDL_GLOBAL_MOUSE_ID, SDL_FALSE, cursorPos.X, cursorPos.Y);
 #endif
 #endif
 
 
-            /* TODO, WinRT: see if the Win32 bugfix from https://hg.libsdl.org/SDL/rev/d278747da408 needs to be applied (on window activation) */
+            // TODO, WinRT: see if the Win32 bugfix from https://hg.libsdl.org/SDL/rev/d278747da408 needs to be applied (on window activation)
             // WIN_CheckAsyncMouseRelease(data);
             // WIN_CheckAsyncMouseRelease(data);
 
 
-            /* TODO, WinRT: implement clipboard support, if possible */
+            // TODO, WinRT: implement clipboard support, if possible
             ///*
             ///*
             // * FIXME: Update keyboard state
             // * FIXME: Update keyboard state
             // */
             // */

+ 3 - 3
src/core/winrt/SDL_winrtapp_xaml.cpp

@@ -20,7 +20,7 @@
 */
 */
 #include "SDL_internal.h"
 #include "SDL_internal.h"
 
 
-/* Windows includes */
+// Windows includes
 #include <agile.h>
 #include <agile.h>
 #include <Windows.h>
 #include <Windows.h>
 
 
@@ -28,13 +28,13 @@
 #include <windows.ui.xaml.media.dxinterop.h>
 #include <windows.ui.xaml.media.dxinterop.h>
 #endif
 #endif
 
 
-/* SDL includes */
+// SDL includes
 #include "../../video/winrt/SDL_winrtevents_c.h"
 #include "../../video/winrt/SDL_winrtevents_c.h"
 #include "../../video/winrt/SDL_winrtvideo_cpp.h"
 #include "../../video/winrt/SDL_winrtvideo_cpp.h"
 #include "SDL_winrtapp_common.h"
 #include "SDL_winrtapp_common.h"
 #include "SDL_winrtapp_xaml.h"
 #include "SDL_winrtapp_xaml.h"
 
 
-/* SDL-internal globals: */
+// SDL-internal globals:
 SDL_bool WINRT_XAMLWasEnabled = SDL_FALSE;
 SDL_bool WINRT_XAMLWasEnabled = SDL_FALSE;
 
 
 #if WINAPI_FAMILY == WINAPI_FAMILY_APP
 #if WINAPI_FAMILY == WINAPI_FAMILY_APP

+ 39 - 39
src/cpuinfo/SDL_cpuinfo.c

@@ -27,7 +27,7 @@
 #include "../core/windows/SDL_windows.h"
 #include "../core/windows/SDL_windows.h"
 #endif
 #endif
 
 
-/* CPU feature detection for SDL */
+// CPU feature detection for SDL
 
 
 #ifdef HAVE_SYSCONF
 #ifdef HAVE_SYSCONF
 #include <unistd.h>
 #include <unistd.h>
@@ -37,10 +37,10 @@
 #include <sys/sysctl.h>
 #include <sys/sysctl.h>
 #endif
 #endif
 #if defined(SDL_PLATFORM_MACOS) && (defined(__ppc__) || defined(__ppc64__))
 #if defined(SDL_PLATFORM_MACOS) && (defined(__ppc__) || defined(__ppc64__))
-#include <sys/sysctl.h> /* For AltiVec check */
+#include <sys/sysctl.h> // For AltiVec check
 #elif defined(SDL_PLATFORM_OPENBSD) && defined(__powerpc__)
 #elif defined(SDL_PLATFORM_OPENBSD) && defined(__powerpc__)
 #include <sys/types.h>
 #include <sys/types.h>
-#include <sys/sysctl.h> /* For AltiVec check */
+#include <sys/sysctl.h> // For AltiVec check
 #include <machine/cpu.h>
 #include <machine/cpu.h>
 #elif defined(SDL_PLATFORM_FREEBSD) && defined(__powerpc__)
 #elif defined(SDL_PLATFORM_FREEBSD) && defined(__powerpc__)
 #include <machine/cpu.h>
 #include <machine/cpu.h>
@@ -57,7 +57,7 @@
 #include <fcntl.h>
 #include <fcntl.h>
 #include <elf.h>
 #include <elf.h>
 
 
-/*#include <asm/hwcap.h>*/
+// #include <asm/hwcap.h>
 #ifndef AT_HWCAP
 #ifndef AT_HWCAP
 #define AT_HWCAP 16
 #define AT_HWCAP 16
 #endif
 #endif
@@ -122,13 +122,13 @@ static void illegal_instruction(int sig)
 {
 {
     longjmp(jmpbuf, 1);
     longjmp(jmpbuf, 1);
 }
 }
-#endif /* HAVE_SETJMP */
+#endif // HAVE_SETJMP
 
 
 static int CPU_haveCPUID(void)
 static int CPU_haveCPUID(void)
 {
 {
     int has_CPUID = 0;
     int has_CPUID = 0;
 
 
-/* *INDENT-OFF* */ /* clang-format off */
+/* *INDENT-OFF* */ // clang-format off
 #ifndef SDL_PLATFORM_EMSCRIPTEN
 #ifndef SDL_PLATFORM_EMSCRIPTEN
 #if (defined(__GNUC__) || defined(__llvm__)) && defined(__i386__)
 #if (defined(__GNUC__) || defined(__llvm__)) && defined(__i386__)
     __asm__ (
     __asm__ (
@@ -216,8 +216,8 @@ done:
 "1:                            \n"
 "1:                            \n"
     );
     );
 #endif
 #endif
-#endif /* !SDL_PLATFORM_EMSCRIPTEN */
-/* *INDENT-ON* */ /* clang-format on */
+#endif // !SDL_PLATFORM_EMSCRIPTEN
+/* *INDENT-ON* */ // clang-format on
     return has_CPUID;
     return has_CPUID;
 }
 }
 
 
@@ -253,7 +253,7 @@ done:
         __asm mov d, edx                   \
         __asm mov d, edx                   \
     }
     }
 #elif (defined(_MSC_VER) && defined(_M_X64))
 #elif (defined(_MSC_VER) && defined(_M_X64))
-/* Use __cpuidex instead of __cpuid because ICL does not clear ecx register */
+// Use __cpuidex instead of __cpuid because ICL does not clear ecx register
 #define cpuid(func, a, b, c, d)      \
 #define cpuid(func, a, b, c, d)      \
     {                                \
     {                                \
         int CPUInfo[4];              \
         int CPUInfo[4];              \
@@ -295,15 +295,15 @@ static void CPU_calcCPUIDFeatures(void)
                 CPU_CPUIDFeatures[2] = c;
                 CPU_CPUIDFeatures[2] = c;
                 CPU_CPUIDFeatures[3] = d;
                 CPU_CPUIDFeatures[3] = d;
 
 
-                /* Check to make sure we can call xgetbv */
+                // Check to make sure we can call xgetbv
                 if (c & 0x08000000) {
                 if (c & 0x08000000) {
-                    /* Call xgetbv to see if YMM (etc) register state is saved */
+                    // Call xgetbv to see if YMM (etc) register state is saved
 #if (defined(__GNUC__) || defined(__llvm__)) && (defined(__i386__) || defined(__x86_64__))
 #if (defined(__GNUC__) || defined(__llvm__)) && (defined(__i386__) || defined(__x86_64__))
                     __asm__(".byte 0x0f, 0x01, 0xd0"
                     __asm__(".byte 0x0f, 0x01, 0xd0"
                             : "=a"(a)
                             : "=a"(a)
                             : "c"(0)
                             : "c"(0)
                             : "%edx");
                             : "%edx");
-#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64)) && (_MSC_FULL_VER >= 160040219) /* VS2010 SP1 */
+#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64)) && (_MSC_FULL_VER >= 160040219) // VS2010 SP1
                     a = (int)_xgetbv(0);
                     a = (int)_xgetbv(0);
 #elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)
 #elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)
                     __asm
                     __asm
@@ -447,28 +447,28 @@ static int CPU_haveNEON(void)
 /* The way you detect NEON is a privileged instruction on ARM, so you have
 /* The way you detect NEON is a privileged instruction on ARM, so you have
    query the OS kernel in a platform-specific way. :/ */
    query the OS kernel in a platform-specific way. :/ */
 #if defined(SDL_PLATFORM_WINDOWS) && (defined(_M_ARM) || defined(_M_ARM64))
 #if defined(SDL_PLATFORM_WINDOWS) && (defined(_M_ARM) || defined(_M_ARM64))
-/* Visual Studio, for ARM, doesn't define __ARM_ARCH. Handle this first. */
-/* Seems to have been removed */
+// Visual Studio, for ARM, doesn't define __ARM_ARCH. Handle this first.
+// Seems to have been removed
 #ifndef PF_ARM_NEON_INSTRUCTIONS_AVAILABLE
 #ifndef PF_ARM_NEON_INSTRUCTIONS_AVAILABLE
 #define PF_ARM_NEON_INSTRUCTIONS_AVAILABLE 19
 #define PF_ARM_NEON_INSTRUCTIONS_AVAILABLE 19
 #endif
 #endif
-    /* All WinRT ARM devices are required to support NEON, but just in case. */
+    // All WinRT ARM devices are required to support NEON, but just in case.
     return IsProcessorFeaturePresent(PF_ARM_NEON_INSTRUCTIONS_AVAILABLE) != 0;
     return IsProcessorFeaturePresent(PF_ARM_NEON_INSTRUCTIONS_AVAILABLE) != 0;
 #elif (defined(__ARM_ARCH) && (__ARM_ARCH >= 8)) || defined(__aarch64__)
 #elif (defined(__ARM_ARCH) && (__ARM_ARCH >= 8)) || defined(__aarch64__)
-    return 1; /* ARMv8 always has non-optional NEON support. */
+    return 1; // ARMv8 always has non-optional NEON support.
 #elif defined(SDL_PLATFORM_VITA)
 #elif defined(SDL_PLATFORM_VITA)
     return 1;
     return 1;
 #elif defined(SDL_PLATFORM_3DS)
 #elif defined(SDL_PLATFORM_3DS)
     return 0;
     return 0;
 #elif defined(SDL_PLATFORM_APPLE) && defined(__ARM_ARCH) && (__ARM_ARCH >= 7)
 #elif defined(SDL_PLATFORM_APPLE) && defined(__ARM_ARCH) && (__ARM_ARCH >= 7)
-    /* (note that sysctlbyname("hw.optional.neon") doesn't work!) */
-    return 1; /* all Apple ARMv7 chips and later have NEON. */
+    // (note that sysctlbyname("hw.optional.neon") doesn't work!)
+    return 1; // all Apple ARMv7 chips and later have NEON.
 #elif defined(SDL_PLATFORM_APPLE)
 #elif defined(SDL_PLATFORM_APPLE)
-    return 0; /* assume anything else from Apple doesn't have NEON. */
+    return 0; // assume anything else from Apple doesn't have NEON.
 #elif !defined(__arm__)
 #elif !defined(__arm__)
-    return 0; /* not an ARM CPU at all. */
+    return 0; // not an ARM CPU at all.
 #elif defined(SDL_PLATFORM_OPENBSD)
 #elif defined(SDL_PLATFORM_OPENBSD)
-    return 1; /* OpenBSD only supports ARMv7 CPUs that have NEON. */
+    return 1; // OpenBSD only supports ARMv7 CPUs that have NEON.
 #elif defined(HAVE_ELF_AUX_INFO)
 #elif defined(HAVE_ELF_AUX_INFO)
     unsigned long hasneon = 0;
     unsigned long hasneon = 0;
     if (elf_aux_info(AT_HWCAP, (void *)&hasneon, (int)sizeof(hasneon)) != 0) {
     if (elf_aux_info(AT_HWCAP, (void *)&hasneon, (int)sizeof(hasneon)) != 0) {
@@ -480,7 +480,7 @@ static int CPU_haveNEON(void)
 #elif defined(SDL_PLATFORM_LINUX)
 #elif defined(SDL_PLATFORM_LINUX)
     return readProcAuxvForNeon();
     return readProcAuxvForNeon();
 #elif defined(SDL_PLATFORM_ANDROID)
 #elif defined(SDL_PLATFORM_ANDROID)
-    /* Use NDK cpufeatures to read either /proc/self/auxv or /proc/cpuinfo */
+    // Use NDK cpufeatures to read either /proc/self/auxv or /proc/cpuinfo
     {
     {
         AndroidCpuFamily cpu_family = android_getCpuFamily();
         AndroidCpuFamily cpu_family = android_getCpuFamily();
         if (cpu_family == ANDROID_CPU_FAMILY_ARM) {
         if (cpu_family == ANDROID_CPU_FAMILY_ARM) {
@@ -492,7 +492,7 @@ static int CPU_haveNEON(void)
         return 0;
         return 0;
     }
     }
 #elif defined(SDL_PLATFORM_RISCOS)
 #elif defined(SDL_PLATFORM_RISCOS)
-    /* Use the VFPSupport_Features SWI to access the MVFR registers */
+    // Use the VFPSupport_Features SWI to access the MVFR registers
     {
     {
         _kernel_swi_regs regs;
         _kernel_swi_regs regs;
         regs.r[0] = 0;
         regs.r[0] = 0;
@@ -590,7 +590,7 @@ static int CPU_haveAVX2(void)
         (void)a;
         (void)a;
         (void)b;
         (void)b;
         (void)c;
         (void)c;
-        (void)d; /* compiler warnings... */
+        (void)d; // compiler warnings...
         cpuid(7, a, b, c, d);
         cpuid(7, a, b, c, d);
         return b & 0x00000020;
         return b & 0x00000020;
     }
     }
@@ -612,7 +612,7 @@ static int CPU_haveAVX512F(void)
         (void)a;
         (void)a;
         (void)b;
         (void)b;
         (void)c;
         (void)c;
-        (void)d; /* compiler warnings... */
+        (void)d; // compiler warnings...
         cpuid(7, a, b, c, d);
         cpuid(7, a, b, c, d);
         return b & 0x00010000;
         return b & 0x00010000;
     }
     }
@@ -643,7 +643,7 @@ int SDL_GetCPUCount(void)
             SDL_CPUCount = info.dwNumberOfProcessors;
             SDL_CPUCount = info.dwNumberOfProcessors;
         }
         }
 #endif
 #endif
-        /* There has to be at least 1, right? :) */
+        // There has to be at least 1, right? :)
         if (SDL_CPUCount <= 0) {
         if (SDL_CPUCount <= 0) {
             SDL_CPUCount = 1;
             SDL_CPUCount = 1;
         }
         }
@@ -662,7 +662,7 @@ SDL_GetCPUType(void)
     return SDL_CPUType;
     return SDL_CPUType;
 }
 }
 #else
 #else
-/* Oh, such a sweet sweet trick, just not very useful. :) */
+// Oh, such a sweet sweet trick, just not very useful. :)
 static const char *SDL_GetCPUType(void)
 static const char *SDL_GetCPUType(void)
 {
 {
     static char SDL_CPUType[13];
     static char SDL_CPUType[13];
@@ -671,7 +671,7 @@ static const char *SDL_GetCPUType(void)
         int i = 0;
         int i = 0;
 
 
         CPU_calcCPUIDFeatures();
         CPU_calcCPUIDFeatures();
-        if (CPU_CPUIDMaxFunction > 0) { /* do we have CPUID at all? */
+        if (CPU_CPUIDMaxFunction > 0) { // do we have CPUID at all?
             int a, b, c, d;
             int a, b, c, d;
             cpuid(0x00000000, a, b, c, d);
             cpuid(0x00000000, a, b, c, d);
             (void)a;
             (void)a;
@@ -729,7 +729,7 @@ static const char *SDL_GetCPUName(void)
         int a, b, c, d;
         int a, b, c, d;
 
 
         CPU_calcCPUIDFeatures();
         CPU_calcCPUIDFeatures();
-        if (CPU_CPUIDMaxFunction > 0) { /* do we have CPUID at all? */
+        if (CPU_CPUIDMaxFunction > 0) { // do we have CPUID at all?
             cpuid(0x80000000, a, b, c, d);
             cpuid(0x80000000, a, b, c, d);
             if (a >= 0x80000004) {
             if (a >= 0x80000004) {
                 cpuid(0x80000002, a, b, c, d);
                 cpuid(0x80000002, a, b, c, d);
@@ -845,7 +845,7 @@ static const char *SDL_GetCPUName(void)
 int SDL_GetCPUCacheLineSize(void)
 int SDL_GetCPUCacheLineSize(void)
 {
 {
     const char *cpuType = SDL_GetCPUType();
     const char *cpuType = SDL_GetCPUType();
-    int cacheline_size = SDL_CACHELINE_SIZE; /* initial guess */
+    int cacheline_size = SDL_CACHELINE_SIZE; // initial guess
     int a, b, c, d;
     int a, b, c, d;
     (void)a;
     (void)a;
     (void)b;
     (void)b;
@@ -949,7 +949,7 @@ static Uint32 SDLCALL SDL_CPUFeatureMaskFromHint(void)
             } else if (ref_string_equals("lasx", spot, end)) {
             } else if (ref_string_equals("lasx", spot, end)) {
                 spot_mask = CPU_HAS_LASX;
                 spot_mask = CPU_HAS_LASX;
             } else {
             } else {
-                /* Ignore unknown/incorrect cpu feature(s) */
+                // Ignore unknown/incorrect cpu feature(s)
                 continue;
                 continue;
             }
             }
             if (add_spot_mask) {
             if (add_spot_mask) {
@@ -967,7 +967,7 @@ static Uint32 SDL_GetCPUFeatures(void)
     if (SDL_CPUFeatures == SDL_CPUFEATURES_RESET_VALUE) {
     if (SDL_CPUFeatures == SDL_CPUFEATURES_RESET_VALUE) {
         CPU_calcCPUIDFeatures();
         CPU_calcCPUIDFeatures();
         SDL_CPUFeatures = 0;
         SDL_CPUFeatures = 0;
-        SDL_SIMDAlignment = sizeof(void *); /* a good safe base value */
+        SDL_SIMDAlignment = sizeof(void *); // a good safe base value
         if (CPU_haveAltiVec()) {
         if (CPU_haveAltiVec()) {
             SDL_CPUFeatures |= CPU_HAS_ALTIVEC;
             SDL_CPUFeatures |= CPU_HAS_ALTIVEC;
             SDL_SIMDAlignment = SDL_max(SDL_SIMDAlignment, 16);
             SDL_SIMDAlignment = SDL_max(SDL_SIMDAlignment, 16);
@@ -1118,18 +1118,18 @@ int SDL_GetSystemRAM(void)
 #ifdef HAVE_SYSCTLBYNAME
 #ifdef HAVE_SYSCTLBYNAME
         if (SDL_SystemRAM <= 0) {
         if (SDL_SystemRAM <= 0) {
 #ifdef HW_PHYSMEM64
 #ifdef HW_PHYSMEM64
-            /* (64-bit): NetBSD since 2003, OpenBSD */
+            // (64-bit): NetBSD since 2003, OpenBSD
             int mib[2] = { CTL_HW, HW_PHYSMEM64 };
             int mib[2] = { CTL_HW, HW_PHYSMEM64 };
 #elif defined(HW_REALMEM)
 #elif defined(HW_REALMEM)
-            /* (64-bit): FreeBSD since 2005, DragonFly */
+            // (64-bit): FreeBSD since 2005, DragonFly
             int mib[2] = { CTL_HW, HW_REALMEM };
             int mib[2] = { CTL_HW, HW_REALMEM };
 #elif defined(HW_MEMSIZE)
 #elif defined(HW_MEMSIZE)
-            /* (64-bit): Darwin */
+            // (64-bit): Darwin
             int mib[2] = { CTL_HW, HW_MEMSIZE };
             int mib[2] = { CTL_HW, HW_MEMSIZE };
 #else
 #else
-            /* (32-bit): very old BSD, might only report up to 2 GiB */
+            // (32-bit): very old BSD, might only report up to 2 GiB
             int mib[2] = { CTL_HW, HW_PHYSMEM };
             int mib[2] = { CTL_HW, HW_PHYSMEM };
-#endif /* HW_PHYSMEM64 */
+#endif // HW_PHYSMEM64
             Uint64 memsize = 0;
             Uint64 memsize = 0;
             size_t len = sizeof(memsize);
             size_t len = sizeof(memsize);
 
 
@@ -1165,7 +1165,7 @@ int SDL_GetSystemRAM(void)
 #endif
 #endif
 #ifdef SDL_PLATFORM_PS2
 #ifdef SDL_PLATFORM_PS2
         if (SDL_SystemRAM <= 0) {
         if (SDL_SystemRAM <= 0) {
-            /* PlayStation 2 has 32MiB however there are some special models with 64 and 128 */
+            // PlayStation 2 has 32MiB however there are some special models with 64 and 128
             SDL_SystemRAM = GetMemorySize();
             SDL_SystemRAM = GetMemorySize();
         }
         }
 #endif
 #endif
@@ -1186,7 +1186,7 @@ int SDL_GetSystemRAM(void)
 size_t SDL_GetSIMDAlignment(void)
 size_t SDL_GetSIMDAlignment(void)
 {
 {
     if (SDL_SIMDAlignment == 0xFFFFFFFF) {
     if (SDL_SIMDAlignment == 0xFFFFFFFF) {
-        SDL_GetCPUFeatures(); /* make sure this has been calculated */
+        SDL_GetCPUFeatures(); // make sure this has been calculated
     }
     }
     SDL_assert(SDL_SIMDAlignment != 0);
     SDL_assert(SDL_SIMDAlignment != 0);
     return SDL_SIMDAlignment;
     return SDL_SIMDAlignment;

+ 1 - 1
src/cpuinfo/SDL_cpuinfo_c.h

@@ -24,4 +24,4 @@
 
 
 extern void SDL_QuitCPUInfo(void);
 extern void SDL_QuitCPUInfo(void);
 
 
-#endif /* SDL_cpuinfo_c_h_ */
+#endif // SDL_cpuinfo_c_h_

+ 6 - 6
src/dialog/SDL_dialog_utils.c

@@ -78,7 +78,7 @@ char *convert_filters(const SDL_DialogFileFilter *filters, int nfilters,
         SDL_free(converted);
         SDL_free(converted);
     }
     }
 
 
-    /* If the filter list is empty, put the suffix */
+    // If the filter list is empty, put the suffix
     if (!filters->name || !filters->pattern) {
     if (!filters->name || !filters->pattern) {
         new_length = SDL_strlen(combined) + SDL_strlen(suffix) + 1;
         new_length = SDL_strlen(combined) + SDL_strlen(suffix) + 1;
 
 
@@ -117,7 +117,7 @@ char *convert_filter(const SDL_DialogFileFilter filter, NameTransform ntf,
     if (ntf) {
     if (ntf) {
         name_filtered = ntf(filter.name);
         name_filtered = ntf(filter.name);
     } else {
     } else {
-        /* Useless strdup, but easier to read and maintain code this way */
+        // Useless strdup, but easier to read and maintain code this way
         name_filtered = SDL_strdup(filter.name);
         name_filtered = SDL_strdup(filter.name);
     }
     }
 
 
@@ -161,10 +161,10 @@ char *convert_ext_list(const char *list, const char *prefix,
     }
     }
 
 
     total_length =
     total_length =
-        SDL_strlen(list) - semicolons /* length of list contents */
-      + semicolons * SDL_strlen(separator) /* length of separators */
-      + SDL_strlen(prefix) + SDL_strlen(suffix) /* length of prefix/suffix */
-      + 1; /* terminating null byte */
+        SDL_strlen(list) - semicolons // length of list contents
+      + semicolons * SDL_strlen(separator) // length of separators
+      + SDL_strlen(prefix) + SDL_strlen(suffix) // length of prefix/suffix
+      + 1; // terminating null byte
 
 
     converted = (char *) SDL_malloc(total_length);
     converted = (char *) SDL_malloc(total_length);
 
 

+ 7 - 7
src/dialog/SDL_dialog_utils.h

@@ -30,8 +30,8 @@
    as "|" with Zenity). */
    as "|" with Zenity). */
 typedef char *(NameTransform)(const char * name);
 typedef char *(NameTransform)(const char * name);
 
 
-/* Converts all the filters into a single string. */
-/* <prefix>[filter]{<separator>[filter]...}<suffix> */
+// Converts all the filters into a single string.
+// <prefix>[filter]{<separator>[filter]...}<suffix>
 char *convert_filters(const SDL_DialogFileFilter *filters, int nfilters,
 char *convert_filters(const SDL_DialogFileFilter *filters, int nfilters,
                       NameTransform ntf, const char *prefix,
                       NameTransform ntf, const char *prefix,
                       const char *separator, const char *suffix,
                       const char *separator, const char *suffix,
@@ -39,20 +39,20 @@ char *convert_filters(const SDL_DialogFileFilter *filters, int nfilters,
                       const char *filt_suffix, const char *ext_prefix,
                       const char *filt_suffix, const char *ext_prefix,
                       const char *ext_separator, const char *ext_suffix);
                       const char *ext_separator, const char *ext_suffix);
 
 
-/* Converts one filter into a single string. */
-/* <prefix>[filter name]<separator>[filter extension list]<suffix> */
+// Converts one filter into a single string.
+// <prefix>[filter name]<separator>[filter extension list]<suffix>
 char *convert_filter(const SDL_DialogFileFilter filter, NameTransform ntf,
 char *convert_filter(const SDL_DialogFileFilter filter, NameTransform ntf,
                      const char *prefix, const char *separator,
                      const char *prefix, const char *separator,
                      const char *suffix, const char *ext_prefix,
                      const char *suffix, const char *ext_prefix,
                      const char *ext_separator, const char *ext_suffix);
                      const char *ext_separator, const char *ext_suffix);
 
 
-/* Converts the extenstion list of a filter into a single string. */
-/* <prefix>[extension]{<separator>[extension]...}<suffix> */
+// Converts the extenstion list of a filter into a single string.
+// <prefix>[extension]{<separator>[extension]...}<suffix>
 char *convert_ext_list(const char *list, const char *prefix,
 char *convert_ext_list(const char *list, const char *prefix,
                        const char *separator, const char *suffix);
                        const char *separator, const char *suffix);
 
 
 /* Must be used if convert_* functions aren't used */
 /* Must be used if convert_* functions aren't used */
-/* Returns an error message if there's a problem, NULL otherwise */
+// Returns an error message if there's a problem, NULL otherwise
 const char *validate_filters(const SDL_DialogFileFilter *filters,
 const char *validate_filters(const SDL_DialogFileFilter *filters,
                              int nfilters);
                              int nfilters);
 
 

+ 2 - 2
src/dialog/android/SDL_androiddialog.c

@@ -25,7 +25,7 @@
 void SDLCALL SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const SDL_DialogFileFilter *filters, int nfilters, const char *default_location, SDL_bool allow_many)
 void SDLCALL SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const SDL_DialogFileFilter *filters, int nfilters, const char *default_location, SDL_bool allow_many)
 {
 {
     if (!Android_JNI_OpenFileDialog(callback, userdata, filters, nfilters, SDL_FALSE, allow_many)) {
     if (!Android_JNI_OpenFileDialog(callback, userdata, filters, nfilters, SDL_FALSE, allow_many)) {
-        /* SDL_SetError is already called when it fails */
+        // SDL_SetError is already called when it fails
         callback(userdata, NULL, -1);
         callback(userdata, NULL, -1);
     }
     }
 }
 }
@@ -33,7 +33,7 @@ void SDLCALL SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void *userd
 void SDLCALL SDL_ShowSaveFileDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const SDL_DialogFileFilter *filters, int nfilters, const char *default_location)
 void SDLCALL SDL_ShowSaveFileDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const SDL_DialogFileFilter *filters, int nfilters, const char *default_location)
 {
 {
     if (!Android_JNI_OpenFileDialog(callback, userdata, filters, nfilters, SDL_TRUE, SDL_FALSE)) {
     if (!Android_JNI_OpenFileDialog(callback, userdata, filters, nfilters, SDL_TRUE, SDL_FALSE)) {
-        /* SDL_SetError is already called when it fails */
+        // SDL_SetError is already called when it fails
         callback(userdata, NULL, -1);
         callback(userdata, NULL, -1);
     }
     }
 }
 }

+ 2 - 2
src/dialog/cocoa/SDL_cocoadialog.m

@@ -53,7 +53,7 @@ void show_file_dialog(cocoa_FileDialogType type, SDL_DialogFileCallback callback
         return;
         return;
     }
     }
 
 
-    /* NSOpenPanel inherits from NSSavePanel */
+    // NSOpenPanel inherits from NSSavePanel
     NSSavePanel *dialog;
     NSSavePanel *dialog;
     NSOpenPanel *dialog_as_open;
     NSOpenPanel *dialog_as_open;
 
 
@@ -120,7 +120,7 @@ void show_file_dialog(cocoa_FileDialogType type, SDL_DialogFileCallback callback
         }
         }
     }
     }
 
 
-    /* Keep behavior consistent with other platforms */
+    // Keep behavior consistent with other platforms
     [dialog setAllowsOtherFileTypes:YES];
     [dialog setAllowsOtherFileTypes:YES];
 
 
     if (default_location) {
     if (default_location) {

+ 15 - 15
src/dialog/unix/SDL_portaldialog.c

@@ -165,19 +165,19 @@ static DBusHandlerResult DBus_MessageFilter(DBusConnection *conn, DBusMessage *m
         const char **path;
         const char **path;
 
 
         dbus->message_iter_init(msg, &signal_iter);
         dbus->message_iter_init(msg, &signal_iter);
-        /* Check if the parameters are what we expect */
+        // Check if the parameters are what we expect
         if (dbus->message_iter_get_arg_type(&signal_iter) != DBUS_TYPE_UINT32)
         if (dbus->message_iter_get_arg_type(&signal_iter) != DBUS_TYPE_UINT32)
             goto not_our_signal;
             goto not_our_signal;
         dbus->message_iter_get_basic(&signal_iter, &result);
         dbus->message_iter_get_basic(&signal_iter, &result);
 
 
         if (result == 1 || result == 2) {
         if (result == 1 || result == 2) {
-            /* cancelled */
+            // cancelled
             const char *result_data[] = { NULL };
             const char *result_data[] = { NULL };
-            signal_data->callback(signal_data->userdata, result_data, -1); /* TODO: Set this to the last selected filter */
+            signal_data->callback(signal_data->userdata, result_data, -1); // TODO: Set this to the last selected filter
             goto handled;
             goto handled;
         }
         }
         else if (result) {
         else if (result) {
-            /* some error occurred */
+            // some error occurred
             signal_data->callback(signal_data->userdata, NULL, -1);
             signal_data->callback(signal_data->userdata, NULL, -1);
             goto handled;
             goto handled;
         }
         }
@@ -199,7 +199,7 @@ static DBusHandlerResult DBus_MessageFilter(DBusConnection *conn, DBusMessage *m
 
 
             dbus->message_iter_get_basic(&array_entry, &method);
             dbus->message_iter_get_basic(&array_entry, &method);
             if (!SDL_strcmp(method, "uris")) {
             if (!SDL_strcmp(method, "uris")) {
-                /* we only care about the selected file paths */
+                // we only care about the selected file paths
                 break;
                 break;
             }
             }
 
 
@@ -239,8 +239,8 @@ static DBusHandlerResult DBus_MessageFilter(DBusConnection *conn, DBusMessage *m
 
 
             dbus->message_iter_get_basic(&uri_entry, &uri);
             dbus->message_iter_get_basic(&uri_entry, &uri);
 
 
-            /* https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.FileChooser.html */
-            /* Returned paths will always start with 'file://'; SDL_URIToLocal() truncates it. */
+            // https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.FileChooser.html
+            // Returned paths will always start with 'file://'; SDL_URIToLocal() truncates it.
             char *decoded_uri = SDL_malloc(SDL_strlen(uri) + 1);
             char *decoded_uri = SDL_malloc(SDL_strlen(uri) + 1);
             if (SDL_URIToLocal(uri, decoded_uri)) {
             if (SDL_URIToLocal(uri, decoded_uri)) {
                 path[current] = decoded_uri;
                 path[current] = decoded_uri;
@@ -255,7 +255,7 @@ static DBusHandlerResult DBus_MessageFilter(DBusConnection *conn, DBusMessage *m
             ++current;
             ++current;
         }
         }
         path[length - 1] = NULL;
         path[length - 1] = NULL;
-        signal_data->callback(signal_data->userdata, path, -1); /* TODO: Fetch the index of the filter that was used */
+        signal_data->callback(signal_data->userdata, path, -1); // TODO: Fetch the index of the filter that was used
 cleanup:
 cleanup:
         dbus->connection_remove_filter(conn, &DBus_MessageFilter, signal_data);
         dbus->connection_remove_filter(conn, &DBus_MessageFilter, signal_data);
 
 
@@ -326,14 +326,14 @@ static void DBus_OpenDialog(const char *method, const char *method_title, SDL_Di
         } else {
         } else {
             const Uint64 xid = (Uint64)SDL_GetNumberProperty(props, SDL_PROP_WINDOW_X11_WINDOW_NUMBER, 0);
             const Uint64 xid = (Uint64)SDL_GetNumberProperty(props, SDL_PROP_WINDOW_X11_WINDOW_NUMBER, 0);
             if (xid) {
             if (xid) {
-                const size_t len = sizeof(X11_HANDLE_PREFIX) + 24; /* A 64-bit number can be 20 characters max. */
+                const size_t len = sizeof(X11_HANDLE_PREFIX) + 24; // A 64-bit number can be 20 characters max.
                 handle_str = SDL_malloc(len * sizeof(char));
                 handle_str = SDL_malloc(len * sizeof(char));
                 if (!handle_str) {
                 if (!handle_str) {
                     callback(userdata, NULL, -1);
                     callback(userdata, NULL, -1);
                     return;
                     return;
                 }
                 }
 
 
-                /* The portal wants X11 window ID numbers in hex. */
+                // The portal wants X11 window ID numbers in hex.
                 SDL_snprintf(handle_str, len, "%s%" SDL_PRIx64, X11_HANDLE_PREFIX, xid);
                 SDL_snprintf(handle_str, len, "%s%" SDL_PRIx64, X11_HANDLE_PREFIX, xid);
             }
             }
         }
         }
@@ -448,7 +448,7 @@ int SDL_Portal_detect(void)
     DBusMessageIter reply_iter;
     DBusMessageIter reply_iter;
     static int portal_present = -1;
     static int portal_present = -1;
 
 
-    /* No need for this if the result is cached. */
+    // No need for this if the result is cached.
     if (portal_present != -1) {
     if (portal_present != -1) {
         return portal_present;
         return portal_present;
     }
     }
@@ -460,7 +460,7 @@ int SDL_Portal_detect(void)
         return 0;
         return 0;
     }
     }
 
 
-    /* Use introspection to get the available services. */
+    // Use introspection to get the available services.
     msg = dbus->message_new_method_call(PORTAL_DESTINATION, PORTAL_PATH, "org.freedesktop.DBus.Introspectable", "Introspect");
     msg = dbus->message_new_method_call(PORTAL_DESTINATION, PORTAL_PATH, "org.freedesktop.DBus.Introspectable", "Introspect");
     if (!msg) {
     if (!msg) {
         goto done;
         goto done;
@@ -485,7 +485,7 @@ int SDL_Portal_detect(void)
      */
      */
     dbus->message_iter_get_basic(&reply_iter, &reply_str);
     dbus->message_iter_get_basic(&reply_iter, &reply_str);
     if (SDL_strstr(reply_str, PORTAL_INTERFACE)) {
     if (SDL_strstr(reply_str, PORTAL_INTERFACE)) {
-        portal_present = 1; /* Found it! */
+        portal_present = 1; // Found it!
     }
     }
 
 
 done:
 done:
@@ -498,7 +498,7 @@ done:
 
 
 #else
 #else
 
 
-/* Dummy implementation to avoid compilation problems */
+// Dummy implementation to avoid compilation problems
 
 
 void SDL_Portal_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location, SDL_bool allow_many)
 void SDL_Portal_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location, SDL_bool allow_many)
 {
 {
@@ -523,4 +523,4 @@ int SDL_Portal_detect(void)
     return 0;
     return 0;
 }
 }
 
 
-#endif /* SDL_USE_LIBDBUS */
+#endif // SDL_USE_LIBDBUS

+ 7 - 7
src/dialog/unix/SDL_unixdialog.c

@@ -44,7 +44,7 @@ static void set_callback(void)
     }
     }
 }
 }
 
 
-/* Returns non-zero on success, 0 on failure */
+// Returns non-zero on success, 0 on failure
 static int detect_available_methods(const char *value)
 static int detect_available_methods(const char *value)
 {
 {
     const char *driver = value ? value : SDL_GetHint(SDL_HINT_FILE_DIALOG_DRIVER);
     const char *driver = value ? value : SDL_GetHint(SDL_HINT_FILE_DIALOG_DRIVER);
@@ -75,9 +75,9 @@ static int detect_available_methods(const char *value)
 
 
 void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location, SDL_bool allow_many)
 void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location, SDL_bool allow_many)
 {
 {
-    /* Call detect_available_methods() again each time in case the situation changed */
+    // Call detect_available_methods() again each time in case the situation changed
     if (!detected_open && !detect_available_methods(NULL)) {
     if (!detected_open && !detect_available_methods(NULL)) {
-        /* SetError() done by detect_available_methods() */
+        // SetError() done by detect_available_methods()
         callback(userdata, NULL, -1);
         callback(userdata, NULL, -1);
         return;
         return;
     }
     }
@@ -87,9 +87,9 @@ void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL
 
 
 void SDL_ShowSaveFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location)
 void SDL_ShowSaveFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location)
 {
 {
-    /* Call detect_available_methods() again each time in case the situation changed */
+    // Call detect_available_methods() again each time in case the situation changed
     if (!detected_save && !detect_available_methods(NULL)) {
     if (!detected_save && !detect_available_methods(NULL)) {
-        /* SetError() done by detect_available_methods() */
+        // SetError() done by detect_available_methods()
         callback(userdata, NULL, -1);
         callback(userdata, NULL, -1);
         return;
         return;
     }
     }
@@ -99,9 +99,9 @@ void SDL_ShowSaveFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL
 
 
 void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const char* default_location, SDL_bool allow_many)
 void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const char* default_location, SDL_bool allow_many)
 {
 {
-    /* Call detect_available_methods() again each time in case the situation changed */
+    // Call detect_available_methods() again each time in case the situation changed
     if (!detected_folder && !detect_available_methods(NULL)) {
     if (!detected_folder && !detect_available_methods(NULL)) {
-        /* SetError() done by detect_available_methods() */
+        // SetError() done by detect_available_methods()
         callback(userdata, NULL, -1);
         callback(userdata, NULL, -1);
         return;
         return;
     }
     }

+ 9 - 9
src/dialog/unix/SDL_zenitydialog.c

@@ -73,7 +73,7 @@ char *zenity_clean_name(const char *name)
        there aren't others. TODO: find something better. */
        there aren't others. TODO: find something better. */
     for (char *c = newname; *c; c++) {
     for (char *c = newname; *c; c++) {
         if (*c == '|') {
         if (*c == '|') {
-            /* Zenity doesn't support escaping with \ */
+            // Zenity doesn't support escaping with '\'
             *c = '/';
             *c = '/';
         }
         }
     }
     }
@@ -93,7 +93,7 @@ static char** generate_args(const zenityArgs* info)
     int nextarg = 0;
     int nextarg = 0;
     char **argv = NULL;
     char **argv = NULL;
 
 
-    /* ARGC PASS */
+    // ARGC PASS
     if (info->flags & ZENITY_MULTIPLE) {
     if (info->flags & ZENITY_MULTIPLE) {
         argc++;
         argc++;
     }
     }
@@ -128,7 +128,7 @@ static char** generate_args(const zenityArgs* info)
     argv[nextarg++] = SDL_strdup("--separator=\n");
     argv[nextarg++] = SDL_strdup("--separator=\n");
     CHECK_OOM()
     CHECK_OOM()
 
 
-    /* ARGV PASS */
+    // ARGV PASS
     if (info->flags & ZENITY_MULTIPLE) {
     if (info->flags & ZENITY_MULTIPLE) {
         argv[nextarg++] = SDL_strdup("--multiple");
         argv[nextarg++] = SDL_strdup("--multiple");
         CHECK_OOM()
         CHECK_OOM()
@@ -185,7 +185,7 @@ void free_args(char **argv)
     SDL_free(argv);
     SDL_free(argv);
 }
 }
 
 
-/* TODO: Zenity survives termination of the parent */
+// TODO: Zenity survives termination of the parent
 
 
 static void run_zenity(zenityArgs* arg_struct)
 static void run_zenity(zenityArgs* arg_struct)
 {
 {
@@ -207,7 +207,7 @@ static void run_zenity(zenityArgs* arg_struct)
     char **args = generate_args(arg_struct);
     char **args = generate_args(arg_struct);
 
 
     if (!args) {
     if (!args) {
-        /* SDL_SetError will have been called already */
+        // SDL_SetError will have been called already
         callback(userdata, NULL, -1);
         callback(userdata, NULL, -1);
         return;
         return;
     }
     }
@@ -223,7 +223,7 @@ static void run_zenity(zenityArgs* arg_struct)
         return;
         return;
     } else if (process == 0){
     } else if (process == 0){
         dup2(out[1], STDOUT_FILENO);
         dup2(out[1], STDOUT_FILENO);
-        close(STDERR_FILENO); /* Hide errors from Zenity to stderr */
+        close(STDERR_FILENO); // Hide errors from Zenity to stderr
         close(out[0]);
         close(out[0]);
         close(out[1]);
         close(out[1]);
 
 
@@ -286,7 +286,7 @@ static void run_zenity(zenityArgs* arg_struct)
         for (int i = 0; i < bytes_read; i++) {
         for (int i = 0; i < bytes_read; i++) {
             if (container[i] == '\n') {
             if (container[i] == '\n') {
                 container[i] = '\0';
                 container[i] = '\0';
-                /* Reading from a process often leaves a trailing \n, so ignore the last one */
+                // Reading from a process often leaves a trailing \n, so ignore the last one
                 if (i < bytes_read - 1) {
                 if (i < bytes_read - 1) {
                     array[narray] = container + i + 1;
                     array[narray] = container + i + 1;
                     narray++;
                     narray++;
@@ -303,7 +303,7 @@ static void run_zenity(zenityArgs* arg_struct)
             }
             }
         }
         }
 
 
-        /* 0 = the user chose one or more files, 1 = the user canceled the dialog */
+        // 0 = the user chose one or more files, 1 = the user canceled the dialog
         if (status == 0 || status == 1) {
         if (status == 0 || status == 1) {
             callback(userdata, (const char * const*) array, -1);
             callback(userdata, (const char * const*) array, -1);
         } else {
         } else {
@@ -418,7 +418,7 @@ int SDL_Zenity_detect(void)
         SDL_SetError("Could not fork process: %s", strerror(errno));
         SDL_SetError("Could not fork process: %s", strerror(errno));
         return 0;
         return 0;
     } else if (process == 0){
     } else if (process == 0){
-        /* Disable output */
+        // Disable output
         close(STDERR_FILENO);
         close(STDERR_FILENO);
         close(STDOUT_FILENO);
         close(STDOUT_FILENO);
         execl("/usr/bin/env", "/usr/bin/env", "zenity", "--version", NULL);
         execl("/usr/bin/env", "/usr/bin/env", "zenity", "--version", NULL);

+ 12 - 12
src/dialog/windows/SDL_windowsdialog.c

@@ -27,7 +27,7 @@
 #include "../../core/windows/SDL_windows.h"
 #include "../../core/windows/SDL_windows.h"
 #include "../../thread/SDL_systhread.h"
 #include "../../thread/SDL_systhread.h"
 
 
-/* If this number is too small, selecting too many files will give an error */
+// If this number is too small, selecting too many files will give an error
 #define SELECTLIST_SIZE 65536
 #define SELECTLIST_SIZE 65536
 
 
 typedef struct
 typedef struct
@@ -56,7 +56,7 @@ int getFilterIndex(int as_reported_by_windows)
     return as_reported_by_windows - 1;
     return as_reported_by_windows - 1;
 }
 }
 
 
-/* TODO: The new version of file dialogs */
+// TODO: The new version of file dialogs
 void windows_ShowFileDialog(void *ptr)
 void windows_ShowFileDialog(void *ptr)
 {
 {
     winArgs *args = (winArgs *) ptr;
     winArgs *args = (winArgs *) ptr;
@@ -104,14 +104,14 @@ void windows_ShowFileDialog(void *ptr)
         window = (HWND) SDL_GetPointerProperty(SDL_GetWindowProperties(parent), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL);
         window = (HWND) SDL_GetPointerProperty(SDL_GetWindowProperties(parent), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL);
     }
     }
 
 
-    wchar_t *filebuffer; /* lpstrFile */
-    wchar_t initfolder[MAX_PATH] = L""; /* lpstrInitialDir */
+    wchar_t *filebuffer; // lpstrFile
+    wchar_t initfolder[MAX_PATH] = L""; // lpstrInitialDir
 
 
     /* If SELECTLIST_SIZE is too large, putting filebuffer on the stack might
     /* If SELECTLIST_SIZE is too large, putting filebuffer on the stack might
        cause an overflow */
        cause an overflow */
     filebuffer = (wchar_t *) SDL_malloc(SELECTLIST_SIZE * sizeof(wchar_t));
     filebuffer = (wchar_t *) SDL_malloc(SELECTLIST_SIZE * sizeof(wchar_t));
 
 
-    /* Necessary for the return code below */
+    // Necessary for the return code below
     SDL_memset(filebuffer, 0, SELECTLIST_SIZE * sizeof(wchar_t));
     SDL_memset(filebuffer, 0, SELECTLIST_SIZE * sizeof(wchar_t));
 
 
     if (default_file) {
     if (default_file) {
@@ -151,8 +151,8 @@ void windows_ShowFileDialog(void *ptr)
     wchar_t *filter_wchar = NULL;
     wchar_t *filter_wchar = NULL;
 
 
     if (filters) {
     if (filters) {
-        /* '\x01' is used in place of a null byte */
-        /* suffix needs two null bytes in case the filter list is empty */
+        // '\x01' is used in place of a null byte
+        // suffix needs two null bytes in case the filter list is empty
         char *filterlist = convert_filters(filters, nfilters, NULL, "", "",
         char *filterlist = convert_filters(filters, nfilters, NULL, "", "",
                                            "\x01\x01", "", "\x01", "\x01",
                                            "\x01\x01", "", "\x01", "\x01",
                                            "*.", ";*.", "");
                                            "*.", ";*.", "");
@@ -206,7 +206,7 @@ void windows_ShowFileDialog(void *ptr)
     dialog.lCustData = 0;
     dialog.lCustData = 0;
     dialog.lpfnHook = NULL;
     dialog.lpfnHook = NULL;
     dialog.lpTemplateName = NULL;
     dialog.lpTemplateName = NULL;
-    /* Skipped many mac-exclusive and reserved members */
+    // Skipped many mac-exclusive and reserved members
     dialog.FlagsEx = 0;
     dialog.FlagsEx = 0;
 
 
     BOOL result = pGetAnyFileName(&dialog);
     BOOL result = pGetAnyFileName(&dialog);
@@ -215,7 +215,7 @@ void windows_ShowFileDialog(void *ptr)
 
 
     if (result) {
     if (result) {
         if (!(flags & OFN_ALLOWMULTISELECT)) {
         if (!(flags & OFN_ALLOWMULTISELECT)) {
-            /* File is a C string stored in dialog.lpstrFile */
+            // File is a C string stored in dialog.lpstrFile
             char *chosen_file = WIN_StringToUTF8W(dialog.lpstrFile);
             char *chosen_file = WIN_StringToUTF8W(dialog.lpstrFile);
             const char* opts[2] = { chosen_file, NULL };
             const char* opts[2] = { chosen_file, NULL };
             callback(userdata, opts, getFilterIndex(dialog.nFilterIndex));
             callback(userdata, opts, getFilterIndex(dialog.nFilterIndex));
@@ -306,7 +306,7 @@ void windows_ShowFileDialog(void *ptr)
                 }
                 }
             }
             }
 
 
-            /* If the user chose only one file, it's all just one string */
+            // If the user chose only one file, it's all just one string
             if (nfiles == 0) {
             if (nfiles == 0) {
                 nfiles++;
                 nfiles++;
                 char **new_cfl = (char **) SDL_realloc(chosen_files_list, sizeof(char*) * (nfiles + 1));
                 char **new_cfl = (char **) SDL_realloc(chosen_files_list, sizeof(char*) * (nfiles + 1));
@@ -340,7 +340,7 @@ void windows_ShowFileDialog(void *ptr)
         }
         }
     } else {
     } else {
         DWORD error = pCommDlgExtendedError();
         DWORD error = pCommDlgExtendedError();
-        /* Error code 0 means the user clicked the cancel button. */
+        // Error code 0 means the user clicked the cancel button.
         if (error == 0) {
         if (error == 0) {
             /* Unlike SDL's handling of errors, Windows does reset the error
             /* Unlike SDL's handling of errors, Windows does reset the error
                code to 0 after calling GetOpenFileName if another Windows
                code to 0 after calling GetOpenFileName if another Windows
@@ -399,7 +399,7 @@ void windows_ShowFolderDialog(void* ptr)
     BROWSEINFOW dialog;
     BROWSEINFOW dialog;
     dialog.hwndOwner = parent;
     dialog.hwndOwner = parent;
     dialog.pidlRoot = NULL;
     dialog.pidlRoot = NULL;
-    /* Windows docs say this is `LPTSTR` - apparently it's actually `LPWSTR`*/
+    // Windows docs say this is `LPTSTR` - apparently it's actually `LPWSTR`
     dialog.pszDisplayName = buffer;
     dialog.pszDisplayName = buffer;
     dialog.lpszTitle = NULL;
     dialog.lpszTitle = NULL;
     dialog.ulFlags = BIF_USENEWUI;
     dialog.ulFlags = BIF_USENEWUI;

+ 35 - 35
src/dynapi/SDL_dynapi.c

@@ -35,11 +35,11 @@
 #endif
 #endif
 
 
 #include <SDL3/SDL.h>
 #include <SDL3/SDL.h>
-#define SDL_MAIN_NOIMPL /* don't drag in header-only implementation of SDL_main */
+#define SDL_MAIN_NOIMPL // don't drag in header-only implementation of SDL_main
 #include <SDL3/SDL_main.h>
 #include <SDL3/SDL_main.h>
 
 
 
 
-/* These headers have system specific definitions, so aren't included above */
+// These headers have system specific definitions, so aren't included above
 #include <SDL3/SDL_vulkan.h>
 #include <SDL3/SDL_vulkan.h>
 
 
 /* This is the version of the dynamic API. This doesn't match the SDL version
 /* This is the version of the dynamic API. This doesn't match the SDL version
@@ -62,9 +62,9 @@ static void SDL_InitDynamicAPI(void);
 /* BE CAREFUL CALLING ANY SDL CODE IN HERE, IT WILL BLOW UP.
 /* BE CAREFUL CALLING ANY SDL CODE IN HERE, IT WILL BLOW UP.
    Even self-contained stuff might call SDL_SetError() and break everything. */
    Even self-contained stuff might call SDL_SetError() and break everything. */
 
 
-/* behold, the macro salsa! */
+// behold, the macro salsa!
 
 
-/* Can't use the macro for varargs nonsense. This is atrocious. */
+// Can't use the macro for varargs nonsense. This is atrocious.
 #define SDL_DYNAPI_VARARGS_LOGFN(_static, name, initcall, logname, prio)                                     \
 #define SDL_DYNAPI_VARARGS_LOGFN(_static, name, initcall, logname, prio)                                     \
     _static void SDLCALL SDL_Log##logname##name(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) \
     _static void SDLCALL SDL_Log##logname##name(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) \
     {                                                                                                        \
     {                                                                                                        \
@@ -175,9 +175,9 @@ static void SDL_InitDynamicAPI(void);
     SDL_DYNAPI_VARARGS_LOGFN(_static, name, initcall, Error, ERROR)                                                                       \
     SDL_DYNAPI_VARARGS_LOGFN(_static, name, initcall, Error, ERROR)                                                                       \
     SDL_DYNAPI_VARARGS_LOGFN(_static, name, initcall, Critical, CRITICAL)
     SDL_DYNAPI_VARARGS_LOGFN(_static, name, initcall, Critical, CRITICAL)
 
 
-/* Typedefs for function pointers for jump table, and predeclare funcs */
-/* The DEFAULT funcs will init jump table and then call real function. */
-/* The REAL funcs are the actual functions, name-mangled to not clash. */
+// Typedefs for function pointers for jump table, and predeclare funcs
+// The DEFAULT funcs will init jump table and then call real function.
+// The REAL funcs are the actual functions, name-mangled to not clash.
 #define SDL_DYNAPI_PROC(rc, fn, params, args, ret) \
 #define SDL_DYNAPI_PROC(rc, fn, params, args, ret) \
     typedef rc (SDLCALL *SDL_DYNAPIFN_##fn) params;\
     typedef rc (SDLCALL *SDL_DYNAPIFN_##fn) params;\
     static rc SDLCALL fn##_DEFAULT params;         \
     static rc SDLCALL fn##_DEFAULT params;         \
@@ -185,7 +185,7 @@ static void SDL_InitDynamicAPI(void);
 #include "SDL_dynapi_procs.h"
 #include "SDL_dynapi_procs.h"
 #undef SDL_DYNAPI_PROC
 #undef SDL_DYNAPI_PROC
 
 
-/* The jump table! */
+// The jump table!
 typedef struct
 typedef struct
 {
 {
 #define SDL_DYNAPI_PROC(rc, fn, params, args, ret) SDL_DYNAPIFN_##fn fn;
 #define SDL_DYNAPI_PROC(rc, fn, params, args, ret) SDL_DYNAPIFN_##fn fn;
@@ -193,19 +193,19 @@ typedef struct
 #undef SDL_DYNAPI_PROC
 #undef SDL_DYNAPI_PROC
 } SDL_DYNAPI_jump_table;
 } SDL_DYNAPI_jump_table;
 
 
-/* Predeclare the default functions for initializing the jump table. */
+// Predeclare the default functions for initializing the jump table.
 #define SDL_DYNAPI_PROC(rc, fn, params, args, ret) static rc SDLCALL fn##_DEFAULT params;
 #define SDL_DYNAPI_PROC(rc, fn, params, args, ret) static rc SDLCALL fn##_DEFAULT params;
 #include "SDL_dynapi_procs.h"
 #include "SDL_dynapi_procs.h"
 #undef SDL_DYNAPI_PROC
 #undef SDL_DYNAPI_PROC
 
 
-/* The actual jump table. */
+// The actual jump table.
 static SDL_DYNAPI_jump_table jump_table = {
 static SDL_DYNAPI_jump_table jump_table = {
 #define SDL_DYNAPI_PROC(rc, fn, params, args, ret) fn##_DEFAULT,
 #define SDL_DYNAPI_PROC(rc, fn, params, args, ret) fn##_DEFAULT,
 #include "SDL_dynapi_procs.h"
 #include "SDL_dynapi_procs.h"
 #undef SDL_DYNAPI_PROC
 #undef SDL_DYNAPI_PROC
 };
 };
 
 
-/* Default functions init the function table then call right thing. */
+// Default functions init the function table then call right thing.
 #define SDL_DYNAPI_PROC(rc, fn, params, args, ret) \
 #define SDL_DYNAPI_PROC(rc, fn, params, args, ret) \
     static rc SDLCALL fn##_DEFAULT params          \
     static rc SDLCALL fn##_DEFAULT params          \
     {                                              \
     {                                              \
@@ -218,7 +218,7 @@ static SDL_DYNAPI_jump_table jump_table = {
 #undef SDL_DYNAPI_PROC_NO_VARARGS
 #undef SDL_DYNAPI_PROC_NO_VARARGS
 SDL_DYNAPI_VARARGS(static, _DEFAULT, SDL_InitDynamicAPI())
 SDL_DYNAPI_VARARGS(static, _DEFAULT, SDL_InitDynamicAPI())
 
 
-/* Public API functions to jump into the jump table. */
+// Public API functions to jump into the jump table.
 #define SDL_DYNAPI_PROC(rc, fn, params, args, ret) \
 #define SDL_DYNAPI_PROC(rc, fn, params, args, ret) \
     rc SDLCALL fn params                           \
     rc SDLCALL fn params                           \
     {                                              \
     {                                              \
@@ -234,7 +234,7 @@ SDL_DYNAPI_VARARGS(, , )
 #if ENABLE_SDL_CALL_LOGGING
 #if ENABLE_SDL_CALL_LOGGING
 static int SDLCALL SDL_SetError_LOGSDLCALLS(SDL_PRINTF_FORMAT_STRING const char *fmt, ...)
 static int SDLCALL SDL_SetError_LOGSDLCALLS(SDL_PRINTF_FORMAT_STRING const char *fmt, ...)
 {
 {
-    char buf[512]; /* !!! FIXME: dynamic allocation */
+    char buf[512]; // !!! FIXME: dynamic allocation
     va_list ap;
     va_list ap;
     SDL_Log_REAL("SDL3CALL SDL_SetError");
     SDL_Log_REAL("SDL3CALL SDL_SetError");
     va_start(ap, fmt);
     va_start(ap, fmt);
@@ -342,13 +342,13 @@ static Sint32 initialize_jumptable(Uint32 apiver, void *table, Uint32 tablesize)
     SDL_DYNAPI_jump_table *output_jump_table = (SDL_DYNAPI_jump_table *)table;
     SDL_DYNAPI_jump_table *output_jump_table = (SDL_DYNAPI_jump_table *)table;
 
 
     if (apiver != SDL_DYNAPI_VERSION) {
     if (apiver != SDL_DYNAPI_VERSION) {
-        /* !!! FIXME: can maybe handle older versions? */
-        return -1; /* not compatible. */
+        // !!! FIXME: can maybe handle older versions?
+        return -1; // not compatible.
     } else if (tablesize > sizeof(jump_table)) {
     } else if (tablesize > sizeof(jump_table)) {
-        return -1; /* newer version of SDL with functions we can't provide. */
+        return -1; // newer version of SDL with functions we can't provide.
     }
     }
 
 
-/* Init our jump table first. */
+// Init our jump table first.
 #if ENABLE_SDL_CALL_LOGGING
 #if ENABLE_SDL_CALL_LOGGING
     {
     {
         const char *env = SDL_getenv_REAL("SDL_DYNAPI_LOG_CALLS");
         const char *env = SDL_getenv_REAL("SDL_DYNAPI_LOG_CALLS");
@@ -369,18 +369,18 @@ static Sint32 initialize_jumptable(Uint32 apiver, void *table, Uint32 tablesize)
 #undef SDL_DYNAPI_PROC
 #undef SDL_DYNAPI_PROC
 #endif
 #endif
 
 
-    /* Then the external table... */
+    // Then the external table...
     if (output_jump_table != &jump_table) {
     if (output_jump_table != &jump_table) {
         jump_table.SDL_memcpy(output_jump_table, &jump_table, tablesize);
         jump_table.SDL_memcpy(output_jump_table, &jump_table, tablesize);
     }
     }
 
 
-    /* Safe to call SDL functions now; jump table is initialized! */
+    // Safe to call SDL functions now; jump table is initialized!
 
 
-    return 0; /* success! */
+    return 0; // success!
 }
 }
 
 
-/* Here's the exported entry point that fills in the jump table. */
-/*  Use specific types when an "int" might suffice to keep this sane. */
+// Here's the exported entry point that fills in the jump table.
+// Use specific types when an "int" might suffice to keep this sane.
 typedef Sint32 (SDLCALL *SDL_DYNAPI_ENTRYFN)(Uint32 apiver, void *table, Uint32 tablesize);
 typedef Sint32 (SDLCALL *SDL_DYNAPI_ENTRYFN)(Uint32 apiver, void *table, Uint32 tablesize);
 extern SDL_DECLSPEC Sint32 SDLCALL SDL_DYNAPI_entry(Uint32, void *, Uint32);
 extern SDL_DECLSPEC Sint32 SDLCALL SDL_DYNAPI_entry(Uint32, void *, Uint32);
 
 
@@ -393,8 +393,8 @@ Sint32 SDL_DYNAPI_entry(Uint32 apiver, void *table, Uint32 tablesize)
 }
 }
 #endif
 #endif
 
 
-/* Obviously we can't use SDL_LoadObject() to load SDL.  :)  */
-/* Also obviously, we never close the loaded library. */
+// Obviously we can't use SDL_LoadObject() to load SDL.  :)
+// Also obviously, we never close the loaded library.
 #if defined(WIN32) || defined(_WIN32) || defined(SDL_PLATFORM_CYGWIN)
 #if defined(WIN32) || defined(_WIN32) || defined(SDL_PLATFORM_CYGWIN)
 #ifndef WIN32_LEAN_AND_MEAN
 #ifndef WIN32_LEAN_AND_MEAN
 #define WIN32_LEAN_AND_MEAN 1
 #define WIN32_LEAN_AND_MEAN 1
@@ -436,7 +436,7 @@ static void dynapi_warn(const char *msg)
 {
 {
     const char *caption = "SDL Dynamic API Failure!";
     const char *caption = "SDL Dynamic API Failure!";
     (void)caption;
     (void)caption;
-/* SDL_ShowSimpleMessageBox() is a too heavy for here. */
+// SDL_ShowSimpleMessageBox() is a too heavy for here.
 #if (defined(WIN32) || defined(_WIN32) || defined(SDL_PLATFORM_CYGWIN)) && !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)
 #if (defined(WIN32) || defined(_WIN32) || defined(SDL_PLATFORM_CYGWIN)) && !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)
     MessageBoxA(NULL, msg, caption, MB_OK | MB_ICONERROR);
     MessageBoxA(NULL, msg, caption, MB_OK | MB_ICONERROR);
 #elif defined(HAVE_STDIO_H)
 #elif defined(HAVE_STDIO_H)
@@ -462,7 +462,7 @@ extern SDL_NORETURN void SDL_ExitProcess(int exitcode);
 static void SDL_InitDynamicAPILocked(void)
 static void SDL_InitDynamicAPILocked(void)
 {
 {
     const char *libname = SDL_getenv_REAL(SDL_DYNAMIC_API_ENVVAR);
     const char *libname = SDL_getenv_REAL(SDL_DYNAMIC_API_ENVVAR);
-    SDL_DYNAPI_ENTRYFN entry = NULL; /* funcs from here by default. */
+    SDL_DYNAPI_ENTRYFN entry = NULL; // funcs from here by default.
     SDL_bool use_internal = SDL_TRUE;
     SDL_bool use_internal = SDL_TRUE;
 
 
     if (libname) {
     if (libname) {
@@ -484,29 +484,29 @@ static void SDL_InitDynamicAPILocked(void)
         }
         }
         if (!entry) {
         if (!entry) {
             dynapi_warn("Couldn't load an overriding SDL library. Please fix or remove the " SDL_DYNAMIC_API_ENVVAR " environment variable. Using the default SDL.");
             dynapi_warn("Couldn't load an overriding SDL library. Please fix or remove the " SDL_DYNAMIC_API_ENVVAR " environment variable. Using the default SDL.");
-            /* Just fill in the function pointers from this library, later. */
+            // Just fill in the function pointers from this library, later.
         }
         }
     }
     }
 
 
     if (entry) {
     if (entry) {
         if (entry(SDL_DYNAPI_VERSION, &jump_table, sizeof(jump_table)) < 0) {
         if (entry(SDL_DYNAPI_VERSION, &jump_table, sizeof(jump_table)) < 0) {
             dynapi_warn("Couldn't override SDL library. Using a newer SDL build might help. Please fix or remove the " SDL_DYNAMIC_API_ENVVAR " environment variable. Using the default SDL.");
             dynapi_warn("Couldn't override SDL library. Using a newer SDL build might help. Please fix or remove the " SDL_DYNAMIC_API_ENVVAR " environment variable. Using the default SDL.");
-            /* Just fill in the function pointers from this library, later. */
+            // Just fill in the function pointers from this library, later.
         } else {
         } else {
-            use_internal = SDL_FALSE; /* We overrode SDL! Don't use the internal version! */
+            use_internal = SDL_FALSE; // We overrode SDL! Don't use the internal version!
         }
         }
     }
     }
 
 
-    /* Just fill in the function pointers from this library. */
+    // Just fill in the function pointers from this library.
     if (use_internal) {
     if (use_internal) {
         if (initialize_jumptable(SDL_DYNAPI_VERSION, &jump_table, sizeof(jump_table)) < 0) {
         if (initialize_jumptable(SDL_DYNAPI_VERSION, &jump_table, sizeof(jump_table)) < 0) {
-            /* Now we're screwed. Should definitely abort now. */
+            // Now we're screwed. Should definitely abort now.
             dynapi_warn("Failed to initialize internal SDL dynapi. As this would otherwise crash, we have to abort now.");
             dynapi_warn("Failed to initialize internal SDL dynapi. As this would otherwise crash, we have to abort now.");
             SDL_ExitProcess(86);
             SDL_ExitProcess(86);
         }
         }
     }
     }
 
 
-    /* we intentionally never close the newly-loaded lib, of course. */
+    // we intentionally never close the newly-loaded lib, of course.
 }
 }
 
 
 static void SDL_InitDynamicAPI(void)
 static void SDL_InitDynamicAPI(void)
@@ -535,7 +535,7 @@ static void SDL_InitDynamicAPI(void)
     SDL_UnlockSpinlock_REAL(&lock);
     SDL_UnlockSpinlock_REAL(&lock);
 }
 }
 
 
-#else /* SDL_DYNAMIC_API */
+#else // SDL_DYNAMIC_API
 
 
 #include <SDL3/SDL.h>
 #include <SDL3/SDL.h>
 
 
@@ -545,7 +545,7 @@ Sint32 SDL_DYNAPI_entry(Uint32 apiver, void *table, Uint32 tablesize)
     (void)apiver;
     (void)apiver;
     (void)table;
     (void)table;
     (void)tablesize;
     (void)tablesize;
-    return -1; /* not compatible. */
+    return -1; // not compatible.
 }
 }
 
 
-#endif /* SDL_DYNAMIC_API */
+#endif // SDL_DYNAMIC_API

+ 12 - 12
src/dynapi/SDL_dynapi.h

@@ -35,7 +35,7 @@
    updated SDL can transparently take advantage of them, but your program will
    updated SDL can transparently take advantage of them, but your program will
    not without this feature. Think hard before turning it off.
    not without this feature. Think hard before turning it off.
 */
 */
-#ifdef SDL_DYNAMIC_API /* Tried to force it on the command line? */
+#ifdef SDL_DYNAMIC_API // Tried to force it on the command line?
 #error Nope, you have to edit this file to force this off.
 #error Nope, you have to edit this file to force this off.
 #endif
 #endif
 
 
@@ -43,33 +43,33 @@
 #include "TargetConditionals.h"
 #include "TargetConditionals.h"
 #endif
 #endif
 
 
-#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE /* probably not useful on iOS. */
+#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE // probably not useful on iOS.
 #define SDL_DYNAMIC_API 0
 #define SDL_DYNAMIC_API 0
-#elif defined(SDL_PLATFORM_ANDROID) /* probably not useful on Android. */
+#elif defined(SDL_PLATFORM_ANDROID) // probably not useful on Android.
 #define SDL_DYNAMIC_API 0
 #define SDL_DYNAMIC_API 0
-#elif defined(SDL_PLATFORM_EMSCRIPTEN) /* probably not useful on Emscripten. */
+#elif defined(SDL_PLATFORM_EMSCRIPTEN) // probably not useful on Emscripten.
 #define SDL_DYNAMIC_API 0
 #define SDL_DYNAMIC_API 0
-#elif defined(SDL_BUILDING_WINRT) && SDL_BUILDING_WINRT /* probably not useful on WinRT, given current .dll loading restrictions */
+#elif defined(SDL_BUILDING_WINRT) && SDL_BUILDING_WINRT // probably not useful on WinRT, given current .dll loading restrictions
 #define SDL_DYNAMIC_API 0
 #define SDL_DYNAMIC_API 0
 #elif defined(SDL_PLATFORM_PS2) && SDL_PLATFORM_PS2
 #elif defined(SDL_PLATFORM_PS2) && SDL_PLATFORM_PS2
 #define SDL_DYNAMIC_API 0
 #define SDL_DYNAMIC_API 0
 #elif defined(SDL_PLATFORM_PSP) && SDL_PLATFORM_PSP
 #elif defined(SDL_PLATFORM_PSP) && SDL_PLATFORM_PSP
 #define SDL_DYNAMIC_API 0
 #define SDL_DYNAMIC_API 0
-#elif defined(SDL_PLATFORM_RISCOS) /* probably not useful on RISC OS, since dlopen() can't be used when using static linking. */
+#elif defined(SDL_PLATFORM_RISCOS) // probably not useful on RISC OS, since dlopen() can't be used when using static linking.
 #define SDL_DYNAMIC_API 0
 #define SDL_DYNAMIC_API 0
 #elif defined(__clang_analyzer__) || defined(__INTELLISENSE__) || defined(SDL_THREAD_SAFETY_ANALYSIS)
 #elif defined(__clang_analyzer__) || defined(__INTELLISENSE__) || defined(SDL_THREAD_SAFETY_ANALYSIS)
-#define SDL_DYNAMIC_API 0 /* Turn off for static analysis, so reports are more clear. */
+#define SDL_DYNAMIC_API 0 // Turn off for static analysis, so reports are more clear.
 #elif defined(SDL_PLATFORM_VITA)
 #elif defined(SDL_PLATFORM_VITA)
-#define SDL_DYNAMIC_API 0 /* vitasdk doesn't support dynamic linking */
+#define SDL_DYNAMIC_API 0 // vitasdk doesn't support dynamic linking
 #elif defined(SDL_PLATFORM_NGAGE)
 #elif defined(SDL_PLATFORM_NGAGE)
-#define SDL_DYNAMIC_API 0 /* The N-Gage doesn't support dynamic linking either */
+#define SDL_DYNAMIC_API 0 // The N-Gage doesn't support dynamic linking either
 #elif defined(SDL_PLATFORM_3DS)
 #elif defined(SDL_PLATFORM_3DS)
-#define SDL_DYNAMIC_API 0 /* devkitARM doesn't support dynamic linking */
+#define SDL_DYNAMIC_API 0 // devkitARM doesn't support dynamic linking
 #elif defined(DYNAPI_NEEDS_DLOPEN) && !defined(HAVE_DLOPEN)
 #elif defined(DYNAPI_NEEDS_DLOPEN) && !defined(HAVE_DLOPEN)
-#define SDL_DYNAMIC_API 0 /* we need dlopen(), but don't have it.... */
+#define SDL_DYNAMIC_API 0 // we need dlopen(), but don't have it....
 #endif
 #endif
 
 
-/* everyone else. This is where we turn on the API if nothing forced it off. */
+// everyone else. This is where we turn on the API if nothing forced it off.
 #ifndef SDL_DYNAMIC_API
 #ifndef SDL_DYNAMIC_API
 #define SDL_DYNAMIC_API 1
 #define SDL_DYNAMIC_API 1
 #endif
 #endif

+ 1 - 1
src/dynapi/SDL_dynapi.sym

@@ -987,7 +987,7 @@ SDL3_0.0.0 {
     SDL_powf;
     SDL_powf;
     SDL_qsort;
     SDL_qsort;
     SDL_qsort_r;
     SDL_qsort_r;
-    SDL_rand;  
+    SDL_rand;
     SDL_rand_bits;
     SDL_rand_bits;
     SDL_rand_bits_r;
     SDL_rand_bits_r;
     SDL_rand_r;
     SDL_rand_r;

+ 2 - 2
src/dynapi/SDL_dynapi_overrides.h

@@ -20,13 +20,13 @@
 */
 */
 
 
 
 
-/* DO NOT EDIT THIS FILE BY HAND. It is autogenerated by gendynapi.pl. */
+// DO NOT EDIT THIS FILE BY HAND. It is autogenerated by gendynapi.pl.
 
 
 #if !SDL_DYNAMIC_API
 #if !SDL_DYNAMIC_API
 #error You should not be here.
 #error You should not be here.
 #endif
 #endif
 
 
-/* New API symbols are added at the end */
+// New API symbols are added at the end
 #define SDL_AcquireCameraFrame SDL_AcquireCameraFrame_REAL
 #define SDL_AcquireCameraFrame SDL_AcquireCameraFrame_REAL
 #define SDL_AddEventWatch SDL_AddEventWatch_REAL
 #define SDL_AddEventWatch SDL_AddEventWatch_REAL
 #define SDL_AddGamepadMapping SDL_AddGamepadMapping_REAL
 #define SDL_AddGamepadMapping SDL_AddGamepadMapping_REAL

+ 2 - 2
src/dynapi/SDL_dynapi_procs.h

@@ -28,7 +28,7 @@
    Also, this file gets included multiple times, don't add #pragma once, etc.
    Also, this file gets included multiple times, don't add #pragma once, etc.
 */
 */
 
 
-/* direct jump magic can use these, the rest needs special code. */
+// direct jump magic can use these, the rest needs special code.
 #ifndef SDL_DYNAPI_PROC_NO_VARARGS
 #ifndef SDL_DYNAPI_PROC_NO_VARARGS
 SDL_DYNAPI_PROC(size_t,SDL_IOprintf,(SDL_IOStream *a, SDL_PRINTF_FORMAT_STRING const char *b, ...),(a,b),return)
 SDL_DYNAPI_PROC(size_t,SDL_IOprintf,(SDL_IOStream *a, SDL_PRINTF_FORMAT_STRING const char *b, ...),(a,b),return)
 SDL_DYNAPI_PROC(void,SDL_Log,(SDL_PRINTF_FORMAT_STRING const char *a, ...),(a),)
 SDL_DYNAPI_PROC(void,SDL_Log,(SDL_PRINTF_FORMAT_STRING const char *a, ...),(a),)
@@ -46,7 +46,7 @@ SDL_DYNAPI_PROC(int,SDL_sscanf,(const char *a, SDL_SCANF_FORMAT_STRING const cha
 SDL_DYNAPI_PROC(int,SDL_swprintf,(SDL_OUT_Z_CAP(b) wchar_t *a, size_t b, SDL_PRINTF_FORMAT_STRING const wchar_t *c, ...),(a,b,c),return)
 SDL_DYNAPI_PROC(int,SDL_swprintf,(SDL_OUT_Z_CAP(b) wchar_t *a, size_t b, SDL_PRINTF_FORMAT_STRING const wchar_t *c, ...),(a,b,c),return)
 #endif
 #endif
 
 
-/* New API symbols are added at the end */
+// New API symbols are added at the end
 SDL_DYNAPI_PROC(SDL_Surface*,SDL_AcquireCameraFrame,(SDL_Camera *a, Uint64 *b),(a,b),return)
 SDL_DYNAPI_PROC(SDL_Surface*,SDL_AcquireCameraFrame,(SDL_Camera *a, Uint64 *b),(a,b),return)
 SDL_DYNAPI_PROC(int,SDL_AddEventWatch,(SDL_EventFilter a, void *b),(a,b),return)
 SDL_DYNAPI_PROC(int,SDL_AddEventWatch,(SDL_EventFilter a, void *b),(a,b),return)
 SDL_DYNAPI_PROC(int,SDL_AddGamepadMapping,(const char *a),(a),return)
 SDL_DYNAPI_PROC(int,SDL_AddGamepadMapping,(const char *a),(a),return)

+ 1 - 1
src/dynapi/gendynapi.py

@@ -99,7 +99,7 @@ def main():
             if match:
             if match:
                 continue
                 continue
 
 
-            # Remove one line comment /* ... */
+            # Remove one line comment // ...
             # eg: extern SDL_DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open_path(const char *path, int bExclusive /* = false */);
             # eg: extern SDL_DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open_path(const char *path, int bExclusive /* = false */);
             line = reg_comment_remove_content.sub('', line)
             line = reg_comment_remove_content.sub('', line)
 
 

+ 3 - 3
src/events/SDL_categories.c

@@ -20,7 +20,7 @@
 */
 */
 #include "SDL_internal.h"
 #include "SDL_internal.h"
 
 
-/* SDL event categories */
+// SDL event categories
 
 
 #include "SDL_events_c.h"
 #include "SDL_events_c.h"
 #include "SDL_categories_c.h"
 #include "SDL_categories_c.h"
@@ -233,8 +233,8 @@ SDL_Window *SDL_GetWindowFromEvent(const SDL_Event *event)
         windowID = event->drop.windowID;
         windowID = event->drop.windowID;
         break;
         break;
     default:
     default:
-        /* < 0  -> invalid event type (error is set by SDL_GetEventCategory) */
-        /* else -> event has no associated window (not an error) */
+        // < 0  -> invalid event type (error is set by SDL_GetEventCategory)
+        // else -> event has no associated window (not an error)
         return NULL;
         return NULL;
     }
     }
     return SDL_GetWindowFromID(windowID);
     return SDL_GetWindowFromID(windowID);

+ 1 - 1
src/events/SDL_categories_c.h

@@ -65,4 +65,4 @@ typedef enum SDL_EventCategory
 
 
 extern SDL_EventCategory SDL_GetEventCategory(Uint32 type);
 extern SDL_EventCategory SDL_GetEventCategory(Uint32 type);
 
 
-#endif /* SDL_categories_c_h_ */
+#endif // SDL_categories_c_h_

+ 2 - 2
src/events/SDL_clipboardevents.c

@@ -20,7 +20,7 @@
 */
 */
 #include "SDL_internal.h"
 #include "SDL_internal.h"
 
 
-/* Clipboard event handling code for SDL */
+// Clipboard event handling code for SDL
 
 
 #include "SDL_events_c.h"
 #include "SDL_events_c.h"
 #include "SDL_clipboardevents_c.h"
 #include "SDL_clipboardevents_c.h"
@@ -29,7 +29,7 @@ int SDL_SendClipboardUpdate(void)
 {
 {
     int posted;
     int posted;
 
 
-    /* Post the event, if desired */
+    // Post the event, if desired
     posted = 0;
     posted = 0;
     if (SDL_EventEnabled(SDL_EVENT_CLIPBOARD_UPDATE)) {
     if (SDL_EventEnabled(SDL_EVENT_CLIPBOARD_UPDATE)) {
         SDL_Event event;
         SDL_Event event;

+ 1 - 1
src/events/SDL_clipboardevents_c.h

@@ -25,4 +25,4 @@
 
 
 extern int SDL_SendClipboardUpdate(void);
 extern int SDL_SendClipboardUpdate(void);
 
 
-#endif /* SDL_clipboardevents_c_h_ */
+#endif // SDL_clipboardevents_c_h_

+ 2 - 2
src/events/SDL_displayevents.c

@@ -20,7 +20,7 @@
 */
 */
 #include "SDL_internal.h"
 #include "SDL_internal.h"
 
 
-/* Display event handling code for SDL */
+// Display event handling code for SDL
 
 
 #include "SDL_events_c.h"
 #include "SDL_events_c.h"
 
 
@@ -42,7 +42,7 @@ int SDL_SendDisplayEvent(SDL_VideoDisplay *display, SDL_EventType displayevent,
         break;
         break;
     }
     }
 
 
-    /* Post the event, if desired */
+    // Post the event, if desired
     posted = 0;
     posted = 0;
     if (SDL_EventEnabled(displayevent)) {
     if (SDL_EventEnabled(displayevent)) {
         SDL_Event event;
         SDL_Event event;

+ 1 - 1
src/events/SDL_displayevents_c.h

@@ -25,4 +25,4 @@
 
 
 extern int SDL_SendDisplayEvent(SDL_VideoDisplay *display, SDL_EventType displayevent, int data1, int data2);
 extern int SDL_SendDisplayEvent(SDL_VideoDisplay *display, SDL_EventType displayevent, int data1, int data2);
 
 
-#endif /* SDL_displayevents_c_h_ */
+#endif // SDL_displayevents_c_h_

+ 3 - 3
src/events/SDL_dropevents.c

@@ -20,12 +20,12 @@
 */
 */
 #include "SDL_internal.h"
 #include "SDL_internal.h"
 
 
-/* Drag and drop event handling code for SDL */
+// Drag and drop event handling code for SDL
 
 
 #include "SDL_events_c.h"
 #include "SDL_events_c.h"
 #include "SDL_dropevents_c.h"
 #include "SDL_dropevents_c.h"
 
 
-#include "../video/SDL_sysvideo.h" /* for SDL_Window internals. */
+#include "../video/SDL_sysvideo.h" // for SDL_Window internals.
 
 
 static int SDL_SendDrop(SDL_Window *window, const SDL_EventType evtype, const char *source, const char *data, float x, float y)
 static int SDL_SendDrop(SDL_Window *window, const SDL_EventType evtype, const char *source, const char *data, float x, float y)
 {
 {
@@ -34,7 +34,7 @@ static int SDL_SendDrop(SDL_Window *window, const SDL_EventType evtype, const ch
     static float last_drop_y = 0;
     static float last_drop_y = 0;
     int posted = 0;
     int posted = 0;
 
 
-    /* Post the event, if desired */
+    // Post the event, if desired
     if (SDL_EventEnabled(evtype)) {
     if (SDL_EventEnabled(evtype)) {
         const SDL_bool need_begin = window ? !window->is_dropping : !app_is_dropping;
         const SDL_bool need_begin = window ? !window->is_dropping : !app_is_dropping;
         SDL_Event event;
         SDL_Event event;

Some files were not shown because too many files changed in this diff