http://git.etherboot.org
/
people
/
sha0
/
gpxe.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Don't get stuck in an infinite loop on negative integers!
[people/sha0/gpxe.git]
/
src
/
core
/
bitops.c
1
#include <strings.h>
2
3
int __flsl ( long x ) {
4
unsigned long value = x;
5
int ls = 0;
6
7
for ( ls = 0 ; value ; ls++ ) {
8
value >>= 1;
9
}
10
return ls;
11
}