aboutsummaryrefslogtreecommitdiff
path: root/reftable/stack.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-02-06 07:35:35 +0100
committerJunio C Hamano <gitster@pobox.com>2024-02-06 12:10:08 -0800
commit6d5e80fba2397708671cee6d9c5e394c4c187659 (patch)
treeda7841148339a1bd17166395eb96cd0dbbafacc7 /reftable/stack.h
parentca63af0a248d31bf917d207722b284da41ffcee7 (diff)
downloadgit-6d5e80fba2397708671cee6d9c5e394c4c187659.tar.xz
reftable/stack: index segments with `size_t`
We use `int`s to index into arrays of segments and track the length of them, which is considered to be a code smell in the Git project. Convert the code to use `size_t` instead. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reftable/stack.h')
-rw-r--r--reftable/stack.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/reftable/stack.h b/reftable/stack.h
index c1e3efa899..d919455669 100644
--- a/reftable/stack.h
+++ b/reftable/stack.h
@@ -32,13 +32,13 @@ struct reftable_stack {
int read_lines(const char *filename, char ***lines);
struct segment {
- int start, end;
+ size_t start, end;
int log;
uint64_t bytes;
};
int fastlog2(uint64_t sz);
-struct segment *sizes_to_segments(int *seglen, uint64_t *sizes, int n);
-struct segment suggest_compaction_segment(uint64_t *sizes, int n);
+struct segment *sizes_to_segments(size_t *seglen, uint64_t *sizes, size_t n);
+struct segment suggest_compaction_segment(uint64_t *sizes, size_t n);
#endif