diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:27:17 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:27:17 -0700 |
commit | e0ff940e1adb68d3575705ebf1546d9f07ad3b4a (patch) | |
tree | 792ac6996d1225c0955027050296126bc8ff6e26 /examples | |
parent | 7df877eccdd826e94df53215f65dee639428e83f (diff) | |
download | zlib-1.2.3.8.tar.gz zlib-1.2.3.8.tar.bz2 zlib-1.2.3.8.zip |
zlib 1.2.3.8v1.2.3.8
Diffstat (limited to 'examples')
-rw-r--r-- | examples/enough.c | 16 | ||||
-rw-r--r-- | examples/gzlog.c | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/examples/enough.c b/examples/enough.c index b570707..c40410b 100644 --- a/examples/enough.c +++ b/examples/enough.c | |||
@@ -141,7 +141,7 @@ struct tab { /* type for been here check */ | |||
141 | For the deflate example of 286 symbols limited to 15-bit codes, the array | 141 | For the deflate example of 286 symbols limited to 15-bit codes, the array |
142 | has 284,284 entries, taking up 2.17 MB for an 8-byte big_t. More than | 142 | has 284,284 entries, taking up 2.17 MB for an 8-byte big_t. More than |
143 | half of the space allocated for saved results is actually used -- not all | 143 | half of the space allocated for saved results is actually used -- not all |
144 | possible triplets are reached in the generation of valid Huffman codes. | 144 | possible triplets are reached in the generation of valid Huffman codes. |
145 | */ | 145 | */ |
146 | 146 | ||
147 | /* The array for tracking visited states, done[], is itself indexed identically | 147 | /* The array for tracking visited states, done[], is itself indexed identically |
@@ -466,19 +466,19 @@ int main(int argc, char **argv) | |||
466 | 466 | ||
467 | /* get arguments -- default to the deflate literal/length code */ | 467 | /* get arguments -- default to the deflate literal/length code */ |
468 | syms = 286; | 468 | syms = 286; |
469 | root = 9; | 469 | root = 9; |
470 | max = 15; | 470 | max = 15; |
471 | if (argc > 1) { | 471 | if (argc > 1) { |
472 | syms = atoi(argv[1]); | 472 | syms = atoi(argv[1]); |
473 | if (argc > 2) { | 473 | if (argc > 2) { |
474 | root = atoi(argv[2]); | 474 | root = atoi(argv[2]); |
475 | if (argc > 3) | 475 | if (argc > 3) |
476 | max = atoi(argv[3]); | 476 | max = atoi(argv[3]); |
477 | } | 477 | } |
478 | } | 478 | } |
479 | if (argc > 4 || syms < 2 || root < 1 || max < 1) { | 479 | if (argc > 4 || syms < 2 || root < 1 || max < 1) { |
480 | fputs("invalid arguments, need: [sym >= 2 [root >= 1 [max >= 1]]]\n", | 480 | fputs("invalid arguments, need: [sym >= 2 [root >= 1 [max >= 1]]]\n", |
481 | stderr); | 481 | stderr); |
482 | return 1; | 482 | return 1; |
483 | } | 483 | } |
484 | 484 | ||
@@ -556,8 +556,8 @@ int main(int argc, char **argv) | |||
556 | } | 556 | } |
557 | 557 | ||
558 | /* find and show maximum inflate table usage */ | 558 | /* find and show maximum inflate table usage */ |
559 | if (root > max) /* reduce root to max length */ | 559 | if (root > max) /* reduce root to max length */ |
560 | root = max; | 560 | root = max; |
561 | if (syms < ((code_t)1 << (root + 1))) | 561 | if (syms < ((code_t)1 << (root + 1))) |
562 | enough(syms); | 562 | enough(syms); |
563 | else | 563 | else |
diff --git a/examples/gzlog.c b/examples/gzlog.c index 4daf1c2..d70aaca 100644 --- a/examples/gzlog.c +++ b/examples/gzlog.c | |||
@@ -62,7 +62,7 @@ | |||
62 | compressed data, and contains both the crc and length of just the compressed | 62 | compressed data, and contains both the crc and length of just the compressed |
63 | data and of the complete set of data including the contents of the foo.add | 63 | data and of the complete set of data including the contents of the foo.add |
64 | file. | 64 | file. |
65 | 65 | ||
66 | Again, the foo.add file is maintained during the compress operation in case | 66 | Again, the foo.add file is maintained during the compress operation in case |
67 | of an interruption. If in the unlikely event the foo.add file with the data | 67 | of an interruption. If in the unlikely event the foo.add file with the data |
68 | to be compressed is missing due to some external force, a gzip file with | 68 | to be compressed is missing due to some external force, a gzip file with |