diff options
author | dotdotisdead <dotdotisdead@a3eca27d-f21b-0410-9b4a-6511e771f64e> | 2006-12-10 02:20:48 +0000 |
---|---|---|
committer | dotdotisdead <dotdotisdead@a3eca27d-f21b-0410-9b4a-6511e771f64e> | 2006-12-10 02:20:48 +0000 |
commit | 7fb75616337a50fb98c6c251f8d76825dfca9165 (patch) | |
tree | 5767f0e88ce9fe638d8112d35a4ae65337091415 /xdelta3/xdelta3.c | |
parent | ad85653ca73c8126de516b9a4294e8f08577c00d (diff) |
Preliminary WIN32 support.
Diffstat (limited to 'xdelta3/xdelta3.c')
-rwxr-xr-x | xdelta3/xdelta3.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/xdelta3/xdelta3.c b/xdelta3/xdelta3.c index e2f4f28..828643a 100755 --- a/xdelta3/xdelta3.c +++ b/xdelta3/xdelta3.c | |||
@@ -637,7 +637,7 @@ const char* xd3_strerror (int ret) | |||
637 | case XD3_TOOFARBACK: return "XD3_TOOFARBACK"; | 637 | case XD3_TOOFARBACK: return "XD3_TOOFARBACK"; |
638 | case XD3_INTERNAL: return "XD3_INTERNAL"; | 638 | case XD3_INTERNAL: return "XD3_INTERNAL"; |
639 | } | 639 | } |
640 | return strerror (ret); | 640 | return strerror(ret); |
641 | } | 641 | } |
642 | 642 | ||
643 | /******************************************************************************************/ | 643 | /******************************************************************************************/ |
@@ -4007,6 +4007,7 @@ xd3_srcwin_move_point (xd3_stream *stream, usize_t *next_move_point) | |||
4007 | usize_t blkoff = stream->srcwin_cksum_pos % stream->src->blksize; | 4007 | usize_t blkoff = stream->srcwin_cksum_pos % stream->src->blksize; |
4008 | usize_t onblk = xd3_bytes_on_srcblk (stream->src, blkno); | 4008 | usize_t onblk = xd3_bytes_on_srcblk (stream->src, blkno); |
4009 | int ret; | 4009 | int ret; |
4010 | int diff; | ||
4010 | 4011 | ||
4011 | if (blkoff + stream->smatcher.large_look > onblk) | 4012 | if (blkoff + stream->smatcher.large_look > onblk) |
4012 | { | 4013 | { |
@@ -4026,7 +4027,7 @@ xd3_srcwin_move_point (xd3_stream *stream, usize_t *next_move_point) | |||
4026 | } | 4027 | } |
4027 | 4028 | ||
4028 | onblk -= stream->smatcher.large_look; | 4029 | onblk -= stream->smatcher.large_look; |
4029 | int diff = logical_input_cksum_pos - stream->srcwin_cksum_pos; | 4030 | diff = logical_input_cksum_pos - stream->srcwin_cksum_pos; |
4030 | onblk = min(blkoff + diff, onblk); | 4031 | onblk = min(blkoff + diff, onblk); |
4031 | 4032 | ||
4032 | while (blkoff <= onblk) | 4033 | while (blkoff <= onblk) |
@@ -4060,12 +4061,12 @@ xd3_source_cksum_offset(xd3_stream *stream, usize_t low) | |||
4060 | xoff_t scp = stream->srcwin_cksum_pos; | 4061 | xoff_t scp = stream->srcwin_cksum_pos; |
4061 | xoff_t s0 = scp >> 32; | 4062 | xoff_t s0 = scp >> 32; |
4062 | 4063 | ||
4064 | usize_t sr = (usize_t) scp; | ||
4065 | |||
4063 | if (s0 == 0) { | 4066 | if (s0 == 0) { |
4064 | return low; | 4067 | return low; |
4065 | } | 4068 | } |
4066 | 4069 | ||
4067 | usize_t sr = (usize_t) scp; | ||
4068 | |||
4069 | // This should not be >= because srcwin_cksum_pos is the next position to index | 4070 | // This should not be >= because srcwin_cksum_pos is the next position to index |
4070 | if (low > sr) { | 4071 | if (low > sr) { |
4071 | return (--s0 << 32) | low; | 4072 | return (--s0 << 32) | low; |