File: learn.c.patch

package info (click to toggle)
sjeng 11.2-15
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,436 kB
  • sloc: ansic: 13,378; sh: 324; makefile: 29
file content (30 lines) | stat: -rw-r--r-- 749 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Author: Lukas Geyer <lukas@debian.org>
Description: Made all score variables long int.
Bugs: #192902

--- sjeng-11.2.orig/learn.c
+++ sjeng-11.2/learn.c
@@ -36,13 +36,13 @@
 }
 LearnType;
 
-void Learn(int score, int best, int depth)
+void Learn(long score, int best, int depth)
 {
   int number = 0, next = 0;
   LearnType draft;
   FILE **lrnfile;
 
-  printf("Learning score: %d  best: %d  depth:%d  hash: %X\n", score, best, depth, hash);
+  printf("Learning score: %ld  best: %d  depth:%d  hash: %lX\n", score, best, depth, hash);
   
   if (Variant == Normal)
     {
@@ -122,6 +122,7 @@
   {
       lrnfile = &lrn_losers;
   }
+  else return; // Can this happen?
 
   fseek(*lrnfile, 0, SEEK_SET);
   fread(&number, sizeof(int), 1, *lrnfile);