]> git.sesse.net Git - stockfish/blobdiff - src/pawns.cpp
Rewrite async I/O
[stockfish] / src / pawns.cpp
index c099153a2ca5d7e1038d15a6ca01e934fcdfa859..52bc9f88eea5eb031931cfe1aa17dce81fde575e 100644 (file)
@@ -79,8 +79,6 @@ namespace {
 
 PawnInfo* PawnInfoTable::get_pawn_info(const Position& pos) const {
 
-  assert(pos.is_ok());
-
   Key key = pos.get_pawn_key();
   PawnInfo* pi = probe(key);
 
@@ -134,8 +132,8 @@ Score PawnInfoTable::evaluate_pawns(const Position& pos, Bitboard ourPawns,
   {
       assert(pos.piece_on(s) == make_piece(Us, PAWN));
 
-      f = square_file(s);
-      r = square_rank(s);
+      f = file_of(s);
+      r = rank_of(s);
 
       // This file cannot be half open
       pi->halfOpenFiles[Us] &= ~(1 << f);
@@ -230,7 +228,7 @@ Score PawnInfo::updateShelter(const Position& pos, Square ksq) {
       for (int i = 0; i < 3; i++)
       {
           r += Shift;
-          shelter += BitCount8Bit[(pawns >> r) & 0xFF] * (64 >> i);
+          shelter += BitCount8Bit[(pawns >> r) & 0xFF] << (6 - i);
       }
   }
   kingSquares[Us] = ksq;