Skip to content

Commit 8e9e136

Browse files
pks-tgitster
authored andcommitted
reftable: use uint16_t to track restart interval
The restart interval can at most be `UINT16_MAX` as specified in the technical documentation of the reftable format. Furthermore, it cannot ever be negative. Regardless of that we use an `int` to track the restart interval. Change the type to use an `uint16_t` instead. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 831b366 commit 8e9e136

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

reftable/block.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct block_writer {
2929
uint32_t header_off;
3030

3131
/* How often to restart keys. */
32-
int restart_interval;
32+
uint16_t restart_interval;
3333
int hash_size;
3434

3535
/* Offset of next uint8_t to write. */

reftable/reftable-writer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct reftable_write_options {
2828
unsigned skip_index_objects : 1;
2929

3030
/* how often to write complete keys in each block. */
31-
int restart_interval;
31+
uint16_t restart_interval;
3232

3333
/* 4-byte identifier ("sha1", "s256") of the hash.
3434
* Defaults to SHA1 if unset

0 commit comments

Comments
 (0)