]> git.sesse.net Git - stockfish/blobdiff - src/uci.cpp
Fix a warning under Intel compiler in square.h
[stockfish] / src / uci.cpp
index b03752edc4220e865d4087642e1523e53050d42a..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;
@@ -228,6 +229,9 @@ namespace {
                 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);
   }