Skip to content

Commit e5df780

Browse files
committed
work around issue #137
1 parent a7d496d commit e5df780

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

std/zlib/inflate.zig

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ pub struct InflateState {
6464
/* sliding window */
6565
wbits: u32, /* log base 2 of requested window size */
6666
wsize: u32, /* window size or zero if not using window */
67-
whave: u32, /* valid bytes in the window */
68-
wnext: u32, /* window write index */
67+
whave: isize, /* valid bytes in the window */
68+
wnext: isize, /* window write index */
6969
window: [WINDOW_SIZE]u8,/* sliding window, if needed */
7070
/* bit accumulator */
7171
hold: u32, /* input bit accumulator */
@@ -977,9 +977,11 @@ pub fn inflate(strm: &z_stream, flush: FlushMode) -> %void {
977977
state.check = UPDATE(state.check, strm.next_out - out, out);
978978
strm.adler = state.check;
979979
}
980-
strm.data_type = state.bits + (if (state.last) 64 else 0) +
981-
(if (state.mode == inflate_mode.TYPE) 128 else 0) +
982-
(if (state.mode == inflate_mode.LEN_ || state.mode == inflate_mode.COPY_) 256 else 0);
980+
// TODO: https://github.com/andrewrk/zig/issues/136
981+
// strm.data_type = state.bits +
982+
// (if (state.last) 64 else 0) +
983+
// (if (state.mode == inflate_mode.TYPE) 128 else 0) +
984+
// (if (state.mode == inflate_mode.LEN_ || state.mode == inflate_mode.COPY_) 256 else 0);
983985
if (((in == 0 && out == 0) || flush == FlushMode.Z_FINISH) && ret == Z_OK)
984986
ret = Z_BUF_ERROR;
985987
return ret;

0 commit comments

Comments
 (0)