diff options
author | Jason Evans <jasone@canonware.com> | 2017-01-16 00:56:30 (GMT) |
---|---|---|
committer | Jason Evans <jasone@canonware.com> | 2017-01-21 05:43:07 (GMT) |
commit | c4c2592c834d8a37beb0a0d53842095160cbf9ee (patch) | |
tree | e4717ea6a2f13926dadd74ea1fc83f9742f77968 /include/msvc_compat | |
parent | 5154ff32ee8c37bacb6afd8a07b923eb33228357 (diff) | |
download | jemalloc-c4c2592c834d8a37beb0a0d53842095160cbf9ee.zip jemalloc-c4c2592c834d8a37beb0a0d53842095160cbf9ee.tar.gz jemalloc-c4c2592c834d8a37beb0a0d53842095160cbf9ee.tar.bz2 |
Update brace style.
Add braces around single-line blocks, and remove line breaks before
function-opening braces.
This resolves #537.
Diffstat (limited to 'include/msvc_compat')
-rw-r--r-- | include/msvc_compat/strings.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/include/msvc_compat/strings.h b/include/msvc_compat/strings.h index 47998be..971b36d 100644 --- a/include/msvc_compat/strings.h +++ b/include/msvc_compat/strings.h @@ -6,17 +6,16 @@ #ifdef _MSC_VER # include <intrin.h> # pragma intrinsic(_BitScanForward) -static __forceinline int ffsl(long x) -{ +static __forceinline int ffsl(long x) { unsigned long i; - if (_BitScanForward(&i, x)) + if (_BitScanForward(&i, x)) { return (i + 1); + } return (0); } -static __forceinline int ffs(int x) -{ +static __forceinline int ffs(int x) { return (ffsl(x)); } @@ -24,12 +23,12 @@ static __forceinline int ffs(int x) # pragma intrinsic(_BitScanForward64) # endif -static __forceinline int ffsll(unsigned __int64 x) -{ +static __forceinline int ffsll(unsigned __int64 x) { unsigned long i; #ifdef _M_X64 - if (_BitScanForward64(&i, x)) + if (_BitScanForward64(&i, x)) { return (i + 1); + } return (0); #else // Fallback for 32-bit build where 64-bit version not available @@ -41,10 +40,11 @@ static __forceinline int ffsll(unsigned __int64 x) s.ll = x; - if (_BitScanForward(&i, s.l[0])) + if (_BitScanForward(&i, s.l[0])) { return (i + 1); - else if(_BitScanForward(&i, s.l[1])) + } else if(_BitScanForward(&i, s.l[1])) { return (i + 33); + } return (0); #endif } |