summaryrefslogtreecommitdiff
path: root/xdelta3/xdelta3.c
diff options
context:
space:
mode:
authorjosh.macdonald <jmacd@users.noreply.github.com>2010-11-07 16:48:21 +0000
committerjosh.macdonald <jmacd@users.noreply.github.com>2010-11-07 16:48:21 +0000
commit1882c39affc3b224871790bfe06ac71f293e5f2b (patch)
tree8557cec8a83ca210d5552c304d292acccf8d9e24 /xdelta3/xdelta3.c
parent75fe1e3d0b617ca6ef19f145f8df0ca57977eaf6 (diff)
Whitespace cleanups, comments
Diffstat (limited to 'xdelta3/xdelta3.c')
-rw-r--r--xdelta3/xdelta3.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/xdelta3/xdelta3.c b/xdelta3/xdelta3.c
index 23877b1..1bc7fe5 100644
--- a/xdelta3/xdelta3.c
+++ b/xdelta3/xdelta3.c
@@ -1263,14 +1263,14 @@ int xd3_compute_code_table_encoding (xd3_stream *in_stream,
1263 * about 20 bytes. */ 1263 * about 20 bytes. */
1264 uint8_t dflt_string[CODE_TABLE_STRING_SIZE]; 1264 uint8_t dflt_string[CODE_TABLE_STRING_SIZE];
1265 uint8_t code_string[CODE_TABLE_STRING_SIZE]; 1265 uint8_t code_string[CODE_TABLE_STRING_SIZE];
1266 1266
1267 xd3_compute_code_table_string (xd3_rfc3284_code_table (), dflt_string); 1267 xd3_compute_code_table_string (xd3_rfc3284_code_table (), dflt_string);
1268 xd3_compute_code_table_string (code_table, code_string); 1268 xd3_compute_code_table_string (code_table, code_string);
1269 1269
1270 return xd3_encode_memory (code_string, CODE_TABLE_STRING_SIZE, 1270 return xd3_encode_memory (code_string, CODE_TABLE_STRING_SIZE,
1271 dflt_string, CODE_TABLE_STRING_SIZE, 1271 dflt_string, CODE_TABLE_STRING_SIZE,
1272 comp_string, comp_string_size, 1272 comp_string, comp_string_size,
1273 CODE_TABLE_VCDIFF_SIZE, 1273 CODE_TABLE_VCDIFF_SIZE,
1274 /* flags */ 0); 1274 /* flags */ 0);
1275} 1275}
1276 1276
@@ -1362,8 +1362,8 @@ xd3_apply_table_string (xd3_stream *stream, const uint8_t *code_string)
1362 xd3_dinst *code_table; 1362 xd3_dinst *code_table;
1363 1363
1364 if ((code_table = stream->code_table_alloc = 1364 if ((code_table = stream->code_table_alloc =
1365 (xd3_dinst*) xd3_alloc (stream, 1365 (xd3_dinst*) xd3_alloc (stream,
1366 (usize_t) sizeof (xd3_dinst), 1366 (usize_t) sizeof (xd3_dinst),
1367 256)) == NULL) 1367 256)) == NULL)
1368 { 1368 {
1369 return ENOMEM; 1369 return ENOMEM;
@@ -1873,12 +1873,12 @@ xd3_alloc_cache (xd3_stream *stream)
1873 1873
1874 if (((stream->acache.s_near > 0) && 1874 if (((stream->acache.s_near > 0) &&
1875 (stream->acache.near_array = (usize_t*) 1875 (stream->acache.near_array = (usize_t*)
1876 xd3_alloc (stream, stream->acache.s_near, 1876 xd3_alloc (stream, stream->acache.s_near,
1877 (usize_t) sizeof (usize_t))) 1877 (usize_t) sizeof (usize_t)))
1878 == NULL) || 1878 == NULL) ||
1879 ((stream->acache.s_same > 0) && 1879 ((stream->acache.s_same > 0) &&
1880 (stream->acache.same_array = (usize_t*) 1880 (stream->acache.same_array = (usize_t*)
1881 xd3_alloc (stream, stream->acache.s_same * 256, 1881 xd3_alloc (stream, stream->acache.s_same * 256,
1882 (usize_t) sizeof (usize_t))) 1882 (usize_t) sizeof (usize_t)))
1883 == NULL)) 1883 == NULL))
1884 { 1884 {
@@ -2536,7 +2536,7 @@ xd3_getblk (xd3_stream *stream, xoff_t blkno)
2536 ret = stream->getblk (stream, source, blkno); 2536 ret = stream->getblk (stream, source, blkno);
2537 if (ret != 0) 2537 if (ret != 0)
2538 { 2538 {
2539 IF_DEBUG1 (DP(RINT "[getblk] app error blkno %"Q"u: %s\n", 2539 IF_DEBUG1 (DP(RINT "[getblk] app error blkno %"Q"u: %s\n",
2540 blkno, xd3_strerror (ret))); 2540 blkno, xd3_strerror (ret)));
2541 return ret; 2541 return ret;
2542 } 2542 }
@@ -2623,7 +2623,7 @@ xd3_set_source (xd3_stream *stream,
2623} 2623}
2624 2624
2625int 2625int
2626xd3_set_source_and_size (xd3_stream *stream, 2626xd3_set_source_and_size (xd3_stream *stream,
2627 xd3_source *user_source, 2627 xd3_source *user_source,
2628 xoff_t source_size) { 2628 xoff_t source_size) {
2629 int ret = xd3_set_source (stream, user_source); 2629 int ret = xd3_set_source (stream, user_source);
@@ -2799,7 +2799,7 @@ xd3_iopt_finish_encoding (xd3_stream *stream, xd3_rinst *inst)
2799 else 2799 else
2800 { 2800 {
2801 stream->srcwin_decided_early = (!stream->src->eof_known || 2801 stream->srcwin_decided_early = (!stream->src->eof_known ||
2802 (stream->srcwin_cksum_pos < 2802 (stream->srcwin_cksum_pos <
2803 xd3_source_eof (stream->src))); 2803 xd3_source_eof (stream->src)));
2804 } 2804 }
2805 2805
@@ -2807,7 +2807,7 @@ xd3_iopt_finish_encoding (xd3_stream *stream, xd3_rinst *inst)
2807 if (inst->xtra) 2807 if (inst->xtra)
2808 { 2808 {
2809 XD3_ASSERT (inst->addr >= src->srcbase); 2809 XD3_ASSERT (inst->addr >= src->srcbase);
2810 XD3_ASSERT (inst->addr + inst->size <= 2810 XD3_ASSERT (inst->addr + inst->size <=
2811 src->srcbase + src->srclen); 2811 src->srcbase + src->srclen);
2812 addr = (usize_t)(inst->addr - src->srcbase); 2812 addr = (usize_t)(inst->addr - src->srcbase);
2813 stream->n_scpy += 1; 2813 stream->n_scpy += 1;
@@ -2815,7 +2815,7 @@ xd3_iopt_finish_encoding (xd3_stream *stream, xd3_rinst *inst)
2815 } 2815 }
2816 else 2816 else
2817 { 2817 {
2818 /* with source window: target copy address is offset 2818 /* with source window: target copy address is offset
2819 * by taroff. */ 2819 * by taroff. */
2820 addr = stream->taroff + (usize_t) inst->addr; 2820 addr = stream->taroff + (usize_t) inst->addr;
2821 stream->n_tcpy += 1; 2821 stream->n_tcpy += 1;
@@ -3810,7 +3810,7 @@ xd3_encode_input (xd3_stream *stream)
3810 3810
3811 case ENC_SEARCH: 3811 case ENC_SEARCH:
3812 IF_DEBUG2 (DP(RINT "[SEARCH] match_state %d avail_in %u %s\n", 3812 IF_DEBUG2 (DP(RINT "[SEARCH] match_state %d avail_in %u %s\n",
3813 stream->match_state, stream->avail_in, 3813 stream->match_state, stream->avail_in,
3814 stream->src ? "source" : "no source")); 3814 stream->src ? "source" : "no source"));
3815 3815
3816 /* Reentrant matching. */ 3816 /* Reentrant matching. */