]> git.sesse.net Git - stockfish/blobdiff - src/san.cpp
Retire piece.cpp
[stockfish] / src / san.cpp
index 545fae8fd5bd6a96ec37acd7786aca70a600ddd7..ef22626f950c51e65c8033c42f89d6a94f1642dc 100644 (file)
@@ -85,7 +85,7 @@ const string move_to_san(Position& pos, Move m) {
   {
       if (pt != PAWN)
       {
-          san += piece_type_to_char(pt, true);
+          san += piece_type_to_char(pt);
 
           switch (move_ambiguity(pos, m)) {
           case AMBIGUITY_NONE:
@@ -113,7 +113,7 @@ const string move_to_san(Position& pos, Move m) {
       if (move_is_promotion(m))
       {
           san += "=";
-          san += piece_type_to_char(move_promotion_piece(m), true);
+          san += piece_type_to_char(move_promotion_piece(m));
       }
   }
 
@@ -138,7 +138,7 @@ Move move_from_san(const Position& pos, const string& movestr) {
 
   assert(pos.is_ok());
 
-  MovePicker mp = MovePicker(pos, MOVE_NONE, OnePly, H);
+  MovePicker mp = MovePicker(pos, MOVE_NONE, ONE_PLY, H);
   Bitboard pinned = pos.pinned_pieces(pos.side_to_move());
 
   // Castling moves
@@ -164,7 +164,7 @@ Move move_from_san(const Position& pos, const string& movestr) {
   // Normal moves. We use a simple FSM to parse the san string.
   enum { START, TO_FILE, TO_RANK, PROMOTION_OR_CHECK, PROMOTION, CHECK, END };
   static const string pieceLetters = "KQRBN";
-  PieceType pt = NO_PIECE_TYPE, promotion = NO_PIECE_TYPE;
+  PieceType pt = PIECE_TYPE_NONE, promotion = PIECE_TYPE_NONE;
   File fromFile = FILE_NONE, toFile = FILE_NONE;
   Rank fromRank = RANK_NONE, toRank = RANK_NONE;
   Square to;
@@ -322,11 +322,11 @@ const string line_to_san(const Position& pos, Move line[], int startColumn, bool
 /// It is used to write search information to the log file (which is created
 /// when the UCI parameter "Use Search Log" is "true").
 
-const string pretty_pv(const Position& pos, int time, int depth, uint64_t nodes,
+const string pretty_pv(const Position& pos, int time, int depth,
                        Value score, ValueType type, Move pv[]) {
 
-  const uint64_t K = 1000;
-  const uint64_t M = 1000000;
+  const int64_t K = 1000;
+  const int64_t M = 1000000;
 
   std::stringstream s;
 
@@ -341,12 +341,12 @@ const string pretty_pv(const Position& pos, int time, int depth, uint64_t nodes,
   s << std::setw(8) << time_string(time) << " ";
 
   // Nodes
-  if (nodes < M)
-      s << std::setw(8) << nodes / 1 << " ";
-  else if (nodes < K * M)
-      s << std::setw(7) << nodes / K << "K ";
+  if (pos.nodes_searched() < M)
+      s << std::setw(8) << pos.nodes_searched() / 1 << " ";
+  else if (pos.nodes_searched() < K * M)
+      s << std::setw(7) << pos.nodes_searched() / K << "K ";
   else
-      s << std::setw(7) << nodes / M << "M ";
+      s << std::setw(7) << pos.nodes_searched() / M << "M ";
 
   // PV
   s << line_to_san(pos, pv, 30, true);
@@ -368,7 +368,7 @@ namespace {
     if (type_of_piece(pc) == KING)
         return AMBIGUITY_NONE;
 
-    MovePicker mp = MovePicker(pos, MOVE_NONE, OnePly, H);
+    MovePicker mp = MovePicker(pos, MOVE_NONE, ONE_PLY, H);
     Bitboard pinned = pos.pinned_pieces(pos.side_to_move());
     Move mv, moveList[8];