author | Junio C Hamano <gitster@pobox.com> | |
Mon, 5 Dec 2011 23:12:34 +0000 (15:12 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 5 Dec 2011 23:12:34 +0000 (15:12 -0800) |
* 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
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
builtin/apply.c | patch | blob | history | |
builtin/diff.c | patch | blob | history | |
submodule.c | patch | blob | history |
diff --git a/builtin/apply.c b/builtin/apply.c
index 84a8a0b52136c4d1e43ec10f9ef5ed76b7d3c12f..b3b59db534ff0763c822ae9da571d5643a8b709a 100644 (file)
--- a/builtin/apply.c
+++ b/builtin/apply.c
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 1118689fb246b864ce758039543327c4304cdaa4..0fe638fc45c780e53901b8be22d3b4d715be3c30 100644 (file)
--- a/builtin/diff.c
+++ b/builtin/diff.c
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 0fd10a0fdbf5d1af10819dea808b43f6b13b98a8..52cdcc6a6347a786deafad34efdb9dc4dc3670ff 100644 (file)
--- 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)