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.
This commit is contained in:
Aleksei Bavshin 2021-12-05 20:29:31 -08:00
parent b27b4665ac
commit cdf2ecd176
No known key found for this signature in database
GPG key ID: 4F071603387A382A

View file

@ -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()
}