Fewer uses of size_t in delete.c

* src/delete.c (write_recent_blocks, write_recent_bytes):
Prefer idx_t to size_t.
This commit is contained in:
Paul Eggert
2024-10-31 19:53:25 -07:00
parent 849f244a0b
commit 739483114d

View File

@@ -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);