diff options
author | Emil Velikov <emil.velikov@collabora.com> | 2017-03-09 17:45:19 +0000 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2017-03-13 11:16:34 +0000 |
commit | a72ac981605d34be5b9da3d9ee8e43b81c5a5296 (patch) | |
tree | c44fb29a3e3f14ffa565d25ccdf7e959a4b2719c /src/util | |
parent | fb0832b86db07421d525ddd9633d247b70b897f9 (diff) |
util/bitscan: use correct signature for ffs/ffsll
Otherwise we'll get errors such as
error: conflicting types for ‘ffs’
error: conflicting types for ‘ffsll’
We might want to improve the heuristics and provide a definition only
when a native one is missing. We can address that at a later stage.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/bitscan.c | 4 | ||||
-rw-r--r-- | src/util/bitscan.h | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/util/bitscan.c b/src/util/bitscan.c index ceca59eba9..7858291bf6 100644 --- a/src/util/bitscan.c +++ b/src/util/bitscan.c @@ -32,7 +32,7 @@ #elif defined(_MSC_VER) && (_M_IX86 || _M_ARM || _M_AMD64 || _M_IA64) #else int -ffs(unsigned i) +ffs(int i) { int bit = 0; if (!i) @@ -63,7 +63,7 @@ ffs(unsigned i) #elif defined(_MSC_VER) && (_M_AMD64 || _M_ARM || _M_IA64) #else int -ffsll(uint64_t val) +ffsll(long long int val) { int bit; diff --git a/src/util/bitscan.h b/src/util/bitscan.h index 32e027165c..7a605e0370 100644 --- a/src/util/bitscan.h +++ b/src/util/bitscan.h @@ -52,7 +52,7 @@ extern "C" { #define ffs __builtin_ffs #elif defined(_MSC_VER) && (_M_IX86 || _M_ARM || _M_AMD64 || _M_IA64) static inline -int ffs(unsigned i) +int ffs(int i) { unsigned long index; if (_BitScanForward(&index, i)) @@ -62,14 +62,14 @@ int ffs(unsigned i) } #else extern -int ffs(unsigned i); +int ffs(int i); #endif #ifdef HAVE___BUILTIN_FFSLL #define ffsll __builtin_ffsll #elif defined(_MSC_VER) && (_M_AMD64 || _M_ARM || _M_IA64) static inline int -ffsll(uint64_t i) +ffsll(long long int i) { unsigned long index; if (_BitScanForward64(&index, i)) @@ -79,7 +79,7 @@ ffsll(uint64_t i) } #else extern int -ffsll(uint64_t val); +ffsll(long long int val); #endif |