summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/imports.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/imports.c')
-rw-r--r--src/mesa/main/imports.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c
index c46e5beb918..7231fa699cb 100644
--- a/src/mesa/main/imports.c
+++ b/src/mesa/main/imports.c
@@ -539,10 +539,10 @@ _mesa_pow(double x, double y)
* Find the first bit set in a word.
*/
int
-_mesa_ffs(int i)
+_mesa_ffs(int32_t i)
{
#if (defined(_WIN32) && !defined(__MINGW32__) ) || defined(__IBMC__) || defined(__IBMCPP__)
- register int bit = 1;
+ register int32_t bit = 1;
if ((i & 0xffff) == 0) {
bit += 16;
i >>= 16;
@@ -573,11 +573,7 @@ _mesa_ffs(int i)
* if no bits set.
*/
int
-#ifdef __MINGW32__
-_mesa_ffsll(long val)
-#else
-_mesa_ffsll(long long val)
-#endif
+_mesa_ffsll(int64_t val)
{
#ifdef ffsll
return ffsll(val);
@@ -586,11 +582,11 @@ _mesa_ffsll(long long val)
assert(sizeof(val) == 8);
- bit = _mesa_ffs(val);
+ bit = _mesa_ffs((int32_t)val);
if (bit != 0)
return bit;
- bit = _mesa_ffs(val >> 32);
+ bit = _mesa_ffs((int32_t)(val >> 32));
if (bit != 0)
return 32 + bit;