mirror of
https://github.com/git/git.git
synced 2026-01-09 17:46:37 +00:00
reftable/basics: adjust common_prefix_size() to return size_t
The `common_prefix_size()` function computes the length of the common prefix between two buffers. As such its return value will always be an unsigned integer, as the length cannot be negative. Regardless of that, the function returns a signed integer, which is nonsensical and causes a couple of -Wsign-compare warnings all over the place. Adjust the function to return a `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
072e3aa3a5
commit
5ac65f0d6b
@@ -169,7 +169,7 @@ static inline void *reftable_alloc_grow(void *p, size_t nelem, size_t elsize,
|
||||
#endif
|
||||
|
||||
/* Find the longest shared prefix size of `a` and `b` */
|
||||
int common_prefix_size(struct reftable_buf *a, struct reftable_buf *b);
|
||||
size_t common_prefix_size(struct reftable_buf *a, struct reftable_buf *b);
|
||||
|
||||
int hash_size(enum reftable_hash id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user