@matheusbsbs / matheus-bagliano / commits / 10e8d68820
Fork 0

Correct compiler warnings in fast-import.

Junio noticed these warnings/errors in fast-import when compiling with `-Werror -ansi -pedantic`. A few changes are to reduce compiler warnings, while one (in cmd_merge) is a bug fix. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Shawn O. Pearce committed Feb 6, 2007 at 00:26 UTC 10e8d68820db9c7b6412d5a553a93fd200388f30
1 file changed +5 -4
fast-import.c
+5 -4
@@ -1455,7 +1455,7 @@ static void file_change_m(struct branch *b)
1455 const char *p = command_buf.buf + 2;
1456 char *p_uq;
1457 const char *endp;
1458 - struct object_entry *oe;
1458 + struct object_entry *oe = oe;
1459 unsigned char sha1[20];
1460 uint16_t mode, inline_data = 0;
1461 char type[20];
@@ -1607,7 +1607,7 @@ static void cmd_from(struct branch *b)
1607
1608 static struct hash_list* cmd_merge(unsigned int *count)
1609 {
1610 - struct hash_list *list = NULL, *n, *e;
1610 + struct hash_list *list = NULL, *n, *e = e;
1611 const char *from;
1612 struct branch *s;
1613
@@ -1633,7 +1633,7 @@ static struct hash_list* cmd_merge(unsigned int *count)
1633 else
1634 list = n;
1635 e = n;
1636 - *count++;
1636 + (*count)++;
1637 read_next_command();
1638 }
1639 return list;
@@ -1763,8 +1763,9 @@ static void cmd_new_tag(void)
1763 if (s) {
1764 hashcpy(sha1, s->sha1);
1765 } else if (*from == ':') {
1766 + struct object_entry *oe;
1767 from_mark = strtoumax(from + 1, NULL, 10);
1767 - struct object_entry *oe = find_mark(from_mark);
1768 + oe = find_mark(from_mark);
1769 if (oe->type != OBJ_COMMIT)
1770 die("Mark :%ju not a commit", from_mark);
1771 hashcpy(sha1, oe->sha1);