-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Change pop_lsb() signature to C++ style #3404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This changes the pop_lsb() signature from Square pop_lsb(Bitboard*) to Square pop_lsb(Bitboard&). No functional change.
|
You also need to test non-regression on LTC, even though I don't think it's necessary. |
|
@BM123499 I think using pointers where references will do is ugly and error-prone, but I don't want to revive the reference-vs-pointer discussion here. I was saving this for a "Small cleanups" PR where usually no regression tests are run at all, but I was getting tired of waiting (and rebasing) so I made this PR. I'll run an LTC test if people think it's required, but I personally think it's a waste of resources. |
|
I have compiled this patch, calculated the md5 hash of the executable binary and compared it to the md5 hash of master: they are the same, so the compiled binaries are the same at least for my compiler (gcc-10 on Mac). So yes, LTC is unnecessary in that case :-) Patch looks good to me. |
|
@gvreuls I understand your point of view, but I believe that the absence of signally that the value will be change inside another function has more change of a new dev misread what is going to happen. |
|
@BM123499 I think most C++ programmers expect that a I appreciate and understand your point of view, don't worry. I think it's related to what code you read/write most often, C or C++. |
|
Passing a pointer also doesn't tell the whole picture on the callsite, for all we know it could be a |
|
Merged via ec42154, thanks! :-) |
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 official-stockfish#3404
No functional change.
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 official-stockfish/Stockfish#3404
No functional change.
This changes the pop_lsb() signature from
Square pop_lsb(Bitboard*)toSquare pop_lsb(Bitboard&).Just some refactoring, feel free to close.
No functional change.
This patch 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