summaryrefslogtreecommitdiff
path: root/src/common/common_funcs.h
diff options
context:
space:
mode:
authorGravatar Emmanuel Gil Peyrot2014-11-19 08:49:13 +0000
committerGravatar Emmanuel Gil Peyrot2014-11-19 09:03:07 +0000
commitf5d38649c7ad6fedf9db95044e3ad91ce393b8df (patch)
tree57cd232d34d8f889315331a84f0812e705d2ea88 /src/common/common_funcs.h
parentMerge pull request #212 from archshift/idea (diff)
downloadyuzu-f5d38649c7ad6fedf9db95044e3ad91ce393b8df.tar.gz
yuzu-f5d38649c7ad6fedf9db95044e3ad91ce393b8df.tar.xz
yuzu-f5d38649c7ad6fedf9db95044e3ad91ce393b8df.zip
Remove trailing spaces in every file but the ones imported from SkyEye, AOSP or generated
Diffstat (limited to 'src/common/common_funcs.h')
-rw-r--r--src/common/common_funcs.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h
index c18afe119..d84ec4c42 100644
--- a/src/common/common_funcs.h
+++ b/src/common/common_funcs.h
@@ -17,7 +17,7 @@ template<> struct CompileTimeAssert<true> {};
17#define b2(x) ( (x) | ( (x) >> 1) ) 17#define b2(x) ( (x) | ( (x) >> 1) )
18#define b4(x) ( b2(x) | ( b2(x) >> 2) ) 18#define b4(x) ( b2(x) | ( b2(x) >> 2) )
19#define b8(x) ( b4(x) | ( b4(x) >> 4) ) 19#define b8(x) ( b4(x) | ( b4(x) >> 4) )
20#define b16(x) ( b8(x) | ( b8(x) >> 8) ) 20#define b16(x) ( b8(x) | ( b8(x) >> 8) )
21#define b32(x) (b16(x) | (b16(x) >>16) ) 21#define b32(x) (b16(x) | (b16(x) >>16) )
22#define ROUND_UP_POW2(x) (b32(x - 1) + 1) 22#define ROUND_UP_POW2(x) (b32(x - 1) + 1)
23 23
@@ -79,12 +79,12 @@ inline u64 _rotr64(u64 x, unsigned int shift){
79 #define unlink _unlink 79 #define unlink _unlink
80 #define snprintf _snprintf 80 #define snprintf _snprintf
81 #define vscprintf _vscprintf 81 #define vscprintf _vscprintf
82 82
83// Locale Cross-Compatibility 83// Locale Cross-Compatibility
84 #define locale_t _locale_t 84 #define locale_t _locale_t
85 #define freelocale _free_locale 85 #define freelocale _free_locale
86 #define newlocale(mask, locale, base) _create_locale(mask, locale) 86 #define newlocale(mask, locale, base) _create_locale(mask, locale)
87 87
88 #define LC_GLOBAL_LOCALE ((locale_t)-1) 88 #define LC_GLOBAL_LOCALE ((locale_t)-1)
89 #define LC_ALL_MASK LC_ALL 89 #define LC_ALL_MASK LC_ALL
90 #define LC_COLLATE_MASK LC_COLLATE 90 #define LC_COLLATE_MASK LC_COLLATE
@@ -92,7 +92,7 @@ inline u64 _rotr64(u64 x, unsigned int shift){
92 #define LC_MONETARY_MASK LC_MONETARY 92 #define LC_MONETARY_MASK LC_MONETARY
93 #define LC_NUMERIC_MASK LC_NUMERIC 93 #define LC_NUMERIC_MASK LC_NUMERIC
94 #define LC_TIME_MASK LC_TIME 94 #define LC_TIME_MASK LC_TIME
95 95
96 inline locale_t uselocale(locale_t new_locale) 96 inline locale_t uselocale(locale_t new_locale)
97 { 97 {
98 // Retrieve the current per thread locale setting 98 // Retrieve the current per thread locale setting
@@ -168,8 +168,8 @@ inline u16 swap16(u16 _data) {return _byteswap_ushort(_data);}
168inline u32 swap32(u32 _data) {return _byteswap_ulong (_data);} 168inline u32 swap32(u32 _data) {return _byteswap_ulong (_data);}
169inline u64 swap64(u64 _data) {return _byteswap_uint64(_data);} 169inline u64 swap64(u64 _data) {return _byteswap_uint64(_data);}
170#elif _M_ARM 170#elif _M_ARM
171inline u16 swap16 (u16 _data) { u32 data = _data; __asm__ ("rev16 %0, %1\n" : "=l" (data) : "l" (data)); return (u16)data;} 171inline u16 swap16 (u16 _data) { u32 data = _data; __asm__ ("rev16 %0, %1\n" : "=l" (data) : "l" (data)); return (u16)data;}
172inline u32 swap32 (u32 _data) {__asm__ ("rev %0, %1\n" : "=l" (_data) : "l" (_data)); return _data;} 172inline u32 swap32 (u32 _data) {__asm__ ("rev %0, %1\n" : "=l" (_data) : "l" (_data)); return _data;}
173inline u64 swap64(u64 _data) {return ((u64)swap32(_data) << 32) | swap32(_data >> 32);} 173inline u64 swap64(u64 _data) {return ((u64)swap32(_data) << 32) | swap32(_data >> 32);}
174#elif __linux__ 174#elif __linux__
175inline u16 swap16(u16 _data) {return bswap_16(_data);} 175inline u16 swap16(u16 _data) {return bswap_16(_data);}
@@ -226,7 +226,7 @@ template <typename T>
226inline T FromBigEndian(T data) 226inline T FromBigEndian(T data)
227{ 227{
228 //static_assert(std::is_arithmetic<T>::value, "function only makes sense with arithmetic types"); 228 //static_assert(std::is_arithmetic<T>::value, "function only makes sense with arithmetic types");
229 229
230 swap<sizeof(data)>(reinterpret_cast<u8*>(&data)); 230 swap<sizeof(data)>(reinterpret_cast<u8*>(&data));
231 return data; 231 return data;
232} 232}