From 739483114da3ec83cdb97f119de78bf96c2663ba Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 31 Oct 2024 19:53:25 -0700 Subject: [PATCH] Fewer uses of size_t in delete.c * src/delete.c (write_recent_blocks, write_recent_bytes): Prefer idx_t to size_t. --- src/delete.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/delete.c b/src/delete.c index 2896bdef..cc356067 100644 --- a/src/delete.c +++ b/src/delete.c @@ -101,10 +101,9 @@ write_record (int move_back_flag) } static void -write_recent_blocks (union block *h, size_t blocks) +write_recent_blocks (union block *h, idx_t blocks) { - size_t i; - for (i = 0; i < blocks; i++) + for (idx_t i = 0; i < blocks; i++) { new_record[new_blocks++] = h[i]; if (new_blocks == blocking_factor) @@ -113,10 +112,10 @@ write_recent_blocks (union block *h, size_t blocks) } static void -write_recent_bytes (char *data, size_t bytes) +write_recent_bytes (char *data, idx_t bytes) { - size_t blocks = bytes / BLOCKSIZE; - size_t rest = bytes % BLOCKSIZE; + idx_t blocks = bytes / BLOCKSIZE; + idx_t rest = bytes % BLOCKSIZE; write_recent_blocks ((union block *)data, blocks); memcpy (new_record[new_blocks].buffer, data + blocks * BLOCKSIZE, rest); -- 2.47.2