From: H.G. Muller Date: Wed, 11 May 2011 18:15:58 +0000 (+0200) Subject: Include learn info in book edit X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=9a4dfcc5cc870b1f5dd88fa91ad0644d842e84b4;p=xboard.git Include learn info in book edit --- diff --git a/book.c b/book.c index aecb30d..9b02936 100644 --- a/book.c +++ b/book.c @@ -58,7 +58,8 @@ typedef struct { uint64 key; uint16 move; uint16 weight; - uint32 learn; + uint16 learnPoints; + uint16 learnCount; } entry_t; entry_t entry_none = { @@ -371,9 +372,12 @@ int entry_from_file(FILE *f, entry_t *entry) ret=int_from_file(f,2,&r); if(ret) return 1; entry->weight=r; - ret=int_from_file(f,4,&r); + ret=int_from_file(f,2,&r); + if(ret) return 1; + entry->learnCount=r; + ret=int_from_file(f,2,&r); if(ret) return 1; - entry->learn=r; + entry->learnPoints=r; return 0; } @@ -547,8 +551,13 @@ char *MovesToText(int count, entry_t *entries) for(i=0; ikey); int_to_file(f,2,entry->move); int_to_file(f,2,entry->weight); - int_to_file(f,4,entry->learn); + int_to_file(f,2,entry->learnCount); + int_to_file(f,2,entry->learnPoints); } char buf1[4096], buf2[4096];