Commit 3c238280 authored by Stefan Lankes's avatar Stefan Lankes
Browse files

remove compiler warinings

- remove unneeded unsafe blocks
parent c0e8767d
......@@ -153,7 +153,7 @@ pub unsafe fn __sys_realloc(ptr: *mut u8, size: usize, align: usize, new_size: u
return core::ptr::null::<*mut u8>() as *mut u8;
}
let layout = layout_res.unwrap();
let new_ptr = unsafe { ALLOCATOR.realloc(ptr, layout, new_size) };
let new_ptr = ALLOCATOR.realloc(ptr, layout, new_size);
if new_ptr.is_null() {
debug!(
......
......@@ -229,9 +229,8 @@ impl SyscallInterface for Uhyve {
syscmdsize.argc as usize * mem::size_of::<*const u8>(),
mem::size_of::<*const u8>(),
) as *mut *const u8;
let argv = unsafe { slice::from_raw_parts_mut(argv_raw, syscmdsize.argc as usize) };
let argv_phy =
unsafe { slice::from_raw_parts_mut(argv_phy_raw, syscmdsize.argc as usize) };
let argv = slice::from_raw_parts_mut(argv_raw, syscmdsize.argc as usize);
let argv_phy = slice::from_raw_parts_mut(argv_phy_raw, syscmdsize.argc as usize);
for i in 0..syscmdsize.argc as usize {
argv[i] = crate::__sys_malloc(
syscmdsize.argsz[i] as usize * mem::size_of::<*const u8>(),
......@@ -249,9 +248,8 @@ impl SyscallInterface for Uhyve {
(syscmdsize.envc + 1) as usize * mem::size_of::<*const u8>(),
mem::size_of::<*const u8>(),
) as *mut *const u8;
let env = unsafe { slice::from_raw_parts_mut(env_raw, (syscmdsize.envc + 1) as usize) };
let env_phy =
unsafe { slice::from_raw_parts_mut(env_phy_raw, (syscmdsize.envc + 1) as usize) };
let env = slice::from_raw_parts_mut(env_raw, (syscmdsize.envc + 1) as usize);
let env_phy = slice::from_raw_parts_mut(env_phy_raw, (syscmdsize.envc + 1) as usize);
for i in 0..syscmdsize.envc as usize {
env[i] = crate::__sys_malloc(
syscmdsize.envsz[i] as usize * mem::size_of::<*const u8>(),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment