Cast to unsigned to avoid sign-extension problems.
This commit is contained in:
parent
1de30b60cb
commit
8746a69a28
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=124482
@ -47,6 +47,6 @@ ffs(int mask)
|
||||
if (mask == 0)
|
||||
return (0);
|
||||
for (bit = 1; !(mask & 1); bit++)
|
||||
mask >>= 1;
|
||||
(unsigned int)mask >>= 1;
|
||||
return (bit);
|
||||
}
|
||||
|
@ -47,6 +47,6 @@ ffsl(long mask)
|
||||
if (mask == 0)
|
||||
return (0);
|
||||
for (bit = 1; !(mask & 1); bit++)
|
||||
mask >>= 1;
|
||||
(unsigned long)mask >>= 1;
|
||||
return (bit);
|
||||
}
|
||||
|
@ -47,6 +47,6 @@ fls(int mask)
|
||||
if (mask == 0)
|
||||
return (0);
|
||||
for (bit = 1; mask != 1; bit++)
|
||||
mask >>= 1;
|
||||
(unsigned int)mask >>= 1;
|
||||
return (bit);
|
||||
}
|
||||
|
@ -47,6 +47,6 @@ flsl(long mask)
|
||||
if (mask == 0)
|
||||
return (0);
|
||||
for (bit = 1; mask != 1; bit++)
|
||||
mask >>= 1;
|
||||
(unsigned long)mask >>= 1;
|
||||
return (bit);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user