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 c_char type error (i8 vs u8) when building on linux arm64 #3

Merged
merged 1 commit into from
May 16, 2022
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
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ impl std::iter::Iterator for MetadataIterator {
let mut buf: *mut Buffer = std::ptr::null_mut();
let key = match void_result(blackmagic_raw_metadata_iterator_get_key(self.implementation, &mut buf)) {
Ok(_) => {
let key = std::ffi::CStr::from_ptr(buffer_data(buf) as *const i8).to_str().unwrap_or("").to_string();
let key = std::ffi::CStr::from_ptr(buffer_data(buf) as *const c_char).to_str().unwrap_or("").to_string();
buffer_release(buf);
key
},
Expand All @@ -657,7 +657,7 @@ impl std::iter::Iterator for MetadataIterator {
_BlackmagicRawVariantType_blackmagicRawVariantTypeString => {
let mut buf: *mut Buffer = std::ptr::null_mut();
blackmagic_raw_variant_get_string(&mut value, &mut buf);
let s = std::ffi::CStr::from_ptr(buffer_data(buf) as *const i8).to_str().unwrap_or("").to_string();
let s = std::ffi::CStr::from_ptr(buffer_data(buf) as *const c_char).to_str().unwrap_or("").to_string();
buffer_release(buf);
Value::String(s)
},
Expand Down