aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1997-12-18 11:18:32 +0000
committerAndrew Tridgell <tridge@samba.org>1997-12-18 11:18:32 +0000
commit5c36219d404da75b66d092e60f691acb3fee43c1 (patch)
treebd1c93e45b9ba8d3853343ccad48818f4be22606 /lib
parentf0e5517fb8abdf468542af0e5cb31607fb536c5e (diff)
downloadandroid_external_rsync-5c36219d404da75b66d092e60f691acb3fee43c1.tar.gz
android_external_rsync-5c36219d404da75b66d092e60f691acb3fee43c1.tar.bz2
android_external_rsync-5c36219d404da75b66d092e60f691acb3fee43c1.zip
following a report of problems with Linux/alpha I've changed zlib.c to
use uint32 instead of "long" in several places. Apparently this fixes things on the alpha. The strange thing is that my own tests on a OSF/alpha box and a 64 bit IRIX box showed no problems. I wonder what was actually going wrong? I'll email the zlib maintainers and let them know.
Diffstat (limited to 'lib')
-rw-r--r--lib/zlib.c14
-rw-r--r--lib/zlib.h3
2 files changed, 9 insertions, 8 deletions
diff --git a/lib/zlib.c b/lib/zlib.c
index 9d732bb7..a4cf064e 100644
--- a/lib/zlib.c
+++ b/lib/zlib.c
@@ -252,7 +252,7 @@ typedef struct deflate_state {
* hash_shift * MIN_MATCH >= hash_bits
*/
- long block_start;
+ Long block_start;
/* Window position at the beginning of the current output block. Gets
* negative when the window is moved backwards.
*/
@@ -1122,7 +1122,7 @@ local void fill_window(s)
s->match_start -= wsize;
s->strstart -= wsize; /* we now have strstart >= MAX_DIST */
- s->block_start -= (long) wsize;
+ s->block_start -= (Long) wsize;
/* Slide the hash table (could be avoided with 32 bit values
at the expense of memory usage):
@@ -1187,7 +1187,7 @@ local void fill_window(s)
#define FLUSH_BLOCK_ONLY(s, flush) { \
ct_flush_block(s, (s->block_start >= 0L ? \
(charf *)&s->window[(unsigned)s->block_start] : \
- (charf *)Z_NULL), (long)s->strstart - s->block_start, (flush)); \
+ (charf *)Z_NULL), (Long)s->strstart - s->block_start, (flush)); \
s->block_start = s->strstart; \
flush_pending(s->strm); \
Tracev((stderr,"[FLUSH]")); \
@@ -1907,8 +1907,8 @@ local void gen_bitlen(s, desc)
if (m > max_code) continue;
if (tree[m].Len != (unsigned) bits) {
Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
- s->opt_len += ((long)bits - (long)tree[m].Len)
- *(long)tree[m].Freq;
+ s->opt_len += ((Long)bits - (Long)tree[m].Len)
+ *(Long)tree[m].Freq;
tree[m].Len = (ush)bits;
}
n--;
@@ -4578,8 +4578,8 @@ uLong adler32(adler, buf, len)
Bytef *buf;
uInt len;
{
- unsigned long s1 = adler & 0xffff;
- unsigned long s2 = (adler >> 16) & 0xffff;
+ uLong s1 = adler & 0xffff;
+ uLong s2 = (adler >> 16) & 0xffff;
int k;
if (buf == Z_NULL) return 1L;
diff --git a/lib/zlib.h b/lib/zlib.h
index e3413d6a..6ff2ae53 100644
--- a/lib/zlib.h
+++ b/lib/zlib.h
@@ -112,7 +112,8 @@
typedef unsigned char Byte; /* 8 bits */
typedef unsigned int uInt; /* 16 bits or more */
-typedef unsigned long uLong; /* 32 bits or more */
+typedef int32 Long; /* 32 bits or more */
+typedef uint32 uLong; /* 32 bits or more */
typedef Byte FAR Bytef;
typedef char FAR charf;