]> git.sesse.net Git - stockfish/blobdiff - src/uci.cpp
Fix a warning under Intel compiler in square.h
[stockfish] / src / uci.cpp
index 4aade3b66bb99cbcdb261089519443f7c8e48c11..48459757dda217aaf117fc5fbc60211722555488 100644 (file)
@@ -22,6 +22,7 @@
 //// Includes
 ////
 
+#include <cassert>
 #include <iostream>
 #include <sstream>
 #include <string>
@@ -169,7 +170,7 @@ namespace {
     }
     else if (token == "key")
     {
-        std::cout << "key: " << RootPosition.get_key()
+        std::cout << "key: " << std::hex << RootPosition.get_key()
                   << " material key: " << RootPosition.get_material_key()
                   << " pawn key: " << RootPosition.get_pawn_key()
                   << std::endl;
@@ -219,15 +220,18 @@ namespace {
         if (token == "moves")
         {
             Move move;
-            UndoInfo u;
+            StateInfo st;
             while (!uip.eof())
             {
                 uip >> token;
                 move = move_from_string(RootPosition, token);
-                RootPosition.do_move(move, u);
+                RootPosition.do_move(move, st);
                 if (RootPosition.rule_50_counter() == 0)
                     RootPosition.reset_game_ply();
             }
+            // Our StateInfo st is about going out of scope,
+            // so save its content before they disappear.
+            RootPosition.setStartState(st);
         }
     }
   }
@@ -321,6 +325,8 @@ namespace {
     if (moveTime)
         infinite = true;  // HACK
 
+    assert(RootPosition.is_ok());
+
     think(RootPosition, infinite, ponder, RootPosition.side_to_move(), time,
           inc, movesToGo, depth, nodes, moveTime, searchMoves);
   }