X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=book.c;h=c40cd925895c6bf42541188e68da96a62aec5c10;hb=0a3919ff10a347a8d840f75fd2c816efe52e5098;hp=893dee88ac84f2214549756623e47357af1478c4;hpb=848e9dfc57a2db0255eb1adbd2c01c61fe26c4ed;p=xboard.git diff --git a/book.c b/book.c index 893dee8..c40cd92 100644 --- a/book.c +++ b/book.c @@ -35,6 +35,7 @@ #include #include "common.h" +#include "frontend.h" #include "backend.h" #include "moves.h" #include "gettext.h" @@ -282,7 +283,8 @@ uint64 *RandomEnPassant =Random64+772; uint64 *RandomTurn =Random64+780; -uint64 hash(int moveNr) +uint64 +hash (int moveNr) { int r, f, p_enc, squareNr, pieceGroup; uint64 key=0, holdingsKey=0, Zobrist; @@ -378,7 +380,8 @@ uint64 hash(int moveNr) #define MOVE_BUF 100 -int int_from_file(FILE *f, int l, uint64 *r) +int +int_from_file (FILE *f, int l, uint64 *r) { int i,c; for(i=0;i=0;i--) fputc(r>>8*i & 255, f); } -void entry_to_file(FILE *f, entry_t *entry) +void +entry_to_file (FILE *f, entry_t *entry) { int_to_file(f,8,entry->key); int_to_file(f,2,entry->move); @@ -675,7 +688,8 @@ void entry_to_file(FILE *f, entry_t *entry) char buf1[4096], buf2[4096]; -void SaveToBook(char *text) +void +SaveToBook (char *text) { entry_t entries[MOVE_BUF], entry; int count = TextToMoves(text, currentMove, entries);