X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbitboard.h;h=3afbeedfbab42ee086000de51a4964350b34bea5;hp=e0e2fe64545ececedd4acf53852b9fd7e3b7dbf0;hb=53c04c0429c3e3d8988ec92dc949cc6c67919378;hpb=aecdbfc4a000c72fcc2642f54ce83967913a16ba diff --git a/src/bitboard.h b/src/bitboard.h index e0e2fe64..3afbeedf 100644 --- a/src/bitboard.h +++ b/src/bitboard.h @@ -319,9 +319,10 @@ extern Square pop_lsb(Bitboard* b); #endif -/// lsb() overload finds least significant bit relative to the given color -inline Square lsb(Color c, Bitboard b) { - return c == WHITE ? lsb(b) : msb(b); -} +/// frontmost_sq() and backmost_sq() find the square corresponding to the +/// most/least advanced bit relative to the given color. + +inline Square frontmost_sq(Color c, Bitboard b) { return c == WHITE ? msb(b) : lsb(b); } +inline Square backmost_sq(Color c, Bitboard b) { return c == WHITE ? lsb(b) : msb(b); } #endif // #ifndef BITBOARD_H_INCLUDED