Skip to content

Commit 94c2b14

Browse files
committed
fix some lints that were detected by the new style checker
1 parent bd1b838 commit 94c2b14

File tree

4 files changed

+16
-18
lines changed

4 files changed

+16
-18
lines changed

src/teeos/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ pub type c_long = i64;
5151

5252
pub type c_ulong = u64;
5353

54-
#[repr(align(16))]
55-
pub struct _CLongDouble(pub u128);
56-
5754
// long double in C means A float point value, which has 128bit length.
5855
// but some bit maybe not used, so the real length of long double could be 80(x86) or 128(power pc/IEEE)
5956
// this is different from f128(not stable and not included default) in Rust, so we use u128 for FFI(Rust to C).
@@ -88,6 +85,9 @@ pub type wctype_t = c_ulong;
8885

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

88+
#[repr(align(16))]
89+
pub struct _CLongDouble(pub u128);
90+
9191
#[repr(align(8))]
9292
#[repr(C)]
9393
pub struct pthread_cond_t {

src/unix/linux_like/linux/mod.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -2214,18 +2214,6 @@ cfg_if! {
22142214
}
22152215
}
22162216

2217-
cfg_if! {
2218-
if #[cfg(all(
2219-
any(target_env = "gnu", target_env = "musl", target_env = "ohos"),
2220-
any(target_arch = "x86_64", target_arch = "x86")
2221-
))] {
2222-
extern "C" {
2223-
pub fn iopl(level: c_int) -> c_int;
2224-
pub fn ioperm(from: c_ulong, num: c_ulong, turn_on: c_int) -> c_int;
2225-
}
2226-
}
2227-
}
2228-
22292217
cfg_if! {
22302218
if #[cfg(any(
22312219
target_env = "gnu",
@@ -6088,6 +6076,18 @@ safe_f! {
60886076
}
60896077
}
60906078

6079+
cfg_if! {
6080+
if #[cfg(all(
6081+
any(target_env = "gnu", target_env = "musl", target_env = "ohos"),
6082+
any(target_arch = "x86_64", target_arch = "x86")
6083+
))] {
6084+
extern "C" {
6085+
pub fn iopl(level: c_int) -> c_int;
6086+
pub fn ioperm(from: c_ulong, num: c_ulong, turn_on: c_int) -> c_int;
6087+
}
6088+
}
6089+
}
6090+
60916091
cfg_if! {
60926092
if #[cfg(all(not(target_env = "uclibc"), not(target_env = "ohos")))] {
60936093
extern "C" {

src/unix/linux_like/linux/uclibc/x86_64/l4re.rs

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ s! {
2828
}
2929
}
3030

31-
#[cfg(target_os = "l4re")]
3231
#[allow(missing_debug_implementations)]
3332
pub struct pthread_attr_t {
3433
pub __detachstate: c_int,

src/wasi/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ pub type nfds_t = c_ulong;
4444
pub type wchar_t = i32;
4545
pub type nl_item = c_int;
4646
pub type __wasi_rights_t = u64;
47+
pub type locale_t = *mut __locale_struct;
4748

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

66-
pub type locale_t = *mut __locale_struct;
67-
6867
s_paren! {
6968
// in wasi-libc clockid_t is const struct __clockid* (where __clockid is an opaque struct),
7069
// but that's an implementation detail that we don't want to have to deal with

0 commit comments

Comments
 (0)