diff --git a/src/deflate/deflate.rs b/src/deflate/deflate.rs index 38fa9314..e8044770 100644 --- a/src/deflate/deflate.rs +++ b/src/deflate/deflate.rs @@ -17,7 +17,7 @@ pub fn inflate(data: &[u8]) -> Result, String> { Ok(output) } -pub fn deflate(data: &[u8], zc: u8, zm: u8, zs: u8, zw: u16) -> Result, String> { +pub fn deflate(data: &[u8], zc: u8, zm: u8, zs: u8, zw: u8) -> Result, String> { let mut input = data.to_owned(); let mut stream = super::stream::Stream::new_compress(zc as libc::c_int, zw as libc::c_int, diff --git a/src/deflate/stream.rs b/src/deflate/stream.rs index 715722eb..9c95023a 100644 --- a/src/deflate/stream.rs +++ b/src/deflate/stream.rs @@ -62,19 +62,19 @@ impl Stream { } impl Stream { - pub fn total_in(&self) -> u64 { - self.raw.total_in as u64 + pub fn total_in(&self) -> usize { + self.raw.total_in as usize } - pub fn total_out(&self) -> u64 { - self.raw.total_out as u64 + pub fn total_out(&self) -> usize { + self.raw.total_out as usize } } impl Stream { pub fn decompress_vec(&mut self, input: &mut [u8], output: &mut Vec) -> c_int { - self.raw.avail_in = (input.len() - self.total_in() as usize) as c_uint; - self.raw.avail_out = (output.capacity() - self.total_out() as usize) as c_uint; + self.raw.avail_in = (input.len() - self.total_in()) as c_uint; + self.raw.avail_out = (output.capacity() - self.total_out()) as c_uint; unsafe { self.raw.next_in = input.as_mut_ptr().offset(self.total_in() as isize); diff --git a/src/lib.rs b/src/lib.rs index ba21cbaf..d15ed1f9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -29,7 +29,7 @@ pub struct Options { pub compression: HashSet, pub memory: HashSet, pub strategies: HashSet, - pub window: u16, + pub window: u8, pub bit_depth_reduction: bool, pub color_type_reduction: bool, pub palette_reduction: bool,