summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/timeout_bind.rs14
-rw-r--r--src/timeout_bind_test.rs2
2 files changed, 8 insertions, 8 deletions
diff --git a/src/timeout_bind.rs b/src/timeout_bind.rs
index 8b9e932..98689f8 100644
--- a/src/timeout_bind.rs
+++ b/src/timeout_bind.rs
@@ -44,7 +44,7 @@ pub type timeout_error_t = usize;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct timeout_cb {
- pub fn_: Option<unsafe extern "C" fn()>,
+ pub fn_ptr: Option<extern "C" fn(arg: *mut c_void)>,
pub arg: *mut c_void,
}
@@ -91,7 +91,7 @@ impl Default for timeout {
tqe_prev: null_mut(),
},
callback: timeout_cb {
- fn_: None,
+ fn_ptr: None,
arg: null_mut(),
},
interval: 0,
@@ -132,11 +132,11 @@ pub type wheel_t = u64;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct timeouts {
- // pub wheel: [[timeout_list; WHEEL_LEN]; WHEEL_NUM],
- // pub expired: timeout_list,
- // pub pending: [wheel_t; WHEEL_NUM],
- // pub curtime: timeout_t,
- // pub hertz: timeout_t,
+ pub wheel: [[timeout_list; WHEEL_LEN]; WHEEL_NUM],
+ pub expired: timeout_list,
+ pub pending: [wheel_t; WHEEL_NUM],
+ pub curtime: timeout_t,
+ pub hertz: timeout_t,
}
extern "C" {
diff --git a/src/timeout_bind_test.rs b/src/timeout_bind_test.rs
index 4ed68de..2438592 100644
--- a/src/timeout_bind_test.rs
+++ b/src/timeout_bind_test.rs
@@ -55,7 +55,7 @@ fn bindgen_test_layout_timeout_cb() {
concat!("Alignment of ", stringify!(timeout_cb))
);
assert_eq!(
- unsafe { addr_of!((*ptr).fn_) as usize - ptr as usize },
+ unsafe { addr_of!((*ptr).fn_ptr) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",