diff options
author | Junio C Hamano <junkio@cox.net> | 2005-08-29 12:41:03 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-08-29 12:41:03 -0700 |
commit | 2c04662d89eaa55cecb6effd743c17051d1458ec (patch) | |
tree | aa27bc3ebd317ed648b152ef92e00870d9b33414 | |
parent | 10d781b9caa4f71495c7b34963bef137216f86a8 (diff) | |
download | git-2c04662d89eaa55cecb6effd743c17051d1458ec.tar.gz git-2c04662d89eaa55cecb6effd743c17051d1458ec.tar.xz |
Revert "Replace zero-length array decls with []."
This reverts 6c5f9baa3bc0d63e141e0afc23110205379905a4 commit, whose
change breaks gcc-2.95.
Not that I ignore portability to compilers that are properly C99, but
keeping compilation with GCC working is more important, at least for
now. We would probably end up declaring with "name[1]" and teach the
allocator to subtract one if we really aimed for portability, but that
is left for later rounds.
Signed-off-by: Junio C Hamano <junkio@cox.net>
-rw-r--r-- | cache.h | 8 | ||||
-rw-r--r-- | commit.c | 2 | ||||
-rw-r--r-- | ls-files.c | 2 | ||||
-rw-r--r-- | receive-pack.c | 2 | ||||
-rw-r--r-- | server-info.c | 2 |
5 files changed, 8 insertions, 8 deletions
@@ -104,7 +104,7 @@ struct cache_entry { unsigned int ce_size; unsigned char sha1[20]; unsigned short ce_flags; - char name[]; + char name[0]; }; #define CE_NAMEMASK (0x0fff) @@ -287,7 +287,7 @@ extern int checkout_entry(struct cache_entry *ce, struct checkout *state); extern struct alternate_object_database { struct alternate_object_database *next; char *name; - char base[]; /* more */ + char base[0]; /* more */ } *alt_odb_list; extern void prepare_alt_odb(void); @@ -300,7 +300,7 @@ extern struct packed_git { unsigned int pack_last_used; unsigned int pack_use_cnt; unsigned char sha1[20]; - char pack_name[]; /* something like ".git/objects/pack/xxxxx.pack" */ + char pack_name[0]; /* something like ".git/objects/pack/xxxxx.pack" */ } *packed_git; struct pack_entry { @@ -315,7 +315,7 @@ struct ref { unsigned char new_sha1[20]; unsigned char force; struct ref *peer_ref; /* when renaming */ - char name[]; + char name[0]; }; extern int git_connect(int fd[2], char *url, const char *prog); @@ -102,7 +102,7 @@ static unsigned long parse_commit_date(const char *buf) static struct commit_graft { unsigned char sha1[20]; int nr_parent; - unsigned char parent[][20]; /* more */ + unsigned char parent[0][20]; /* more */ } **commit_graft; static int commit_graft_alloc, commit_graft_nr; diff --git a/ls-files.c b/ls-files.c index 0d79104e0..e53d24588 100644 --- a/ls-files.c +++ b/ls-files.c @@ -205,7 +205,7 @@ static int excluded(const char *pathname) struct nond_on_fs { int len; - char name[]; + char name[0]; }; static struct nond_on_fs **dir; diff --git a/receive-pack.c b/receive-pack.c index 1ef0c1393..06857eb77 100644 --- a/receive-pack.c +++ b/receive-pack.c @@ -24,7 +24,7 @@ struct command { unsigned char updated; unsigned char old_sha1[20]; unsigned char new_sha1[20]; - char ref_name[]; + char ref_name[0]; }; static struct command *commands = NULL; diff --git a/server-info.c b/server-info.c index cb58eb607..2b3aecab4 100644 --- a/server-info.c +++ b/server-info.c @@ -70,7 +70,7 @@ static struct pack_info { int nr_alloc; int nr_heads; unsigned char (*head)[20]; - char dep[]; /* more */ + char dep[0]; /* more */ } **info; static int num_pack; static const char *objdir; |