X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbitboard.cpp;h=4e2778a946b89a282d83ba51f774d8b21fe2ecee;hp=994ee17f26fa8b078e636f0378ec6ad44fe43e70;hb=8a4821923ac6860c791185a6d25c60ad0391739f;hpb=edf4c07d251f1d6c709d47969bfe1452194d9430 diff --git a/src/bitboard.cpp b/src/bitboard.cpp index 994ee17f..4e2778a9 100644 --- a/src/bitboard.cpp +++ b/src/bitboard.cpp @@ -89,7 +89,7 @@ void Bitboards::init() { PopCnt16[i] = (uint8_t) popcount16(i); for (Square s = SQ_A1; s <= SQ_H8; ++s) - SquareBB[s] = 1ULL << s; + SquareBB[s] = (1ULL << s); for (File f = FILE_A; f <= FILE_H; ++f) FileBB[f] = f > FILE_A ? FileBB[f - 1] << 1 : FileABB; @@ -116,7 +116,7 @@ void Bitboards::init() { if (s1 != s2) { SquareDistance[s1][s2] = std::max(distance(s1, s2), distance(s1, s2)); - DistanceRingBB[s1][SquareDistance[s1][s2] - 1] |= s2; + DistanceRingBB[s1][SquareDistance[s1][s2]] |= s2; } int steps[][5] = { {}, { 7, 9 }, { 6, 10, 15, 17 }, {}, {}, {}, { 1, 7, 8, 9 } }; @@ -137,7 +137,7 @@ void Bitboards::init() { } } - Direction RookDirections[] = { NORTH, EAST, SOUTH, WEST }; + Direction RookDirections[] = { NORTH, EAST, SOUTH, WEST }; Direction BishopDirections[] = { NORTH_EAST, SOUTH_EAST, SOUTH_WEST, NORTH_WEST }; init_magics(RookTable, RookMagics, RookDirections);