refactor: fix clippy warnings

This commit is contained in:
2021-11-30 20:34:17 +02:00
parent d0681eb589
commit a577b2dcc4
16 changed files with 70 additions and 101 deletions
+1 -1
View File
@@ -410,7 +410,7 @@ impl Process {
let mut data_offset = 0usize;
for arg in argv.iter() {
// XXX this is really unsafe and I am not really sure ABI will stay like this XXX
Self::write_paged(space, base + offset + 0, base + data_offset)?;
Self::write_paged(space, base + offset, base + data_offset)?;
Self::write_paged(space, base + offset + 8, arg.len())?;
offset += 16;
data_offset += arg.len();
+1
View File
@@ -237,6 +237,7 @@ impl Thread {
/// Changes process wait condition status
pub fn setup_wait(&self, wait: *const Wait) {
#![allow(clippy::not_unsafe_ptr_arg_deref)]
let mut lock = self.inner.lock();
// FIXME this is not cool
lock.pending_wait = Some(unsafe { &*wait });
+6 -2
View File
@@ -83,8 +83,12 @@ pub fn select(
}
let read = rfds.as_deref().map(FdSet::clone);
let write = wfds.as_deref().map(FdSet::clone);
rfds.as_deref_mut().map(FdSet::reset);
wfds.as_deref_mut().map(FdSet::reset);
if let Some(rfds) = &mut rfds {
rfds.reset();
}
if let Some(wfds) = &mut wfds {
wfds.reset();
}
let deadline = timeout.map(|v| v + machine::local_timer().timestamp().unwrap());
let proc = thread.owner().unwrap();