]> git.sesse.net Git - stockfish/blobdiff - src/bitboard.h
Small cleanups
[stockfish] / src / bitboard.h
index f1d14603687fd19ae0d975799154d15ac8058a66..529e3dfe5f44e31e18099dfa85e372a11e31c76e 100644 (file)
@@ -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);
 }