X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fpawns.h;h=0099ec209d736184cc43186f22632783a4f289c9;hp=7292606b8451b95a06716bc65a6157a7668d1971;hb=13a73f67c018e58b2fd46f886c45ef2b75188c8e;hpb=002062ae934c1fae3e56157e8e7e6451b552ada5 diff --git a/src/pawns.h b/src/pawns.h index 7292606b..0099ec20 100644 --- a/src/pawns.h +++ b/src/pawns.h @@ -37,7 +37,8 @@ struct Entry { Score pawns_value() const { return value; } Bitboard pawn_attacks(Color c) const { return pawnAttacks[c]; } Bitboard passed_pawns(Color c) const { return passedPawns[c]; } - int pawns_on_same_color_squares(Color c, Square s) const { return pawnsOnSquares[c][!!(BlackSquares & s)]; } + Bitboard candidate_pawns(Color c) const { return candidatePawns[c]; } + int pawns_on_same_color_squares(Color c, Square s) const { return pawnsOnSquares[c][!!(DarkSquares & s)]; } int semiopen(Color c, File f) const { return semiopenFiles[c] & (1 << int(f)); } int semiopen_on_side(Color c, File f, bool left) const { @@ -47,7 +48,7 @@ struct Entry { template Score king_safety(const Position& pos, Square ksq) { - return kingSquares[Us] == ksq && castleRights[Us] == pos.can_castle(Us) + return kingSquares[Us] == ksq && castlingFlags[Us] == pos.can_castle(Us) ? kingSafety[Us] : update_safety(pos, ksq); } @@ -59,10 +60,11 @@ struct Entry { Key key; Bitboard passedPawns[COLOR_NB]; + Bitboard candidatePawns[COLOR_NB]; Bitboard pawnAttacks[COLOR_NB]; Square kingSquares[COLOR_NB]; int minKPdistance[COLOR_NB]; - int castleRights[COLOR_NB]; + int castlingFlags[COLOR_NB]; Score value; int semiopenFiles[COLOR_NB]; Score kingSafety[COLOR_NB]; @@ -71,6 +73,7 @@ struct Entry { typedef HashTable Table; +void init(); Entry* probe(const Position& pos, Table& entries); }