X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gnushogi%2Fbook.c;h=423749f89d47e8b9c3c3ed17e7bb57ee30cdf0a3;hb=96253e9fec23f465f064dfbe1ae469d03c1d3267;hp=547f3fd8f5e0e7292edb15c3e822236379445a31;hpb=7e806d3c2cba049e315b13e64cadfa309c734ba5;p=gnushogi.git diff --git a/gnushogi/book.c b/gnushogi/book.c index 547f3fd..423749f 100644 --- a/gnushogi/book.c +++ b/gnushogi/book.c @@ -73,7 +73,7 @@ static ULONG bhashkey; * Generate move strings in different formats. */ -void +static void Balgbr(short f, short t, short flag) { short promoted = false; @@ -166,10 +166,8 @@ Balgbr(short f, short t, short flag) } - - #ifndef QUIETBOOKGEN -void +static void bkdisplay(char *s, int cnt, int moveno) { static short pnt; @@ -240,11 +238,9 @@ bkdisplay(char *s, int cnt, int moveno) } #endif /* SEMIQUIETBOOKGEN */ } - #endif /* QUIETBOOKGEN */ - /* * BVerifyMove(s, mv, moveno) * @@ -252,7 +248,7 @@ bkdisplay(char *s, int cnt, int moveno) * opponent. If a match is found, make the move on the board. */ -int +static int BVerifyMove(char *s, unsigned short *mv, int moveno) { static short pnt, tempb, tempc, tempsf, tempst, cnt; @@ -320,8 +316,6 @@ BVerifyMove(char *s, unsigned short *mv, int moveno) } - - /* * RESET() * @@ -329,7 +323,7 @@ BVerifyMove(char *s, unsigned short *mv, int moveno) * */ -void +static void RESET(void) { short l; @@ -365,9 +359,7 @@ RESET(void) } - -static -int +static int Vparse (FILE * fd, USHORT *mv, USHORT *flags, int moveno) { int c, i; @@ -601,7 +593,7 @@ static ULONG currentoffset; #define WriteAdmin() \ { \ - lseek(gfd, 0, 0); \ + lseek(gfd, 0, SEEK_SET); \ write(gfd, (char *)&ADMIN, sizeof_gdxadmin); \ } @@ -609,7 +601,7 @@ static ULONG currentoffset; { \ if (mustwrite ) \ { \ - lseek(gfd, currentoffset, 0); \ + lseek(gfd, currentoffset, SEEK_SET); \ write(gfd, (char *)&DATA, sizeof_gdxdata); \ mustwrite = false; \ } \ @@ -617,13 +609,13 @@ static ULONG currentoffset; static int ReadAdmin(void) { - lseek(gfd, 0, 0); + lseek(gfd, 0, SEEK_SET); return (sizeof_gdxadmin == read(gfd, (char *)&ADMIN, sizeof_gdxadmin)); } static int ReadData(struct gdxdata *DATA) { - lseek(gfd, currentoffset, 0); + lseek(gfd, currentoffset, SEEK_SET); return (sizeof_gdxdata == read(gfd, (char *)DATA, sizeof_gdxdata)); } @@ -891,7 +883,6 @@ GetOpenings(void) } - /* * OpeningBook(hint) * @@ -1056,6 +1047,3 @@ OpeningBook(unsigned short *hint) Book--; return false; } - - -