From: Paul Eggert Date: Fri, 1 Nov 2024 16:40:36 +0000 (-0700) Subject: Prefer idx_t to size_t in tar.h X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c2ce0b7e13ce4c41c9c3a26dd037783af89e5121;p=thirdparty%2Ftar.git Prefer idx_t to size_t in tar.h * src/tar.h (struct xheader, struct tar_stat_info): Prefer idx_t to size_t. All uses changed. --- diff --git a/src/sparse.c b/src/sparse.c index ac9f0bb5..61f20c1f 100644 --- a/src/sparse.c +++ b/src/sparse.c @@ -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; } diff --git a/src/tar.h b/src/tar.h index e9faf406..caae9a13 100644 --- 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 */