Skip to content

Commit

Permalink
fix parsing problems
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertdev committed Aug 28, 2024
1 parent e4742b8 commit e3fd47e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
11 changes: 7 additions & 4 deletions src/unix/linux_like/linux/ioctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,13 @@ const _IOC_DIRSHIFT: u32 = _IOC_SIZESHIFT + _IOC_SIZEBITS;
/// Build an ioctl number, analogous to the C macro of the same name.
#[inline(always)]
const fn _IOC(dir: u32, ty: u32, nr: u32, size: usize) -> u32 {
debug_assert!(dir <= _IOC_DIRMASK);
debug_assert!(ty <= _IOC_TYPEMASK);
debug_assert!(nr <= _IOC_NRMASK);
debug_assert!(size <= (_IOC_SIZEMASK as usize));
// TODO the `garando_syntax` crate (used by ctest2 in the CI test suite)
// cannot currently parse these `debug_assert!`s
//
// debug_assert!(dir <= _IOC_DIRMASK);
// debug_assert!(ty <= _IOC_TYPEMASK);
// debug_assert!(nr <= _IOC_NRMASK);
// debug_assert!(size <= (_IOC_SIZEMASK as usize));

(dir << _IOC_DIRSHIFT)
| (ty << _IOC_TYPESHIFT)
Expand Down
5 changes: 3 additions & 2 deletions src/unix/linux_like/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,8 @@ s! {
pub n_pins: ::c_int,
pub cross_timestamping: ::c_int,
pub adjust_phase: ::c_int,
pub rsv: [::c_int; 12],
pub max_phase_adj: ::c_int,
pub rsv: [::c_int; 11],
}

pub struct ptp_extts_request {
Expand Down Expand Up @@ -1069,7 +1070,7 @@ s! {
pub struct ptp_sys_offset {
pub n_samples: ::c_uint,
pub rsv: [::c_uint; 3],
pub ts: [ptp_clock_time; 2 * PTP_MAX_SAMPLES as usize + 1],
pub ts: [ptp_clock_time; 51],
}

pub struct ptp_pin_desc {
Expand Down

0 comments on commit e3fd47e

Please sign in to comment.