From dc8479928c5aee4c6ad6fe4f59006fb604cee701 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 18 Sep 2016 09:38:01 +0900 Subject: Sources: Run clang-format on everything. --- src/common/common_funcs.h | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'src/common/common_funcs.h') diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h index 4633897ce..ad5bdbc08 100644 --- a/src/common/common_funcs.h +++ b/src/common/common_funcs.h @@ -14,7 +14,7 @@ /// Textually concatenates two tokens. The double-expansion is required by the C preprocessor. #define CONCAT2(x, y) DO_CONCAT2(x, y) -#define DO_CONCAT2(x, y) x ## y +#define DO_CONCAT2(x, y) x##y // helper macro to properly align structure members. // Calling INSERT_PADDING_BYTES will add a new member variable with a name like "pad121", @@ -24,9 +24,9 @@ // Inlining #ifdef _WIN32 - #define FORCE_INLINE __forceinline +#define FORCE_INLINE __forceinline #else - #define FORCE_INLINE inline __attribute__((always_inline)) +#define FORCE_INLINE inline __attribute__((always_inline)) #endif #ifndef _MSC_VER @@ -46,7 +46,8 @@ #else inline u32 rotl(u32 x, int shift) { shift &= 31; - if (!shift) return x; + if (!shift) + return x; return (x << shift) | (x >> (32 - shift)); } #endif @@ -56,17 +57,18 @@ inline u32 rotl(u32 x, int shift) { #else inline u32 rotr(u32 x, int shift) { shift &= 31; - if (!shift) return x; + if (!shift) + return x; return (x >> shift) | (x << (32 - shift)); } #endif -inline u64 _rotl64(u64 x, unsigned int shift){ +inline u64 _rotl64(u64 x, unsigned int shift) { unsigned int n = shift % 64; return (x << n) | (x >> (64 - n)); } -inline u64 _rotr64(u64 x, unsigned int shift){ +inline u64 _rotr64(u64 x, unsigned int shift) { unsigned int n = shift % 64; return (x >> n) | (x << (64 - n)); } @@ -74,17 +76,18 @@ inline u64 _rotr64(u64 x, unsigned int shift){ #else // _MSC_VER #if (_MSC_VER < 1900) - // Function Cross-Compatibility - #define snprintf _snprintf +// Function Cross-Compatibility +#define snprintf _snprintf #endif // Locale Cross-Compatibility #define locale_t _locale_t extern "C" { - __declspec(dllimport) void __stdcall DebugBreak(void); +__declspec(dllimport) void __stdcall DebugBreak(void); } -#define Crash() {DebugBreak();} +#define Crash() \ + { DebugBreak(); } // cstdlib provides these on MSVC #define rotr _rotr -- cgit v1.2.3