Fix BIT_FLS().
The iteration index is unsigned, so testing for larger than or equal to zero makes little sense. Submitted by: Sebastian Huber <sebastian.huber@embedded-brains.de> MFC after: 3 days
This commit is contained in:
parent
d43225de5c
commit
f08b46d9da
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=320893
@ -218,10 +218,10 @@
|
||||
int __bit; \
|
||||
\
|
||||
__bit = 0; \
|
||||
for (__i = __bitset_words((_s)) - 1; __i >= 0; __i--) { \
|
||||
if ((p)->__bits[__i] != 0) { \
|
||||
__bit = flsl((p)->__bits[__i]); \
|
||||
__bit += __i * _BITSET_BITS; \
|
||||
for (__i = __bitset_words((_s)); __i > 0; __i--) { \
|
||||
if ((p)->__bits[__i - 1] != 0) { \
|
||||
__bit = flsl((p)->__bits[__i - 1]); \
|
||||
__bit += (__i - 1) * _BITSET_BITS; \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
|
Loading…
Reference in New Issue
Block a user