X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbitboard.cpp;h=e329ab52a79439710ef1771ecc4ac3be08442c0b;hp=334ea879eabe6011eca8933780ce9d5763880306;hb=e0504ab876a997321102f040ab88203cb893db12;hpb=8fb45caadef67fb2ccc27857c15ade987d9f5e2f diff --git a/src/bitboard.cpp b/src/bitboard.cpp index 334ea879..e329ab52 100644 --- a/src/bitboard.cpp +++ b/src/bitboard.cpp @@ -78,7 +78,7 @@ namespace { // popcount16() counts the non-zero bits using SWAR-Popcount algorithm - uint8_t popcount16(uint16_t u) { + unsigned popcount16(unsigned u) { u -= (u >> 1) & 0x5555U; u = ((u >> 2) & 0x3333U) + (u & 0x3333U); u = ((u >> 4) + u) & 0x0F0FU; @@ -152,7 +152,7 @@ const std::string Bitboards::pretty(Bitboard b) { void Bitboards::init() { for (unsigned i = 0; i < (1 << 16); ++i) - PopCnt16[i] = popcount16(i); + PopCnt16[i] = (uint8_t) popcount16(i); for (Square s = SQ_A1; s <= SQ_H8; ++s) { @@ -205,8 +205,8 @@ void Bitboards::init() { StepAttacksBB[make_piece(c, pt)][s] |= to; } - Square RookDeltas[] = { DELTA_N, DELTA_E, DELTA_S, DELTA_W }; - Square BishopDeltas[] = { DELTA_NE, DELTA_SE, DELTA_SW, DELTA_NW }; + Square RookDeltas[] = { NORTH, EAST, SOUTH, WEST }; + Square BishopDeltas[] = { NORTH_EAST, SOUTH_EAST, SOUTH_WEST, NORTH_WEST }; init_magics(RookTable, RookAttacks, RookMagics, RookMasks, RookShifts, RookDeltas, magic_index); init_magics(BishopTable, BishopAttacks, BishopMagics, BishopMasks, BishopShifts, BishopDeltas, magic_index);