Skip to content

Commit ed57762

Browse files
committed
ir: Make macro constants not being architecture-dependent.
Fixes #1185
1 parent 92b86c5 commit ed57762

17 files changed

+126
-139
lines changed

src/ir/var.rs

+16-11
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,21 @@ impl DotAttributes for Var {
113113
}
114114
}
115115

116+
// TODO(emilio): we could make this more (or less) granular, I guess.
117+
fn default_macro_constant_type(value: i64) -> IntKind {
118+
if value < 0 {
119+
if value < i32::min_value() as i64 {
120+
IntKind::I64
121+
} else {
122+
IntKind::I32
123+
}
124+
} else if value > u32::max_value() as i64 {
125+
IntKind::U64
126+
} else {
127+
IntKind::U32
128+
}
129+
}
130+
116131
impl ClangSubItemParser for Var {
117132
fn parse(
118133
cursor: clang::Cursor,
@@ -189,17 +204,7 @@ impl ClangSubItemParser for Var {
189204
EvalResult::Int(Wrapping(value)) => {
190205
let kind = ctx.parse_callbacks()
191206
.and_then(|c| c.int_macro(&name, value))
192-
.unwrap_or_else(|| if value < 0 {
193-
if value < i32::min_value() as i64 {
194-
IntKind::LongLong
195-
} else {
196-
IntKind::Int
197-
}
198-
} else if value > u32::max_value() as i64 {
199-
IntKind::ULongLong
200-
} else {
201-
IntKind::UInt
202-
});
207+
.unwrap_or_else(|| default_macro_constant_type(value));
203208

204209
(TypeKind::Int(kind), VarType::Int(value))
205210
}

tests/expectations/tests/jsval_layout_opaque.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ where
8181
}
8282
}
8383
}
84-
pub const JSVAL_TAG_SHIFT: ::std::os::raw::c_uint = 47;
85-
pub const JSVAL_PAYLOAD_MASK: ::std::os::raw::c_ulonglong = 140737488355327;
86-
pub const JSVAL_TAG_MASK: ::std::os::raw::c_longlong = -140737488355328;
84+
pub const JSVAL_TAG_SHIFT: u32 = 47;
85+
pub const JSVAL_PAYLOAD_MASK: u64 = 140737488355327;
86+
pub const JSVAL_TAG_MASK: i64 = -140737488355328;
8787
#[repr(u8)]
8888
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
8989
pub enum JSValueType {

tests/expectations/tests/jsval_layout_opaque_1_0.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ impl<T> ::std::cmp::PartialEq for __BindgenUnionField<T> {
124124
}
125125
}
126126
impl<T> ::std::cmp::Eq for __BindgenUnionField<T> {}
127-
pub const JSVAL_TAG_SHIFT: ::std::os::raw::c_uint = 47;
128-
pub const JSVAL_PAYLOAD_MASK: ::std::os::raw::c_ulonglong = 140737488355327;
129-
pub const JSVAL_TAG_MASK: ::std::os::raw::c_longlong = -140737488355328;
127+
pub const JSVAL_TAG_SHIFT: u32 = 47;
128+
pub const JSVAL_PAYLOAD_MASK: u64 = 140737488355327;
129+
pub const JSVAL_TAG_MASK: i64 = -140737488355328;
130130
#[repr(u8)]
131131
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
132132
pub enum JSValueType {

tests/expectations/tests/layout_arp.rs

+8-10
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
/* automatically generated by rust-bindgen */
22

3-
43
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
54

6-
7-
pub const ETHER_ADDR_LEN: ::std::os::raw::c_uint = 6;
8-
pub const ARP_HRD_ETHER: ::std::os::raw::c_uint = 1;
9-
pub const ARP_OP_REQUEST: ::std::os::raw::c_uint = 1;
10-
pub const ARP_OP_REPLY: ::std::os::raw::c_uint = 2;
11-
pub const ARP_OP_REVREQUEST: ::std::os::raw::c_uint = 3;
12-
pub const ARP_OP_REVREPLY: ::std::os::raw::c_uint = 4;
13-
pub const ARP_OP_INVREQUEST: ::std::os::raw::c_uint = 8;
14-
pub const ARP_OP_INVREPLY: ::std::os::raw::c_uint = 9;
5+
pub const ETHER_ADDR_LEN: u32 = 6;
6+
pub const ARP_HRD_ETHER: u32 = 1;
7+
pub const ARP_OP_REQUEST: u32 = 1;
8+
pub const ARP_OP_REPLY: u32 = 2;
9+
pub const ARP_OP_REVREQUEST: u32 = 3;
10+
pub const ARP_OP_REVREPLY: u32 = 4;
11+
pub const ARP_OP_INVREQUEST: u32 = 8;
12+
pub const ARP_OP_INVREPLY: u32 = 9;
1513
/// Ethernet address:
1614
/// A universally administered address is uniquely assigned to a device by its
1715
/// manufacturer. The first three octets (in transmission order) contain the

tests/expectations/tests/layout_array.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
44

5-
pub const RTE_CACHE_LINE_SIZE: ::std::os::raw::c_uint = 64;
6-
pub const RTE_MEMPOOL_OPS_NAMESIZE: ::std::os::raw::c_uint = 32;
7-
pub const RTE_MEMPOOL_MAX_OPS_IDX: ::std::os::raw::c_uint = 16;
8-
pub const RTE_HEAP_NUM_FREELISTS: ::std::os::raw::c_uint = 13;
5+
pub const RTE_CACHE_LINE_SIZE: u32 = 64;
6+
pub const RTE_MEMPOOL_OPS_NAMESIZE: u32 = 32;
7+
pub const RTE_MEMPOOL_MAX_OPS_IDX: u32 = 16;
8+
pub const RTE_HEAP_NUM_FREELISTS: u32 = 13;
99
#[repr(C)]
1010
#[derive(Debug, Copy, Clone)]
1111
pub struct rte_mempool {

tests/expectations/tests/layout_array_too_long.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
44

5-
pub const RTE_CACHE_LINE_SIZE: ::std::os::raw::c_uint = 64;
6-
pub const RTE_LIBRTE_IP_FRAG_MAX_FRAG: ::std::os::raw::c_uint = 4;
5+
pub const RTE_CACHE_LINE_SIZE: u32 = 64;
6+
pub const RTE_LIBRTE_IP_FRAG_MAX_FRAG: u32 = 4;
77
pub const IP_LAST_FRAG_IDX: _bindgen_ty_1 = _bindgen_ty_1::IP_LAST_FRAG_IDX;
88
pub const IP_FIRST_FRAG_IDX: _bindgen_ty_1 = _bindgen_ty_1::IP_FIRST_FRAG_IDX;
99
pub const IP_MIN_FRAG_NUM: _bindgen_ty_1 = _bindgen_ty_1::IP_MIN_FRAG_NUM;

tests/expectations/tests/layout_eth_conf.rs

+32-32
Original file line numberDiff line numberDiff line change
@@ -81,38 +81,38 @@ where
8181
}
8282
}
8383
}
84-
pub const ETH_MQ_RX_RSS_FLAG: ::std::os::raw::c_uint = 1;
85-
pub const ETH_MQ_RX_DCB_FLAG: ::std::os::raw::c_uint = 2;
86-
pub const ETH_MQ_RX_VMDQ_FLAG: ::std::os::raw::c_uint = 4;
87-
pub const ETH_VMDQ_MAX_VLAN_FILTERS: ::std::os::raw::c_uint = 64;
88-
pub const ETH_DCB_NUM_USER_PRIORITIES: ::std::os::raw::c_uint = 8;
89-
pub const ETH_VMDQ_DCB_NUM_QUEUES: ::std::os::raw::c_uint = 128;
90-
pub const ETH_DCB_NUM_QUEUES: ::std::os::raw::c_uint = 128;
91-
pub const RTE_ETH_FDIR_MAX_FLEXLEN: ::std::os::raw::c_uint = 16;
92-
pub const RTE_ETH_INSET_SIZE_MAX: ::std::os::raw::c_uint = 128;
93-
pub const RTE_ETH_FLOW_UNKNOWN: ::std::os::raw::c_uint = 0;
94-
pub const RTE_ETH_FLOW_RAW: ::std::os::raw::c_uint = 1;
95-
pub const RTE_ETH_FLOW_IPV4: ::std::os::raw::c_uint = 2;
96-
pub const RTE_ETH_FLOW_FRAG_IPV4: ::std::os::raw::c_uint = 3;
97-
pub const RTE_ETH_FLOW_NONFRAG_IPV4_TCP: ::std::os::raw::c_uint = 4;
98-
pub const RTE_ETH_FLOW_NONFRAG_IPV4_UDP: ::std::os::raw::c_uint = 5;
99-
pub const RTE_ETH_FLOW_NONFRAG_IPV4_SCTP: ::std::os::raw::c_uint = 6;
100-
pub const RTE_ETH_FLOW_NONFRAG_IPV4_OTHER: ::std::os::raw::c_uint = 7;
101-
pub const RTE_ETH_FLOW_IPV6: ::std::os::raw::c_uint = 8;
102-
pub const RTE_ETH_FLOW_FRAG_IPV6: ::std::os::raw::c_uint = 9;
103-
pub const RTE_ETH_FLOW_NONFRAG_IPV6_TCP: ::std::os::raw::c_uint = 10;
104-
pub const RTE_ETH_FLOW_NONFRAG_IPV6_UDP: ::std::os::raw::c_uint = 11;
105-
pub const RTE_ETH_FLOW_NONFRAG_IPV6_SCTP: ::std::os::raw::c_uint = 12;
106-
pub const RTE_ETH_FLOW_NONFRAG_IPV6_OTHER: ::std::os::raw::c_uint = 13;
107-
pub const RTE_ETH_FLOW_L2_PAYLOAD: ::std::os::raw::c_uint = 14;
108-
pub const RTE_ETH_FLOW_IPV6_EX: ::std::os::raw::c_uint = 15;
109-
pub const RTE_ETH_FLOW_IPV6_TCP_EX: ::std::os::raw::c_uint = 16;
110-
pub const RTE_ETH_FLOW_IPV6_UDP_EX: ::std::os::raw::c_uint = 17;
111-
pub const RTE_ETH_FLOW_PORT: ::std::os::raw::c_uint = 18;
112-
pub const RTE_ETH_FLOW_VXLAN: ::std::os::raw::c_uint = 19;
113-
pub const RTE_ETH_FLOW_GENEVE: ::std::os::raw::c_uint = 20;
114-
pub const RTE_ETH_FLOW_NVGRE: ::std::os::raw::c_uint = 21;
115-
pub const RTE_ETH_FLOW_MAX: ::std::os::raw::c_uint = 22;
84+
pub const ETH_MQ_RX_RSS_FLAG: u32 = 1;
85+
pub const ETH_MQ_RX_DCB_FLAG: u32 = 2;
86+
pub const ETH_MQ_RX_VMDQ_FLAG: u32 = 4;
87+
pub const ETH_VMDQ_MAX_VLAN_FILTERS: u32 = 64;
88+
pub const ETH_DCB_NUM_USER_PRIORITIES: u32 = 8;
89+
pub const ETH_VMDQ_DCB_NUM_QUEUES: u32 = 128;
90+
pub const ETH_DCB_NUM_QUEUES: u32 = 128;
91+
pub const RTE_ETH_FDIR_MAX_FLEXLEN: u32 = 16;
92+
pub const RTE_ETH_INSET_SIZE_MAX: u32 = 128;
93+
pub const RTE_ETH_FLOW_UNKNOWN: u32 = 0;
94+
pub const RTE_ETH_FLOW_RAW: u32 = 1;
95+
pub const RTE_ETH_FLOW_IPV4: u32 = 2;
96+
pub const RTE_ETH_FLOW_FRAG_IPV4: u32 = 3;
97+
pub const RTE_ETH_FLOW_NONFRAG_IPV4_TCP: u32 = 4;
98+
pub const RTE_ETH_FLOW_NONFRAG_IPV4_UDP: u32 = 5;
99+
pub const RTE_ETH_FLOW_NONFRAG_IPV4_SCTP: u32 = 6;
100+
pub const RTE_ETH_FLOW_NONFRAG_IPV4_OTHER: u32 = 7;
101+
pub const RTE_ETH_FLOW_IPV6: u32 = 8;
102+
pub const RTE_ETH_FLOW_FRAG_IPV6: u32 = 9;
103+
pub const RTE_ETH_FLOW_NONFRAG_IPV6_TCP: u32 = 10;
104+
pub const RTE_ETH_FLOW_NONFRAG_IPV6_UDP: u32 = 11;
105+
pub const RTE_ETH_FLOW_NONFRAG_IPV6_SCTP: u32 = 12;
106+
pub const RTE_ETH_FLOW_NONFRAG_IPV6_OTHER: u32 = 13;
107+
pub const RTE_ETH_FLOW_L2_PAYLOAD: u32 = 14;
108+
pub const RTE_ETH_FLOW_IPV6_EX: u32 = 15;
109+
pub const RTE_ETH_FLOW_IPV6_TCP_EX: u32 = 16;
110+
pub const RTE_ETH_FLOW_IPV6_UDP_EX: u32 = 17;
111+
pub const RTE_ETH_FLOW_PORT: u32 = 18;
112+
pub const RTE_ETH_FLOW_VXLAN: u32 = 19;
113+
pub const RTE_ETH_FLOW_GENEVE: u32 = 20;
114+
pub const RTE_ETH_FLOW_NVGRE: u32 = 21;
115+
pub const RTE_ETH_FLOW_MAX: u32 = 22;
116116
#[repr(u32)]
117117
/// A set of values to identify what method is to be used to route
118118
/// packets to multiple queues.

tests/expectations/tests/layout_eth_conf_1_0.rs

+32-32
Original file line numberDiff line numberDiff line change
@@ -124,38 +124,38 @@ impl<T> ::std::cmp::PartialEq for __BindgenUnionField<T> {
124124
}
125125
}
126126
impl<T> ::std::cmp::Eq for __BindgenUnionField<T> {}
127-
pub const ETH_MQ_RX_RSS_FLAG: ::std::os::raw::c_uint = 1;
128-
pub const ETH_MQ_RX_DCB_FLAG: ::std::os::raw::c_uint = 2;
129-
pub const ETH_MQ_RX_VMDQ_FLAG: ::std::os::raw::c_uint = 4;
130-
pub const ETH_VMDQ_MAX_VLAN_FILTERS: ::std::os::raw::c_uint = 64;
131-
pub const ETH_DCB_NUM_USER_PRIORITIES: ::std::os::raw::c_uint = 8;
132-
pub const ETH_VMDQ_DCB_NUM_QUEUES: ::std::os::raw::c_uint = 128;
133-
pub const ETH_DCB_NUM_QUEUES: ::std::os::raw::c_uint = 128;
134-
pub const RTE_ETH_FDIR_MAX_FLEXLEN: ::std::os::raw::c_uint = 16;
135-
pub const RTE_ETH_INSET_SIZE_MAX: ::std::os::raw::c_uint = 128;
136-
pub const RTE_ETH_FLOW_UNKNOWN: ::std::os::raw::c_uint = 0;
137-
pub const RTE_ETH_FLOW_RAW: ::std::os::raw::c_uint = 1;
138-
pub const RTE_ETH_FLOW_IPV4: ::std::os::raw::c_uint = 2;
139-
pub const RTE_ETH_FLOW_FRAG_IPV4: ::std::os::raw::c_uint = 3;
140-
pub const RTE_ETH_FLOW_NONFRAG_IPV4_TCP: ::std::os::raw::c_uint = 4;
141-
pub const RTE_ETH_FLOW_NONFRAG_IPV4_UDP: ::std::os::raw::c_uint = 5;
142-
pub const RTE_ETH_FLOW_NONFRAG_IPV4_SCTP: ::std::os::raw::c_uint = 6;
143-
pub const RTE_ETH_FLOW_NONFRAG_IPV4_OTHER: ::std::os::raw::c_uint = 7;
144-
pub const RTE_ETH_FLOW_IPV6: ::std::os::raw::c_uint = 8;
145-
pub const RTE_ETH_FLOW_FRAG_IPV6: ::std::os::raw::c_uint = 9;
146-
pub const RTE_ETH_FLOW_NONFRAG_IPV6_TCP: ::std::os::raw::c_uint = 10;
147-
pub const RTE_ETH_FLOW_NONFRAG_IPV6_UDP: ::std::os::raw::c_uint = 11;
148-
pub const RTE_ETH_FLOW_NONFRAG_IPV6_SCTP: ::std::os::raw::c_uint = 12;
149-
pub const RTE_ETH_FLOW_NONFRAG_IPV6_OTHER: ::std::os::raw::c_uint = 13;
150-
pub const RTE_ETH_FLOW_L2_PAYLOAD: ::std::os::raw::c_uint = 14;
151-
pub const RTE_ETH_FLOW_IPV6_EX: ::std::os::raw::c_uint = 15;
152-
pub const RTE_ETH_FLOW_IPV6_TCP_EX: ::std::os::raw::c_uint = 16;
153-
pub const RTE_ETH_FLOW_IPV6_UDP_EX: ::std::os::raw::c_uint = 17;
154-
pub const RTE_ETH_FLOW_PORT: ::std::os::raw::c_uint = 18;
155-
pub const RTE_ETH_FLOW_VXLAN: ::std::os::raw::c_uint = 19;
156-
pub const RTE_ETH_FLOW_GENEVE: ::std::os::raw::c_uint = 20;
157-
pub const RTE_ETH_FLOW_NVGRE: ::std::os::raw::c_uint = 21;
158-
pub const RTE_ETH_FLOW_MAX: ::std::os::raw::c_uint = 22;
127+
pub const ETH_MQ_RX_RSS_FLAG: u32 = 1;
128+
pub const ETH_MQ_RX_DCB_FLAG: u32 = 2;
129+
pub const ETH_MQ_RX_VMDQ_FLAG: u32 = 4;
130+
pub const ETH_VMDQ_MAX_VLAN_FILTERS: u32 = 64;
131+
pub const ETH_DCB_NUM_USER_PRIORITIES: u32 = 8;
132+
pub const ETH_VMDQ_DCB_NUM_QUEUES: u32 = 128;
133+
pub const ETH_DCB_NUM_QUEUES: u32 = 128;
134+
pub const RTE_ETH_FDIR_MAX_FLEXLEN: u32 = 16;
135+
pub const RTE_ETH_INSET_SIZE_MAX: u32 = 128;
136+
pub const RTE_ETH_FLOW_UNKNOWN: u32 = 0;
137+
pub const RTE_ETH_FLOW_RAW: u32 = 1;
138+
pub const RTE_ETH_FLOW_IPV4: u32 = 2;
139+
pub const RTE_ETH_FLOW_FRAG_IPV4: u32 = 3;
140+
pub const RTE_ETH_FLOW_NONFRAG_IPV4_TCP: u32 = 4;
141+
pub const RTE_ETH_FLOW_NONFRAG_IPV4_UDP: u32 = 5;
142+
pub const RTE_ETH_FLOW_NONFRAG_IPV4_SCTP: u32 = 6;
143+
pub const RTE_ETH_FLOW_NONFRAG_IPV4_OTHER: u32 = 7;
144+
pub const RTE_ETH_FLOW_IPV6: u32 = 8;
145+
pub const RTE_ETH_FLOW_FRAG_IPV6: u32 = 9;
146+
pub const RTE_ETH_FLOW_NONFRAG_IPV6_TCP: u32 = 10;
147+
pub const RTE_ETH_FLOW_NONFRAG_IPV6_UDP: u32 = 11;
148+
pub const RTE_ETH_FLOW_NONFRAG_IPV6_SCTP: u32 = 12;
149+
pub const RTE_ETH_FLOW_NONFRAG_IPV6_OTHER: u32 = 13;
150+
pub const RTE_ETH_FLOW_L2_PAYLOAD: u32 = 14;
151+
pub const RTE_ETH_FLOW_IPV6_EX: u32 = 15;
152+
pub const RTE_ETH_FLOW_IPV6_TCP_EX: u32 = 16;
153+
pub const RTE_ETH_FLOW_IPV6_UDP_EX: u32 = 17;
154+
pub const RTE_ETH_FLOW_PORT: u32 = 18;
155+
pub const RTE_ETH_FLOW_VXLAN: u32 = 19;
156+
pub const RTE_ETH_FLOW_GENEVE: u32 = 20;
157+
pub const RTE_ETH_FLOW_NVGRE: u32 = 21;
158+
pub const RTE_ETH_FLOW_MAX: u32 = 22;
159159
#[repr(u32)]
160160
/// A set of values to identify what method is to be used to route
161161
/// packets to multiple queues.

tests/expectations/tests/layout_kni_mbuf.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
/* automatically generated by rust-bindgen */
22

3-
43
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
54

6-
7-
pub const RTE_CACHE_LINE_MIN_SIZE: ::std::os::raw::c_uint = 64;
8-
pub const RTE_CACHE_LINE_SIZE: ::std::os::raw::c_uint = 64;
5+
pub const RTE_CACHE_LINE_MIN_SIZE: u32 = 64;
6+
pub const RTE_CACHE_LINE_SIZE: u32 = 64;
97
#[repr(C)]
108
#[derive(Copy, Clone)]
119
pub struct rte_kni_mbuf {

tests/expectations/tests/layout_large_align_field.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ impl<T> ::std::clone::Clone for __IncompleteArrayField<T> {
3939
}
4040
}
4141
impl<T> ::std::marker::Copy for __IncompleteArrayField<T> {}
42-
pub const RTE_CACHE_LINE_SIZE: ::std::os::raw::c_uint = 64;
43-
pub const RTE_LIBRTE_IP_FRAG_MAX_FRAG: ::std::os::raw::c_uint = 4;
42+
pub const RTE_CACHE_LINE_SIZE: u32 = 64;
43+
pub const RTE_LIBRTE_IP_FRAG_MAX_FRAG: u32 = 4;
4444
pub const IP_LAST_FRAG_IDX: _bindgen_ty_1 = _bindgen_ty_1::IP_LAST_FRAG_IDX;
4545
pub const IP_FIRST_FRAG_IDX: _bindgen_ty_1 = _bindgen_ty_1::IP_FIRST_FRAG_IDX;
4646
pub const IP_MIN_FRAG_NUM: _bindgen_ty_1 = _bindgen_ty_1::IP_MIN_FRAG_NUM;

tests/expectations/tests/layout_mbuf.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

3-
43
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
54

6-
75
#[repr(C)]
86
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
97
pub struct __BindgenBitfieldUnit<Storage, Align>
@@ -83,8 +81,8 @@ where
8381
}
8482
}
8583
}
86-
pub const RTE_CACHE_LINE_MIN_SIZE: ::std::os::raw::c_uint = 64;
87-
pub const RTE_CACHE_LINE_SIZE: ::std::os::raw::c_uint = 64;
84+
pub const RTE_CACHE_LINE_MIN_SIZE: u32 = 64;
85+
pub const RTE_CACHE_LINE_SIZE: u32 = 64;
8886
pub type phys_addr_t = u64;
8987
pub type MARKER = [*mut ::std::os::raw::c_void; 0usize];
9088
pub type MARKER8 = [u8; 0usize];

tests/expectations/tests/layout_mbuf_1_0.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

3-
43
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
54

6-
75
#[repr(C)]
86
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
97
pub struct __BindgenBitfieldUnit<Storage, Align>
@@ -126,8 +124,8 @@ impl<T> ::std::cmp::PartialEq for __BindgenUnionField<T> {
126124
}
127125
}
128126
impl<T> ::std::cmp::Eq for __BindgenUnionField<T> {}
129-
pub const RTE_CACHE_LINE_MIN_SIZE: ::std::os::raw::c_uint = 64;
130-
pub const RTE_CACHE_LINE_SIZE: ::std::os::raw::c_uint = 64;
127+
pub const RTE_CACHE_LINE_MIN_SIZE: u32 = 64;
128+
pub const RTE_CACHE_LINE_SIZE: u32 = 64;
131129
pub type phys_addr_t = u64;
132130
pub type MARKER = [*mut ::std::os::raw::c_void; 0usize];
133131
pub type MARKER8 = [u8; 0usize];
+9-11
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
/* automatically generated by rust-bindgen */
22

3-
43
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
54

6-
7-
pub const FOO: ::std::os::raw::c_uint = 1;
8-
pub const BAR: ::std::os::raw::c_uint = 4;
9-
pub const BAZ: ::std::os::raw::c_uint = 5;
10-
pub const MIN: ::std::os::raw::c_longlong = -9223372036854775808;
11-
pub const BARR: ::std::os::raw::c_uint = 1;
12-
pub const BAZZ: ::std::os::raw::c_uint = 7;
13-
pub const I_RAN_OUT_OF_DUMB_NAMES: ::std::os::raw::c_uint = 7;
14-
pub const HAZ_A_COMMENT: ::std::os::raw::c_uint = 1;
15-
pub const HAZ_A_COMMENT_INSIDE: ::std::os::raw::c_uint = 2;
5+
pub const FOO: u32 = 1;
6+
pub const BAR: u32 = 4;
7+
pub const BAZ: u32 = 5;
8+
pub const MIN: i64 = -9223372036854775808;
9+
pub const BARR: u32 = 1;
10+
pub const BAZZ: u32 = 7;
11+
pub const I_RAN_OUT_OF_DUMB_NAMES: u32 = 7;
12+
pub const HAZ_A_COMMENT: u32 = 1;
13+
pub const HAZ_A_COMMENT_INSIDE: u32 = 2;
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
/* automatically generated by rust-bindgen */
22

3-
43
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
54

6-
7-
pub const MODBUS_WOOT: ::std::os::raw::c_uint = 3;
5+
pub const MODBUS_WOOT: u32 = 3;
86
extern "C" {
97
pub fn foo();
108
}
+3-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

3-
43
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
54

6-
7-
pub const FOO: ::std::os::raw::c_uint = 4;
8-
pub const BAR: ::std::os::raw::c_uint = 5;
9-
pub const BAZ: ::std::os::raw::c_uint = 6;
5+
pub const FOO: u32 = 4;
6+
pub const BAR: u32 = 5;
7+
pub const BAZ: u32 = 6;

tests/expectations/tests/ref_argument_array.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
/* automatically generated by rust-bindgen */
22

3-
43
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
54

6-
7-
pub const NSID_LENGTH: ::std::os::raw::c_uint = 10;
5+
pub const NSID_LENGTH: u32 = 10;
86
#[repr(C)]
97
pub struct nsID__bindgen_vtable(::std::os::raw::c_void);
108
#[repr(C)]

0 commit comments

Comments
 (0)