Skip to content

Commit

Permalink
Fix for systems with unsigned char
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Nov 5, 2024
1 parent a869950 commit f811d1c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bzlib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1788,7 +1788,7 @@ pub unsafe extern "C" fn BZ2_bzWrite(
(*bzf).strm.next_in = buf as *mut libc::c_char;
loop {
(*bzf).strm.avail_out = 5000 as libc::c_int as libc::c_uint;
(*bzf).strm.next_out = ((*bzf).buf).as_mut_ptr();
(*bzf).strm.next_out = ((*bzf).buf).as_mut_ptr().cast::<c_char>();
ret = BZ2_bzCompress(&mut (*bzf).strm, 0 as libc::c_int);
if ret != 1 as libc::c_int {
if !bzerror.is_null() {
Expand Down Expand Up @@ -1902,7 +1902,7 @@ pub unsafe extern "C" fn BZ2_bzWriteClose64(
if abandon == 0 && (*bzf).lastErr == 0 as libc::c_int {
loop {
(*bzf).strm.avail_out = 5000 as libc::c_int as libc::c_uint;
(*bzf).strm.next_out = ((*bzf).buf).as_mut_ptr();
(*bzf).strm.next_out = ((*bzf).buf).as_mut_ptr().cast::<c_char>();
ret = BZ2_bzCompress(&mut (*bzf).strm, 2 as libc::c_int);
if ret != 3 as libc::c_int && ret != 4 as libc::c_int {
if !bzerror.is_null() {
Expand Down Expand Up @@ -2052,7 +2052,7 @@ pub unsafe extern "C" fn BZ2_bzReadOpen(
return std::ptr::null_mut::<libc::c_void>();
}
(*bzf).strm.avail_in = (*bzf).bufN as libc::c_uint;
(*bzf).strm.next_in = ((*bzf).buf).as_mut_ptr();
(*bzf).strm.next_in = ((*bzf).buf).as_mut_ptr().cast::<c_char>();
(*bzf).initialisedOk = true;
bzf as *mut libc::c_void
}
Expand Down Expand Up @@ -2162,7 +2162,7 @@ pub unsafe extern "C" fn BZ2_bzRead(
}
(*bzf).bufN = n;
(*bzf).strm.avail_in = (*bzf).bufN as libc::c_uint;
(*bzf).strm.next_in = ((*bzf).buf).as_mut_ptr();
(*bzf).strm.next_in = ((*bzf).buf).as_mut_ptr().cast::<c_char>();
}
ret = BZ2_bzDecompress(&mut (*bzf).strm);
if ret != 0 as libc::c_int && ret != 4 as libc::c_int {
Expand Down

0 comments on commit f811d1c

Please sign in to comment.