]> git.ipfire.org Git - thirdparty/tar.git/commitdiff
Fewer uses of size_t in delete.c
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 1 Nov 2024 02:53:25 +0000 (19:53 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 2 Nov 2024 06:47:23 +0000 (23:47 -0700)
* src/delete.c (write_recent_blocks, write_recent_bytes):
Prefer idx_t to size_t.

src/delete.c

index 2896bdef06039442bb8ba93d479bd3835697f4c4..cc3560671db809e88d267126fd005495f5f287e2 100644 (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);