]> git.ipfire.org Git - thirdparty/tar.git/commitdiff
Prefer idx_t to size_t in tar.h
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 1 Nov 2024 16:40:36 +0000 (09:40 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 2 Nov 2024 06:47:23 +0000 (23:47 -0700)
* src/tar.h (struct xheader, struct tar_stat_info):
Prefer idx_t to size_t.  All uses changed.

src/sparse.c
src/tar.h

index ac9f0bb5a00ff2908b459dcc206104237abc734a..61f20c1f32bb4ea49a430d96a22b8eff58ccf357 100644 (file)
@@ -200,7 +200,7 @@ sparse_add_map (struct tar_stat_info *st, struct sp_array const *sp)
   idx_t avail = st->sparse_map_avail;
   if (avail == st->sparse_map_size)
     st->sparse_map = sparse_map =
-      x2nrealloc (sparse_map, &st->sparse_map_size, sizeof *sparse_map);
+      xpalloc (sparse_map, &st->sparse_map_size, 1, -1, sizeof *sparse_map);
   sparse_map[avail] = *sp;
   st->sparse_map_avail = avail + 1;
 }
index e9faf406e9716e987cd289752742c645b20c733f..caae9a13cda485efa57f5d2ad063ffaf4b13795c 100644 (file)
--- a/src/tar.h
+++ b/src/tar.h
@@ -287,7 +287,7 @@ struct sp_array
 struct xheader
 {
   struct obstack *stk;
-  size_t size;
+  idx_t size;
   char *buffer;
   uintmax_t string_length;
 };
@@ -343,10 +343,10 @@ struct tar_stat_info
   /* For sparse files: */
   intmax_t sparse_major;
   intmax_t sparse_minor;
-  size_t sparse_map_avail;  /* Index to the first unused element in
+  idx_t sparse_map_avail;   /* Index to the first unused element in
                               sparse_map array. Zero if the file is
                               not sparse */
-  size_t sparse_map_size;   /* Size of the sparse map */
+  idx_t sparse_map_size;   /* Size of the sparse map */
   struct sp_array *sparse_map;
 
   off_t real_size;          /* The real size of sparse file */