Skip to content

Commit

Permalink
fix some lints that were detected by the new style checker
Browse files Browse the repository at this point in the history
  • Loading branch information
rmehri01 committed Jan 12, 2025
1 parent bd1b838 commit 94c2b14
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 18 deletions.
6 changes: 3 additions & 3 deletions src/teeos/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ pub type c_long = i64;

pub type c_ulong = u64;

#[repr(align(16))]
pub struct _CLongDouble(pub u128);

// long double in C means A float point value, which has 128bit length.
// but some bit maybe not used, so the real length of long double could be 80(x86) or 128(power pc/IEEE)
// this is different from f128(not stable and not included default) in Rust, so we use u128 for FFI(Rust to C).
Expand Down Expand Up @@ -88,6 +85,9 @@ pub type wctype_t = c_ulong;

pub type cmpfunc = extern "C" fn(x: *const c_void, y: *const c_void) -> c_int;

#[repr(align(16))]
pub struct _CLongDouble(pub u128);

#[repr(align(8))]
#[repr(C)]
pub struct pthread_cond_t {
Expand Down
24 changes: 12 additions & 12 deletions src/unix/linux_like/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2214,18 +2214,6 @@ cfg_if! {
}
}

cfg_if! {
if #[cfg(all(
any(target_env = "gnu", target_env = "musl", target_env = "ohos"),
any(target_arch = "x86_64", target_arch = "x86")
))] {
extern "C" {
pub fn iopl(level: c_int) -> c_int;
pub fn ioperm(from: c_ulong, num: c_ulong, turn_on: c_int) -> c_int;
}
}
}

cfg_if! {
if #[cfg(any(
target_env = "gnu",
Expand Down Expand Up @@ -6088,6 +6076,18 @@ safe_f! {
}
}

cfg_if! {
if #[cfg(all(
any(target_env = "gnu", target_env = "musl", target_env = "ohos"),
any(target_arch = "x86_64", target_arch = "x86")
))] {
extern "C" {
pub fn iopl(level: c_int) -> c_int;
pub fn ioperm(from: c_ulong, num: c_ulong, turn_on: c_int) -> c_int;
}
}
}

cfg_if! {
if #[cfg(all(not(target_env = "uclibc"), not(target_env = "ohos")))] {
extern "C" {
Expand Down
1 change: 0 additions & 1 deletion src/unix/linux_like/linux/uclibc/x86_64/l4re.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ s! {
}
}

#[cfg(target_os = "l4re")]
#[allow(missing_debug_implementations)]
pub struct pthread_attr_t {
pub __detachstate: c_int,
Expand Down
3 changes: 1 addition & 2 deletions src/wasi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ pub type nfds_t = c_ulong;
pub type wchar_t = i32;
pub type nl_item = c_int;
pub type __wasi_rights_t = u64;
pub type locale_t = *mut __locale_struct;

s_no_extra_traits! {
#[repr(align(16))]
Expand All @@ -63,8 +64,6 @@ pub enum DIR {}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum __locale_struct {}

pub type locale_t = *mut __locale_struct;

s_paren! {
// in wasi-libc clockid_t is const struct __clockid* (where __clockid is an opaque struct),
// but that's an implementation detail that we don't want to have to deal with
Expand Down

0 comments on commit 94c2b14

Please sign in to comment.