summaryrefslogtreecommitdiffstats
path: root/src/common/common_funcs.h
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-09-18 02:38:01 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-09-18 02:38:01 +0200
commitdc8479928c5aee4c6ad6fe4f59006fb604cee701 (patch)
tree569a7f13128450bbab973236615587ff00bced5f /src/common/common_funcs.h
parentTravis: Import Dolphin’s clang-format hook. (diff)
downloadyuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.gz
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.bz2
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.lz
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.xz
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.zst
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.zip
Diffstat (limited to '')
-rw-r--r--src/common/common_funcs.h25
1 files changed, 14 insertions, 11 deletions
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