diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-05-30 04:50:21 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-05-30 04:50:21 +0200 |
commit | acaaca839abada0d0718375ba03dcaeddda15d9e (patch) | |
tree | 73f1a0603b61c17156878aee1c7d234e61dd6e19 | |
parent | 6948f210ed443f8153e0ba751e77bec8a0c6c8d4 (diff) | |
download | busybox-w32-acaaca839abada0d0718375ba03dcaeddda15d9e.tar.gz busybox-w32-acaaca839abada0d0718375ba03dcaeddda15d9e.tar.bz2 busybox-w32-acaaca839abada0d0718375ba03dcaeddda15d9e.zip |
unxz: remove debugging. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | archival/libunarchive/decompress_unxz.c | 1 | ||||
-rw-r--r-- | archival/libunarchive/unxz/xz.h | 4 | ||||
-rw-r--r-- | archival/libunarchive/unxz/xz_dec_lzma2.c | 4 | ||||
-rw-r--r-- | archival/libunarchive/unxz/xz_dec_stream.c | 35 |
4 files changed, 11 insertions, 33 deletions
diff --git a/archival/libunarchive/decompress_unxz.c b/archival/libunarchive/decompress_unxz.c index 9edc2461a..924a52513 100644 --- a/archival/libunarchive/decompress_unxz.c +++ b/archival/libunarchive/decompress_unxz.c | |||
@@ -12,7 +12,6 @@ | |||
12 | #include "libbb.h" | 12 | #include "libbb.h" |
13 | #include "unarchive.h" | 13 | #include "unarchive.h" |
14 | 14 | ||
15 | //#define XZ_DEBUG_MSG(...) bb_error_msg(__VA_ARGS) | ||
16 | #define XZ_REALLOC_DICT_BUF(ptr, size) xrealloc(ptr, size) | 15 | #define XZ_REALLOC_DICT_BUF(ptr, size) xrealloc(ptr, size) |
17 | #define XZ_FUNC FAST_FUNC | 16 | #define XZ_FUNC FAST_FUNC |
18 | #define XZ_EXTERN static | 17 | #define XZ_EXTERN static |
diff --git a/archival/libunarchive/unxz/xz.h b/archival/libunarchive/unxz/xz.h index 82f16ee22..dbb9ba92d 100644 --- a/archival/libunarchive/unxz/xz.h +++ b/archival/libunarchive/unxz/xz.h | |||
@@ -19,10 +19,6 @@ | |||
19 | # include <stdint.h> | 19 | # include <stdint.h> |
20 | #endif | 20 | #endif |
21 | 21 | ||
22 | #ifndef XZ_DEBUG_MSG | ||
23 | # define XZ_DEBUG_MSG(...) ((void)0) | ||
24 | #endif | ||
25 | |||
26 | /* In Linux, this is used to make extern functions static when needed. */ | 22 | /* In Linux, this is used to make extern functions static when needed. */ |
27 | #ifndef XZ_EXTERN | 23 | #ifndef XZ_EXTERN |
28 | # define XZ_EXTERN extern | 24 | # define XZ_EXTERN extern |
diff --git a/archival/libunarchive/unxz/xz_dec_lzma2.c b/archival/libunarchive/unxz/xz_dec_lzma2.c index 890141b7c..c22dc5ba5 100644 --- a/archival/libunarchive/unxz/xz_dec_lzma2.c +++ b/archival/libunarchive/unxz/xz_dec_lzma2.c | |||
@@ -1117,10 +1117,8 @@ XZ_EXTERN enum xz_ret XZ_FUNC xz_dec_lzma2_reset( | |||
1117 | struct xz_dec_lzma2 *s, uint8_t props) | 1117 | struct xz_dec_lzma2 *s, uint8_t props) |
1118 | { | 1118 | { |
1119 | /* This limits dictionary size to 3 GiB to keep parsing simpler. */ | 1119 | /* This limits dictionary size to 3 GiB to keep parsing simpler. */ |
1120 | if (props > 39) { | 1120 | if (props > 39) |
1121 | XZ_DEBUG_MSG("props:%d", props); | ||
1122 | return XZ_OPTIONS_ERROR; | 1121 | return XZ_OPTIONS_ERROR; |
1123 | } | ||
1124 | 1122 | ||
1125 | s->dict.size = 2 + (props & 1); | 1123 | s->dict.size = 2 + (props & 1); |
1126 | s->dict.size <<= (props >> 1) + 11; | 1124 | s->dict.size <<= (props >> 1) + 11; |
diff --git a/archival/libunarchive/unxz/xz_dec_stream.c b/archival/libunarchive/unxz/xz_dec_stream.c index e10c9413d..121c3b53a 100644 --- a/archival/libunarchive/unxz/xz_dec_stream.c +++ b/archival/libunarchive/unxz/xz_dec_stream.c | |||
@@ -365,16 +365,14 @@ static enum xz_ret XZ_FUNC dec_stream_header(struct xz_dec *s) | |||
365 | /* | 365 | /* |
366 | * Decode the Stream Flags field. Of integrity checks, we support | 366 | * Decode the Stream Flags field. Of integrity checks, we support |
367 | * only none (Check ID = 0) and CRC32 (Check ID = 1). | 367 | * only none (Check ID = 0) and CRC32 (Check ID = 1). |
368 | * We also accept CRC64 and SHA-256, but they will not be verified. | ||
368 | */ | 369 | */ |
369 | if (s->temp.buf[HEADER_MAGIC_SIZE] != 0 | 370 | if (s->temp.buf[HEADER_MAGIC_SIZE] != 0 |
370 | || (s->temp.buf[HEADER_MAGIC_SIZE + 1] > 1 | 371 | || (s->temp.buf[HEADER_MAGIC_SIZE + 1] > 1 |
371 | && s->temp.buf[HEADER_MAGIC_SIZE + 1] != 0x04 | 372 | && s->temp.buf[HEADER_MAGIC_SIZE + 1] != 0x04 /* CRC64 */ |
372 | && s->temp.buf[HEADER_MAGIC_SIZE + 1] != 0x0A | 373 | && s->temp.buf[HEADER_MAGIC_SIZE + 1] != 0x0A /* SHA-256 */ |
373 | ) | 374 | ) |
374 | ) { | 375 | ) { |
375 | XZ_DEBUG_MSG("unsupported stream flags %x:%x", | ||
376 | s->temp.buf[HEADER_MAGIC_SIZE], | ||
377 | s->temp.buf[HEADER_MAGIC_SIZE+1]); | ||
378 | return XZ_OPTIONS_ERROR; | 376 | return XZ_OPTIONS_ERROR; |
379 | } | 377 | } |
380 | 378 | ||
@@ -435,10 +433,7 @@ static enum xz_ret XZ_FUNC dec_block_header(struct xz_dec *s) | |||
435 | #else | 433 | #else |
436 | if (s->temp.buf[1] & 0x3F) | 434 | if (s->temp.buf[1] & 0x3F) |
437 | #endif | 435 | #endif |
438 | { | ||
439 | XZ_DEBUG_MSG("s->temp.buf[1] & 0x3E/3F != 0"); | ||
440 | return XZ_OPTIONS_ERROR; | 436 | return XZ_OPTIONS_ERROR; |
441 | } | ||
442 | 437 | ||
443 | /* Compressed Size */ | 438 | /* Compressed Size */ |
444 | if (s->temp.buf[1] & 0x40) { | 439 | if (s->temp.buf[1] & 0x40) { |
@@ -466,10 +461,8 @@ static enum xz_ret XZ_FUNC dec_block_header(struct xz_dec *s) | |||
466 | /* If there are two filters, the first one must be a BCJ filter. */ | 461 | /* If there are two filters, the first one must be a BCJ filter. */ |
467 | s->bcj_active = s->temp.buf[1] & 0x01; | 462 | s->bcj_active = s->temp.buf[1] & 0x01; |
468 | if (s->bcj_active) { | 463 | if (s->bcj_active) { |
469 | if (s->temp.size - s->temp.pos < 2) { | 464 | if (s->temp.size - s->temp.pos < 2) |
470 | XZ_DEBUG_MSG("temp.size - temp.pos < 2"); | ||
471 | return XZ_OPTIONS_ERROR; | 465 | return XZ_OPTIONS_ERROR; |
472 | } | ||
473 | 466 | ||
474 | ret = xz_dec_bcj_reset(s->bcj, s->temp.buf[s->temp.pos++]); | 467 | ret = xz_dec_bcj_reset(s->bcj, s->temp.buf[s->temp.pos++]); |
475 | if (ret != XZ_OK) | 468 | if (ret != XZ_OK) |
@@ -479,10 +472,8 @@ static enum xz_ret XZ_FUNC dec_block_header(struct xz_dec *s) | |||
479 | * We don't support custom start offset, | 472 | * We don't support custom start offset, |
480 | * so Size of Properties must be zero. | 473 | * so Size of Properties must be zero. |
481 | */ | 474 | */ |
482 | if (s->temp.buf[s->temp.pos++] != 0x00) { | 475 | if (s->temp.buf[s->temp.pos++] != 0x00) |
483 | XZ_DEBUG_MSG("size of properties != 0"); | ||
484 | return XZ_OPTIONS_ERROR; | 476 | return XZ_OPTIONS_ERROR; |
485 | } | ||
486 | } | 477 | } |
487 | #endif | 478 | #endif |
488 | 479 | ||
@@ -491,16 +482,12 @@ static enum xz_ret XZ_FUNC dec_block_header(struct xz_dec *s) | |||
491 | return XZ_DATA_ERROR; | 482 | return XZ_DATA_ERROR; |
492 | 483 | ||
493 | /* Filter ID = LZMA2 */ | 484 | /* Filter ID = LZMA2 */ |
494 | if (s->temp.buf[s->temp.pos++] != 0x21) { | 485 | if (s->temp.buf[s->temp.pos++] != 0x21) |
495 | XZ_DEBUG_MSG("filter ID != 0x21"); | ||
496 | return XZ_OPTIONS_ERROR; | 486 | return XZ_OPTIONS_ERROR; |
497 | } | ||
498 | 487 | ||
499 | /* Size of Properties = 1-byte Filter Properties */ | 488 | /* Size of Properties = 1-byte Filter Properties */ |
500 | if (s->temp.buf[s->temp.pos++] != 0x01) { | 489 | if (s->temp.buf[s->temp.pos++] != 0x01) |
501 | XZ_DEBUG_MSG("size of properties != 1"); | ||
502 | return XZ_OPTIONS_ERROR; | 490 | return XZ_OPTIONS_ERROR; |
503 | } | ||
504 | 491 | ||
505 | /* Filter Properties contains LZMA2 dictionary size. */ | 492 | /* Filter Properties contains LZMA2 dictionary size. */ |
506 | if (s->temp.size - s->temp.pos < 1) | 493 | if (s->temp.size - s->temp.pos < 1) |
@@ -512,10 +499,8 @@ static enum xz_ret XZ_FUNC dec_block_header(struct xz_dec *s) | |||
512 | 499 | ||
513 | /* The rest must be Header Padding. */ | 500 | /* The rest must be Header Padding. */ |
514 | while (s->temp.pos < s->temp.size) | 501 | while (s->temp.pos < s->temp.size) |
515 | if (s->temp.buf[s->temp.pos++] != 0x00) { | 502 | if (s->temp.buf[s->temp.pos++] != 0x00) |
516 | XZ_DEBUG_MSG("padding is not zero-filled"); | ||
517 | return XZ_OPTIONS_ERROR; | 503 | return XZ_OPTIONS_ERROR; |
518 | } | ||
519 | 504 | ||
520 | s->temp.pos = 0; | 505 | s->temp.pos = 0; |
521 | s->block.compressed = 0; | 506 | s->block.compressed = 0; |