diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs index fb07eaf8ed..77941fa34f 100644 --- a/src/codegen/mod.rs +++ b/src/codegen/mod.rs @@ -2138,7 +2138,7 @@ impl ToRustTy for Type { TypeKind::Int(ik) => { match ik { IntKind::Bool => aster::ty::TyBuilder::new().bool(), - IntKind::Char => raw_type(ctx, "c_char"), + IntKind::Char => raw_type(ctx, "c_schar"), IntKind::UChar => raw_type(ctx, "c_uchar"), IntKind::Short => raw_type(ctx, "c_short"), IntKind::UShort => raw_type(ctx, "c_ushort"), diff --git a/tests/expectations/tests/arg_keyword.rs b/tests/expectations/tests/arg_keyword.rs index cb1cc4327a..23818328c4 100644 --- a/tests/expectations/tests/arg_keyword.rs +++ b/tests/expectations/tests/arg_keyword.rs @@ -6,5 +6,5 @@ extern "C" { #[link_name = "_Z3fooPKc"] - pub fn foo(type_: *const ::std::os::raw::c_char); + pub fn foo(type_: *const ::std::os::raw::c_schar); } diff --git a/tests/expectations/tests/bitfield-enum-basic.rs b/tests/expectations/tests/bitfield-enum-basic.rs index 362cf28030..a3eb0d7ad8 100644 --- a/tests/expectations/tests/bitfield-enum-basic.rs +++ b/tests/expectations/tests/bitfield-enum-basic.rs @@ -33,7 +33,7 @@ impl ::std::ops::BitOr for Buz { } #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub struct Buz(pub ::std::os::raw::c_char); +pub struct Buz(pub ::std::os::raw::c_schar); pub const NS_FOO: _bindgen_ty_1 = _bindgen_ty_1(1); pub const NS_BAR: _bindgen_ty_1 = _bindgen_ty_1(2); impl ::std::ops::BitOr<_bindgen_ty_1> for _bindgen_ty_1 { diff --git a/tests/expectations/tests/class.rs b/tests/expectations/tests/class.rs index 92389cbefa..3ed5edd243 100644 --- a/tests/expectations/tests/class.rs +++ b/tests/expectations/tests/class.rs @@ -64,7 +64,7 @@ impl ::std::fmt::Debug for __BindgenUnionField { #[repr(C)] pub struct C { pub a: ::std::os::raw::c_int, - pub big_array: [::std::os::raw::c_char; 33usize], + pub big_array: [::std::os::raw::c_schar; 33usize], } #[test] fn bindgen_test_layout_C() { @@ -88,8 +88,8 @@ impl Default for C { #[repr(C)] pub struct C_with_zero_length_array { pub a: ::std::os::raw::c_int, - pub big_array: [::std::os::raw::c_char; 33usize], - pub zero_length_array: __IncompleteArrayField<::std::os::raw::c_char>, + pub big_array: [::std::os::raw::c_schar; 33usize], + pub zero_length_array: __IncompleteArrayField<::std::os::raw::c_schar>, } #[test] fn bindgen_test_layout_C_with_zero_length_array() { @@ -124,8 +124,8 @@ impl Default for C_with_zero_length_array { #[repr(C)] pub struct C_with_incomplete_array { pub a: ::std::os::raw::c_int, - pub big_array: [::std::os::raw::c_char; 33usize], - pub incomplete_array: __IncompleteArrayField<::std::os::raw::c_char>, + pub big_array: [::std::os::raw::c_schar; 33usize], + pub incomplete_array: __IncompleteArrayField<::std::os::raw::c_schar>, } #[test] fn bindgen_test_layout_C_with_incomplete_array() { @@ -142,9 +142,9 @@ impl Default for C_with_incomplete_array { #[repr(C)] pub struct C_with_zero_length_array_and_incomplete_array { pub a: ::std::os::raw::c_int, - pub big_array: [::std::os::raw::c_char; 33usize], - pub zero_length_array: __IncompleteArrayField<::std::os::raw::c_char>, - pub incomplete_array: __IncompleteArrayField<::std::os::raw::c_char>, + pub big_array: [::std::os::raw::c_schar; 33usize], + pub zero_length_array: __IncompleteArrayField<::std::os::raw::c_schar>, + pub incomplete_array: __IncompleteArrayField<::std::os::raw::c_schar>, } #[test] fn bindgen_test_layout_C_with_zero_length_array_and_incomplete_array() { diff --git a/tests/expectations/tests/class_with_typedef.rs b/tests/expectations/tests/class_with_typedef.rs index 1a92b98603..03822233ff 100644 --- a/tests/expectations/tests/class_with_typedef.rs +++ b/tests/expectations/tests/class_with_typedef.rs @@ -15,7 +15,7 @@ pub struct C { pub other_ptr: *mut AnotherInt, } pub type C_MyInt = ::std::os::raw::c_int; -pub type C_Lookup = *const ::std::os::raw::c_char; +pub type C_Lookup = *const ::std::os::raw::c_schar; #[test] fn bindgen_test_layout_C() { assert_eq!(::std::mem::size_of::() , 72usize , concat ! ( diff --git a/tests/expectations/tests/constant-evaluate.rs b/tests/expectations/tests/constant-evaluate.rs index cdf097a2d8..ae0570ea7f 100644 --- a/tests/expectations/tests/constant-evaluate.rs +++ b/tests/expectations/tests/constant-evaluate.rs @@ -14,7 +14,7 @@ pub const k: EasyToOverflow = 2147483648; pub const k_expr: EasyToOverflow = 0; pub const BAZ: ::std::os::raw::c_longlong = 24; pub const fuzz: f64 = 51.; -pub const BAZZ: ::std::os::raw::c_char = 53; -pub const WAT: ::std::os::raw::c_char = 0; +pub const BAZZ: ::std::os::raw::c_schar = 53; +pub const WAT: ::std::os::raw::c_schar = 0; pub const bytestring: &'static [u8; 4usize] = b"Foo\x00"; pub const NOT_UTF8: [u8; 5usize] = [240, 40, 140, 40, 0]; diff --git a/tests/expectations/tests/inline_namespace_whitelist.rs b/tests/expectations/tests/inline_namespace_whitelist.rs index 9b8f87a5cf..d3a9d95855 100644 --- a/tests/expectations/tests/inline_namespace_whitelist.rs +++ b/tests/expectations/tests/inline_namespace_whitelist.rs @@ -10,6 +10,6 @@ pub mod root { pub mod std { #[allow(unused_imports)] use self::super::super::root; - pub type string = *const ::std::os::raw::c_char; + pub type string = *const ::std::os::raw::c_schar; } } diff --git a/tests/expectations/tests/issue-493.rs b/tests/expectations/tests/issue-493.rs index f8814bd396..a2246ca6a3 100644 --- a/tests/expectations/tests/issue-493.rs +++ b/tests/expectations/tests/issue-493.rs @@ -37,7 +37,7 @@ pub struct basic_string<_CharT, _Traits, _Allocator> { pub _phantom_2: ::std::marker::PhantomData<_Allocator>, } pub type basic_string_size_type = ::std::os::raw::c_ulonglong; -pub type basic_string_value_type = ::std::os::raw::c_char; +pub type basic_string_value_type = ::std::os::raw::c_schar; pub type basic_string_pointer = *mut basic_string_value_type; #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/tests/expectations/tests/layout.rs b/tests/expectations/tests/layout.rs index 115a108a2e..d074867284 100644 --- a/tests/expectations/tests/layout.rs +++ b/tests/expectations/tests/layout.rs @@ -40,7 +40,7 @@ impl ::std::marker::Copy for __IncompleteArrayField { } #[repr(C, packed)] #[derive(Debug, Default, Copy)] pub struct header { - pub proto: ::std::os::raw::c_char, + pub proto: ::std::os::raw::c_schar, pub size: ::std::os::raw::c_uint, pub data: __IncompleteArrayField<::std::os::raw::c_uchar>, pub __bindgen_padding_0: [u8; 11usize], diff --git a/tests/expectations/tests/layout_array.rs b/tests/expectations/tests/layout_array.rs index 2cc8578519..eedc32b274 100644 --- a/tests/expectations/tests/layout_array.rs +++ b/tests/expectations/tests/layout_array.rs @@ -58,7 +58,7 @@ pub type rte_mempool_get_count = #[derive(Debug, Copy)] pub struct rte_mempool_ops { /**< Name of mempool ops struct. */ - pub name: [::std::os::raw::c_char; 32usize], + pub name: [::std::os::raw::c_schar; 32usize], /**< Allocate private data. */ pub alloc: rte_mempool_alloc_t, /**< Free the external pool. */ diff --git a/tests/expectations/tests/layout_cmdline_token.rs b/tests/expectations/tests/layout_cmdline_token.rs index 791ea9b3e2..c2b10455c3 100644 --- a/tests/expectations/tests/layout_cmdline_token.rs +++ b/tests/expectations/tests/layout_cmdline_token.rs @@ -64,7 +64,7 @@ pub struct cmdline_token_ops { pub parse: ::std::option::Option ::std::os::raw::c_int>, @@ -88,7 +88,7 @@ pub struct cmdline_token_ops { pub get_help: ::std::option::Option ::std::os::raw::c_int>, diff --git a/tests/expectations/tests/layout_kni_mbuf.rs b/tests/expectations/tests/layout_kni_mbuf.rs index d704267dee..209be0f129 100644 --- a/tests/expectations/tests/layout_kni_mbuf.rs +++ b/tests/expectations/tests/layout_kni_mbuf.rs @@ -11,22 +11,22 @@ pub const RTE_CACHE_LINE_SIZE: ::std::os::raw::c_uint = 64; pub struct rte_kni_mbuf { pub buf_addr: *mut ::std::os::raw::c_void, pub buf_physaddr: u64, - pub pad0: [::std::os::raw::c_char; 2usize], + pub pad0: [::std::os::raw::c_schar; 2usize], /**< Start address of data in segment buffer. */ pub data_off: u16, - pub pad1: [::std::os::raw::c_char; 2usize], + pub pad1: [::std::os::raw::c_schar; 2usize], /**< Number of segments. */ pub nb_segs: u8, - pub pad4: [::std::os::raw::c_char; 1usize], + pub pad4: [::std::os::raw::c_schar; 1usize], /**< Offload features. */ pub ol_flags: u64, - pub pad2: [::std::os::raw::c_char; 4usize], + pub pad2: [::std::os::raw::c_schar; 4usize], /**< Total pkt len: sum of all segment data_len. */ pub pkt_len: u32, /**< Amount of data in segment buffer. */ pub data_len: u16, pub __bindgen_padding_0: [u8; 22usize], - pub pad3: [::std::os::raw::c_char; 8usize], + pub pad3: [::std::os::raw::c_schar; 8usize], pub pool: *mut ::std::os::raw::c_void, pub next: *mut ::std::os::raw::c_void, pub __bindgen_padding_1: [u64; 5usize], diff --git a/tests/expectations/tests/objc_method.rs b/tests/expectations/tests/objc_method.rs index d0342a2129..c9b9504f39 100644 --- a/tests/expectations/tests/objc_method.rs +++ b/tests/expectations/tests/objc_method.rs @@ -20,7 +20,7 @@ pub trait Foo { unsafe fn methodWithArg1_andArg2_andArg3_(self, intvalue: ::std::os::raw::c_int, ptr: - *mut ::std::os::raw::c_char, + *mut ::std::os::raw::c_schar, floatvalue: f32); } impl Foo for id { @@ -40,7 +40,7 @@ impl Foo for id { unsafe fn methodWithArg1_andArg2_andArg3_(self, intvalue: ::std::os::raw::c_int, ptr: - *mut ::std::os::raw::c_char, + *mut ::std::os::raw::c_schar, floatvalue: f32) { msg_send!(self , methodWithArg1:intvalue andArg2:ptr andArg3:floatvalue ) diff --git a/tests/expectations/tests/overloading.rs b/tests/expectations/tests/overloading.rs index 71002e23bc..99efe496d5 100644 --- a/tests/expectations/tests/overloading.rs +++ b/tests/expectations/tests/overloading.rs @@ -6,7 +6,7 @@ extern "C" { #[link_name = "_Z8Evaluatec"] - pub fn Evaluate(r: ::std::os::raw::c_char) -> bool; + pub fn Evaluate(r: ::std::os::raw::c_schar) -> bool; } extern "C" { #[link_name = "_Z8Evaluateii"] diff --git a/tests/expectations/tests/struct_with_packing.rs b/tests/expectations/tests/struct_with_packing.rs index cba3d4759e..293cc5342f 100644 --- a/tests/expectations/tests/struct_with_packing.rs +++ b/tests/expectations/tests/struct_with_packing.rs @@ -7,7 +7,7 @@ #[repr(C, packed)] #[derive(Debug, Default, Copy)] pub struct a { - pub b: ::std::os::raw::c_char, + pub b: ::std::os::raw::c_schar, pub c: ::std::os::raw::c_short, } #[test] diff --git a/tests/expectations/tests/union_with_big_member.rs b/tests/expectations/tests/union_with_big_member.rs index 2b7a8eefd3..0a11b8bc1e 100644 --- a/tests/expectations/tests/union_with_big_member.rs +++ b/tests/expectations/tests/union_with_big_member.rs @@ -62,7 +62,7 @@ impl Default for WithBigArray { #[derive(Debug, Default, Copy)] pub struct WithBigArray2 { pub a: __BindgenUnionField<::std::os::raw::c_int>, - pub b: __BindgenUnionField<[::std::os::raw::c_char; 33usize]>, + pub b: __BindgenUnionField<[::std::os::raw::c_schar; 33usize]>, pub bindgen_union_field: [u32; 9usize], } #[test] diff --git a/tests/expectations/tests/variadic-method.rs b/tests/expectations/tests/variadic-method.rs index 542e1e75b4..6241c2cb80 100644 --- a/tests/expectations/tests/variadic-method.rs +++ b/tests/expectations/tests/variadic-method.rs @@ -6,7 +6,7 @@ extern "C" { #[link_name = "_Z3fooPKcz"] - pub fn foo(fmt: *const ::std::os::raw::c_char, ...); + pub fn foo(fmt: *const ::std::os::raw::c_schar, ...); } #[repr(C)] #[derive(Debug, Default, Copy)] @@ -22,7 +22,7 @@ fn bindgen_test_layout_Bar() { } extern "C" { #[link_name = "_ZN3Bar3fooEPKcz"] - pub fn Bar_foo(this: *mut Bar, fmt: *const ::std::os::raw::c_char, ...); + pub fn Bar_foo(this: *mut Bar, fmt: *const ::std::os::raw::c_schar, ...); } impl Clone for Bar { fn clone(&self) -> Self { *self }