diff options
author | Josh MacDonald <josh.macdonald@gmail.com> | 2016-01-05 00:12:13 -0800 |
---|---|---|
committer | Josh MacDonald <josh.macdonald@gmail.com> | 2016-01-05 00:12:13 -0800 |
commit | 00895d7c9d6a0cd8b86243c62eecdd7a2bdd981b (patch) | |
tree | dbaf88c2d23cd4b23a6832d99614dee3f76add05 /xdelta3/xdelta3-djw.h | |
parent | f9f0e902b6f3a0f5eead5ac06aaf81eca3d25950 (diff) |
-Wformat fixes
Diffstat (limited to 'xdelta3/xdelta3-djw.h')
-rw-r--r-- | xdelta3/xdelta3-djw.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/xdelta3/xdelta3-djw.h b/xdelta3/xdelta3-djw.h index 414702a..a4c7e51 100644 --- a/xdelta3/xdelta3-djw.h +++ b/xdelta3/xdelta3-djw.h | |||
@@ -318,7 +318,7 @@ heap_check (usize_t *heap, djw_heapen *ents, usize_t heap_last) | |||
318 | /* Heap property: child not less than parent */ | 318 | /* Heap property: child not less than parent */ |
319 | XD3_ASSERT (! heap_less (& ents[heap[i]], & ents[heap[i/2]])); | 319 | XD3_ASSERT (! heap_less (& ents[heap[i]], & ents[heap[i/2]])); |
320 | 320 | ||
321 | IF_DEBUG2 (DP(RINT "heap[%d] = %u\n", i, ents[heap[i]].freq)); | 321 | IF_DEBUG2 (DP(RINT "heap[%"W"u] = %u\n", i, ents[heap[i]].freq)); |
322 | } | 322 | } |
323 | } | 323 | } |
324 | #endif | 324 | #endif |
@@ -404,7 +404,7 @@ djw_build_prefix (const djw_weight *freq, uint8_t *clen, usize_t asize, usize_t | |||
404 | for (i = 0; i < asize; i += 1) | 404 | for (i = 0; i < asize; i += 1) |
405 | { | 405 | { |
406 | ents[i+1].freq = freq[i]; | 406 | ents[i+1].freq = freq[i]; |
407 | IF_DEBUG2 (DP(RINT "ents[%d] = freq[%d] = %d\n", | 407 | IF_DEBUG2 (DP(RINT "ents[%"W"i] = freq[%"W"u] = %d\n", |
408 | i+1, i, freq[i])); | 408 | i+1, i, freq[i])); |
409 | } | 409 | } |
410 | 410 | ||
@@ -483,7 +483,7 @@ djw_build_prefix (const djw_weight *freq, uint8_t *clen, usize_t asize, usize_t | |||
483 | } | 483 | } |
484 | 484 | ||
485 | /* clen is 0-origin, unlike ents. */ | 485 | /* clen is 0-origin, unlike ents. */ |
486 | IF_DEBUG2 (DP(RINT "clen[%d] = %d\n", i-1, b)); | 486 | IF_DEBUG2 (DP(RINT "clen[%"W"u] = %"W"u\n", i-1, b)); |
487 | clen[i-1] = b; | 487 | clen[i-1] = b; |
488 | } | 488 | } |
489 | 489 | ||
@@ -493,7 +493,7 @@ djw_build_prefix (const djw_weight *freq, uint8_t *clen, usize_t asize, usize_t | |||
493 | { | 493 | { |
494 | IF_DEBUG2 (if (first_bits != total_bits) | 494 | IF_DEBUG2 (if (first_bits != total_bits) |
495 | { | 495 | { |
496 | DP(RINT "code length overflow changed %"Z" bits\n", | 496 | DP(RINT "code length overflow changed %"W"u bits\n", |
497 | total_bits - first_bits); | 497 | total_bits - first_bits); |
498 | }); | 498 | }); |
499 | return total_bits; | 499 | return total_bits; |
@@ -547,7 +547,7 @@ djw_build_codes (usize_t *codes, const uint8_t *clen, usize_t asize, usize_t abs | |||
547 | IF_DEBUG2 ({ | 547 | IF_DEBUG2 ({ |
548 | for (i = 0; i < asize; i += 1) | 548 | for (i = 0; i < asize; i += 1) |
549 | { | 549 | { |
550 | DP(RINT "code[%d] = %u\n", i, codes[i]); | 550 | DP(RINT "code[%"W"u] = %"W"u\n", i, codes[i]); |
551 | } | 551 | } |
552 | }); | 552 | }); |
553 | } | 553 | } |
@@ -1021,7 +1021,7 @@ xd3_encode_huff (xd3_stream *stream, | |||
1021 | * testing group behavior, so don't mess things up. */ | 1021 | * testing group behavior, so don't mess things up. */ |
1022 | if (goal == 0 && !cfg->inefficient) | 1022 | if (goal == 0 && !cfg->inefficient) |
1023 | { | 1023 | { |
1024 | IF_DEBUG2 (DP(RINT "too many groups (%u), dropping one\n", | 1024 | IF_DEBUG2 (DP(RINT "too many groups (%"W"u), dropping one\n", |
1025 | groups)); | 1025 | groups)); |
1026 | groups -= 1; | 1026 | groups -= 1; |
1027 | goto regroup; | 1027 | goto regroup; |
@@ -1035,8 +1035,8 @@ xd3_encode_huff (xd3_stream *stream, | |||
1035 | sum += real_freq[sym2++]; | 1035 | sum += real_freq[sym2++]; |
1036 | } | 1036 | } |
1037 | 1037 | ||
1038 | IF_DEBUG2(DP(RINT "group %u has symbols %u..%u (%u non-zero) " | 1038 | IF_DEBUG2(DP(RINT "group %"W"u has symbols %"W"u..%"W"u (%"W"u non-zero) " |
1039 | "(%u/%u = %.3f)\n", | 1039 | "(%u/%"W"u = %.3f)\n", |
1040 | gp, sym1, sym2, nz, sum, | 1040 | gp, sym1, sym2, nz, sum, |
1041 | input_bytes, sum / (double)input_bytes);); | 1041 | input_bytes, sum / (double)input_bytes);); |
1042 | 1042 | ||
@@ -1165,21 +1165,21 @@ xd3_encode_huff (xd3_stream *stream, | |||
1165 | if (evolve_zero[i]) { output_bits -= evolve_clen[gp][i]; } | 1165 | if (evolve_zero[i]) { output_bits -= evolve_clen[gp][i]; } |
1166 | } | 1166 | } |
1167 | 1167 | ||
1168 | IF_DEBUG2 (DP(RINT "evolve_zero reduced %u bits in group %u\n", | 1168 | IF_DEBUG2 (DP(RINT "evolve_zero reduced %"W"u bits in group %"W"u\n", |
1169 | save_total - output_bits, gp)); | 1169 | save_total - output_bits, gp)); |
1170 | } | 1170 | } |
1171 | } | 1171 | } |
1172 | 1172 | ||
1173 | IF_DEBUG2( | 1173 | IF_DEBUG2( |
1174 | DP(RINT "pass %u total bits: %u group uses: ", niter, output_bits); | 1174 | DP(RINT "pass %"W"u total bits: %"W"u group uses: ", niter, output_bits); |
1175 | for (gp = 0; gp < groups; gp += 1) { DP(RINT "%u ", gcount[gp]); } | 1175 | for (gp = 0; gp < groups; gp += 1) { DP(RINT "%"W"u ", gcount[gp]); } |
1176 | DP(RINT "\n"); | 1176 | DP(RINT "\n"); |
1177 | ); | 1177 | ); |
1178 | 1178 | ||
1179 | /* End iteration. */ | 1179 | /* End iteration. */ |
1180 | 1180 | ||
1181 | IF_DEBUG2 (if (niter > 1 && best_bits < output_bits) { | 1181 | IF_DEBUG2 (if (niter > 1 && best_bits < output_bits) { |
1182 | DP(RINT "iteration lost %u bits\n", output_bits - best_bits); }); | 1182 | DP(RINT "iteration lost %"W"u bits\n", output_bits - best_bits); }); |
1183 | 1183 | ||
1184 | if (niter == 1 || (niter < DJW_MAX_ITER && | 1184 | if (niter == 1 || (niter < DJW_MAX_ITER && |
1185 | (best_bits - output_bits) >= DJW_MIN_IMPROVEMENT)) | 1185 | (best_bits - output_bits) >= DJW_MIN_IMPROVEMENT)) |
@@ -1194,7 +1194,7 @@ xd3_encode_huff (xd3_stream *stream, | |||
1194 | goto nosecond; | 1194 | goto nosecond; |
1195 | } | 1195 | } |
1196 | 1196 | ||
1197 | IF_DEBUG2 (DP(RINT "djw compression: %u -> %0.3f\n", | 1197 | IF_DEBUG2 (DP(RINT "djw compression: %"W"u -> %0.3f\n", |
1198 | input_bytes, output_bits / 8.0)); | 1198 | input_bytes, output_bits / 8.0)); |
1199 | 1199 | ||
1200 | /* Encode: prefix */ | 1200 | /* Encode: prefix */ |
@@ -1471,7 +1471,7 @@ djw_decode_symbol (xd3_stream *stream, | |||
1471 | 1471 | ||
1472 | if (offset <= max_sym) | 1472 | if (offset <= max_sym) |
1473 | { | 1473 | { |
1474 | IF_DEBUG2 (DP(RINT "(j) %u ", code)); | 1474 | IF_DEBUG2 (DP(RINT "(j) %"W"u ", code)); |
1475 | *sym = inorder[offset]; | 1475 | *sym = inorder[offset]; |
1476 | return 0; | 1476 | return 0; |
1477 | } | 1477 | } |