summaryrefslogtreecommitdiffstats
path: root/bisect.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-12-27 11:46:25 +0100
committerJunio C Hamano <gitster@pobox.com>2024-12-27 17:11:45 +0100
commit85ee0680e2d5d667919e06394ca7622f09652310 (patch)
treeb7bec04951c0310b0df8a88e7ff24dd77e1eeca7 /bisect.c
parentcommit-reach: use `size_t` to track indices in `remove_redundant()` (diff)
downloadgit-85ee0680e2d5d667919e06394ca7622f09652310.tar.xz
git-85ee0680e2d5d667919e06394ca7622f09652310.zip
commit-reach: use `size_t` to track indices in `get_reachable_subset()`
Similar as with the preceding commit, adapt `get_reachable_subset()` so that it tracks array indices via `size_t` instead of using signed integers to fix a couple of -Wsign-compare warnings. Adapt callers accordingly. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'bisect.c')
-rw-r--r--bisect.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/bisect.c b/bisect.c
index 1a9069c9ad..7a1afc46e5 100644
--- a/bisect.c
+++ b/bisect.c
@@ -780,10 +780,10 @@ static struct commit *get_commit_reference(struct repository *r,
}
static struct commit **get_bad_and_good_commits(struct repository *r,
- int *rev_nr)
+ size_t *rev_nr)
{
struct commit **rev;
- int i, n = 0;
+ size_t i, n = 0;
ALLOC_ARRAY(rev, 1 + good_revs.nr);
rev[n++] = get_commit_reference(r, current_bad_oid);
@@ -887,7 +887,7 @@ static enum bisect_error check_merge_bases(int rev_nr, struct commit **rev, int
return res;
}
-static int check_ancestors(struct repository *r, int rev_nr,
+static int check_ancestors(struct repository *r, size_t rev_nr,
struct commit **rev, const char *prefix)
{
struct strvec rev_argv = STRVEC_INIT;
@@ -922,7 +922,8 @@ static enum bisect_error check_good_are_ancestors_of_bad(struct repository *r,
{
char *filename;
struct stat st;
- int fd, rev_nr;
+ int fd;
+ size_t rev_nr;
enum bisect_error res = BISECT_OK;
struct commit **rev;