mirror of
https://github.com/official-stockfish/Stockfish.git
synced 2026-07-23 13:17:12 +00:00
Use reference instead of pointer for pop_lsb() signature
This patch changes the pop_lsb() signature from Square pop_lsb(Bitboard*) to
Square pop_lsb(Bitboard&). This is more idomatic for C++ style signatures.
Passed a non-regression STC test:
LLR: 2.93 (-2.94,2.94) {-1.25,0.25}
Total: 21280 W: 1928 L: 1847 D: 17505
Ptnml(0-2): 71, 1427, 7558, 1518, 66
https://tests.stockfishchess.org/tests/view/6053a1e22433018de7a38e2f
We have verified that the generated binary is identical on gcc-10.
Closes https://github.com/official-stockfish/Stockfish/pull/3404
No functional change.
This commit is contained in:
committed by
Stéphane Nicolet
parent
ace9632c67
commit
ec42154ef2
+3
-3
@@ -73,7 +73,7 @@ std::ostream& operator<<(std::ostream& os, const Position& pos) {
|
||||
<< std::setfill(' ') << std::dec << "\nCheckers: ";
|
||||
|
||||
for (Bitboard b = pos.checkers(); b; )
|
||||
os << UCI::square(pop_lsb(&b)) << " ";
|
||||
os << UCI::square(pop_lsb(b)) << " ";
|
||||
|
||||
if ( int(Tablebases::MaxCardinality) >= popcount(pos.pieces())
|
||||
&& !pos.can_castle(ANY_CASTLING))
|
||||
@@ -359,7 +359,7 @@ void Position::set_state(StateInfo* si) const {
|
||||
|
||||
for (Bitboard b = pieces(); b; )
|
||||
{
|
||||
Square s = pop_lsb(&b);
|
||||
Square s = pop_lsb(b);
|
||||
Piece pc = piece_on(s);
|
||||
si->key ^= Zobrist::psq[pc][s];
|
||||
|
||||
@@ -476,7 +476,7 @@ Bitboard Position::slider_blockers(Bitboard sliders, Square s, Bitboard& pinners
|
||||
|
||||
while (snipers)
|
||||
{
|
||||
Square sniperSq = pop_lsb(&snipers);
|
||||
Square sniperSq = pop_lsb(snipers);
|
||||
Bitboard b = between_bb(s, sniperSq) & occupancy;
|
||||
|
||||
if (b && !more_than_one(b))
|
||||
|
||||
Reference in New Issue
Block a user