diff --git a/scheme/debug.rs b/scheme/debug.rs index 8abb059..43882ae 100644 --- a/scheme/debug.rs +++ b/scheme/debug.rs @@ -5,7 +5,7 @@ use super::Scheme; pub struct DebugScheme; impl Scheme for DebugScheme { - fn open(&mut self, path: &[u8], flags: usize) -> Result { + fn open(&mut self, path: &[u8], _flags: usize) -> Result { println!("DebugScheme::open: {}", unsafe { str::from_utf8_unchecked(path) }); Ok(0) } @@ -13,21 +13,21 @@ impl Scheme for DebugScheme { /// Read the file `number` into the `buffer` /// /// Returns the number of bytes read - fn read(&mut self, file: usize, buffer: &mut [u8]) -> Result { + fn read(&mut self, _file: usize, _buffer: &mut [u8]) -> Result { Ok(0) } /// Write the `buffer` to the `file` /// /// Returns the number of bytes written - fn write(&mut self, file: usize, buffer: &[u8]) -> Result { + fn write(&mut self, _file: usize, buffer: &[u8]) -> Result { //TODO: Write bytes, do not convert to str print!("{}", unsafe { str::from_utf8_unchecked(buffer) }); Ok(buffer.len()) } /// Close the file `number` - fn close(&mut self, file: usize) -> Result<()> { + fn close(&mut self, _file: usize) -> Result<()> { Ok(()) } } diff --git a/syscall/mod.rs b/syscall/mod.rs index 2107d4f..1cf0f58 100644 --- a/syscall/mod.rs +++ b/syscall/mod.rs @@ -92,7 +92,7 @@ pub fn convert_slice_mut(ptr: *mut T, len: usize) -> Result<&'static mut [T]> Ok(unsafe { slice::from_raw_parts_mut(ptr, len) }) } -pub fn handle(a: usize, b: usize, c: usize, d: usize, e: usize, f: usize) -> ::core::result::Result { +pub fn handle(a: usize, b: usize, c: usize, d: usize, e: usize, _f: usize) -> ::core::result::Result { match Call::from(a) { Call::Exit => exit(b), Call::Read => read(b, convert_slice_mut(c as *mut u8, d)?),