X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=book.c;h=e4916154d0a48beac1e645580c5a9477c2db3c0b;hb=d0d7caa02cdf810e913822aa822381b24afe7d6b;hp=98dde33bcd80047a58602bfa25fad285a6f77220;hpb=74506c0e852b35465c651f331e010ca7e60e7dd3;p=xboard.git diff --git a/book.c b/book.c index 98dde33..e491615 100644 --- a/book.c +++ b/book.c @@ -2,7 +2,7 @@ * book.c -- code for probing Polyglot opening books * * This code was first released in the public domain by Michel Van den Bergh. - * The array Random64 is taken from the Polyglot source code. + * The array Random64 is taken from the Polyglot source code. * I am pretty sure that a table of random numbers is never protected * by copyright. * @@ -65,7 +65,7 @@ typedef unsigned short uint16; typedef unsigned int uint32; typedef struct { - uint64 key; + uint64 key; uint16 move; uint16 weight; uint16 learnPoints; @@ -358,7 +358,7 @@ hash (int moveNr) f = boards[moveNr][EP_STATUS]; if(f >= 0 && f < 8){ if(!WhiteOnMove(moveNr)){ - // the test for neighboring Pawns might not be needed, + // the test for neighboring Pawns might not be needed, // as epStatus already kept track of it, but better safe than sorry. if((f>0 && boards[moveNr][3][f-1]==BlackPawn)|| (f<7 && boards[moveNr][3][f+1]==BlackPawn)){ @@ -515,7 +515,7 @@ move_to_string (char move_s[6], uint16 move) if(gameInfo.variant != VariantNormal) return; - // correct FRC-style castlings in variant normal. + // correct FRC-style castlings in variant normal. // [HGM] This is buggy code! e1h1 could very well be a normal R or Q move. if(!strcmp(move_s,"e1h1")){ safeStrCpy(move_s,"e1g1", 6); @@ -567,14 +567,14 @@ ReadFromBookFile (int moveNr, char *book, entry_t entries[]) static FILE *f = NULL; static char curBook[MSG_SIZ]; - if(book == NULL) return -1; + if(book == NULL) return -1; if(!f || strcmp(book, curBook)){ // keep book file open until book changed strncpy(curBook, book, MSG_SIZ); if(f) fclose(f); f = fopen(book,"rb"); } if(!f){ - DisplayError("Polyglot book not valid", 0); + DisplayError(_("Polyglot book not valid"), 0); appData.usePolyglotBook = FALSE; return -1; } @@ -665,14 +665,14 @@ MCprobe (moveNr) char *ProbeBook (int moveNr, char *book) -{ // +{ // entry_t entries[MOVE_BUF]; int count; int i, j; static char move_s[6]; int total_weight; - if(moveNr >= 2*appData.bookDepth) return NULL; + if(moveNr >= 2*appData.bookDepth) return NULL; if(mcMode) return MCprobe(moveNr); if((count = ReadFromBookFile(moveNr, book, entries)) <= 0) return NULL; // no book, or no hit @@ -995,5 +995,5 @@ FlushBook () // entry.learnCount = 0; entry_to_file(f, &entry); } - } else DisplayError("Could not create book", 0); + } else DisplayError(_("Could not create book"), 0); }