mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 00:56:39 +08:00
Unify BitCountType selection
Now that HasPopCnt is a compile time constant we can centralize and unify the BitCountType selection. Also rename count_1s() in the more standard popcount() No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -1691,7 +1691,7 @@ bool Position::pos_is_ok(int* failedStep) const {
|
||||
|
||||
// Is there more than 2 checkers?
|
||||
if (failedStep) (*failedStep)++;
|
||||
if (debugCheckerCount && count_1s<CNT32>(st->checkersBB) > 2)
|
||||
if (debugCheckerCount && popcount<Full>(st->checkersBB) > 2)
|
||||
return false;
|
||||
|
||||
// Bitboards OK?
|
||||
@@ -1760,7 +1760,7 @@ bool Position::pos_is_ok(int* failedStep) const {
|
||||
if (debugPieceCounts)
|
||||
for (Color c = WHITE; c <= BLACK; c++)
|
||||
for (PieceType pt = PAWN; pt <= KING; pt++)
|
||||
if (pieceCount[c][pt] != count_1s<CNT32>(pieces(pt, c)))
|
||||
if (pieceCount[c][pt] != popcount<Full>(pieces(pt, c)))
|
||||
return false;
|
||||
|
||||
if (failedStep) (*failedStep)++;
|
||||
|
||||
Reference in New Issue
Block a user