From: Mika Lindqvist Date: Tue, 14 Feb 2017 20:10:02 +0000 (+0200) Subject: Type cleanup... X-Git-Tag: 1.9.9-b1~680 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bcab6edb16782a404779a9937c4f646ccda04af6;p=thirdparty%2Fzlib-ng.git Type cleanup... * uInt -> unsigned int * ulg -> unsigned long --- diff --git a/deflate.c b/deflate.c index 72da7e84e..8bba94554 100644 --- a/deflate.c +++ b/deflate.c @@ -163,7 +163,7 @@ static const config configuration_table[10] = { static void slide_hash(deflate_state *s) { unsigned n; Pos *p; - uInt wsize = s->w_size; + unsigned int wsize = s->w_size; n = s->hash_size; p = &s->head[n]; @@ -1347,7 +1347,7 @@ static block_state deflate_stored(deflate_state *s, int flush) { /* maximum stored block length that will fit in avail_out: */ have = s->strm->avail_out - have; left = s->strstart - s->block_start; /* bytes left in window */ - if (len > (ulg)left + s->strm->avail_in) + if (len > (unsigned long)left + s->strm->avail_in) len = left + s->strm->avail_in; /* limit len to the input */ if (len > have) len = have; /* limit len to the output */ diff --git a/deflate_p.h b/deflate_p.h index 3550818aa..a446544da 100644 --- a/deflate_p.h +++ b/deflate_p.h @@ -33,12 +33,12 @@ void flush_pending(z_stream *strm); */ #ifdef X86_SSE4_2_CRC_HASH -extern Pos insert_string_sse(deflate_state *const s, const Pos str, uInt count); +extern Pos insert_string_sse(deflate_state *const s, const Pos str, unsigned int count); #endif -static inline Pos insert_string_c(deflate_state *const s, const Pos str, uInt count) { +static inline Pos insert_string_c(deflate_state *const s, const Pos str, unsigned int count) { Pos ret = 0; - uInt idx; + unsigned int idx; for (idx = 0; idx < count; idx++) { UPDATE_HASH(s, s->ins_h, str+idx); @@ -51,7 +51,7 @@ static inline Pos insert_string_c(deflate_state *const s, const Pos str, uInt co return ret; } -static inline Pos insert_string(deflate_state *const s, const Pos str, uInt count) { +static inline Pos insert_string(deflate_state *const s, const Pos str, unsigned int count) { #ifdef X86_SSE4_2_CRC_HASH if (x86_cpu_has_sse42) return insert_string_sse(s, str, count); @@ -67,7 +67,7 @@ static inline Pos insert_string(deflate_state *const s, const Pos str, uInt coun _tr_flush_block(s, (s->block_start >= 0L ? \ (char *)&s->window[(unsigned)s->block_start] : \ NULL), \ - (ulg)((long)s->strstart - s->block_start), \ + (unsigned long)((long)s->strstart - s->block_start), \ (last)); \ s->block_start = s->strstart; \ flush_pending(s->strm); \ diff --git a/deflate_slow.c b/deflate_slow.c index f9e81d5ff..c0be3eaa3 100644 --- a/deflate_slow.c +++ b/deflate_slow.c @@ -79,7 +79,7 @@ block_state deflate_slow(deflate_state *s, int flush) { * match is not better, output the previous match: */ if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) { - uInt max_insert = s->strstart + s->lookahead - MIN_MATCH; + unsigned int max_insert = s->strstart + s->lookahead - MIN_MATCH; /* Do not insert strings in hash table beyond this. */ check_match(s, s->strstart-1, s->prev_match, s->prev_length); @@ -105,8 +105,8 @@ block_state deflate_slow(deflate_state *s, int flush) { s->strstart++; #else { - uInt mov_fwd = s->prev_length - 2; - uInt insert_cnt = mov_fwd; + unsigned int mov_fwd = s->prev_length - 2; + unsigned int insert_cnt = mov_fwd; if (unlikely(insert_cnt > max_insert - s->strstart)) insert_cnt = max_insert - s->strstart; diff --git a/infback.c b/infback.c index 81f792e5b..5c545b423 100644 --- a/infback.c +++ b/infback.c @@ -46,7 +46,7 @@ int ZEXPORT inflateBackInit_(z_stream *strm, int windowBits, unsigned char *wind Tracev((stderr, "inflate: allocated\n")); strm->state = (struct internal_state *)state; state->dmax = 32768U; - state->wbits = (uInt)windowBits; + state->wbits = (unsigned int)windowBits; state->wsize = 1U << windowBits; state->window = window; state->wnext = 0;