aboutsummaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
Diffstat (limited to 'archival')
-rw-r--r--archival/ar.c8
-rw-r--r--archival/dpkg.c5
-rw-r--r--archival/gzip.c14
-rw-r--r--archival/libunarchive/decompress_unzip.c12
-rw-r--r--archival/tar.c2
5 files changed, 21 insertions, 20 deletions
diff --git a/archival/ar.c b/archival/ar.c
index e85ca5c6f..7b16c2b59 100644
--- a/archival/ar.c
+++ b/archival/ar.c
@@ -41,10 +41,11 @@ static void header_verbose_list_ar(const file_header_t *file_header)
41int ar_main(int argc, char **argv); 41int ar_main(int argc, char **argv);
42int ar_main(int argc, char **argv) 42int ar_main(int argc, char **argv)
43{ 43{
44 static const char msg_unsupported_err[] ALIGN1 =
45 "archive %s is not supported";
46
44 archive_handle_t *archive_handle; 47 archive_handle_t *archive_handle;
45 unsigned opt; 48 unsigned opt;
46 static const char msg_unsupported_err[] =
47 "Archive %s not supported. Install binutils 'ar'.";
48 char magic[8]; 49 char magic[8];
49 50
50 archive_handle = init_handle(); 51 archive_handle = init_handle();
@@ -88,7 +89,8 @@ int ar_main(int argc, char **argv)
88 } 89 }
89 archive_handle->offset += 7; 90 archive_handle->offset += 7;
90 91
91 while (get_header_ar(archive_handle) == EXIT_SUCCESS) /* repeat */; 92 while (get_header_ar(archive_handle) == EXIT_SUCCESS)
93 continue;
92 94
93 return EXIT_SUCCESS; 95 return EXIT_SUCCESS;
94} 96}
diff --git a/archival/dpkg.c b/archival/dpkg.c
index bd729a2a9..0c1f96fc9 100644
--- a/archival/dpkg.c
+++ b/archival/dpkg.c
@@ -582,7 +582,8 @@ static int read_package_field(const char *package_buffer, char **field_name, cha
582 582
583static unsigned fill_package_struct(char *control_buffer) 583static unsigned fill_package_struct(char *control_buffer)
584{ 584{
585 static const char field_names[] = "Package\0""Version\0" 585 static const char field_names[] ALIGN1 =
586 "Package\0""Version\0"
586 "Pre-Depends\0""Depends\0""Replaces\0""Provides\0" 587 "Pre-Depends\0""Depends\0""Replaces\0""Provides\0"
587 "Conflicts\0""Suggests\0""Recommends\0""Enhances\0"; 588 "Conflicts\0""Suggests\0""Recommends\0""Enhances\0";
588 589
@@ -1226,7 +1227,7 @@ static int run_package_script(const char *package_name, const char *script_type)
1226 return result; 1227 return result;
1227} 1228}
1228 1229
1229static const char *all_control_files[] = { 1230static const char *const all_control_files[] = {
1230 "preinst", "postinst", "prerm", "postrm", 1231 "preinst", "postinst", "prerm", "postrm",
1231 "list", "md5sums", "shlibs", "conffiles", 1232 "list", "md5sums", "shlibs", "conffiles",
1232 "config", "templates", NULL 1233 "config", "templates", NULL
diff --git a/archival/gzip.c b/archival/gzip.c
index 08c660e40..83d78e47c 100644
--- a/archival/gzip.c
+++ b/archival/gzip.c
@@ -768,26 +768,24 @@ static void check_match(IPos start, IPos match, int length)
768#define BL_CODES 19 768#define BL_CODES 19
769/* number of codes used to transfer the bit lengths */ 769/* number of codes used to transfer the bit lengths */
770 770
771typedef uch extra_bits_t;
772
773/* extra bits for each length code */ 771/* extra bits for each length code */
774static const extra_bits_t extra_lbits[LENGTH_CODES]= { 772static const uint8_t extra_lbits[LENGTH_CODES] ALIGN1 = {
775 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 773 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4,
776 4, 4, 5, 5, 5, 5, 0 774 4, 4, 5, 5, 5, 5, 0
777}; 775};
778 776
779/* extra bits for each distance code */ 777/* extra bits for each distance code */
780static const extra_bits_t extra_dbits[D_CODES] = { 778static const uint8_t extra_dbits[D_CODES] ALIGN1 = {
781 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 779 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,
782 10, 10, 11, 11, 12, 12, 13, 13 780 10, 10, 11, 11, 12, 12, 13, 13
783}; 781};
784 782
785/* extra bits for each bit length code */ 783/* extra bits for each bit length code */
786static const extra_bits_t extra_blbits[BL_CODES] = { 784static const uint8_t extra_blbits[BL_CODES] ALIGN1 = {
787 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7 }; 785 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7 };
788 786
789/* number of codes at each bit length for an optimal tree */ 787/* number of codes at each bit length for an optimal tree */
790static const uch bl_order[BL_CODES] = { 788static const uint8_t bl_order[BL_CODES] ALIGN1 = {
791 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; 789 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 };
792 790
793#define STORED_BLOCK 0 791#define STORED_BLOCK 0
@@ -861,7 +859,7 @@ typedef struct ct_data {
861typedef struct tree_desc { 859typedef struct tree_desc {
862 ct_data *dyn_tree; /* the dynamic tree */ 860 ct_data *dyn_tree; /* the dynamic tree */
863 ct_data *static_tree; /* corresponding static tree or NULL */ 861 ct_data *static_tree; /* corresponding static tree or NULL */
864 const extra_bits_t *extra_bits; /* extra bits for each code or NULL */ 862 const uint8_t *extra_bits; /* extra bits for each code or NULL */
865 int extra_base; /* base index for extra_bits */ 863 int extra_base; /* base index for extra_bits */
866 int elems; /* max number of elements in the tree */ 864 int elems; /* max number of elements in the tree */
867 int max_length; /* max bit length for the codes */ 865 int max_length; /* max bit length for the codes */
@@ -1064,7 +1062,7 @@ static void pqdownheap(ct_data * tree, int k)
1064static void gen_bitlen(tree_desc * desc) 1062static void gen_bitlen(tree_desc * desc)
1065{ 1063{
1066 ct_data *tree = desc->dyn_tree; 1064 ct_data *tree = desc->dyn_tree;
1067 const extra_bits_t *extra = desc->extra_bits; 1065 const uint8_t *extra = desc->extra_bits;
1068 int base = desc->extra_base; 1066 int base = desc->extra_base;
1069 int max_code = desc->max_code; 1067 int max_code = desc->max_code;
1070 int max_length = desc->max_length; 1068 int max_length = desc->max_length;
diff --git a/archival/libunarchive/decompress_unzip.c b/archival/libunarchive/decompress_unzip.c
index c698763d3..ead628ed5 100644
--- a/archival/libunarchive/decompress_unzip.c
+++ b/archival/libunarchive/decompress_unzip.c
@@ -182,39 +182,39 @@ static state_t* alloc_state(void)
182#endif 182#endif
183 183
184 184
185static const unsigned short mask_bits[] = { 185static const unsigned short mask_bits[] ALIGN2 = {
186 0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, 186 0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
187 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff 187 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
188}; 188};
189 189
190/* Copy lengths for literal codes 257..285 */ 190/* Copy lengths for literal codes 257..285 */
191static const unsigned short cplens[] = { 191static const unsigned short cplens[] ALIGN2 = {
192 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 192 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59,
193 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 193 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0
194}; 194};
195 195
196/* note: see note #13 above about the 258 in this list. */ 196/* note: see note #13 above about the 258 in this list. */
197/* Extra bits for literal codes 257..285 */ 197/* Extra bits for literal codes 257..285 */
198static const unsigned char cplext[] = { 198static const unsigned char cplext[] ALIGN1 = {
199 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 199 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5,
200 5, 5, 5, 0, 99, 99 200 5, 5, 5, 0, 99, 99
201}; /* 99 == invalid */ 201}; /* 99 == invalid */
202 202
203/* Copy offsets for distance codes 0..29 */ 203/* Copy offsets for distance codes 0..29 */
204static const unsigned short cpdist[] = { 204static const unsigned short cpdist[] ALIGN2 = {
205 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 205 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513,
206 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577 206 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577
207}; 207};
208 208
209/* Extra bits for distance codes */ 209/* Extra bits for distance codes */
210static const unsigned char cpdext[] = { 210static const unsigned char cpdext[] ALIGN1 = {
211 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 211 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10,
212 11, 11, 12, 12, 13, 13 212 11, 11, 12, 12, 13, 13
213}; 213};
214 214
215/* Tables for deflate from PKZIP's appnote.txt. */ 215/* Tables for deflate from PKZIP's appnote.txt. */
216/* Order of the bit length code lengths */ 216/* Order of the bit length code lengths */
217static const unsigned char border[] = { 217static const unsigned char border[] ALIGN1 = {
218 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 218 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15
219}; 219};
220 220
diff --git a/archival/tar.c b/archival/tar.c
index 7d7bf79d6..bed8cf24c 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -715,7 +715,7 @@ enum {
715 OPT_NOPRESERVE_PERM = 1 << OPTBIT_NOPRESERVE_PERM, // no-same-permissions 715 OPT_NOPRESERVE_PERM = 1 << OPTBIT_NOPRESERVE_PERM, // no-same-permissions
716}; 716};
717#if ENABLE_FEATURE_TAR_LONG_OPTIONS 717#if ENABLE_FEATURE_TAR_LONG_OPTIONS
718static const char tar_longopts[] = 718static const char tar_longopts[] ALIGN1 =
719 "list\0" No_argument "t" 719 "list\0" No_argument "t"
720 "extract\0" No_argument "x" 720 "extract\0" No_argument "x"
721 "directory\0" Required_argument "C" 721 "directory\0" Required_argument "C"