[Zlib-devel] A few compiler warnings with 1.2.2.2

Mark Adler madler at alumni.caltech.edu
Sun Feb 6 16:50:09 EST 2005


On Feb 6, 2005, at 1:33 PM, Gilles Vollant wrote:
>  !         zmemcpy(window, state->window, 1U << state->wbits);
>
> Give a warning
>
> But
> {
> uInt startlog = 1;
> zmemcpy(window, state->window, startlog << state->wbits);
> }
> Give no warning

Remarkable.  Microsoft must have a team of highly-paid geniuses that do 
nothing but come up with new ways to drive people crazy.

Ok, let me know if the patch below helps.

mark


*** ../zlib-1.2.2.2/inflate.c   Fri Nov 12 21:49:43 2004
--- inflate.c   Sun Feb  6 13:45:48 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)(1U << state->wbits));
       copy->window = window;
       dest->state = (voidpf)copy;
       return Z_OK;


*** ../zlib-1.2.2.2/inftrees.c  Sun Oct 31 09:54:30 2004
--- inftrees.c  Sun Feb  6 13:45:27 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)(1U << curr);

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





More information about the Zlib-devel mailing list