mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-12-21 22:05:31 +00:00
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:
@@ -40,7 +40,7 @@ void *SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len)
|
||||
Uint8 value1;
|
||||
Uint32 value4;
|
||||
|
||||
/* The value used in memset() is a byte, passed as an int */
|
||||
// The value used in memset() is a byte, passed as an int
|
||||
c &= 0xff;
|
||||
|
||||
/* The destination pointer needs to be aligned on a 4-byte boundary to
|
||||
@@ -76,10 +76,10 @@ void *SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len)
|
||||
}
|
||||
|
||||
return dst;
|
||||
#endif /* HAVE_MEMSET */
|
||||
#endif // HAVE_MEMSET
|
||||
}
|
||||
|
||||
/* Note that memset() is a byte assignment and this is a 32-bit assignment, so they're not directly equivalent. */
|
||||
// Note that memset() is a byte assignment and this is a 32-bit assignment, so they're not directly equivalent.
|
||||
void *SDL_memset4(void *dst, Uint32 val, size_t dwords)
|
||||
{
|
||||
#if defined(__APPLE__) && defined(HAVE_STRING_H)
|
||||
@@ -121,7 +121,7 @@ void *SDL_memset4(void *dst, Uint32 val, size_t dwords)
|
||||
/* The optimizer on Visual Studio 2005 and later generates memcpy() and memset() calls.
|
||||
We will provide our own implementation if we're not building with a C runtime. */
|
||||
#ifndef HAVE_LIBC
|
||||
/* NOLINTNEXTLINE(readability-redundant-declaration) */
|
||||
// NOLINTNEXTLINE(readability-redundant-declaration)
|
||||
extern void *memset(void *dst, int c, size_t len);
|
||||
#if defined(_MSC_VER) && !defined(__INTEL_LLVM_COMPILER)
|
||||
#pragma intrinsic(memset)
|
||||
@@ -130,10 +130,10 @@ extern void *memset(void *dst, int c, size_t len);
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
#pragma function(memset)
|
||||
#endif
|
||||
/* NOLINTNEXTLINE(readability-inconsistent-declaration-parameter-name) */
|
||||
// NOLINTNEXTLINE(readability-inconsistent-declaration-parameter-name)
|
||||
void *memset(void *dst, int c, size_t len)
|
||||
{
|
||||
return SDL_memset(dst, c, len);
|
||||
}
|
||||
#endif /* !HAVE_LIBC */
|
||||
#endif // !HAVE_LIBC
|
||||
|
||||
|
||||
Reference in New Issue
Block a user