X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbitboard.cpp;h=110609d294c8ce75180b15d01daf094807f450a5;hp=54cc94fa7d04525390ff3e66094fff51b2adff69;hb=d372f2e39a65e2b14fc0335841e652a9d208d3ec;hpb=a617b038759f6abd1b33f71ef6d1938fa3588c3d diff --git a/src/bitboard.cpp b/src/bitboard.cpp index 54cc94fa..110609d2 100644 --- a/src/bitboard.cpp +++ b/src/bitboard.cpp @@ -175,7 +175,7 @@ Bitboard RankBB[8]; Bitboard NeighboringFilesBB[8]; Bitboard ThisAndNeighboringFilesBB[8]; Bitboard InFrontBB[2][8]; -Bitboard NonSlidingAttacksBB[16][64]; +Bitboard StepAttacksBB[16][64]; Bitboard BetweenBB[64][64]; Bitboard SquaresInFrontMask[2][64]; Bitboard PassedPawnMask[2][64]; @@ -191,7 +191,7 @@ uint8_t BitCount8Bit[256]; namespace { void init_masks(); - void init_non_sliding_attacks(); + void init_step_attacks(); void init_pseudo_attacks(); void init_between_bitboards(); Bitboard index_to_bitboard(int index, Bitboard mask); @@ -307,7 +307,7 @@ void init_bitboards() { int bishopDeltas[4][2] = {{1,1},{-1,1},{1,-1},{-1,-1}}; init_masks(); - init_non_sliding_attacks(); + init_step_attacks(); init_sliding_attacks(RAttacks, RAttackIndex, RMask, RShift, RMult, rookDeltas); init_sliding_attacks(BAttacks, BAttackIndex, BMask, BShift, BMult, bishopDeltas); init_pseudo_attacks(); @@ -329,19 +329,19 @@ namespace { FileBB[FILE_A] = FileABB; RankBB[RANK_1] = Rank1BB; - for (File f = FILE_B; f <= FILE_H; f++) + for (int f = FILE_B; f <= FILE_H; f++) { FileBB[f] = FileBB[f - 1] << 1; RankBB[f] = RankBB[f - 1] << 8; } - for (File f = FILE_A; f <= FILE_H; f++) + for (int f = FILE_A; f <= FILE_H; f++) { NeighboringFilesBB[f] = (f > FILE_A ? FileBB[f - 1] : 0) | (f < FILE_H ? FileBB[f + 1] : 0); ThisAndNeighboringFilesBB[f] = FileBB[f] | NeighboringFilesBB[f]; } - for (Rank rw = RANK_7, rb = RANK_1; rw >= RANK_1; rw--, rb++) + for (int rw = RANK_7, rb = RANK_2; rw >= RANK_1; rw--, rb++) { InFrontBB[WHITE][rw] = InFrontBB[WHITE][rw + 1] | RankBB[rw + 1]; InFrontBB[BLACK][rb] = InFrontBB[BLACK][rb - 1] | RankBB[rb - 1]; @@ -368,7 +368,7 @@ namespace { BitCount8Bit[b] = (uint8_t)count_1s(b); } - void init_non_sliding_attacks() { + void init_step_attacks() { const int step[][9] = { {0}, @@ -385,7 +385,7 @@ namespace { Square to = s + Square(step[pc][k]); if (square_is_ok(to) && square_distance(s, to) < 3) - set_bit(&NonSlidingAttacksBB[pc][s], to); + set_bit(&StepAttacksBB[pc][s], to); } }