diff mbox series

[08/10] reftable/blocksource: adjust type of the block length

Message ID 20250116-b4-pks-reftable-sign-compare-v1-8-bd30e2ee96e7@pks.im (mailing list archive)
State Superseded
Headers show
Series reftable: fix -Wsign-compare warnings | expand

Commit Message

Patrick Steinhardt Jan. 16, 2025, 10:08 a.m. UTC
The block length is used to track the number of bytes available in a
specific block. As such, it is never set to a negative value, but is
still represented by a signed integer.

Adjust the type of the variable to be `size_t`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 reftable/reftable-blocksource.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/reftable/reftable-blocksource.h b/reftable/reftable-blocksource.h
index 5aa3990a57..f06ad52e0a 100644
--- a/reftable/reftable-blocksource.h
+++ b/reftable/reftable-blocksource.h
@@ -22,7 +22,7 @@  struct reftable_block_source {
  * so it can return itself into the pool. */
 struct reftable_block {
 	uint8_t *data;
-	int len;
+	size_t len;
 	struct reftable_block_source source;
 };