X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fpawns.cpp;h=8dfb75a9d40692aaffb769895548a58c1b272556;hp=e01062d67ee6244c68cb440228a28aff432987ab;hb=16abc165d84b390c175ade5d1b19b1dab703129b;hpb=23490bd825d60564b1368b6a7e3df7d86a772bf0 diff --git a/src/pawns.cpp b/src/pawns.cpp index e01062d6..8dfb75a9 100644 --- a/src/pawns.cpp +++ b/src/pawns.cpp @@ -7,12 +7,12 @@ it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + Stockfish is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,6 +26,7 @@ #include #include "pawns.h" +#include "position.h" //// @@ -72,13 +73,13 @@ namespace { Value(32), Value(32), Value(32), Value(28) }; - // Pawn chain membership bonus by file, middle game. + // Pawn chain membership bonus by file, middle game. const Value ChainMidgameBonus[8] = { Value(14), Value(16), Value(17), Value(18), Value(18), Value(17), Value(16), Value(14) }; - // Pawn chain membership bonus by file, endgame. + // Pawn chain membership bonus by file, endgame. const Value ChainEndgameBonus[8] = { Value(16), Value(16), Value(16), Value(16), Value(16), Value(16), Value(16), Value(16) @@ -107,7 +108,7 @@ namespace { 31, 40, 40, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - + const int KStormTable[64] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-4,-13,-22,-27,-27, @@ -167,7 +168,7 @@ void PawnInfoTable::clear() { /// PawnInfoTable::get_pawn_info() takes a position object as input, computes -/// a PawnInfo object, and returns a pointer to it. The result is also +/// a PawnInfo object, and returns a pointer to it. The result is also /// stored in a hash table, so we don't have to recompute everything when /// the same pawn structure occurs again. @@ -179,7 +180,7 @@ PawnInfo *PawnInfoTable::get_pawn_info(const Position &pos) { int index = int(key & (size - 1)); PawnInfo *pi = entries + index; - // If pi->key matches the position's pawn hash key, it means that we + // If pi->key matches the position's pawn hash key, it means that we // have analysed this pawn structure before, and we can simply return the // information we found the last time instead of recomputing it if (pi->key == key) @@ -216,7 +217,7 @@ PawnInfo *PawnInfoTable::get_pawn_info(const Position &pos) { File f = square_file(s); Rank r = square_rank(s); - assert(pos.piece_on(s) == pawn_of_color(us)); + assert(pos.piece_on(s) == piece_of_color_and_type(us, PAWN)); // The file containing the pawn is not half open pi->halfOpenFiles[us] &= ~(1 << f); @@ -370,7 +371,7 @@ PawnInfo *PawnInfoTable::get_pawn_info(const Position &pos) { mgValue[us] += mv; egValue[us] += ev; - + // If the pawn is passed, set the square of the pawn in the passedPawns // bitboard if (passed)