diff --git a/rust/src/function.rs b/rust/src/function.rs index 78b7da9f3..48f02205b 100644 --- a/rust/src/function.rs +++ b/rust/src/function.rs @@ -40,7 +40,7 @@ pub use binaryninjacore_sys::BNFunctionAnalysisSkipOverride as FunctionAnalysisS pub use binaryninjacore_sys::BNFunctionUpdateType as FunctionUpdateType; use std::{fmt, mem}; -use std::{hash::Hash, ops::Range}; +use std::{ffi::c_char, hash::Hash, ops::Range}; pub struct Location { pub arch: Option, @@ -1499,7 +1499,7 @@ impl Function { let arch = arch.unwrap_or_else(|| self.arch()); let enum_display_typeid = enum_display_typeid.map(BnStrCompatible::into_bytes_with_nul); let enum_display_typeid_ptr = enum_display_typeid - .map(|x| x.as_ref().as_ptr() as *const i8) + .map(|x| x.as_ref().as_ptr() as *const c_char) .unwrap_or(core::ptr::null()); unsafe { BNSetIntegerConstantDisplayType( @@ -1944,7 +1944,7 @@ impl Function { .iter() .position(|(alias, _value)| *alias == name) { - let name = DEBUG_REPORT_ALIAS[alias_idx].1.as_ptr() as *const i8; + let name = DEBUG_REPORT_ALIAS[alias_idx].1.as_ptr() as *const c_char; unsafe { BNRequestFunctionDebugReport(self.handle, name) } } else { let name = std::ffi::CString::new(name.to_string()).unwrap(); diff --git a/rust/src/mlil/function.rs b/rust/src/mlil/function.rs index e0856b931..3a3ce5e84 100644 --- a/rust/src/mlil/function.rs +++ b/rust/src/mlil/function.rs @@ -1,4 +1,5 @@ use core::hash::{Hash, Hasher}; +use std::ffi::c_char; use binaryninjacore_sys::*; @@ -127,7 +128,7 @@ impl MediumLevelILFunction { self.get_function().handle, offset, &mut raw_var_type, - name.as_ref().as_ptr() as *const i8, + name.as_ref().as_ptr() as *const c_char, ) } } @@ -270,7 +271,7 @@ impl MediumLevelILFunction { self.get_function().handle, offset, &mut var_type, - name_c_str.as_ptr() as *const i8, + name_c_str.as_ptr() as *const c_char, ) } } @@ -295,7 +296,7 @@ impl MediumLevelILFunction { self.get_function().handle, &var.raw(), &mut var_type, - name_c_str.as_ptr() as *const i8, + name_c_str.as_ptr() as *const c_char, ignore_disjoint_uses, ) }