From 35204d47166bdb7edef45026d90d0044ef129809 Mon Sep 17 00:00:00 2001 From: pca006132 Date: Fri, 15 Jan 2021 17:55:58 +0800 Subject: [PATCH] fixed new compiler warnings --- src/libdyld/src/image.rs | 4 ++-- src/runtime/src/irq.rs | 1 - src/runtime/src/main.rs | 1 - src/runtime/src/rpc.rs | 8 ++++---- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/libdyld/src/image.rs b/src/libdyld/src/image.rs index 87fa665d..34ef7cfc 100644 --- a/src/libdyld/src/image.rs +++ b/src/libdyld/src/image.rs @@ -3,7 +3,7 @@ use core::{ mem, slice, }; -use alloc::alloc::{alloc_zeroed, dealloc, Layout, LayoutErr}; +use alloc::alloc::{alloc_zeroed, dealloc, Layout, LayoutError}; use super::{ elf::*, Error, @@ -27,7 +27,7 @@ pub struct Image { } impl Image { - pub fn new(size: usize, align: usize) -> Result { + pub fn new(size: usize, align: usize) -> Result { let layout = Layout::from_size_align(size, align)?; let data = unsafe { let ptr = alloc_zeroed(layout); diff --git a/src/runtime/src/irq.rs b/src/runtime/src/irq.rs index 84b6afea..030739a3 100644 --- a/src/runtime/src/irq.rs +++ b/src/runtime/src/irq.rs @@ -16,7 +16,6 @@ static CORE1_RESTART: AtomicBool = AtomicBool::new(false); #[link_section = ".text.boot"] #[no_mangle] -#[naked] pub unsafe extern "C" fn IRQ() { if MPIDR.read().cpu_id() == 1 { let mpcore = mpcore::RegisterBlock::mpcore(); diff --git a/src/runtime/src/main.rs b/src/runtime/src/main.rs index f8b7c6a7..63711b6a 100644 --- a/src/runtime/src/main.rs +++ b/src/runtime/src/main.rs @@ -6,7 +6,6 @@ #![feature(c_variadic)] #![feature(const_btree_new)] #![feature(const_in_array_repeat_expressions)] -#![feature(naked_functions)] extern crate alloc; diff --git a/src/runtime/src/rpc.rs b/src/runtime/src/rpc.rs index bb8cfd22..c6c30426 100644 --- a/src/runtime/src/rpc.rs +++ b/src/runtime/src/rpc.rs @@ -75,7 +75,7 @@ async unsafe fn recv_value(stream: &TcpStream, tag: Tag<'async_recursion>, da } Tag::List(it) => { #[repr(C)] - struct List { elements: *mut (), length: u32 }; + struct List { elements: *mut (), length: u32 } consume_value!(List, |ptr| { let length = proto_async::read_i32(stream).await? as usize; (*ptr).length = length as u32; @@ -228,7 +228,7 @@ unsafe fn send_value(writer: &mut W, tag: Tag, data: &mut *const ()) } Tag::List(it) => { #[repr(C)] - struct List { elements: *const (), length: u32 }; + struct List { elements: *const (), length: u32 } consume_value!(List, |ptr| { let length = (*ptr).length as isize; writer.write_u32((*ptr).length)?; @@ -336,7 +336,7 @@ unsafe fn send_value(writer: &mut W, tag: Tag, data: &mut *const ()) } Tag::Keyword(it) => { #[repr(C)] - struct Keyword<'a> { name: CSlice<'a, u8> }; + struct Keyword<'a> { name: CSlice<'a, u8> } consume_value!(Keyword, |ptr| { writer.write_string(str::from_utf8((*ptr).name.as_ref()).unwrap())?; let tag = it.clone().next().expect("truncated tag"); @@ -348,7 +348,7 @@ unsafe fn send_value(writer: &mut W, tag: Tag, data: &mut *const ()) } Tag::Object => { #[repr(C)] - struct Object { id: u32 }; + struct Object { id: u32 } consume_value!(*const Object, |ptr| writer.write_u32((**ptr).id)) }