minor changes to follow the Rust's style guidelines
This commit is contained in:
parent
c1e440a90f
commit
82f40c4b9b
3 changed files with 10 additions and 5 deletions
|
|
@ -226,7 +226,9 @@ impl OpenOptions {
|
|||
(true, true, false) => Ok(O_RDWR),
|
||||
(false, _, true) => Ok(O_WRONLY | O_APPEND),
|
||||
(true, _, true) => Ok(O_RDWR | O_APPEND),
|
||||
(false, false, false) => Err(io::Error::new(ErrorKind::InvalidInput, "invalid access mode")),
|
||||
(false, false, false) => {
|
||||
Err(io::Error::new(ErrorKind::InvalidInput, "invalid access mode"))
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ pub unsafe fn abort_internal() -> ! {
|
|||
sys_abort();
|
||||
}
|
||||
|
||||
// TODO: just a workaround to test the system
|
||||
// FIXME: just a workaround to test the system
|
||||
pub fn hashmap_random_keys() -> (u64, u64) {
|
||||
(1, 2)
|
||||
}
|
||||
|
|
@ -104,7 +104,8 @@ pub fn init() {
|
|||
|
||||
#[cfg(not(test))]
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn runtime_entry(argc: i32, argv: *const *const c_char, env: *const *const c_char) -> ! {
|
||||
pub unsafe extern "C" fn runtime_entry(argc: i32, argv: *const *const c_char,
|
||||
env: *const *const c_char) -> ! {
|
||||
extern "C" {
|
||||
fn main(argc: isize, argv: *const *const c_char) -> i32;
|
||||
fn sys_exit(arg: i32) ->!;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,8 @@ pub const NORMAL_PRIO: Priority = Priority::from(2);
|
|||
|
||||
extern "C" {
|
||||
fn sys_usleep(usecs: u64);
|
||||
fn sys_spawn(id: *mut Tid, func: extern "C" fn(usize), arg: usize, prio: u8, core_id: isize) -> i32;
|
||||
fn sys_spawn(id: *mut Tid, func: extern "C" fn(usize),
|
||||
arg: usize, prio: u8, core_id: isize) -> i32;
|
||||
fn sys_join(id: Tid) -> i32;
|
||||
fn sys_yield();
|
||||
}
|
||||
|
|
@ -55,7 +56,8 @@ impl Thread {
|
|||
{
|
||||
let p = box p;
|
||||
let mut tid: Tid = u32::MAX;
|
||||
let ret = sys_spawn(&mut tid as *mut Tid, thread_start, &*p as *const _ as *const u8 as usize,
|
||||
let ret = sys_spawn(&mut tid as *mut Tid, thread_start,
|
||||
&*p as *const _ as *const u8 as usize,
|
||||
Priority::into(NORMAL_PRIO), core_id);
|
||||
|
||||
return if ret == 0 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue