Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use *const c_char cast instead of *const i8 #285

Merged
merged 1 commit into from
Oct 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions rust_icu_ucsdet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ use {
ffi::CStr,
marker::PhantomData,
mem::transmute,
os::raw::c_char,
ptr::{self, NonNull},
},
};
Expand Down Expand Up @@ -87,7 +88,7 @@ impl<'detector> CharsetDetector<'detector> {
unsafe {
versioned_function!(ucsdet_setText)(
self.rep.as_ptr(),
text.as_ptr() as *const i8,
text.as_ptr() as *const c_char,
text.len() as i32,
&mut status,
);
Expand All @@ -101,7 +102,7 @@ impl<'detector> CharsetDetector<'detector> {
unsafe {
versioned_function!(ucsdet_setDeclaredEncoding)(
self.rep.as_ptr(),
encoding.as_ptr() as *const i8,
encoding.as_ptr() as *const c_char,
encoding.len() as i32,
&mut status,
);
Expand Down