From cdf2ecd176fe9ac8876092dfd385875d6e280139 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Sun, 5 Dec 2021 20:29:31 -0800 Subject: [PATCH] tags: fix incorrect uses of i8 instead of c_char Fixes build on aarch64, ppc64le and other platforms that have c_char defined as u8. --- tags/src/c_lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tags/src/c_lib.rs b/tags/src/c_lib.rs index 8f689a9a..088cc7bc 100644 --- a/tags/src/c_lib.rs +++ b/tags/src/c_lib.rs @@ -215,9 +215,9 @@ pub extern "C" fn ts_tags_buffer_tags_len(this: *const TSTagsBuffer) -> u32 { } #[no_mangle] -pub extern "C" fn ts_tags_buffer_docs(this: *const TSTagsBuffer) -> *const i8 { +pub extern "C" fn ts_tags_buffer_docs(this: *const TSTagsBuffer) -> *const c_char { let buffer = unwrap_ptr(this); - buffer.docs.as_ptr() as *const i8 + buffer.docs.as_ptr() as *const c_char } #[no_mangle] @@ -237,7 +237,7 @@ pub extern "C" fn ts_tagger_syntax_kinds_for_scope_name( this: *mut TSTagger, scope_name: *const c_char, len: *mut u32, -) -> *const *const i8 { +) -> *const *const c_char { let tagger = unwrap_mut_ptr(this); let scope_name = unsafe { unwrap(CStr::from_ptr(scope_name).to_str()) }; let len = unwrap_mut_ptr(len); @@ -245,7 +245,7 @@ pub extern "C" fn ts_tagger_syntax_kinds_for_scope_name( *len = 0; if let Some(config) = tagger.languages.get(scope_name) { *len = config.c_syntax_type_names.len() as u32; - return config.c_syntax_type_names.as_ptr() as *const *const i8; + return config.c_syntax_type_names.as_ptr() as *const *const c_char; } std::ptr::null() }