From 84e6a560367bb3a35509833410dec7199e0b96cf Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Tue, 12 Nov 2024 15:09:15 +0100 Subject: [PATCH] Rename strm usize fields to strm_addr --- bzlib.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bzlib.rs b/bzlib.rs index 8a1041025..1b0887415 100644 --- a/bzlib.rs +++ b/bzlib.rs @@ -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, @@ -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, @@ -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; @@ -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; } @@ -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; } @@ -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; @@ -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; } @@ -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; }