diff options
Diffstat (limited to 'archival')
-rw-r--r-- | archival/libunarchive/decompress_unlzma.c | 4 | ||||
-rw-r--r-- | archival/unzip.c | 14 |
2 files changed, 9 insertions, 9 deletions
diff --git a/archival/libunarchive/decompress_unlzma.c b/archival/libunarchive/decompress_unlzma.c index 62811ddfc..9c53e0a56 100644 --- a/archival/libunarchive/decompress_unlzma.c +++ b/archival/libunarchive/decompress_unlzma.c | |||
@@ -119,10 +119,10 @@ int unlzma(int src_fd, int dst_fd) | |||
119 | pos_state_mask = (1 << pb) - 1; | 119 | pos_state_mask = (1 << pb) - 1; |
120 | literal_pos_mask = (1 << lp) - 1; | 120 | literal_pos_mask = (1 << lp) - 1; |
121 | 121 | ||
122 | #if __BYTE_ORDER == __BIG_ENDIAN | 122 | #if BB_BIG_ENDIAN |
123 | header.dict_size = bswap_32(header.dict_size); | 123 | header.dict_size = bswap_32(header.dict_size); |
124 | header.dst_size = bswap_64(header.dst_size); | 124 | header.dst_size = bswap_64(header.dst_size); |
125 | #endif /* __BYTE_ORDER */ | 125 | #endif |
126 | 126 | ||
127 | if (header.dict_size == 0) | 127 | if (header.dict_size == 0) |
128 | header.dict_size = 1; | 128 | header.dict_size = 1; |
diff --git a/archival/unzip.c b/archival/unzip.c index 7e0d107cc..f95e31206 100644 --- a/archival/unzip.c +++ b/archival/unzip.c | |||
@@ -32,7 +32,7 @@ | |||
32 | #include "unarchive.h" | 32 | #include "unarchive.h" |
33 | #include "busybox.h" | 33 | #include "busybox.h" |
34 | 34 | ||
35 | #if (BYTE_ORDER == BIG_ENDIAN) | 35 | #if BB_BIG_ENDIAN |
36 | static inline unsigned short | 36 | static inline unsigned short |
37 | __swap16(unsigned short x) { | 37 | __swap16(unsigned short x) { |
38 | return (((uint16_t)(x) & 0xFF) << 8) | (((uint16_t)(x) & 0xFF00) >> 8); | 38 | return (((uint16_t)(x) & 0xFF) << 8) | (((uint16_t)(x) & 0xFF00) >> 8); |
@@ -45,10 +45,10 @@ __swap32(uint32_t x) { | |||
45 | ((x & 0xFF0000) >> 8) | | 45 | ((x & 0xFF0000) >> 8) | |
46 | ((x & 0xFF000000) >> 24)); | 46 | ((x & 0xFF000000) >> 24)); |
47 | } | 47 | } |
48 | #else | 48 | #else /* it's little-endian */ |
49 | #define __swap16(x) (x) | 49 | # define __swap16(x) (x) |
50 | #define __swap32(x) (x) | 50 | # define __swap32(x) (x) |
51 | #endif | 51 | #endif /* BB_BIG_ENDIAN */ |
52 | 52 | ||
53 | #define ZIP_FILEHEADER_MAGIC __swap32(0x04034b50) | 53 | #define ZIP_FILEHEADER_MAGIC __swap32(0x04034b50) |
54 | #define ZIP_CDS_MAGIC __swap32(0x02014b50) | 54 | #define ZIP_CDS_MAGIC __swap32(0x02014b50) |
@@ -253,7 +253,7 @@ extern int unzip_main(int argc, char **argv) | |||
253 | 253 | ||
254 | /* Read the file header */ | 254 | /* Read the file header */ |
255 | unzip_read(src_fd, zip_header.raw, 26); | 255 | unzip_read(src_fd, zip_header.raw, 26); |
256 | #if (BYTE_ORDER == BIG_ENDIAN) | 256 | #if BB_BIG_ENDIAN |
257 | zip_header.formated.version = __swap16(zip_header.formated.version); | 257 | zip_header.formated.version = __swap16(zip_header.formated.version); |
258 | zip_header.formated.flags = __swap16(zip_header.formated.flags); | 258 | zip_header.formated.flags = __swap16(zip_header.formated.flags); |
259 | zip_header.formated.method = __swap16(zip_header.formated.method); | 259 | zip_header.formated.method = __swap16(zip_header.formated.method); |
@@ -264,7 +264,7 @@ extern int unzip_main(int argc, char **argv) | |||
264 | zip_header.formated.ucmpsize = __swap32(zip_header.formated.ucmpsize); | 264 | zip_header.formated.ucmpsize = __swap32(zip_header.formated.ucmpsize); |
265 | zip_header.formated.filename_len = __swap16(zip_header.formated.filename_len); | 265 | zip_header.formated.filename_len = __swap16(zip_header.formated.filename_len); |
266 | zip_header.formated.extra_len = __swap16(zip_header.formated.extra_len); | 266 | zip_header.formated.extra_len = __swap16(zip_header.formated.extra_len); |
267 | #endif | 267 | #endif /* BB_BIG_ENDIAN */ |
268 | if ((zip_header.formated.method != 0) && (zip_header.formated.method != 8)) { | 268 | if ((zip_header.formated.method != 0) && (zip_header.formated.method != 8)) { |
269 | bb_error_msg_and_die("Unsupported compression method %d", zip_header.formated.method); | 269 | bb_error_msg_and_die("Unsupported compression method %d", zip_header.formated.method); |
270 | } | 270 | } |