Skip to content

Commit 8e55144

Browse files
committed
Fix errors introduced by #8 and other warnings
1 parent 14daaa9 commit 8e55144

File tree

5 files changed

+19
-12
lines changed

5 files changed

+19
-12
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ impl-default = ["winapi/impl-default"]
2828
user = []
2929
kernel = []
3030
beta = []
31-
nightly = ["beta"]
31+
nightly = ["beta"]

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#![no_std]
3030
#![deny(unused, unused_qualifications)]
3131
#![warn(unused_attributes)]
32-
#![allow(bad_style, overflowing_literals, unused_macros, clippy::cast_lossless, clippy::cast_ptr_alignment, clippy::len_without_is_empty, clippy::trivially_copy_pass_by_ref, clippy::unreadable_literal)]
32+
#![allow(bad_style, deprecated, overflowing_literals, unused_macros, clippy::cast_lossless, clippy::cast_ptr_alignment, clippy::len_without_is_empty, clippy::trivially_copy_pass_by_ref, clippy::unreadable_literal)]
3333
#[doc(hidden)]
3434
pub extern crate core as _core;
3535
#[macro_use]

src/macros.rs

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ macro_rules! EXTERN {
2525
};
2626
}
2727
#[macro_export]
28+
#[doc(hidden)]
2829
macro_rules! FIELD_OFFSET {
2930
($_type:ty, $field:ident$(.$cfields:ident)*) => {
3031
unsafe {
@@ -33,6 +34,7 @@ macro_rules! FIELD_OFFSET {
3334
r: &'static T,
3435
i: usize,
3536
}
37+
#[allow(unaligned_references)]
3638
Transmuter {
3739
r: &(&Transmuter {
3840
p: $crate::_core::ptr::null::<$_type>()

src/ntexapi.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#[allow(deprecated)] //fixme
21
use core::mem::uninitialized;
32
use core::ptr::read_volatile;
43
#[cfg(target_arch = "x86")]
@@ -2779,7 +2778,6 @@ pub type PKUSER_SHARED_DATA = *mut KUSER_SHARED_DATA;
27792778
pub const USER_SHARED_DATA: *const KUSER_SHARED_DATA = 0x7ffe0000 as *const _;
27802779
#[inline]
27812780
pub unsafe fn NtGetTickCount64() -> ULONGLONG {
2782-
#[allow(deprecated)] //fixme
27832781
let mut tick_count: ULARGE_INTEGER = uninitialized();
27842782
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))] {
27852783
*tick_count.QuadPart_mut() = read_volatile(&(*USER_SHARED_DATA).u.TickCountQuad);
@@ -2810,7 +2808,6 @@ pub unsafe fn NtGetTickCount() -> ULONG {
28102808
* (*USER_SHARED_DATA).TickCountMultiplier as u64) >> 24) as u32
28112809
}
28122810
#[cfg(target_arch = "x86")] {
2813-
#[allow(deprecated)] //fixme
28142811
let mut tick_count: ULARGE_INTEGER = uninitialized();
28152812
loop {
28162813
tick_count.s_mut().HighPart = read_volatile(&(*USER_SHARED_DATA).u.TickCount.High1Time)

src/winapi_local/um/winnt.rs

+15-7
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,40 @@ pub const fn UInt32x32To64(a: u32, b: u32) -> u64 {
1212
IFDEF!{
1313
use crate::ntpebteb::TEB;
1414
#[inline]
15+
#[cfg(target_pointer_width = "64")]
1516
pub unsafe fn _bittest64(Base: *const i64, Offset: i64) -> u8 {
1617
let out: u8;
1718
asm!(
1819
"bt {1}, {2}",
1920
"setb {0}",
2021
out(reg_byte) out,
2122
in(reg) Base,
22-
in(reg) Offset);
23+
in(reg) Offset,
24+
options(nostack, pure, readonly),
25+
);
2326
out
2427
}
2528
#[inline]
2629
pub unsafe fn __readfsdword(Offset: DWORD) -> DWORD {
2730
let out: u32;
2831
asm!(
29-
"mov {0:e}, fs:[{1:e}]",
30-
out(reg) out,
31-
in(reg) Offset);
32+
"mov {:e}, fs:[{:e}]",
33+
lateout(reg) out,
34+
in(reg) Offset,
35+
options(nostack, pure, readonly),
36+
);
3237
out
3338
}
3439
#[inline]
40+
#[cfg(target_pointer_width = "64")]
3541
pub unsafe fn __readgsqword(Offset: DWORD) -> DWORD64 {
3642
let out: u64;
3743
asm!(
38-
"mov {0}, gs:[{1:e}]",
39-
out(reg) out,
40-
in(reg) Offset);
44+
"mov {}, gs:[{:e}]",
45+
lateout(reg) out,
46+
in(reg) Offset,
47+
options(nostack, pure, readonly),
48+
);
4149
out
4250
}
4351
#[inline] #[allow(unused_unsafe)]

0 commit comments

Comments
 (0)