summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2011-12-13 21:47:51 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-12-13 21:47:51 -0800
commitc0eb9ccfb97297e25ccbab0481159282147b353f (patch)
treeb7484bd897f92f726103dc3363183bca9626358e
parentMerge branch 'nd/maint-ignore-exclude' into maint-1.7.7 (diff)
parentcast variable in call to free() in builtin/diff.c and submodule.c (diff)
downloadtgif-c0eb9ccfb97297e25ccbab0481159282147b353f.tar.xz
Merge branch 'ab/clang-lints' into maint-1.7.7
* ab/clang-lints: cast variable in call to free() in builtin/diff.c and submodule.c apply: get rid of useless x < 0 comparison on a size_t type
-rw-r--r--builtin/apply.c3
-rw-r--r--builtin/diff.c2
-rw-r--r--submodule.c2
3 files changed, 2 insertions, 5 deletions
diff --git a/builtin/apply.c b/builtin/apply.c
index 311a94e181..082fe8f3e3 100644
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -250,9 +250,6 @@ static int fuzzy_matchlines(const char *s1, size_t n1,
const char *last2 = s2 + n2 - 1;
int result = 0;
- if (n1 < 0 || n2 < 0)
- return 0;
-
/* ignore line endings */
while ((*last1 == '\r') || (*last1 == '\n'))
last1--;
diff --git a/builtin/diff.c b/builtin/diff.c
index 1118689fb2..0fe638fc45 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -182,7 +182,7 @@ static int builtin_diff_combined(struct rev_info *revs,
hashcpy((unsigned char *)(parent + i), ent[i].item->sha1);
diff_tree_combined(parent[0], parent + 1, ents - 1,
revs->dense_combined_merges, revs);
- free(parent);
+ free((void *)parent);
return 0;
}
diff --git a/submodule.c b/submodule.c
index 0b709bc291..09a41b59be 100644
--- a/submodule.c
+++ b/submodule.c
@@ -391,7 +391,7 @@ static void commit_need_pushing(struct commit *commit, struct commit_list *paren
rev.diffopt.format_callback_data = needs_pushing;
diff_tree_combined(commit->object.sha1, parents, n, 1, &rev);
- free(parents);
+ free((void *)parents);
}
int check_submodule_needs_pushing(unsigned char new_sha1[20], const char *remotes_name)