aboutsummaryrefslogtreecommitdiff
path: root/merge-recursive.c
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2009-03-15 22:01:20 +0100
committerJunio C Hamano <gitster@pobox.com>2009-03-15 18:25:24 -0700
commit8e24cbaeafc7eed709e251fda1673ffea84edfb1 (patch)
treeb555dc4e224e336abac4469f80fce106ae898c29 /merge-recursive.c
parentde7697808fd8b552479a60fa3b98440d541b42de (diff)
downloadgit-8e24cbaeafc7eed709e251fda1673ffea84edfb1.tar.gz
git-8e24cbaeafc7eed709e251fda1673ffea84edfb1.tar.xz
Fix various dead stores found by the clang static analyzer
http-push.c::finish_request(): request is initialized by the for loop index-pack.c::free_base_data(): b is initialized by the for loop merge-recursive.c::process_renames(): move compare to narrower scope, and remove unused assignments to it remove unused variable renames2 xdiff/xdiffi.c::xdl_recs_cmp(): remove unused variable ec xdiff/xemit.c::xdl_emit_diff(): xche is always overwritten Signed-off-by: Benjamin Kramer <benny.kra@googlemail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-recursive.c')
-rw-r--r--merge-recursive.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index ee853b990..3e1bc3e07 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -801,22 +801,19 @@ static int process_renames(struct merge_options *o,
}
for (i = 0, j = 0; i < a_renames->nr || j < b_renames->nr;) {
- int compare;
char *src;
- struct string_list *renames1, *renames2, *renames2Dst;
+ struct string_list *renames1, *renames2Dst;
struct rename *ren1 = NULL, *ren2 = NULL;
const char *branch1, *branch2;
const char *ren1_src, *ren1_dst;
if (i >= a_renames->nr) {
- compare = 1;
ren2 = b_renames->items[j++].util;
} else if (j >= b_renames->nr) {
- compare = -1;
ren1 = a_renames->items[i++].util;
} else {
- compare = strcmp(a_renames->items[i].string,
- b_renames->items[j].string);
+ int compare = strcmp(a_renames->items[i].string,
+ b_renames->items[j].string);
if (compare <= 0)
ren1 = a_renames->items[i++].util;
if (compare >= 0)
@@ -826,14 +823,12 @@ static int process_renames(struct merge_options *o,
/* TODO: refactor, so that 1/2 are not needed */
if (ren1) {
renames1 = a_renames;
- renames2 = b_renames;
renames2Dst = &b_by_dst;
branch1 = o->branch1;
branch2 = o->branch2;
} else {
struct rename *tmp;
renames1 = b_renames;
- renames2 = a_renames;
renames2Dst = &a_by_dst;
branch1 = o->branch2;
branch2 = o->branch1;