mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
ca63af0a24
commit
6d5e80fba2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user