nextSetBit

nextSetBit, searches the bit mask for the next set bit.

mask - array that holds the bits start - start position end - end position

returns : index of next set bit, or "end" if none found

note the mask should be long enough in the given word size to hold the bits, IE. If end = 65, then the uint mask should be 3 uints, the ulong mask should be 2 ulongs. If end = 64, then it only need be 2 uints or 1 ulong.

  1. int nextSetBit(ulong* mask, int start, int end)
    int
    nextSetBit
    (
    ulong* mask
    ,
    int start
    ,
    int end
    )
  2. int nextSetBit(uint* mask, int start, int end)

Meta