Fixed joiner detection, allowing it to work with timeseal
[xboard.git] / book.c
diff --git a/book.c b/book.c
index 82d4a45..2ec8546 100644 (file)
--- a/book.c
+++ b/book.c
@@ -30,6 +30,8 @@
 
 #include <stdio.h>
 #include <string.h>
+#include <time.h>
+#include <stdlib.h>
 
 #include "common.h"
 #include "backend.h"
@@ -273,8 +275,7 @@ uint64 *RandomTurn      =Random64+780;
 
 uint64 hash(int moveNr)
 {
-    char c;
-    int p, r, f, i, p_enc, squareNr, pieceGroup;
+    int r, f, p_enc, squareNr, pieceGroup;
     uint64 key=0, Zobrist;
 
     for(f=BOARD_LEFT; f<BOARD_RGHT; f++){
@@ -499,7 +500,6 @@ char *ProbeBook(int moveNr, char *book)
     for(i=0; i<count; i++){
         total_weight += entries[i].weight;
     }
-    srandom( time(0) );
     j = (random() & 0x7FFF) * total_weight >> 15; // create random < total_weight
     total_weight = 0;
     for(i=0; i<count; i++){