summaryrefslogtreecommitdiff
path: root/xdelta3/xdelta3-djw.h
diff options
context:
space:
mode:
authorjosh.macdonald <jmacd@users.noreply.github.com>2007-10-21 07:56:34 +0000
committerjosh.macdonald <jmacd@users.noreply.github.com>2007-10-21 07:56:34 +0000
commit93635ad98b10042bdcbfd8bb139ebb0e795ae26f (patch)
tree8c1a446c74f2165015c7da3c35b4f8d3b2d5df55 /xdelta3/xdelta3-djw.h
parentf79ab343e49f89be06ede199a022eb3da07fd36b (diff)
Comments and build with speed_test.cc
Diffstat (limited to 'xdelta3/xdelta3-djw.h')
-rw-r--r--xdelta3/xdelta3-djw.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/xdelta3/xdelta3-djw.h b/xdelta3/xdelta3-djw.h
index 0d300ba..54ad5e8 100644
--- a/xdelta3/xdelta3-djw.h
+++ b/xdelta3/xdelta3-djw.h
@@ -224,7 +224,7 @@ djw_destroy (xd3_stream *stream,
224/* HEAP */ 224/* HEAP */
225/*********************************************************************/ 225/*********************************************************************/
226 226
227static INLINE int 227static inline int
228heap_less (const djw_heapen *a, const djw_heapen *b) 228heap_less (const djw_heapen *a, const djw_heapen *b)
229{ 229{
230 return a->freq < b->freq || 230 return a->freq < b->freq ||
@@ -232,7 +232,7 @@ heap_less (const djw_heapen *a, const djw_heapen *b)
232 a->depth < b->depth); 232 a->depth < b->depth);
233} 233}
234 234
235static INLINE void 235static inline void
236heap_insert (uint *heap, const djw_heapen *ents, uint p, const uint e) 236heap_insert (uint *heap, const djw_heapen *ents, uint p, const uint e)
237{ 237{
238 /* Insert ents[e] into next slot heap[p] */ 238 /* Insert ents[e] into next slot heap[p] */
@@ -248,7 +248,7 @@ heap_insert (uint *heap, const djw_heapen *ents, uint p, const uint e)
248 heap[p] = e; 248 heap[p] = e;
249} 249}
250 250
251static INLINE djw_heapen* 251static inline djw_heapen*
252heap_extract (uint *heap, const djw_heapen *ents, uint heap_last) 252heap_extract (uint *heap, const djw_heapen *ents, uint heap_last)
253{ 253{
254 uint smallest = heap[1]; 254 uint smallest = heap[1];
@@ -296,7 +296,7 @@ heap_check (uint *heap, djw_heapen *ents, uint heap_last)
296/* MTF, 1/2 */ 296/* MTF, 1/2 */
297/*********************************************************************/ 297/*********************************************************************/
298 298
299static INLINE usize_t 299static inline usize_t
300djw_update_mtf (uint8_t *mtf, usize_t mtf_i) 300djw_update_mtf (uint8_t *mtf, usize_t mtf_i)
301{ 301{
302 int k; 302 int k;
@@ -308,7 +308,7 @@ djw_update_mtf (uint8_t *mtf, usize_t mtf_i)
308 return sym; 308 return sym;
309} 309}
310 310
311static INLINE void 311static inline void
312djw_update_1_2 (int *mtf_run, usize_t *mtf_i, uint8_t *mtfsym, djw_weight *freq) 312djw_update_1_2 (int *mtf_run, usize_t *mtf_i, uint8_t *mtfsym, djw_weight *freq)
313{ 313{
314 int code; 314 int code;
@@ -449,7 +449,7 @@ djw_build_prefix (const djw_weight *freq, uint8_t *clen, int asize, int maxlen)
449 449
450 if (! overflow) 450 if (! overflow)
451 { 451 {
452 IF_DEBUG1 (if (first_bits != total_bits) 452 IF_DEBUG (if (first_bits != total_bits)
453 { 453 {
454 DP(RINT "code length overflow changed %u bits\n", (usize_t)(total_bits - first_bits)); 454 DP(RINT "code length overflow changed %u bits\n", (usize_t)(total_bits - first_bits));
455 }); 455 });
@@ -536,7 +536,7 @@ djw_compute_mtf_1_2 (djw_prefix *prefix,
536 536
537 /* TODO: This assertion was firing in 3.0q due to the wrong value of 537 /* TODO: This assertion was firing in 3.0q due to the wrong value of
538 * DJW_MAX_CODELEN, which disabled the code-length overflow logic. 538 * DJW_MAX_CODELEN, which disabled the code-length overflow logic.
539 * Leave this in until more comments. */ 539 * Bug fix has been confirmed. . */
540 if (j > nsym) 540 if (j > nsym)
541 { 541 {
542 abort(); 542 abort();
@@ -1296,7 +1296,7 @@ djw_build_decoder (xd3_stream *stream,
1296 *max_clenp = max_clen; 1296 *max_clenp = max_clen;
1297} 1297}
1298 1298
1299static INLINE int 1299static inline int
1300djw_decode_symbol (xd3_stream *stream, 1300djw_decode_symbol (xd3_stream *stream,
1301 bit_state *bstate, 1301 bit_state *bstate,
1302 const uint8_t **input, 1302 const uint8_t **input,
@@ -1413,7 +1413,7 @@ djw_decode_clclen (xd3_stream *stream,
1413 return 0; 1413 return 0;
1414} 1414}
1415 1415
1416static INLINE int 1416static inline int
1417djw_decode_1_2 (xd3_stream *stream, 1417djw_decode_1_2 (xd3_stream *stream,
1418 bit_state *bstate, 1418 bit_state *bstate,
1419 const uint8_t **input, 1419 const uint8_t **input,
@@ -1488,7 +1488,7 @@ djw_decode_1_2 (xd3_stream *stream,
1488 return 0; 1488 return 0;
1489} 1489}
1490 1490
1491static INLINE int 1491static inline int
1492djw_decode_prefix (xd3_stream *stream, 1492djw_decode_prefix (xd3_stream *stream,
1493 bit_state *bstate, 1493 bit_state *bstate,
1494 const uint8_t **input, 1494 const uint8_t **input,