summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xxdelta3/xdelta3-decode.h1
-rwxr-xr-xxdelta3/xdelta3-djw.h2
-rwxr-xr-xxdelta3/xdelta3-main.h26
-rwxr-xr-xxdelta3/xdelta3-regtest.py3
-rwxr-xr-xxdelta3/xdelta3-test.h2
-rwxr-xr-xxdelta3/xdelta3.c5
-rwxr-xr-xxdelta3/xdelta3.h36
-rwxr-xr-xxdelta3/xdelta3.vcproj4
8 files changed, 42 insertions, 37 deletions
diff --git a/xdelta3/xdelta3-decode.h b/xdelta3/xdelta3-decode.h
index 9522032..ae148af 100755
--- a/xdelta3/xdelta3-decode.h
+++ b/xdelta3/xdelta3-decode.h
@@ -221,7 +221,6 @@ xd3_decode_parse_halfinst (xd3_stream *stream, xd3_hinst *inst)
221 (ret = xd3_read_size (stream, 221 (ret = xd3_read_size (stream,
222 & stream->inst_sect.buf, 222 & stream->inst_sect.buf,
223 stream->inst_sect.buf_max, 223 stream->inst_sect.buf_max,
224
225 & inst->size))) 224 & inst->size)))
226 { 225 {
227 return XD3_INTERNAL; 226 return XD3_INTERNAL;
diff --git a/xdelta3/xdelta3-djw.h b/xdelta3/xdelta3-djw.h
index 7479895..217928b 100755
--- a/xdelta3/xdelta3-djw.h
+++ b/xdelta3/xdelta3-djw.h
@@ -465,7 +465,7 @@ djw_build_prefix (const djw_weight *freq, uint8_t *clen, int asize, int maxlen)
465 { 465 {
466 IF_DEBUG (if (first_bits != total_bits) 466 IF_DEBUG (if (first_bits != total_bits)
467 { 467 {
468 P(RINT "code length overflow changed %d bits\n", total_bits - first_bits); 468 P(RINT "code length overflow changed %u bits\n", (usize_t)(total_bits - first_bits));
469 }); 469 });
470 return total_bits; 470 return total_bits;
471 } 471 }
diff --git a/xdelta3/xdelta3-main.h b/xdelta3/xdelta3-main.h
index b18e919..702b6b6 100755
--- a/xdelta3/xdelta3-main.h
+++ b/xdelta3/xdelta3-main.h
@@ -971,15 +971,15 @@ main_print_window (xd3_stream* stream)
971 if ((ret = xd3_decode_instruction (stream))) { return ret; } 971 if ((ret = xd3_decode_instruction (stream))) { return ret; }
972 972
973 VC(UT " %06"Q"u %03u %s %3u", stream->dec_winstart + size, code, 973 VC(UT " %06"Q"u %03u %s %3u", stream->dec_winstart + size, code,
974 xd3_rtype_to_string (stream->dec_current1.type, option_print_cpymode), 974 xd3_rtype_to_string (stream->dec_current1.type, option_print_cpymode),
975 stream->dec_current1.size); 975 (usize_t) stream->dec_current1.size);
976 976
977 if (stream->dec_current1.type != XD3_NOOP) 977 if (stream->dec_current1.type != XD3_NOOP)
978 { 978 {
979 size += stream->dec_current1.size; 979 size += stream->dec_current1.size;
980 if (stream->dec_current1.type >= XD3_CPY) 980 if (stream->dec_current1.type >= XD3_CPY)
981 { 981 {
982 VC(UT " @%-6u", stream->dec_current1.addr); 982 VC(UT " @%-6u", (usize_t)stream->dec_current1.addr);
983 } 983 }
984 else 984 else
985 { 985 {
@@ -991,12 +991,12 @@ main_print_window (xd3_stream* stream)
991 { 991 {
992 size += stream->dec_current2.size; 992 size += stream->dec_current2.size;
993 VC(UT " %s %3u", 993 VC(UT " %s %3u",
994 xd3_rtype_to_string (stream->dec_current2.type, option_print_cpymode), 994 xd3_rtype_to_string (stream->dec_current2.type, option_print_cpymode),
995 stream->dec_current2.size); 995 (usize_t)stream->dec_current2.size);
996 996
997 if (stream->dec_current2.type >= XD3_CPY) 997 if (stream->dec_current2.type >= XD3_CPY)
998 { 998 {
999 VC(UT " @%-6u", stream->dec_current2.addr); 999 VC(UT " @%-6u", (usize_t)stream->dec_current2.addr);
1000 } 1000 }
1001 } 1001 }
1002 1002
@@ -1095,7 +1095,7 @@ main_print_func (xd3_stream* stream, main_file *xfile)
1095 1095
1096 if ((stream->dec_win_ind & VCD_ADLER32) != 0) 1096 if ((stream->dec_win_ind & VCD_ADLER32) != 0)
1097 { 1097 {
1098 VC(UT "VCDIFF adler32 checksum: %08X\n", stream->dec_adler32); 1098 VC(UT "VCDIFF adler32 checksum: %08X\n", (usize_t)stream->dec_adler32);
1099 } 1099 }
1100 1100
1101 if (stream->dec_del_ind != 0) 1101 if (stream->dec_del_ind != 0)
@@ -1115,16 +1115,16 @@ main_print_func (xd3_stream* stream, main_file *xfile)
1115 1115
1116 if (SRCORTGT (stream->dec_win_ind)) 1116 if (SRCORTGT (stream->dec_win_ind))
1117 { 1117 {
1118 VC(UT "VCDIFF copy window length: %u\n", stream->dec_cpylen); 1118 VC(UT "VCDIFF copy window length: %u\n", (usize_t)stream->dec_cpylen);
1119 VC(UT "VCDIFF copy window offset: %"Q"u\n", stream->dec_cpyoff); 1119 VC(UT "VCDIFF copy window offset: %"Q"u\n", stream->dec_cpyoff);
1120 } 1120 }
1121 1121
1122 VC(UT "VCDIFF delta encoding length: %u\n", stream->dec_enclen); 1122 VC(UT "VCDIFF delta encoding length: %u\n", (usize_t)stream->dec_enclen);
1123 VC(UT "VCDIFF target window length: %u\n", stream->dec_tgtlen); 1123 VC(UT "VCDIFF target window length: %u\n", (usize_t)stream->dec_tgtlen);
1124 1124
1125 VC(UT "VCDIFF data section length: %u\n", stream->data_sect.size); 1125 VC(UT "VCDIFF data section length: %u\n", (usize_t)stream->data_sect.size);
1126 VC(UT "VCDIFF inst section length: %u\n", stream->inst_sect.size); 1126 VC(UT "VCDIFF inst section length: %u\n", (usize_t)stream->inst_sect.size);
1127 VC(UT "VCDIFF addr section length: %u\n", stream->addr_sect.size); 1127 VC(UT "VCDIFF addr section length: %u\n", (usize_t)stream->addr_sect.size);
1128 1128
1129 ret = 0; 1129 ret = 0;
1130 if ((stream->flags & XD3_JUST_HDR) != 0) 1130 if ((stream->flags & XD3_JUST_HDR) != 0)
diff --git a/xdelta3/xdelta3-regtest.py b/xdelta3/xdelta3-regtest.py
index 079eadc..8cdacac 100755
--- a/xdelta3/xdelta3-regtest.py
+++ b/xdelta3/xdelta3-regtest.py
@@ -46,7 +46,8 @@ MAX_RUN = 1000 * 1000 * 10
46 46
47# 47#
48# 48#
49RCSDIR = '/mnt/polaroid/Polaroid/orbit_linux/home/jmacd/PRCS' 49#RCSDIR = '/mnt/polaroid/Polaroid/orbit_linux/home/jmacd/PRCS'
50RCSDIR = 'Z:/Polaroid/orbit_linux/home/jmacd/PRCS'
50 51
51TMPDIR = '/tmp/xd3regtest.%d' % os.getpid() 52TMPDIR = '/tmp/xd3regtest.%d' % os.getpid()
52 53
diff --git a/xdelta3/xdelta3-test.h b/xdelta3/xdelta3-test.h
index 2307b7e..af90a90 100755
--- a/xdelta3/xdelta3-test.h
+++ b/xdelta3/xdelta3-test.h
@@ -606,7 +606,7 @@ test_address_cache (xd3_stream *stream, int unused)
606 606
607 for (offset = 1; offset < ADDR_CACHE_ROUNDS; offset += 1) 607 for (offset = 1; offset < ADDR_CACHE_ROUNDS; offset += 1)
608 { 608 {
609 usize_t addr; 609 uint32_t addr;
610 610
611 if ((ret = xd3_decode_address (stream, offset, modes[offset], & buf, buf_max, & addr))) { return ret; } 611 if ((ret = xd3_decode_address (stream, offset, modes[offset], & buf, buf_max, & addr))) { return ret; }
612 612
diff --git a/xdelta3/xdelta3.c b/xdelta3/xdelta3.c
index e5c82d8..aaea811 100755
--- a/xdelta3/xdelta3.c
+++ b/xdelta3/xdelta3.c
@@ -598,8 +598,13 @@ static int xd3_selftest (void);
598#define UINT32_OFLOW_MASK 0xfe000000U 598#define UINT32_OFLOW_MASK 0xfe000000U
599#define UINT64_OFLOW_MASK 0xfe00000000000000ULL 599#define UINT64_OFLOW_MASK 0xfe00000000000000ULL
600 600
601#ifndef UINT32_MAX
601#define UINT32_MAX 4294967295U 602#define UINT32_MAX 4294967295U
603#endif
604
605#ifndef UINT64_MAX
602#define UINT64_MAX 18446744073709551615ULL 606#define UINT64_MAX 18446744073709551615ULL
607#endif
603 608
604#if SIZEOF_USIZE_T == 4 609#if SIZEOF_USIZE_T == 4
605#define USIZE_T_MAX UINT32_MAX 610#define USIZE_T_MAX UINT32_MAX
diff --git a/xdelta3/xdelta3.h b/xdelta3/xdelta3.h
index 86a2662..fd91ac8 100755
--- a/xdelta3/xdelta3.h
+++ b/xdelta3/xdelta3.h
@@ -95,7 +95,11 @@
95typedef unsigned int usize_t; 95typedef unsigned int usize_t;
96typedef u_int8_t uint8_t; 96typedef u_int8_t uint8_t;
97typedef u_int16_t uint16_t; 97typedef u_int16_t uint16_t;
98
99#ifndef __uint32_t_defined /* Note: Cygwin compat */
98typedef u_int32_t uint32_t; 100typedef u_int32_t uint32_t;
101#endif
102
99typedef u_int64_t uint64_t; 103typedef u_int64_t uint64_t;
100#else 104#else
101// CRT_SECURE_NO_DEPRECATE silences warnings about sprintf() and strerror() 105// CRT_SECURE_NO_DEPRECATE silences warnings about sprintf() and strerror()
@@ -462,8 +466,8 @@ struct _xd3_dinst
462struct _xd3_hinst 466struct _xd3_hinst
463{ 467{
464 uint8_t type; 468 uint8_t type;
465 usize_t size; 469 uint32_t size;
466 usize_t addr; 470 uint32_t addr;
467}; 471};
468 472
469/* used by the encoder to buffer output in sections. list of blocks. */ 473/* used by the encoder to buffer output in sections. list of blocks. */
@@ -534,12 +538,12 @@ struct _xd3_desect
534{ 538{
535 const uint8_t *buf; 539 const uint8_t *buf;
536 const uint8_t *buf_max; 540 const uint8_t *buf_max;
537 usize_t size; 541 uint32_t size;
538 usize_t pos; 542 usize_t pos;
539 uint8_t *copied1; 543 uint8_t *copied1;
540 usize_t alloc1; 544 usize_t alloc1;
541 uint8_t *copied2; 545 uint8_t *copied2;
542 usize_t alloc2; 546 usize_t alloc2;
543}; 547};
544 548
545/****************************************************************************************** 549/******************************************************************************************
@@ -714,26 +718,26 @@ struct _xd3_stream
714 uint dec_del_ind; /* VCDIFF delta indicator */ 718 uint dec_del_ind; /* VCDIFF delta indicator */
715 719
716 uint8_t dec_magic[4]; /* First four bytes */ 720 uint8_t dec_magic[4]; /* First four bytes */
717 usize_t dec_magicbytes; /* Magic position. */ 721 usize_t dec_magicbytes; /* Magic position. */
718 722
719 uint dec_secondid; /* Optional secondary compressor ID. */ 723 uint dec_secondid; /* Optional secondary compressor ID. */
720 724
721 usize_t dec_codetblsz; /* Optional code table: length. */ 725 uint32_t dec_codetblsz; /* Optional code table: length. */
722 uint8_t *dec_codetbl; /* Optional code table: storage. */ 726 uint8_t *dec_codetbl; /* Optional code table: storage. */
723 usize_t dec_codetblbytes; /* Optional code table: position. */ 727 usize_t dec_codetblbytes; /* Optional code table: position. */
724 728
725 usize_t dec_appheadsz; /* Optional application header: size. */ 729 uint32_t dec_appheadsz; /* Optional application header: size. */
726 uint8_t *dec_appheader; /* Optional application header: storage */ 730 uint8_t *dec_appheader; /* Optional application header: storage */
727 usize_t dec_appheadbytes; /* Optional application header: position. */ 731 usize_t dec_appheadbytes; /* Optional application header: position. */
728 732
729 usize_t dec_cksumbytes; /* Optional checksum: position. */ 733 usize_t dec_cksumbytes; /* Optional checksum: position. */
730 uint8_t dec_cksum[4]; /* Optional checksum: storage. */ 734 uint8_t dec_cksum[4]; /* Optional checksum: storage. */
731 uint32_t dec_adler32; /* Optional checksum: value. */ 735 uint32_t dec_adler32; /* Optional checksum: value. */
732 736
733 usize_t dec_cpylen; /* length of copy window (VCD_SOURCE or VCD_TARGET) */ 737 uint32_t dec_cpylen; /* length of copy window (VCD_SOURCE or VCD_TARGET) */
734 xoff_t dec_cpyoff; /* offset of copy window (VCD_SOURCE or VCD_TARGET) */ 738 xoff_t dec_cpyoff; /* offset of copy window (VCD_SOURCE or VCD_TARGET) */
735 usize_t dec_enclen; /* length of delta encoding */ 739 uint32_t dec_enclen; /* length of delta encoding */
736 usize_t dec_tgtlen; /* length of target window */ 740 uint32_t dec_tgtlen; /* length of target window */
737 741
738#if USE_UINT64 742#if USE_UINT64
739 uint64_t dec_64part; /* part of a decoded uint64_t */ 743 uint64_t dec_64part; /* part of a decoded uint64_t */
diff --git a/xdelta3/xdelta3.vcproj b/xdelta3/xdelta3.vcproj
index 956bcec..e1c3625 100755
--- a/xdelta3/xdelta3.vcproj
+++ b/xdelta3/xdelta3.vcproj
@@ -173,10 +173,6 @@
173 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" 173 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
174 > 174 >
175 <File 175 <File
176 RelativePath=".\xdelta.h"
177 >
178 </File>
179 <File
180 RelativePath=".\xdelta3-cfgs.h" 176 RelativePath=".\xdelta3-cfgs.h"
181 > 177 >
182 </File> 178 </File>