]> git.sesse.net Git - stockfish/commitdiff
Rename NonSlidingAttacksBB[] in StepAttacksBB[]
authorMarco Costalba <mcostalba@gmail.com>
Wed, 9 Mar 2011 08:58:26 +0000 (09:58 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Thu, 10 Mar 2011 07:10:26 +0000 (08:10 +0100)
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/bitbase.cpp
src/bitboard.cpp
src/bitboard.h
src/position.cpp
src/position.h

index 0c3230f2aa9c0e9619fbe6f607eae4a77a1df066..3d4fad991189ee8bba77469ca3d0dadb925b9a7c 100644 (file)
@@ -37,9 +37,9 @@ namespace {
     bool is_legal() const;
     bool is_immediate_draw() const;
     bool is_immediate_win() const;
     bool is_legal() const;
     bool is_immediate_draw() const;
     bool is_immediate_win() const;
-    Bitboard wk_attacks()   const { return NonSlidingAttacksBB[WK][whiteKingSquare]; }
-    Bitboard bk_attacks()   const { return NonSlidingAttacksBB[BK][blackKingSquare]; }
-    Bitboard pawn_attacks() const { return NonSlidingAttacksBB[WP][pawnSquare]; }
+    Bitboard wk_attacks()   const { return StepAttacksBB[WK][whiteKingSquare]; }
+    Bitboard bk_attacks()   const { return StepAttacksBB[BK][blackKingSquare]; }
+    Bitboard pawn_attacks() const { return StepAttacksBB[WP][pawnSquare]; }
 
     Square whiteKingSquare, blackKingSquare, pawnSquare;
     Color sideToMove;
 
     Square whiteKingSquare, blackKingSquare, pawnSquare;
     Color sideToMove;
index bc05bfa070c7d9d4afd7dba717443eaa957208e6..c4d34aeb1737b6513b527794a793da545dfe97fd 100644 (file)
@@ -214,7 +214,7 @@ Bitboard BAttacks[0x1480];
 Bitboard SetMaskBB[65];
 Bitboard ClearMaskBB[65];
 
 Bitboard SetMaskBB[65];
 Bitboard ClearMaskBB[65];
 
-Bitboard NonSlidingAttacksBB[16][64];
+Bitboard StepAttacksBB[16][64];
 Bitboard BetweenBB[64][64];
 
 Bitboard SquaresInFrontMask[2][64];
 Bitboard BetweenBB[64][64];
 
 Bitboard SquaresInFrontMask[2][64];
@@ -231,7 +231,7 @@ uint8_t BitCount8Bit[256];
 namespace {
 
   void init_masks();
 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);
   void init_pseudo_attacks();
   void init_between_bitboards();
   Bitboard index_to_bitboard(int index, Bitboard mask);
@@ -347,7 +347,7 @@ void init_bitboards() {
   int bishopDeltas[4][2] = {{1,1},{-1,1},{1,-1},{-1,-1}};
 
   init_masks();
   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();
   init_sliding_attacks(RAttacks, RAttackIndex, RMask, RShift, RMult, rookDeltas);
   init_sliding_attacks(BAttacks, BAttackIndex, BMask, BShift, BMult, bishopDeltas);
   init_pseudo_attacks();
@@ -384,7 +384,7 @@ namespace {
         BitCount8Bit[b] = (uint8_t)count_1s<CNT32>(b);
   }
 
         BitCount8Bit[b] = (uint8_t)count_1s<CNT32>(b);
   }
 
-  void init_non_sliding_attacks() {
+  void init_step_attacks() {
 
     const int step[][9] =  {
       {0},
 
     const int step[][9] =  {
       {0},
@@ -401,7 +401,7 @@ namespace {
                 Square to = s + Square(step[pc][k]);
 
                 if (square_is_ok(to) && square_distance(s, to) < 3)
                 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);
            }
   }
 
            }
   }
 
index b962226bfb9e5048f950a2dd954622e48db28f7d..2a4ab1666b7509b42e80a932d11e536fc0071a2d 100644 (file)
@@ -53,7 +53,7 @@ extern const Bitboard InFrontBB[2][8];
 extern Bitboard SetMaskBB[65];
 extern Bitboard ClearMaskBB[65];
 
 extern Bitboard SetMaskBB[65];
 extern Bitboard ClearMaskBB[65];
 
-extern Bitboard NonSlidingAttacksBB[16][64];
+extern Bitboard StepAttacksBB[16][64];
 extern Bitboard BetweenBB[64][64];
 
 extern Bitboard SquaresInFrontMask[2][64];
 extern Bitboard BetweenBB[64][64];
 
 extern Bitboard SquaresInFrontMask[2][64];
index d7e0516c88114007d0ee26473a8ed4b16630668e..8b6bafe31ad309cd8c42211098dc7ed227754ed6 100644 (file)
@@ -501,7 +501,7 @@ Bitboard Position::attacks_from(Piece p, Square s) const {
   case WB: case BB: return attacks_from<BISHOP>(s);
   case WR: case BR: return attacks_from<ROOK>(s);
   case WQ: case BQ: return attacks_from<QUEEN>(s);
   case WB: case BB: return attacks_from<BISHOP>(s);
   case WR: case BR: return attacks_from<ROOK>(s);
   case WQ: case BQ: return attacks_from<QUEEN>(s);
-  default: return NonSlidingAttacksBB[p][s];
+  default: return StepAttacksBB[p][s];
   }
 }
 
   }
 }
 
@@ -514,7 +514,7 @@ Bitboard Position::attacks_from(Piece p, Square s, Bitboard occ) {
   case WB: case BB: return bishop_attacks_bb(s, occ);
   case WR: case BR: return rook_attacks_bb(s, occ);
   case WQ: case BQ: return bishop_attacks_bb(s, occ) | rook_attacks_bb(s, occ);
   case WB: case BB: return bishop_attacks_bb(s, occ);
   case WR: case BR: return rook_attacks_bb(s, occ);
   case WQ: case BQ: return bishop_attacks_bb(s, occ) | rook_attacks_bb(s, occ);
-  default: return NonSlidingAttacksBB[p][s];
+  default: return StepAttacksBB[p][s];
   }
 }
 
   }
 }
 
index 7392b9eabd795e39a02a2e12f4470c71ddf69656..8bd70b1643f3d47f6d530b0a091692e63de5dde6 100644 (file)
@@ -431,12 +431,12 @@ inline Square Position::initial_qr_square(Color c) const {
 
 template<>
 inline Bitboard Position::attacks_from<PAWN>(Square s, Color c) const {
 
 template<>
 inline Bitboard Position::attacks_from<PAWN>(Square s, Color c) const {
-  return NonSlidingAttacksBB[make_piece(c, PAWN)][s];
+  return StepAttacksBB[make_piece(c, PAWN)][s];
 }
 
 template<PieceType Piece> // Knight and King and white pawns
 inline Bitboard Position::attacks_from(Square s) const {
 }
 
 template<PieceType Piece> // Knight and King and white pawns
 inline Bitboard Position::attacks_from(Square s) const {
-  return NonSlidingAttacksBB[Piece][s];
+  return StepAttacksBB[Piece][s];
 }
 
 template<>
 }
 
 template<>