Skip to content

Commit

Permalink
Rename strm usize fields to strm_addr
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Nov 12, 2024
1 parent 3a541a5 commit 84e6a56
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions bzlib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ pub(crate) const BZ_N_OVERSHOOT: usize = (BZ_N_RADIX + BZ_N_QSORT + BZ_N_SHELL +
pub(crate) const FTAB_LEN: usize = u16::MAX as usize + 2;

pub(crate) struct EState {
pub strm: usize, // Only for a consistency check
pub strm_addr: usize, // Only for a consistency check
pub mode: Mode,
pub state: State,
pub avail_in_expect: u32,
Expand Down Expand Up @@ -344,7 +344,7 @@ impl Ftab {
}

pub(crate) struct DState {
pub strm: usize, // Only for a consistency check
pub strm_addr: usize, // Only for a consistency check
pub state: decompress::State,
pub state_out_ch: u8,
pub state_out_len: i32,
Expand Down Expand Up @@ -581,7 +581,7 @@ unsafe fn BZ2_bzCompressInitHelp(

// this `s.strm` pointer should _NEVER_ be used! it exists just as a consistency check to ensure
// that a given state belongs to a given strm.
(*s).strm = strm as usize; // FIXME use .addr() once stable
(*s).strm_addr = strm as usize; // FIXME use .addr() once stable

let n = 100000 * blockSize100k;

Expand Down Expand Up @@ -886,7 +886,7 @@ unsafe fn BZ2_bzCompressHelp(strm: &mut bz_stream, action: i32) -> ReturnCode {
};

// FIXME use .addr() once stable
if s.strm != strm as *mut _ as usize {
if s.strm_addr != strm as *mut _ as usize {
return ReturnCode::BZ_PARAM_ERROR;
}

Expand Down Expand Up @@ -986,7 +986,7 @@ pub unsafe extern "C" fn BZ2_bzCompressEnd(strm: *mut bz_stream) -> c_int {
};

// FIXME use .addr() once stable
if s.strm != strm as *mut _ as usize {
if s.strm_addr != strm as *mut _ as usize {
return ReturnCode::BZ_PARAM_ERROR as c_int;
}

Expand Down Expand Up @@ -1062,7 +1062,7 @@ unsafe fn BZ2_bzDecompressInitHelp(

// this `s.strm` pointer should _NEVER_ be used! it exists just as a consistency check to ensure
// that a given state belongs to a given strm.
(*s).strm = strm as usize; // FIXME use .addr() once stable
(*s).strm_addr = strm as usize; // FIXME use .addr() once stable

(*s).state = decompress::State::BZ_X_MAGIC_1;
(*s).bsLive = 0;
Expand Down Expand Up @@ -1593,7 +1593,7 @@ unsafe fn BZ2_bzDecompressHelp(strm: &mut bz_stream) -> ReturnCode {
};

// FIXME use .addr() once stable
if s.strm != strm as *mut _ as usize {
if s.strm_addr != strm as *mut _ as usize {
return ReturnCode::BZ_PARAM_ERROR;
}

Expand Down Expand Up @@ -1687,7 +1687,7 @@ pub unsafe extern "C" fn BZ2_bzDecompressEnd(strm: *mut bz_stream) -> c_int {
};

// FIXME use .addr() once stable
if s.strm != strm as *mut _ as usize {
if s.strm_addr != strm as *mut _ as usize {
return ReturnCode::BZ_PARAM_ERROR as c_int;
}

Expand Down

0 comments on commit 84e6a56

Please sign in to comment.