Skip to content

Commit 27a6ef0

Browse files
committed
Bump bindgen
Bump bindgen to support newer clang versions. See rust-lang/rust-bindgen#2312 Also adapt the types referring to a size to usize, otherwise the new bindgen will no longer accept it. Signed-off-by: Florian Kauer <[email protected]>
1 parent 2d71228 commit 27a6ef0

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ repository = "https://github.com/sjtakada/sysrepo-rs"
1515
version = "0.4.0"
1616

1717
[build-dependencies]
18-
bindgen = "0.59.2"
18+
bindgen = "0.69.4"
1919

2020
[dependencies]
2121
libc = "0.2.121"

src/lib.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -289,14 +289,14 @@ pub struct SrValueSlice {
289289
values: *mut sr_val_t,
290290

291291
/// Length of this slice.
292-
len: u64,
292+
len: usize,
293293

294294
/// Owned flag.
295295
owned: bool,
296296
}
297297

298298
impl SrValueSlice {
299-
pub fn new(capacity: u64, owned: bool) -> Self {
299+
pub fn new(capacity: usize, owned: bool) -> Self {
300300
Self {
301301
values: unsafe {
302302
libc::malloc(mem::size_of::<sr_val_t>() * capacity as usize) as *mut sr_val_t
@@ -306,7 +306,7 @@ impl SrValueSlice {
306306
}
307307
}
308308

309-
pub fn from(values: *mut sr_val_t, len: u64, owned: bool) -> Self {
309+
pub fn from(values: *mut sr_val_t, len: usize, owned: bool) -> Self {
310310
Self {
311311
values: values,
312312
len: len,
@@ -328,7 +328,7 @@ impl SrValueSlice {
328328
self.values
329329
}
330330

331-
pub fn len(&self) -> u64 {
331+
pub fn len(&self) -> usize {
332332
self.len
333333
}
334334

@@ -569,7 +569,7 @@ impl SrSession {
569569
) -> Result<SrValueSlice, i32> {
570570
let xpath = str_to_cstring(xpath)?;
571571
let timeout_ms = timeout.map_or(0, |timeout| timeout.as_millis() as u32);
572-
let mut values_count: u64 = 0;
572+
let mut values_count: usize = 0;
573573
let mut values: *mut sr_val_t = unsafe { zeroed::<*mut sr_val_t>() };
574574

575575
let rc = unsafe {
@@ -678,7 +678,7 @@ impl SrSession {
678678
notif_type: sr_ev_notif_type_t,
679679
path: *const c_char,
680680
values: *const sr_val_t,
681-
values_cnt: size_t,
681+
values_cnt: usize,
682682
timestamp: *mut timespec,
683683
private_data: *mut c_void,
684684
) where
@@ -749,11 +749,11 @@ impl SrSession {
749749
sub_id: u32,
750750
op_path: *const c_char,
751751
input: *const sr_val_t,
752-
input_cnt: size_t,
752+
input_cnt: usize,
753753
event: sr_event_t,
754754
request_id: u32,
755755
output: *mut *mut sr_val_t,
756-
output_cnt: *mut u64,
756+
output_cnt: *mut usize,
757757
private_data: *mut c_void,
758758
) -> i32
759759
where
@@ -960,13 +960,13 @@ impl SrSession {
960960
) -> Result<SrValueSlice, i32> {
961961
let path = str_to_cstring(path)?;
962962
let (input, input_cnt) = match input {
963-
Some(mut input) => (input.as_mut_ptr(), input.len() as u64),
963+
Some(mut input) => (input.as_mut_ptr(), input.len() as usize),
964964
None => (std::ptr::null_mut(), 0),
965965
};
966966
let timeout = timeout.map_or(0, |timeout| timeout.as_millis() as u32);
967967

968968
let mut output: *mut sr_val_t = unsafe { zeroed::<*mut sr_val_t>() };
969-
let mut output_count: u64 = 0;
969+
let mut output_count: usize = 0;
970970

971971
let rc = unsafe {
972972
sr_rpc_send(

0 commit comments

Comments
 (0)