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
This commit is contained in:
Sam Lantinga
2024-08-22 10:30:45 -07:00
parent 658fc3db0f
commit 6501e90018
743 changed files with 11882 additions and 11882 deletions

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
/* This file contains portable stdlib functions for SDL */
// This file contains portable stdlib functions for SDL
#include "../libm/math_libm.h"
@@ -122,7 +122,7 @@ double SDL_ceil(double x)
integer += 1.0;
}
return integer;
#endif /* HAVE_CEIL */
#endif // HAVE_CEIL
}
float SDL_ceilf(float x)
@@ -141,14 +141,14 @@ double SDL_copysign(double x, double y)
#elif defined(HAVE__COPYSIGN)
return _copysign(x, y);
#elif defined(__WATCOMC__) && defined(__386__)
/* this is nasty as hell, but it works.. */
// this is nasty as hell, but it works..
unsigned int *xi = (unsigned int *)&x,
*yi = (unsigned int *)&y;
xi[1] = (yi[1] & 0x80000000) | (xi[1] & 0x7fffffff);
return x;
#else
return SDL_uclibc_copysign(x, y);
#endif /* HAVE_COPYSIGN */
#endif // HAVE_COPYSIGN
}
float SDL_copysignf(float x, float y)
@@ -544,13 +544,13 @@ void *SDL_aligned_alloc(size_t alignment, size_t size)
SDL_size_add_overflow(size, padding, &size) == 0) {
void *original = SDL_malloc(size);
if (original) {
/* Make sure we have enough space to store the original pointer */
// Make sure we have enough space to store the original pointer
retval = (Uint8 *)original + sizeof(original);
/* Align the pointer we're going to return */
// Align the pointer we're going to return
retval += alignment - (((size_t)retval) % alignment);
/* Store the original pointer right before the returned value */
// Store the original pointer right before the returned value
SDL_memcpy(retval - sizeof(original), &original, sizeof(original));
}
}