Small cleanups

closes https://github.com/official-stockfish/Stockfish/pull/2756

No functional change
This commit is contained in:
Joost VandeVondele
2020-06-24 22:19:58 +02:00
parent 11483fe6d9
commit ab5cd8340f
18 changed files with 124 additions and 86 deletions

View File

@@ -349,16 +349,16 @@ constexpr Color operator~(Color c) {
return Color(c ^ BLACK); // Toggle color
}
constexpr Square flip_rank(Square s) {
constexpr Square flip_rank(Square s) { // Swap A1 <-> A8
return Square(s ^ SQ_A8);
}
constexpr Square flip_file(Square s) {
constexpr Square flip_file(Square s) { // Swap A1 <-> H1
return Square(s ^ SQ_H1);
}
constexpr Piece operator~(Piece pc) {
return Piece(pc ^ 8); // Swap color of piece B_KNIGHT -> W_KNIGHT
return Piece(pc ^ 8); // Swap color of piece B_KNIGHT <-> W_KNIGHT
}
constexpr CastlingRights operator&(Color c, CastlingRights cr) {