summaryrefslogtreecommitdiff
path: root/examples/enough.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/enough.c')
-rw-r--r--examples/enough.c16
1 files changed, 8 insertions, 8 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