X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=inline;f=src%2Fendgame.cpp;h=ca38a662a01a588d1fa11cf0eba21d2b2b156582;hb=54253bcce69a0ebc3e6bc4c35dfa76f8ff46521e;hp=835173c468b68bed46b7159dfafe5e32d74c9b0a;hpb=eb6d7f537d214c4dc8bde7d4fdc2aaead47dd3c3;p=stockfish
diff --git a/src/endgame.cpp b/src/endgame.cpp
index 835173c4..ca38a662 100644
--- a/src/endgame.cpp
+++ b/src/endgame.cpp
@@ -18,7 +18,6 @@
along with this program. If not, see .
*/
-#include
#include
#include "bitboard.h"
@@ -75,17 +74,42 @@ namespace {
assert(pos.count(strongSide) == 1);
if (file_of(pos.square(strongSide)) >= FILE_E)
- sq = Square(sq ^ 7); // Mirror SQ_H1 -> SQ_A1
+ sq = Square(int(sq) ^ 7); // Mirror SQ_H1 -> SQ_A1
- if (strongSide == BLACK)
- sq = ~sq;
-
- return sq;
+ return strongSide == WHITE ? sq : ~sq;
}
} // namespace
+namespace Endgames {
+
+ std::pair