Skip to content

Commit b2823f3

Browse files
rmehri01tgross35
authored andcommitted
fix some lints that were detected by the new style checker
(backport <rust-lang#4220>) (cherry picked from commit 94c2b14)
1 parent 80dcbb0 commit b2823f3

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
@@ -2162,18 +2162,6 @@ cfg_if! {
21622162
}
21632163
}
21642164

2165-
cfg_if! {
2166-
if #[cfg(all(
2167-
any(target_env = "gnu", target_env = "musl", target_env = "ohos"),
2168-
any(target_arch = "x86_64", target_arch = "x86")
2169-
))] {
2170-
extern "C" {
2171-
pub fn iopl(level: c_int) -> c_int;
2172-
pub fn ioperm(from: c_ulong, num: c_ulong, turn_on: c_int) -> c_int;
2173-
}
2174-
}
2175-
}
2176-
21772165
cfg_if! {
21782166
if #[cfg(any(
21792167
target_env = "gnu",
@@ -6007,6 +5995,18 @@ safe_f! {
60075995
}
60085996
}
60095997

5998+
cfg_if! {
5999+
if #[cfg(all(
6000+
any(target_env = "gnu", target_env = "musl", target_env = "ohos"),
6001+
any(target_arch = "x86_64", target_arch = "x86")
6002+
))] {
6003+
extern "C" {
6004+
pub fn iopl(level: c_int) -> c_int;
6005+
pub fn ioperm(from: c_ulong, num: c_ulong, turn_on: c_int) -> c_int;
6006+
}
6007+
}
6008+
}
6009+
60106010
cfg_if! {
60116011
if #[cfg(all(not(target_env = "uclibc"), not(target_env = "ohos")))] {
60126012
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)