Ticket #31: signed_char_7_7.8

File signed_char_7_7.8, 5.4 KB (added by gunnar, 4 years ago)
Line 
1Index: engine/liberty.h
2===================================================================
3RCS file: /cvsroot/gnugo/gnugo/engine/liberty.h,v
4retrieving revision 1.244
5diff -u -r1.244 liberty.h
6--- engine/liberty.h    8 Oct 2005 08:17:31 -0000       1.244
7+++ engine/liberty.h    9 Oct 2005 14:59:51 -0000
8@@ -787,21 +787,16 @@
9 
10 
11 struct eyevalue {
12-#if 0
13-  char maxeye;       /* number of eyes if defender plays first               */
14-  char mineye;       /* number of eyes if attacker plays first               */
15-#else
16   unsigned char a; /* number of eyes if attacker plays first twice */
17   unsigned char b; /* number of eyes if attacker plays first */
18   unsigned char c; /* number of eyes if defender plays first */
19   unsigned char d; /* number of eyes if defender plays first twice */
20-#endif
21 };
22 
23 
24 struct half_eye_data {
25   float value;          /* Topological eye value. */
26-  char type;            /* HALF_EYE or FALSE_EYE; */
27+  unsigned char type;   /* HALF_EYE or FALSE_EYE; */
28   int num_attacks;      /* number of attacking points */
29   int attack_point[4];  /* the moves to attack a topological halfeye */
30   int num_defenses;     /* number of defending points */
31@@ -861,8 +844,8 @@
32 #define MAX_SURROUND 10
33 
34 struct surround_data {
35-  int dragon_number;           /* number of the (surrounded) beast */
36-  char surround_map[BOARDMAX]; /* surround map                     */
37+  int dragon_number;                  /* number of the (surrounded) beast */
38+  signed char surround_map[BOARDMAX]; /* surround map                     */
39 };
40 
41 extern struct surround_data surroundings[MAX_SURROUND];
42@@ -988,9 +971,9 @@
43   /* ---------------------------------------------------------------- */
44   /* The below fields are not.                                        */
45 
46-  char marginal;             /* This vertex is marginal               */
47-  char neighbors;            /* number of neighbors in eyespace       */
48-  char marginal_neighbors;   /* number of marginal neighbors          */
49+  unsigned char marginal;             /* This vertex is marginal               */
50+  unsigned char neighbors;            /* number of neighbors in eyespace       */
51+  unsigned char marginal_neighbors;   /* number of marginal neighbors          */
52 };
53 
54 struct vital_eye_points {
55Index: patterns/mkeyes.c
56===================================================================
57RCS file: /cvsroot/gnugo/gnugo/patterns/mkeyes.c,v
58retrieving revision 1.20
59diff -u -r1.20 mkeyes.c
60--- patterns/mkeyes.c   12 Jun 2005 09:34:15 -0000      1.20
61+++ patterns/mkeyes.c   9 Oct 2005 14:59:51 -0000
62@@ -47,9 +47,9 @@
63   int patno = 0;
64   int p;
65   char vertex[MAXDIMEN][MAXDIMEN];
66-  char marginal[MAXDIMEN][MAXDIMEN];
67-  char edge[MAXDIMEN][MAXDIMEN];
68-  char flags[MAXDIMEN][MAXDIMEN];
69+  signed char marginal[MAXDIMEN][MAXDIMEN];
70+  signed char edge[MAXDIMEN][MAXDIMEN];
71+  unsigned char flags[MAXDIMEN][MAXDIMEN];
72   int neighbors[MAXSIZE];
73   int k, l, h;
74   int m = 0, n = 0;
75Index: patterns/mkpat.c
76===================================================================
77RCS file: /cvsroot/gnugo/gnugo/patterns/mkpat.c,v
78retrieving revision 1.151
79diff -u -r1.151 mkpat.c
80--- patterns/mkpat.c    28 Sep 2005 21:52:04 -0000      1.151
81+++ patterns/mkpat.c    9 Oct 2005 14:59:52 -0000
82@@ -1747,7 +1747,7 @@
83 compare_elements(const void *a, const void *b)
84 {
85   /* score for each attribute */
86-  static char order[] = {7, 2, 3, 5, 6, 0, 4, 1};
87+  static int order[] = {7, 2, 3, 5, 6, 0, 4, 1};
88   
89   return  order[((const struct patval_b *)a)->att]
90     - order[((const struct patval_b *)b)->att];
91Index: patterns/patterns.h
92===================================================================
93RCS file: /cvsroot/gnugo/gnugo/patterns/patterns.h,v
94retrieving revision 1.71
95diff -u -r1.71 patterns.h
96--- patterns/patterns.h 28 Sep 2005 21:52:04 -0000      1.71
97+++ patterns/patterns.h 9 Oct 2005 14:59:52 -0000
98@@ -171,7 +171,7 @@
99 
100 typedef struct patval {
101   short offset;
102-  char att;
103+  unsigned char att;
104 } Patval;
105 
106 /* Build-time version of patval structure. */
107@@ -357,18 +357,18 @@
108   int max_width;       /* Largest possible width and... */
109   int max_height;      /* ... largest possible height of database patterns. */
110 
111-  char num_top_variations; /* Number of top level variations. */
112+  unsigned char num_top_variations; /* Number of top level variations. */
113   struct corner_variation *top_variations;
114 };
115 
116 struct corner_variation {
117-  int move_offset;     /* Offset of the move in this variation. */
118-  char xor_att;        /* 0 - the same color as the first matched stone,
119-                        * 3 - the opposite color.
120-                        */
121-  char num_stones;      /* Number of stones in the `move_offset' rectangle. */
122+  int move_offset;         /* Offset of the move in this variation. */
123+  signed char xor_att;      /* 0 - the same color as the first matched stone,
124+                            * 3 - the opposite color.
125+                            */
126+  unsigned char num_stones; /* Number of stones in the `move_offset' rectangle. */
127 
128-  char num_variations;  /* Number of subvariations. */
129+  unsigned char num_variations; /* Number of subvariations. */
130   struct corner_variation *variations; /* Pointer to subvariation array. */
131 
132   struct corner_pattern *pattern; /* Address of matched pattern (if any). */
133@@ -391,10 +391,10 @@
134 /* Build time version of corner_variation structure. */
135 struct corner_variation_b {
136   int move_offset;
137-  char xor_att;
138-  char num_stones;
139+  signed char xor_att;
140+  unsigned char num_stones;
141 
142-  char num_variations;
143+  unsigned char num_variations;
144   struct corner_variation_b *next;
145   struct corner_variation_b *child;
146   int child_num;