X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=book.c;h=ba7a9afc07921957a6da6fc4d01dd00d7bac8695;hb=49511ad9b25e30745202d81410007df8e9c492de;hp=314019f3018100905cb3d21cf71e05693b1f1350;hpb=fcd47eab73ab2998ab3709f8f3cd444058cb20c9;p=xboard.git diff --git a/book.c b/book.c index 314019f..ba7a9af 100644 --- a/book.c +++ b/book.c @@ -11,24 +11,27 @@ * The following terms apply to the enhanced version of XBoard distributed * by the Free Software Foundation: * ------------------------------------------------------------------------ - * This program is free software; you can redistribute it and/or modify + * + * GNU XBoard is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * the Free Software Foundation, either version 3 of the License, or (at + * your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU XBoard is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see http://www.gnu.org/licenses/. * + * * ------------------------------------------------------------------------ */ #include #include +#include +#include #include "common.h" #include "backend.h" @@ -272,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>32), (unsigned int)key); offset=find_key(f, key, &entry); - if(entry.key != key) return NULL; + if(entry.key != key) { + fclose(f); + return NULL; + } entries[0] = entry; count=1; fseek(f, 16*(offset+1), SEEK_SET); @@ -498,7 +503,6 @@ char *ProbeBook(int moveNr, char *book) for(i=0; i> 15; // create random < total_weight total_weight = 0; for(i=0; i