[Zlib-devel] A few compiler warnings with 1.2.2.2

Mark Adler madler at alumni.caltech.edu
Sun Feb 6 15:33:46 EST 2005


On Feb 5, 2005, at 7:59 PM, Gilles Vollant wrote:
> I've also these two warning in 64 bits compiling
> inftrees.c(265) : warning C4334: '<<' : result of 32-bit shift 
> implicitly
> converted to 64 bits (was 64-bit shift intended?)
> inflate.c(1341) : warning C4334: '<<' : result of 32-bit shift 
> implicitly
> converted to 64 bits (was 64-bit shift intended?)

Giles,

Let me know if the patches below help.

mark


gromit% diff -c ../zlib-1.2.2.2/inflate.c inflate.c
*** ../zlib-1.2.2.2/inflate.c   Fri Nov 12 21:49:43 2004
--- inflate.c   Sun Feb  6 12:29:02 2005
***************
*** 1338,1344 ****
       copy->distcode = copy->codes + (state->distcode - state->codes);
       copy->next = copy->codes + (state->next - state->codes);
       if (window != Z_NULL)
!         zmemcpy(window, state->window, 1U << state->wbits);
       copy->window = window;
       dest->state = (voidpf)copy;
       return Z_OK;
--- 1338,1344 ----
       copy->distcode = copy->codes + (state->distcode - state->codes);
       copy->next = copy->codes + (state->next - state->codes);
       if (window != Z_NULL)
!         zmemcpy(window, state->window, ((uInt)1) << state->wbits);
       copy->window = window;
       dest->state = (voidpf)copy;
       return Z_OK;
gromit% diff -c ../zlib-1.2.2.2/inftrees.c inftrees.c
*** ../zlib-1.2.2.2/inftrees.c  Sun Oct 31 09:54:30 2004
--- inftrees.c  Sun Feb  6 12:30:14 2005
***************
*** 262,268 ****
                   drop = root;

               /* increment past last table */
!             next += 1U << curr;

               /* determine length of next table */
               curr = len - drop;
--- 262,268 ----
                   drop = root;

               /* increment past last table */
!             next += ((unsigned)1) << curr;

               /* determine length of next table */
               curr = len - drop;





More information about the Zlib-devel mailing list