Skip to content

Commit 15687c9

Browse files
d-e-s-odanielocfb
authored andcommitted
Update bindgen requirement from ^0.71.1 to ^0.72.0
Updates the requirements on [bindgen](https://github.com/rust-lang/rust-bindgen) to permit the latest version. - [Release notes](https://github.com/rust-lang/rust-bindgen/releases) - [Changelog](https://github.com/rust-lang/rust-bindgen/blob/main/CHANGELOG.md) - [Commits](rust-lang/rust-bindgen@v0.71.1...v0.72.0) --- updated-dependencies: - dependency-name: bindgen dependency-version: 0.72.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
1 parent 0b6a9e5 commit 15687c9

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ github = { repository = "libbpf/libbpf-sys" }
2727
maintenance = { status = "passively-maintained" }
2828

2929
[build-dependencies]
30-
bindgen = { version = "^0.71.1", optional = true }
30+
bindgen = { version = "^0.72", optional = true }
3131
cc = "^1.1.6"
3232
pkg-config = "^0.3.30"
3333
nix = { version = "^0.30.0", default-features = false, features = ["fs"] }

src/bindings.rs

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* automatically generated by rust-bindgen 0.71.1 */
1+
/* automatically generated by rust-bindgen 0.72.0 */
22

33
#[repr(C)]
44
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
@@ -36,7 +36,9 @@ where
3636
pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
3737
debug_assert!(index / 8 < core::mem::size_of::<Storage>());
3838
let byte_index = index / 8;
39-
let byte = *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize);
39+
let byte = unsafe {
40+
*(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize)
41+
};
4042
Self::extract_bit(byte, index)
4143
}
4244
#[inline]
@@ -47,11 +49,7 @@ where
4749
index % 8
4850
};
4951
let mask = 1 << bit_index;
50-
if val {
51-
byte | mask
52-
} else {
53-
byte & !mask
54-
}
52+
if val { byte | mask } else { byte & !mask }
5553
}
5654
#[inline]
5755
pub fn set_bit(&mut self, index: usize, val: bool) {
@@ -64,9 +62,10 @@ where
6462
pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
6563
debug_assert!(index / 8 < core::mem::size_of::<Storage>());
6664
let byte_index = index / 8;
67-
let byte =
68-
(core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize);
69-
*byte = Self::change_bit(*byte, index, val);
65+
let byte = unsafe {
66+
(core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize)
67+
};
68+
unsafe { *byte = Self::change_bit(*byte, index, val) };
7069
}
7170
#[inline]
7271
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
@@ -93,7 +92,7 @@ where
9392
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
9493
let mut val = 0;
9594
for i in 0..(bit_width as usize) {
96-
if Self::raw_get_bit(this, i + bit_offset) {
95+
if unsafe { Self::raw_get_bit(this, i + bit_offset) } {
9796
let index = if cfg!(target_endian = "big") {
9897
bit_width as usize - 1 - i
9998
} else {
@@ -133,7 +132,7 @@ where
133132
} else {
134133
i
135134
};
136-
Self::raw_set_bit(this, index + bit_offset, val_bit_is_set);
135+
unsafe { Self::raw_set_bit(this, index + bit_offset, val_bit_is_set) };
137136
}
138137
}
139138
}
@@ -7423,7 +7422,7 @@ unsafe extern "C" {
74237422
}
74247423
unsafe extern "C" {
74257424
pub fn btf__add_ptr(btf: *mut btf, ref_type_id: ::std::os::raw::c_int)
7426-
-> ::std::os::raw::c_int;
7425+
-> ::std::os::raw::c_int;
74277426
}
74287427
unsafe extern "C" {
74297428
pub fn btf__add_array(
@@ -8427,7 +8426,7 @@ unsafe extern "C" {
84278426
}
84288427
unsafe extern "C" {
84298428
pub fn bpf_map__reuse_fd(map: *mut bpf_map, fd: ::std::os::raw::c_int)
8430-
-> ::std::os::raw::c_int;
8429+
-> ::std::os::raw::c_int;
84318430
}
84328431
unsafe extern "C" {
84338432
pub fn bpf_map__name(map: *const bpf_map) -> *const ::std::os::raw::c_char;
@@ -8443,7 +8442,7 @@ unsafe extern "C" {
84438442
}
84448443
unsafe extern "C" {
84458444
pub fn bpf_map__set_max_entries(map: *mut bpf_map, max_entries: __u32)
8446-
-> ::std::os::raw::c_int;
8445+
-> ::std::os::raw::c_int;
84478446
}
84488447
unsafe extern "C" {
84498448
pub fn bpf_map__map_flags(map: *const bpf_map) -> __u32;
@@ -8682,7 +8681,7 @@ unsafe extern "C" {
86828681
}
86838682
unsafe extern "C" {
86848683
pub fn bpf_tc_attach(hook: *const bpf_tc_hook, opts: *mut bpf_tc_opts)
8685-
-> ::std::os::raw::c_int;
8684+
-> ::std::os::raw::c_int;
86868685
}
86878686
unsafe extern "C" {
86888687
pub fn bpf_tc_detach(
@@ -8891,7 +8890,7 @@ unsafe extern "C" {
88918890
}
88928891
unsafe extern "C" {
88938892
pub fn perf_buffer__buffer_fd(pb: *const perf_buffer, buf_idx: size_t)
8894-
-> ::std::os::raw::c_int;
8893+
-> ::std::os::raw::c_int;
88958894
}
88968895
unsafe extern "C" {
88978896
pub fn perf_buffer__buffer(

0 commit comments

Comments
 (0)