diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-12-27 11:46:25 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-12-27 08:11:45 -0800 |
commit | 85ee0680e2d5d667919e06394ca7622f09652310 (patch) | |
tree | b7bec04951c0310b0df8a88e7ff24dd77e1eeca7 /commit-reach.c | |
parent | 45843d8f4eb2bbfc73cc361ba9d612d088dc8a4f (diff) |
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 'commit-reach.c')
-rw-r--r-- | commit-reach.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/commit-reach.c b/commit-reach.c index d7f6f1be75..bab40f5575 100644 --- a/commit-reach.c +++ b/commit-reach.c @@ -791,8 +791,8 @@ int can_all_from_reach_with_flag(struct object_array *from, timestamp_t min_generation) { struct commit **list = NULL; - int i; - int nr_commits; + size_t i; + size_t nr_commits; int result = 1; ALLOC_ARRAY(list, from->nr); @@ -944,8 +944,8 @@ int can_all_from_reach(struct commit_list *from, struct commit_list *to, return result; } -struct commit_list *get_reachable_subset(struct commit **from, int nr_from, - struct commit **to, int nr_to, +struct commit_list *get_reachable_subset(struct commit **from, size_t nr_from, + struct commit **to, size_t nr_to, unsigned int reachable_flag) { struct commit **item; |