Finds the first set bit.
int ffs( uint32 mask )
ffs finds the lowest-numbered bit that is set in the argument. The least-significant bit is bit number 1, and the most-significant bit is bit 32.
ffs returns zero if no bits are set in the parameter, or the bit index of the first bit is set in the parameter. For example, ffs returns 1 if the value of the argument is 1 or 3 or 7; and 3 if the value of the argument is 4 or 12. If no bits are set, ffs returns 0.
Convenience call implemented in clib.lib V20.
This entry point is provided for portability and compatibility only; code written specifically for Portfolio should use FindLSB() or FindMSB() to reduce any ambiguity over whether the least-significant or most-significant bit is desired.
FindMSB
(), FindLSB()