Correct a few types to be unsigned in fast-import.
The length of an atom string cannot be negative. So make it explicit and declare it as an unsigned value. The shift width in a mark table node also cannot be negative. I'm also moving it to after the pointer arrays to prevent any possible alignment problems on a 64 bit system. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce committed
Jan 17, 2007 at 00:57 UTC
6f64f6d9d2b12cdae1648cbf536685c888f3b981
1 file changed
+3
-3
fast-import.c
+3
-3
@@ -130,11 +130,11 @@ struct object_entry_pool
130
131
struct mark_set
132
{
133
- int shift;
133
union {
134
struct object_entry *marked[1024];
135
struct mark_set *sets[1024];
136
} data;
137
+ unsigned int shift;
138
};
139
140
struct last_object
@@ -157,7 +157,7 @@ struct mem_pool
157
struct atom_str
158
{
159
struct atom_str *next_atom;
160
- int str_len;
160
+ unsigned int str_len;
161
char str_dat[FLEX_ARRAY]; /* more */
162
};
163
@@ -192,8 +192,8 @@ struct branch
192
struct branch *table_next_branch;
193
struct branch *active_next_branch;
194
const char *name;
195
- unsigned long last_commit;
195
struct tree_entry branch_tree;
196
+ unsigned long last_commit;
197
unsigned int pack_id;
198
unsigned char sha1[20];
199
};