Merge branch 'maint'
[gnushogi.git] / gnushogi / book.c
index 009e409..5a331c9 100644 (file)
@@ -366,7 +366,7 @@ RESET(void)
 
 static
 int
-Vparse (FILE * fd, USHORT *mv, USHORT *flags, USHORT side, int moveno)
+Vparse (FILE * fd, USHORT *mv, USHORT *flags, int moveno)
 {
     int c, i;
     char s[255];
@@ -647,7 +647,7 @@ GetOpenings(void)
 {
     short i;
     int mustwrite = false, first;
-    unsigned short xside, side;
+    unsigned short side;
     short c;
     USHORT mv, flags;
     unsigned int x;
@@ -716,11 +716,10 @@ GetOpenings(void)
         {
             /* setvbuf(fd, buffr, _IOFBF, 2048); */
             side = black;
-            xside = white;
             hashbd = hashkey = 0;
             i = 0;
 
-            while ((c = Vparse(fd, &mv, &flags, side, i)) >= 0)
+            while ((c = Vparse(fd, &mv, &flags, i)) >= 0)
             {
                 if (c == 1)
                 {
@@ -822,7 +821,6 @@ GetOpenings(void)
                     computer = opponent;
                     opponent = computer ^ 1;
 
-                    xside = side;
                     side = side ^ 1;
                 }
                 else if (i > 0)
@@ -833,8 +831,6 @@ GetOpenings(void)
                     RESET();
                     i = 0;
                     side = black;
-                    xside = white;
-
                 }
             }
 
@@ -876,8 +872,8 @@ GetOpenings(void)
 
         }
 
-        sprintf(msg, "Book used %d(%d).", B.bookcount, B.booksize);
-        ShowMessage(msg);
+        sprintf(msg, "Book used %lu(%lu).", B.bookcount, B.booksize);
+        dsp->ShowMessage(msg);
     }
 
     /* Set everything back to start the game. */
@@ -887,7 +883,7 @@ GetOpenings(void)
     /* Now get ready to play .*/
     if (!B.bookcount)
     {
-        ShowMessage("Can't find book.");
+        dsp->ShowMessage("Can't find book.");
         Book = 0;
     }
 }
@@ -895,7 +891,7 @@ GetOpenings(void)
 
 
 /*
- * OpeningBook(hint, side)
+ * OpeningBook(hint)
  *
  * Go through each of the opening lines of play and check for a match with
  * the current game listing. If a match occurs, generate a random
@@ -907,7 +903,7 @@ GetOpenings(void)
  */
 
 int
-OpeningBook(unsigned short *hint, short side)
+OpeningBook(unsigned short *hint)
 {
     unsigned short r, m;
     int possibles = TrPnt[2] - TrPnt[1];