Merge branch 'ab/clang-lints'

* 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
This commit is contained in:
Junio C Hamano 2011-12-05 15:12:34 -08:00
commit e72c1dd3bd
3 changed files with 2 additions and 5 deletions

View File

@ -250,9 +250,6 @@ static int fuzzy_matchlines(const char *s1, size_t n1,
const char *last2 = s2 + n2 - 1; const char *last2 = s2 + n2 - 1;
int result = 0; int result = 0;
if (n1 < 0 || n2 < 0)
return 0;
/* ignore line endings */ /* ignore line endings */
while ((*last1 == '\r') || (*last1 == '\n')) while ((*last1 == '\r') || (*last1 == '\n'))
last1--; last1--;

View File

@ -182,7 +182,7 @@ static int builtin_diff_combined(struct rev_info *revs,
hashcpy((unsigned char *)(parent + i), ent[i].item->sha1); hashcpy((unsigned char *)(parent + i), ent[i].item->sha1);
diff_tree_combined(parent[0], parent + 1, ents - 1, diff_tree_combined(parent[0], parent + 1, ents - 1,
revs->dense_combined_merges, revs); revs->dense_combined_merges, revs);
free(parent); free((void *)parent);
return 0; return 0;
} }

View File

@ -391,7 +391,7 @@ static void commit_need_pushing(struct commit *commit, struct commit_list *paren
rev.diffopt.format_callback_data = needs_pushing; rev.diffopt.format_callback_data = needs_pushing;
diff_tree_combined(commit->object.sha1, parents, n, 1, &rev); 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) int check_submodule_needs_pushing(unsigned char new_sha1[20], const char *remotes_name)