diff options
author | josh.macdonald <jmacd@users.noreply.github.com> | 2010-02-15 22:02:51 +0000 |
---|---|---|
committer | josh.macdonald <jmacd@users.noreply.github.com> | 2010-02-15 22:02:51 +0000 |
commit | 1f7cebdc141c0bae5c25201e35b4d8fd2a27bb16 (patch) | |
tree | d6978143cf9e48263dc0fcd184c9b2e8c1964711 /xdelta3/xdelta3.c | |
parent | f241a281e80aaf1aa90fe1a0d9db206396cd6a79 (diff) |
Misc whitespace changes.
Diffstat (limited to 'xdelta3/xdelta3.c')
-rw-r--r-- | xdelta3/xdelta3.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/xdelta3/xdelta3.c b/xdelta3/xdelta3.c index 6d014aa..20bffdb 100644 --- a/xdelta3/xdelta3.c +++ b/xdelta3/xdelta3.c | |||
@@ -2513,7 +2513,7 @@ usize_t xd3_bytes_on_srcblk (xd3_source *src, xoff_t blkno) | |||
2513 | } | 2513 | } |
2514 | 2514 | ||
2515 | /* This function interfaces with the client getblk function, checks | 2515 | /* This function interfaces with the client getblk function, checks |
2516 | * its results, updates frontier_blkno, max_blkno, onlastblk. */ | 2516 | * its results, updates frontier_blkno, max_blkno, onlastblk, eof_known. */ |
2517 | static int | 2517 | static int |
2518 | xd3_getblk (xd3_stream *stream, xoff_t blkno) | 2518 | xd3_getblk (xd3_stream *stream, xoff_t blkno) |
2519 | { | 2519 | { |
@@ -2547,7 +2547,8 @@ xd3_getblk (xd3_stream *stream, xoff_t blkno) | |||
2547 | { | 2547 | { |
2548 | source->frontier_blkno = blkno + 1; | 2548 | source->frontier_blkno = blkno + 1; |
2549 | 2549 | ||
2550 | IF_DEBUG2 (DP(RINT "[getblk] full source blkno %"Q"u: source length unknown %"Q"u\n", | 2550 | IF_DEBUG2 (DP(RINT "[getblk] full source blkno %"Q"u: " |
2551 | "source length unknown %"Q"u\n", | ||
2551 | blkno, | 2552 | blkno, |
2552 | xd3_source_eof (source))); | 2553 | xd3_source_eof (source))); |
2553 | } | 2554 | } |
@@ -2555,7 +2556,8 @@ xd3_getblk (xd3_stream *stream, xoff_t blkno) | |||
2555 | { | 2556 | { |
2556 | if (!source->eof_known) | 2557 | if (!source->eof_known) |
2557 | { | 2558 | { |
2558 | IF_DEBUG2 (DP(RINT "[getblk] eof block has %d bytes; source length known %"Q"u\n", | 2559 | IF_DEBUG2 (DP(RINT "[getblk] eof block has %d bytes; " |
2560 | "source length known %"Q"u\n", | ||
2559 | xd3_bytes_on_srcblk (source, blkno), | 2561 | xd3_bytes_on_srcblk (source, blkno), |
2560 | xd3_source_eof (source))); | 2562 | xd3_source_eof (source))); |
2561 | source->eof_known = 1; | 2563 | source->eof_known = 1; |
@@ -4364,9 +4366,14 @@ xd3_source_match_setup (xd3_stream *stream, xoff_t srcpos) | |||
4364 | } | 4366 | } |
4365 | 4367 | ||
4366 | /* Implement srcwin_maxsz, which prevents the encoder from seeking | 4368 | /* Implement srcwin_maxsz, which prevents the encoder from seeking |
4367 | * back further than the LRU cache maintaining FIFO discipline, | 4369 | * back further than the LRU cache maintaining FIFO discipline, (to |
4368 | * which causes terrible performance. */ | 4370 | * avoid seeking). */ |
4369 | frontier_pos = stream->src->frontier_blkno * stream->src->blksize; | 4371 | frontier_pos = stream->src->eof_known ? |
4372 | xd3_source_eof (stream->src) : | ||
4373 | (stream->src->frontier_blkno * stream->src->blksize); | ||
4374 | IF_DEBUG1(DP(RINT "[match_setup] frontier_pos %"Q"u, srcpos %"Q"u, " | ||
4375 | "srcwin_maxsz %u\n", | ||
4376 | frontier_pos, srcpos, stream->srcwin_maxsz)); | ||
4370 | XD3_ASSERT (frontier_pos >= srcpos); | 4377 | XD3_ASSERT (frontier_pos >= srcpos); |
4371 | if (frontier_pos - srcpos > stream->srcwin_maxsz) { | 4378 | if (frontier_pos - srcpos > stream->srcwin_maxsz) { |
4372 | IF_DEBUG1(DP(RINT "[match_setup] rejected due to srcwin_maxsz " | 4379 | IF_DEBUG1(DP(RINT "[match_setup] rejected due to srcwin_maxsz " |