reftable/stack: use size_t to track stack length

While the stack length is already stored as `size_t`, we frequently use
`int`s to refer to those stacks throughout the reftable library. Convert
those cases to use `size_t` instead to make things consistent.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2024-02-06 07:35:46 +01:00
committed by Junio C Hamano
parent 47616c4399
commit 81879123c3
6 changed files with 26 additions and 31 deletions

View File

@ -64,12 +64,11 @@ void free_names(char **a)
reftable_free(a);
}
int names_length(char **names)
size_t names_length(char **names)
{
char **p = names;
for (; *p; p++) {
/* empty */
}
while (*p)
p++;
return p - names;
}