Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F149966383
D33701.id100765.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D33701.id100765.diff
View Options
Index: sys/sys/bitset.h
===================================================================
--- sys/sys/bitset.h
+++ sys/sys/bitset.h
@@ -229,17 +229,20 @@
__size_t __i; \
long __bit, __mask; \
\
- __mask = ~0UL << ((start) % _BITSET_BITS); \
__bit = 0; \
- for (__i = __bitset_word((_s), (start)); \
- __i < __bitset_words((_s)); \
- __i++) { \
- if (((p)->__bits[__i] & __mask) != 0) { \
- __bit = ffsl((p)->__bits[__i] & __mask); \
+ __i = __bitset_word((_s), (start)); \
+ if (__i < __bitset_words((_s))) { \
+ __mask = ~0UL << ((start) % _BITSET_BITS); \
+ __mask &= (p)->__bits[__i]; \
+ while (__mask == 0 && ++__i < __bitset_words((_s))) \
+ __mask = (p)->__bits[__i]; \
+ if (__i == __bitset_words((_s)) - 1 && \
+ (_s) % _BITSET_BITS != 0) \
+ __mask &= ~(~0UL << ((_s) % _BITSET_BITS)); \
+ if (__mask) != 0) { \
+ __bit = ffsl(__mask); \
__bit += __i * _BITSET_BITS; \
- break; \
} \
- __mask = ~0UL; \
} \
__bit; \
})
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 29, 11:18 AM (9 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30523779
Default Alt Text
D33701.id100765.diff (1 KB)
Attached To
Mode
D33701: BITSET_FFS, FLS corrections and extensions
Attached
Detach File
Event Timeline
Log In to Comment