diff options
author | josh.macdonald@gmail.com <josh.macdonald@gmail.com@a3eca27d-f21b-0410-9b4a-6511e771f64e> | 2010-08-01 02:41:42 +0000 |
---|---|---|
committer | josh.macdonald@gmail.com <josh.macdonald@gmail.com@a3eca27d-f21b-0410-9b4a-6511e771f64e> | 2010-08-01 02:41:42 +0000 |
commit | f1f6f860e659b285b554641a28ba0a9933ddf9ef (patch) | |
tree | 5318dac415c576cd047fb5ee38d4ed46378b65e4 /xdelta3/xdelta3.c | |
parent | debec7aae3d3d3e5b1b2da62a9417ab3a0c72c00 (diff) |
Fixes for win7, especially named pipe handling
Diffstat (limited to 'xdelta3/xdelta3.c')
-rw-r--r-- | xdelta3/xdelta3.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/xdelta3/xdelta3.c b/xdelta3/xdelta3.c index 544184f..a789b16 100644 --- a/xdelta3/xdelta3.c +++ b/xdelta3/xdelta3.c | |||
@@ -2804,14 +2804,16 @@ xd3_iopt_finish_encoding (xd3_stream *stream, xd3_rinst *inst) | |||
2804 | if (inst->xtra) | 2804 | if (inst->xtra) |
2805 | { | 2805 | { |
2806 | XD3_ASSERT (inst->addr >= src->srcbase); | 2806 | XD3_ASSERT (inst->addr >= src->srcbase); |
2807 | XD3_ASSERT (inst->addr + inst->size <= src->srcbase + src->srclen); | 2807 | XD3_ASSERT (inst->addr + inst->size <= |
2808 | addr = (inst->addr - src->srcbase); | 2808 | src->srcbase + src->srclen); |
2809 | addr = (usize_t)(inst->addr - src->srcbase); | ||
2809 | stream->n_scpy += 1; | 2810 | stream->n_scpy += 1; |
2810 | stream->l_scpy += (xoff_t) inst->size; | 2811 | stream->l_scpy += (xoff_t) inst->size; |
2811 | } | 2812 | } |
2812 | else | 2813 | else |
2813 | { | 2814 | { |
2814 | /* with source window: target copy address is offset by taroff. */ | 2815 | /* with source window: target copy address is offset |
2816 | * by taroff. */ | ||
2815 | addr = stream->taroff + (usize_t) inst->addr; | 2817 | addr = stream->taroff + (usize_t) inst->addr; |
2816 | stream->n_tcpy += 1; | 2818 | stream->n_tcpy += 1; |
2817 | stream->l_tcpy += (xoff_t) inst->size; | 2819 | stream->l_tcpy += (xoff_t) inst->size; |
@@ -4499,18 +4501,18 @@ xd3_source_match_setup (xd3_stream *stream, xoff_t srcpos) | |||
4499 | 4501 | ||
4500 | #if 1 | 4502 | #if 1 |
4501 | static inline int | 4503 | static inline int |
4502 | xd3_forward_match(const uint8_t *s1c, const uint8_t *s2c, size_t n) | 4504 | xd3_forward_match(const uint8_t *s1c, const uint8_t *s2c, int n) |
4503 | { | 4505 | { |
4504 | size_t i = 0; | 4506 | int i = 0; |
4505 | #if UNALIGNED_OK | 4507 | #if UNALIGNED_OK |
4506 | size_t nint = n / sizeof(int); | 4508 | int nint = n / sizeof(int); |
4507 | 4509 | ||
4508 | if (nint >> 3) | 4510 | if (nint >> 3) |
4509 | { | 4511 | { |
4510 | size_t j = 0; | 4512 | int j = 0; |
4511 | const int *s1 = (const int*)s1c; | 4513 | const int *s1 = (const int*)s1c; |
4512 | const int *s2 = (const int*)s2c; | 4514 | const int *s2 = (const int*)s2c; |
4513 | size_t nint_8 = nint - 8; | 4515 | int nint_8 = nint - 8; |
4514 | 4516 | ||
4515 | while (i <= nint_8 && | 4517 | while (i <= nint_8 && |
4516 | s1[i++] == s2[j++] && | 4518 | s1[i++] == s2[j++] && |
@@ -4857,7 +4859,7 @@ xd3_smatch (xd3_stream *stream, | |||
4857 | ++ref; | 4859 | ++ref; |
4858 | } | 4860 | } |
4859 | 4861 | ||
4860 | cmp_len = inp - (stream->next_in + stream->input_position); | 4862 | cmp_len = (usize_t)(inp - (stream->next_in + stream->input_position)); |
4861 | 4863 | ||
4862 | /* Verify correctness */ | 4864 | /* Verify correctness */ |
4863 | XD3_ASSERT (xd3_check_smatch (stream->next_in + base, | 4865 | XD3_ASSERT (xd3_check_smatch (stream->next_in + base, |
@@ -5192,14 +5194,14 @@ XD3_TEMPLATE(xd3_string_match_) (xd3_stream *stream) | |||
5192 | uint32_t scksum = 0; | 5194 | uint32_t scksum = 0; |
5193 | uint32_t scksum_state = 0; | 5195 | uint32_t scksum_state = 0; |
5194 | uint32_t lcksum = 0; | 5196 | uint32_t lcksum = 0; |
5195 | usize_t sinx; | 5197 | usize_t sinx; |
5196 | usize_t linx; | 5198 | usize_t linx; |
5197 | uint8_t run_c; | 5199 | uint8_t run_c; |
5198 | size_t run_l; | 5200 | usize_t run_l; |
5199 | int ret; | 5201 | int ret; |
5200 | usize_t match_length; | 5202 | usize_t match_length; |
5201 | usize_t match_offset = 0; | 5203 | usize_t match_offset = 0; |
5202 | usize_t next_move_point; | 5204 | usize_t next_move_point; |
5203 | 5205 | ||
5204 | /* If there will be no compression due to settings or short input, | 5206 | /* If there will be no compression due to settings or short input, |
5205 | * skip it entirely. */ | 5207 | * skip it entirely. */ |