Skip to content

Commit

Permalink
fixed minor warnings for msvc build
Browse files Browse the repository at this point in the history
  • Loading branch information
mmozeiko committed Sep 28, 2017
1 parent da20fdf commit b3d13f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.cmd
Expand Up @@ -2,7 +2,7 @@

call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64

set CL=/nologo /errorReport:none /Gm- /GF /GS- /MT /W4
set CL=/nologo /errorReport:none /Gm- /GF /GS- /MT /W4 /wd4324
set LINK=/errorReport:none /INCREMENTAL:NO

set CL=%CL% /Ox
Expand Down
10 changes: 5 additions & 5 deletions puff.c
Expand Up @@ -174,7 +174,7 @@ local int construct(struct huffman *h, const short *length, int n)
*/
for (symbol = 0; symbol < n; symbol++)
if (length[symbol] != 0)
h->symbol[offs[length[symbol]]++] = symbol;
h->symbol[offs[length[symbol]]++] = (short)symbol;

/* return zero for complete set, positive for incomplete set */
return left;
Expand Down Expand Up @@ -212,7 +212,7 @@ local int codes(struct state *s,
if (s->out != NIL) {
if (s->outcnt == s->outlen)
return 1;
s->out[s->outcnt] = symbol;
s->out[s->outcnt] = (unsigned char)symbol;
}
s->outcnt++;
}
Expand Down Expand Up @@ -325,7 +325,7 @@ local int dynamic(struct state *s)

/* read code length code lengths (really), missing lengths are zero */
for (index = 0; index < ncode; index++)
lengths[order[index]] = bits(s, 3);
lengths[order[index]] = (short)bits(s, 3);
for (; index < 19; index++)
lengths[order[index]] = 0;

Expand All @@ -344,7 +344,7 @@ local int dynamic(struct state *s)
if (symbol < 0)
return symbol; /* invalid symbol */
if (symbol < 16) /* length in 0..15 */
lengths[index++] = symbol;
lengths[index++] = (short)symbol;
else { /* repeat instruction */
len = 0; /* assume repeating zeros */
if (symbol == 16) { /* repeat last length 3..6 times */
Expand All @@ -360,7 +360,7 @@ local int dynamic(struct state *s)
if (index + symbol > nlen + ndist)
return -6; /* too many lengths! */
while (symbol--) /* repeat last or zero symbol times */
lengths[index++] = len;
lengths[index++] = (short)len;
}
}

Expand Down

0 comments on commit b3d13f4

Please sign in to comment.