Skip to content

Commit c7a46c8

Browse files
committed
fix to lint errors
Signed-off-by: Jun Kimura <junkxdev@gmail.com>
1 parent 6bbe582 commit c7a46c8

File tree

5 files changed

+5
-4
lines changed

5 files changed

+5
-4
lines changed

sgx-trts/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
//!
6464
6565
#![no_std]
66+
#![allow(stable_features)]
6667
#![feature(allocator_api)]
6768
#![feature(specialization)]
6869
#![feature(vec_into_raw_parts)]

sgx-tseal/src/aad.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ impl<'a, T: 'a + Copy + ContiguousMemory> SgxMacAadata<'a, [T]> {
371371
if size > aad_len {
372372
return Err(sgx_status_t::SGX_ERROR_MAC_MISMATCH);
373373
}
374-
if (aad_len % size) != 0 {
374+
if !aad_len.is_multiple_of(size) {
375375
return Err(sgx_status_t::SGX_ERROR_MAC_MISMATCH);
376376
}
377377
self.inner.unmac_aadata().map(|x| {

sgx-tseal/src/seal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ impl<'a, T: 'a + Copy + ContiguousMemory> SgxSealedData<'a, [T]> {
675675
if size > encrypt_len {
676676
return Err(sgx_status_t::SGX_ERROR_MAC_MISMATCH);
677677
}
678-
if (encrypt_len % size) != 0 {
678+
if !encrypt_len.is_multiple_of(size) {
679679
return Err(sgx_status_t::SGX_ERROR_MAC_MISMATCH);
680680
}
681681

sgx-urts/src/signal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ pub extern "C" fn u_sigaction_ocall(
233233
.register_signal(signo.unwrap(), enclave_id);
234234

235235
let new_act = sigaction {
236-
sa_sigaction: handle_signal_entry as usize,
236+
sa_sigaction: handle_signal_entry as *const () as usize,
237237
// Set the flag so that sa_sigaction is registered as the signal handler
238238
// instead of sa_handler.
239239
sa_flags: e_act.sa_flags | SA_SIGINFO,

unit-test/app/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ extern "C" fn sigill_handler(_sig: libc::c_int, _info: *mut siginfo_t, context:
9595
fn install_sigill_handler() -> Result<(), String> {
9696
// Install our handler
9797
let mut sa: sigaction = unsafe { mem::zeroed() };
98-
sa.sa_sigaction = sigill_handler as usize;
98+
sa.sa_sigaction = sigill_handler as *const () as usize;
9999
sa.sa_flags = SA_SIGINFO | SA_NODEFER | SA_RESTART;
100100
unsafe {
101101
libc::sigemptyset(&mut sa.sa_mask);

0 commit comments

Comments
 (0)