summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xdelta3/xdelta3-decode.h2
-rw-r--r--xdelta3/xdelta3-fgk.h2
-rw-r--r--xdelta3/xdelta3-internal.h2
-rw-r--r--xdelta3/xdelta3.c18
-rw-r--r--xdelta3/xdelta3.h11
5 files changed, 17 insertions, 18 deletions
diff --git a/xdelta3/xdelta3-decode.h b/xdelta3/xdelta3-decode.h
index f867055..d468669 100644
--- a/xdelta3/xdelta3-decode.h
+++ b/xdelta3/xdelta3-decode.h
@@ -429,7 +429,7 @@ xd3_decode_output_halfinst (xd3_stream *stream, xd3_hinst *inst)
429 xd3_source *source = stream->src; 429 xd3_source *source = stream->src;
430 xoff_t block = source->cpyoff_blocks; 430 xoff_t block = source->cpyoff_blocks;
431 usize_t blkoff = source->cpyoff_blkoff; 431 usize_t blkoff = source->cpyoff_blkoff;
432 const usize_t blksize = source->blksize; 432 const xoff_t blksize = source->blksize;
433 int ret; 433 int ret;
434 434
435 xd3_blksize_add (&block, &blkoff, source, inst->addr); 435 xd3_blksize_add (&block, &blkoff, source, inst->addr);
diff --git a/xdelta3/xdelta3-fgk.h b/xdelta3/xdelta3-fgk.h
index 7011500..f145cc9 100644
--- a/xdelta3/xdelta3-fgk.h
+++ b/xdelta3/xdelta3-fgk.h
@@ -191,7 +191,7 @@ static fgk_stream* fgk_alloc (xd3_stream *stream /*, int alphabet_size0 */)
191static int fgk_init (xd3_stream *stream, fgk_stream *h, int is_encode) 191static int fgk_init (xd3_stream *stream, fgk_stream *h, int is_encode)
192{ 192{
193 usize_t ui; 193 usize_t ui;
194 ssize_t si; 194 size_t si;
195 195
196 h->root_node = h->alphabet; 196 h->root_node = h->alphabet;
197 h->decode_ptr = h->root_node; 197 h->decode_ptr = h->root_node;
diff --git a/xdelta3/xdelta3-internal.h b/xdelta3/xdelta3-internal.h
index 13f4a34..122cc02 100644
--- a/xdelta3/xdelta3-internal.h
+++ b/xdelta3/xdelta3-internal.h
@@ -40,7 +40,7 @@ int main_file_read (main_file *ifile,
40 const char *msg); 40 const char *msg);
41int main_file_write (main_file *ofile, uint8_t *buf, 41int main_file_write (main_file *ofile, uint8_t *buf,
42 usize_t size, const char *msg); 42 usize_t size, const char *msg);
43usize_t xd3_bytes_on_srcblk (xd3_source *src, xoff_t blkno); 43xoff_t xd3_bytes_on_srcblk (xd3_source *src, xoff_t blkno);
44xoff_t xd3_source_eof(const xd3_source *src); 44xoff_t xd3_source_eof(const xd3_source *src);
45uint32_t xd3_large_cksum_update (uint32_t cksum, 45uint32_t xd3_large_cksum_update (uint32_t cksum,
46 const uint8_t *base, 46 const uint8_t *base,
diff --git a/xdelta3/xdelta3.c b/xdelta3/xdelta3.c
index c22c763..2d6f926 100644
--- a/xdelta3/xdelta3.c
+++ b/xdelta3/xdelta3.c
@@ -2560,9 +2560,9 @@ xoff_t xd3_source_eof(const xd3_source *src)
2560} 2560}
2561 2561
2562inline 2562inline
2563usize_t xd3_bytes_on_srcblk (xd3_source *src, xoff_t blkno) 2563xoff_t xd3_bytes_on_srcblk (xd3_source *src, xoff_t blkno)
2564{ 2564{
2565 usize_t r = (blkno == src->max_blkno ? 2565 xoff_t r = (blkno == src->max_blkno ?
2566 src->onlastblk : 2566 src->onlastblk :
2567 src->blksize); 2567 src->blksize);
2568 return r; 2568 return r;
@@ -3697,7 +3697,7 @@ xd3_encode_init (xd3_stream *stream, int full_init)
3697 if (large_comp) 3697 if (large_comp)
3698 { 3698 {
3699 usize_t hash_values = (stream->src->max_winsize / 3699 usize_t hash_values = (stream->src->max_winsize /
3700 stream->smatcher.large_step); 3700 stream->smatcher.large_step);
3701 3701
3702 xd3_size_hashtable (stream, 3702 xd3_size_hashtable (stream,
3703 hash_values, 3703 hash_values,
@@ -4615,9 +4615,9 @@ xd3_source_extend_match (xd3_stream *stream)
4615 of the input match being tested. */ 4615 of the input match being tested. */
4616 xoff_t tryblk; /* tryblk, tryoff are the block, offset position 4616 xoff_t tryblk; /* tryblk, tryoff are the block, offset position
4617 of matchoff */ 4617 of matchoff */
4618 usize_t tryoff; 4618 xoff_t tryoff;
4619 usize_t tryrem; /* tryrem is the number of matchable bytes */ 4619 xoff_t tryrem; /* tryrem is the number of matchable bytes */
4620 usize_t matched; 4620 xoff_t matched;
4621 4621
4622 IF_DEBUG2(DP(RINT "[extend match] srcpos %"Q"u\n", 4622 IF_DEBUG2(DP(RINT "[extend match] srcpos %"Q"u\n",
4623 stream->match_srcpos)); 4623 stream->match_srcpos));
@@ -5095,8 +5095,8 @@ xd3_srcwin_move_point (xd3_stream *stream, usize_t *next_move_point)
5095 xoff_t blkno; 5095 xoff_t blkno;
5096 xoff_t blkbaseoffset; 5096 xoff_t blkbaseoffset;
5097 usize_t blkrem; 5097 usize_t blkrem;
5098 ssize_t oldpos; /* Using ssize_t because of a */ 5098 size_t oldpos; /* Using ssize_t because of a */
5099 ssize_t blkpos; /* do { blkpos-- } 5099 size_t blkpos; /* do { blkpos-- }
5100 while (blkpos >= oldpos); */ 5100 while (blkpos >= oldpos); */
5101 int ret; 5101 int ret;
5102 xd3_blksize_div (stream->srcwin_cksum_pos, 5102 xd3_blksize_div (stream->srcwin_cksum_pos,
@@ -5126,7 +5126,7 @@ xd3_srcwin_move_point (xd3_stream *stream, usize_t *next_move_point)
5126 5126
5127 blkpos = xd3_bytes_on_srcblk (stream->src, blkno); 5127 blkpos = xd3_bytes_on_srcblk (stream->src, blkno);
5128 5128
5129 if (blkpos < (ssize_t) stream->smatcher.large_look) 5129 if (blkpos < (size_t) stream->smatcher.large_look)
5130 { 5130 {
5131 stream->srcwin_cksum_pos = (blkno + 1) * stream->src->blksize; 5131 stream->srcwin_cksum_pos = (blkno + 1) * stream->src->blksize;
5132 IF_DEBUG1 (DP(RINT "[srcwin_move_point] continue (end-of-block)\n")); 5132 IF_DEBUG1 (DP(RINT "[srcwin_move_point] continue (end-of-block)\n"));
diff --git a/xdelta3/xdelta3.h b/xdelta3/xdelta3.h
index 66def15..ec971b9 100644
--- a/xdelta3/xdelta3.h
+++ b/xdelta3/xdelta3.h
@@ -110,7 +110,6 @@
110 */ 110 */
111#ifndef _WIN32 111#ifndef _WIN32
112#include <stdint.h> 112#include <stdint.h>
113typedef uint32_t usize_t;
114#else 113#else
115#define WIN32_LEAN_AND_MEAN 114#define WIN32_LEAN_AND_MEAN
116#if XD3_USE_LARGEFILE64 115#if XD3_USE_LARGEFILE64
@@ -125,10 +124,8 @@ typedef uint32_t usize_t;
125#define _WIN32_WINNT 0x0400 124#define _WIN32_WINNT 0x0400
126#endif 125#endif
127#include <windows.h> 126#include <windows.h>
128typedef uint32_t usize_t;
129#ifdef _MSC_VER 127#ifdef _MSC_VER
130#define inline 128#define inline
131typedef signed int ssize_t;
132#if _MSC_VER < 1600 129#if _MSC_VER < 1600
133typedef unsigned char uint8_t; 130typedef unsigned char uint8_t;
134typedef unsigned short uint16_t; 131typedef unsigned short uint16_t;
@@ -144,6 +141,8 @@ typedef ULONGLONG uint64_t;
144#endif 141#endif
145#endif 142#endif
146 143
144typedef uint32_t usize_t;
145
147#if XD3_USE_LARGEFILE64 146#if XD3_USE_LARGEFILE64
148#define __USE_FILE_OFFSET64 1 /* GLIBC: for 64bit fileops, ... ? */ 147#define __USE_FILE_OFFSET64 1 /* GLIBC: for 64bit fileops, ... ? */
149#ifndef _LARGEFILE_SOURCE 148#ifndef _LARGEFILE_SOURCE
@@ -753,7 +752,7 @@ struct _xd3_source
753 * source position to be read. 752 * source position to be read.
754 * Otherwise, equal to 753 * Otherwise, equal to
755 * max_blkno. */ 754 * max_blkno. */
756 usize_t onlastblk; /* Number of bytes on max_blkno */ 755 xoff_t onlastblk; /* Number of bytes on max_blkno */
757 int eof_known; /* Set to true when the first 756 int eof_known; /* Set to true when the first
758 * partial block is read. */ 757 * partial block is read. */
759}; 758};
@@ -1315,9 +1314,9 @@ static inline
1315void xd3_blksize_div (const xoff_t offset, 1314void xd3_blksize_div (const xoff_t offset,
1316 const xd3_source *source, 1315 const xd3_source *source,
1317 xoff_t *blkno, 1316 xoff_t *blkno,
1318 usize_t *blkoff) { 1317 xoff_t *blkoff) {
1319 *blkno = (xoff_t) (offset >> source->shiftby); 1318 *blkno = (xoff_t) (offset >> source->shiftby);
1320 *blkoff = (usize_t) (offset & source->maskby); 1319 *blkoff = (xoff_t) (offset & source->maskby);
1321 XD3_ASSERT (*blkoff < source->blksize); 1320 XD3_ASSERT (*blkoff < source->blksize);
1322} 1321}
1323 1322