summaryrefslogtreecommitdiff
path: root/src/util/bitscan.h
diff options
context:
space:
mode:
authorEmil Velikov <emil.velikov@collabora.com>2017-03-09 17:45:19 +0000
committerEmil Velikov <emil.l.velikov@gmail.com>2017-03-13 11:16:34 +0000
commita72ac981605d34be5b9da3d9ee8e43b81c5a5296 (patch)
treec44fb29a3e3f14ffa565d25ccdf7e959a4b2719c /src/util/bitscan.h
parentfb0832b86db07421d525ddd9633d247b70b897f9 (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/bitscan.h')
-rw-r--r--src/util/bitscan.h8
1 files changed, 4 insertions, 4 deletions
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