mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-04-06 14:21:43 +08:00
* ffsll.c (ffsll): Correct implementation.
This commit is contained in:
parent
93abc97ad2
commit
154b857c95
@ -1,3 +1,7 @@
|
||||
2009-03-30 Ian Lance Taylor <iant@google.com>
|
||||
|
||||
* ffsll.c (ffsll): Correct implementation.
|
||||
|
||||
2009-03-27 Ian Lance Taylor <iant@google.com>
|
||||
|
||||
* ffsll.c: New file.
|
||||
|
11
gold/ffsll.c
11
gold/ffsll.c
@ -36,8 +36,13 @@ ffsll (long long arg)
|
||||
unsigned long long i;
|
||||
int ret;
|
||||
|
||||
ret = 0;
|
||||
for (i = (unsigned long long) arg; i != 0; i >>= 1)
|
||||
++ret;
|
||||
if (arg == 0)
|
||||
ret = 0;
|
||||
else
|
||||
{
|
||||
ret = 1;
|
||||
for (i = (unsigned long long) arg; (i & 1) == 0; i >>= 1)
|
||||
++ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user