]> git.ipfire.org Git - thirdparty/git.git/commit
reftable/basics: adjust `common_prefix_size()` to return `size_t`
authorPatrick Steinhardt <ps@pks.im>
Mon, 20 Jan 2025 16:17:22 +0000 (17:17 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 21 Jan 2025 22:20:29 +0000 (14:20 -0800)
commit5ac65f0d6b867ff031fda03779c2f2613f022b10
tree4a27077b5eedc1ae09c81cc10277c79ccba22074
parent072e3aa3a5c29ca1b68a7aaf570a0a8e7ab67127
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>
reftable/basics.c
reftable/basics.h
reftable/record.c
reftable/writer.c
t/unit-tests/t-reftable-basics.c