diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-03-21 21:30:15 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-03-21 21:30:15 +0300 |
commit | d17811154b2482bae3fd089f29528e7b7b7ce62b (patch) | |
tree | 2cfe574ab7b61341efe6666744e85e6ac75da3af | |
parent | c108a77f8f9de5b42c9661b9d4584f54f57766ec (diff) | |
parent | 00a4b0350198ce2039af2360ff5d83a1f8ee6cd9 (diff) |
Merge branch 'rj/warning-uninitialized-fix'
Compilation fix.
* rj/warning-uninitialized-fix:
read-cache: fix an -Wmaybe-uninitialized warning
-Wuninitialized: remove some 'init-self' workarounds
-rw-r--r-- | builtin/rev-list.c | 2 | ||||
-rw-r--r-- | fast-import.c | 4 | ||||
-rw-r--r-- | merge-recursive.c | 2 | ||||
-rw-r--r-- | read-cache.c | 6 |
4 files changed, 8 insertions, 6 deletions
diff --git a/builtin/rev-list.c b/builtin/rev-list.c index d320b6f1e3..6f5b9b0847 100644 --- a/builtin/rev-list.c +++ b/builtin/rev-list.c @@ -536,7 +536,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix) mark_edges_uninteresting(&revs, show_edge); if (bisect_list) { - int reaches = reaches, all = all; + int reaches, all; find_bisection(&revs.commits, &reaches, &all, bisect_find_all); diff --git a/fast-import.c b/fast-import.c index 58ef360da4..b5db5d20b1 100644 --- a/fast-import.c +++ b/fast-import.c @@ -3005,7 +3005,7 @@ static void cat_blob(struct object_entry *oe, struct object_id *oid) static void parse_get_mark(const char *p) { - struct object_entry *oe = oe; + struct object_entry *oe; char output[GIT_MAX_HEXSZ + 2]; /* get-mark SP <object> LF */ @@ -3022,7 +3022,7 @@ static void parse_get_mark(const char *p) static void parse_cat_blob(const char *p) { - struct object_entry *oe = oe; + struct object_entry *oe; struct object_id oid; /* cat-blob SP <object> LF */ diff --git a/merge-recursive.c b/merge-recursive.c index 2f232ad3b4..869092f7b9 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -2090,7 +2090,7 @@ int merge_recursive(struct merge_options *o, { struct commit_list *iter; struct commit *merged_common_ancestors; - struct tree *mrtree = mrtree; + struct tree *mrtree; int clean; if (show(o, 4)) { diff --git a/read-cache.c b/read-cache.c index a5dc7c7e67..59a73f4a81 100644 --- a/read-cache.c +++ b/read-cache.c @@ -2110,13 +2110,15 @@ static int ce_write_entry(git_hash_ctx *c, int fd, struct cache_entry *ce, struct strbuf *previous_name, struct ondisk_cache_entry *ondisk) { int size; - int saved_namelen = saved_namelen; /* compiler workaround */ int result; + unsigned int saved_namelen; + int stripped_name = 0; static unsigned char padding[8] = { 0x00 }; if (ce->ce_flags & CE_STRIP_NAME) { saved_namelen = ce_namelen(ce); ce->ce_namelen = 0; + stripped_name = 1; } if (ce->ce_flags & CE_EXTENDED) @@ -2156,7 +2158,7 @@ static int ce_write_entry(git_hash_ctx *c, int fd, struct cache_entry *ce, strbuf_splice(previous_name, common, to_remove, ce->name + common, ce_namelen(ce) - common); } - if (ce->ce_flags & CE_STRIP_NAME) { + if (stripped_name) { ce->ce_namelen = saved_namelen; ce->ce_flags &= ~CE_STRIP_NAME; } |