summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-03-05 22:34:35 -0800
committerGitHub <noreply@github.com>2017-03-05 22:34:35 -0800
commit1a4b8e608b073af430f21f3c49ca39fe21f95d24 (patch)
treef7e72cd2eefaf08df58d7e4ded6aa11f28579f3d /tests
parent4dde8f876dec0efd1f3bf2b0b594a57ef6ac774a (diff)
parent4f1e3da8502100c63e9708107a9a13e77ca86f11 (diff)
Auto merge of #559 - beduino-project:master, r=emilio
Use c_schar instead of c_char The signedness of the C type 'char' is implementation defined. The rust type c_schar exists for this reason. Use it.
Diffstat (limited to 'tests')
-rw-r--r--tests/expectations/tests/arg_keyword.rs2
-rw-r--r--tests/expectations/tests/bitfield-enum-basic.rs2
-rw-r--r--tests/expectations/tests/class.rs16
-rw-r--r--tests/expectations/tests/class_with_typedef.rs2
-rw-r--r--tests/expectations/tests/constant-evaluate.rs4
-rw-r--r--tests/expectations/tests/inline_namespace_whitelist.rs2
-rw-r--r--tests/expectations/tests/issue-493.rs2
-rw-r--r--tests/expectations/tests/layout.rs2
-rw-r--r--tests/expectations/tests/layout_array.rs2
-rw-r--r--tests/expectations/tests/layout_cmdline_token.rs6
-rw-r--r--tests/expectations/tests/layout_kni_mbuf.rs10
-rw-r--r--tests/expectations/tests/objc_method.rs4
-rw-r--r--tests/expectations/tests/overloading.rs2
-rw-r--r--tests/expectations/tests/struct_with_packing.rs2
-rw-r--r--tests/expectations/tests/union_with_big_member.rs2
-rw-r--r--tests/expectations/tests/variadic-method.rs4
16 files changed, 32 insertions, 32 deletions
diff --git a/tests/expectations/tests/arg_keyword.rs b/tests/expectations/tests/arg_keyword.rs
index cb1cc432..23818328 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 362cf280..a3eb0d7a 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<Buz> 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 92389cbe..3ed5edd2 100644
--- a/tests/expectations/tests/class.rs
+++ b/tests/expectations/tests/class.rs
@@ -64,7 +64,7 @@ impl <T> ::std::fmt::Debug for __BindgenUnionField<T> {
#[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 1a92b986..03822233 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::<C>() , 72usize , concat ! (
diff --git a/tests/expectations/tests/constant-evaluate.rs b/tests/expectations/tests/constant-evaluate.rs
index cdf097a2..ae0570ea 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 9b8f87a5..d3a9d958 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 f8814bd3..a2246ca6 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 115a108a..d0748672 100644
--- a/tests/expectations/tests/layout.rs
+++ b/tests/expectations/tests/layout.rs
@@ -40,7 +40,7 @@ impl <T> ::std::marker::Copy for __IncompleteArrayField<T> { }
#[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 2cc85785..eedc32b2 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 791ea9b3..c2b10455 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<unsafe extern "C" fn(arg1:
*mut cmdline_parse_token_hdr_t,
arg2:
- *const ::std::os::raw::c_char,
+ *const ::std::os::raw::c_schar,
arg3:
*mut ::std::os::raw::c_void,
arg4:
@@ -80,7 +80,7 @@ pub struct cmdline_token_ops {
arg2:
::std::os::raw::c_int,
arg3:
- *mut ::std::os::raw::c_char,
+ *mut ::std::os::raw::c_schar,
arg4:
::std::os::raw::c_uint)
-> ::std::os::raw::c_int>,
@@ -88,7 +88,7 @@ pub struct cmdline_token_ops {
pub get_help: ::std::option::Option<unsafe extern "C" fn(arg1:
*mut cmdline_parse_token_hdr_t,
arg2:
- *mut ::std::os::raw::c_char,
+ *mut ::std::os::raw::c_schar,
arg3:
::std::os::raw::c_uint)
-> ::std::os::raw::c_int>,
diff --git a/tests/expectations/tests/layout_kni_mbuf.rs b/tests/expectations/tests/layout_kni_mbuf.rs
index d704267d..209be0f1 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 d0342a21..c9b9504f 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 71002e23..99efe496 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 cba3d475..293cc534 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 2b7a8eef..0a11b8bc 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 542e1e75..6241c2cb 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 }