X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbitboard.h;h=529e3dfe5f44e31e18099dfa85e372a11e31c76e;hp=f1d14603687fd19ae0d975799154d15ac8058a66;hb=ddcbacd04d1c860e808202ce8c1206c8acdca627;hpb=ec2002c594cce22dfbbdc7b6b8df2828a00d18cf diff --git a/src/bitboard.h b/src/bitboard.h index f1d14603..529e3dfe 100644 --- a/src/bitboard.h +++ b/src/bitboard.h @@ -375,14 +375,17 @@ inline Square msb(Bitboard b) { /// pop_lsb() finds and clears the least significant bit in a non-zero bitboard inline Square pop_lsb(Bitboard* b) { + assert(*b); const Square s = lsb(*b); *b &= *b - 1; return s; } -/// frontmost_sq() returns the most advanced square for the given color +/// frontmost_sq() returns the most advanced square for the given color, +/// requires a non-zero bitboard. inline Square frontmost_sq(Color c, Bitboard b) { + assert(b); return c == WHITE ? msb(b) : lsb(b); }