From 8a97c0b8fa17a41f082aed7b60611a3ef4d9cc2a Mon Sep 17 00:00:00 2001 From: Gyubong Lee Date: Sun, 24 Jul 2022 12:53:22 +0900 Subject: [PATCH] `libc::c_void` -> `std::ffi::c_void` --- common/src/hash.rs | 4 ++-- vm/src/builtins/float.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/src/hash.rs b/common/src/hash.rs index 6f699e03d..667e4afa9 100644 --- a/common/src/hash.rs +++ b/common/src/hash.rs @@ -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)) } diff --git a/vm/src/builtins/float.rs b/vm/src/builtins/float.rs index dfa932a42..0211e042a 100644 --- a/vm/src/builtins/float.rs +++ b/vm/src/builtins/float.rs @@ -541,7 +541,7 @@ impl Hashable for PyFloat { fn hash(zelf: &crate::Py, _vm: &VirtualMachine) -> PyResult { 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)), } } }