When bitpos can't be implemented with an inline ffs* instruction, change the binary search so that it does not depend on a single bit only being set in the bitmask. Use bitpos more generally, and avoid some clearing of bits to accommodate its current behavior.
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
So why not use _Generic ?
subr_blist.c | ||
---|---|---|
224 ↗ | (On Diff #57283) | Is this case ever occur ? I believe daddr_t is always 64bit. |
subr_blist.c | ||
---|---|---|
224 ↗ | (On Diff #57283) | Where I'm testing, long long and long have the same size and the switch led to a compilation error. Alan has suggested that someday he hopes to use a 32-bit daddr_t for 32-bit machines, which is why I bother sticking the int case in there. |
subr_blist.c | ||
---|---|---|
224 ↗ | (On Diff #57283) | Did you tested with switch, or with _Generic. I would expect that you can use long with generic, since all three types 'long long', 'long' and 'int' are different, even if some of them have identical representation. |
_Generic broke several builds. I'll prepare a patch to undo it, in case you don't have a better solution to offer.
If you intend reverting the commit, you got the implicit approval.
Can you point me to the reports ?