libc::c_void -> std::ffi::c_void

This commit is contained in:
Gyubong Lee
2022-07-24 12:53:22 +09:00
parent 98d3f38476
commit 8a97c0b8fa
2 changed files with 3 additions and 3 deletions

View File

@@ -194,7 +194,7 @@ pub fn lcg_urandom(mut x: u32, buf: &mut [u8]) {
}
}
pub fn hash_pointer_raw(p: *const libc::c_void) -> PyHash {
pub fn hash_pointer_raw(p: *const std::ffi::c_void) -> PyHash {
// TODO: Use commented logic when below issue resolved.
// Ref: https://github.com/RustPython/RustPython/pull/3951#issuecomment-1193108966
@@ -206,6 +206,6 @@ pub fn hash_pointer_raw(p: *const libc::c_void) -> PyHash {
p as PyHash
}
pub fn hash_pointer(p: *const libc::c_void) -> PyHash {
pub fn hash_pointer(p: *const std::ffi::c_void) -> PyHash {
fix_sentinel(hash_pointer_raw(p))
}

View File

@@ -541,7 +541,7 @@ impl Hashable for PyFloat {
fn hash(zelf: &crate::Py<Self>, _vm: &VirtualMachine) -> PyResult<hash::PyHash> {
match hash::hash_float(zelf.to_f64()) {
Some(value) => Ok(value),
None => Ok(hash::hash_pointer(zelf as *const _ as *const libc::c_void)),
None => Ok(hash::hash_pointer(zelf as *const _ as *const std::ffi::c_void)),
}
}
}