]> git.sesse.net Git - stockfish/blobdiff - src/misc.cpp
Fix reading a book under-promotion move
[stockfish] / src / misc.cpp
index e04dfb2c39427a5a7c641d9cc68f9f9186c51598..d18f48d6e8a7c24a1c4eb7c679cb770e8af4717b 100644 (file)
@@ -127,17 +127,6 @@ void dbg_print_mean() {
        << (float)dbg_cnt1 / (dbg_cnt0 ? dbg_cnt0 : 1) << endl;
 }
 
-void dbg_print_hit_rate(ofstream& logFile) {
-
-  logFile << "Total " << dbg_cnt0 << " Hit " << dbg_cnt1
-          << " hit rate (%) " << (dbg_cnt1*100)/(dbg_cnt0 ? dbg_cnt0 : 1) << endl;
-}
-
-void dbg_print_mean(ofstream& logFile) {
-
-  logFile << "Total " << dbg_cnt0 << " Mean "
-          << (float)dbg_cnt1 / (dbg_cnt0 ? dbg_cnt0 : 1) << endl;
-}
 
 /// engine_name() returns the full name of the current Stockfish version.
 /// This will be either "Stockfish YYMMDD" (where YYMMDD is the date when
@@ -239,19 +228,19 @@ int data_available()
 int data_available()
 {
     static HANDLE inh = NULL;
-    static bool usePipe;
+    static bool usePipe = false;
     INPUT_RECORD rec[256];
     DWORD dw, recCnt;
 
     if (!inh)
     {
         inh = GetStdHandle(STD_INPUT_HANDLE);
-        usePipe = !GetConsoleMode(inh, &dw);
-        if (!usePipe)
+        if (GetConsoleMode(inh, &dw))
         {
             SetConsoleMode(inh, dw & ~(ENABLE_MOUSE_INPUT | ENABLE_WINDOW_INPUT));
             FlushConsoleInputBuffer(inh);
-        }
+        } else
+            usePipe = true;
     }
 
     // If we're running under XBoard then we can't use PeekConsoleInput() as