bolts: haiku, addressing clippy warnings (#1647)
This commit is contained in:
parent
56b37bb4bd
commit
bae24d9072
@ -350,12 +350,14 @@ mod linux {
|
|||||||
// FIXME: no sense of cpu granularity (yet ?)
|
// FIXME: no sense of cpu granularity (yet ?)
|
||||||
|
|
||||||
#[cfg(target_os = "haiku")]
|
#[cfg(target_os = "haiku")]
|
||||||
|
#[allow(clippy::unnecessary_wraps)]
|
||||||
#[inline]
|
#[inline]
|
||||||
fn get_core_ids_helper() -> Result<Vec<CoreId>, Error> {
|
fn get_core_ids_helper() -> Result<Vec<CoreId>, Error> {
|
||||||
Ok(Vec::new())
|
Ok(Vec::new())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "haiku")]
|
#[cfg(target_os = "haiku")]
|
||||||
|
#[allow(clippy::unnecessary_wraps)]
|
||||||
#[inline]
|
#[inline]
|
||||||
fn set_for_current_helper(_core_id: CoreId) -> Result<(), Error> {
|
fn set_for_current_helper(_core_id: CoreId) -> Result<(), Error> {
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -653,7 +653,7 @@ fn write_crash<W: Write>(
|
|||||||
_ucontext: &ucontext_t,
|
_ucontext: &ucontext_t,
|
||||||
) -> Result<(), std::io::Error> {
|
) -> Result<(), std::io::Error> {
|
||||||
// TODO add fault addr for other platforms.
|
// TODO add fault addr for other platforms.
|
||||||
writeln!(writer, "Received signal {}", signal,)?;
|
writeln!(writer, "Received signal {signal}")?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@ -848,15 +848,16 @@ fn write_minibsod<W: Write>(writer: &mut BufWriter<W>) -> Result<(), std::io::Er
|
|||||||
|
|
||||||
#[cfg(target_os = "haiku")]
|
#[cfg(target_os = "haiku")]
|
||||||
fn write_minibsod<W: Write>(writer: &mut BufWriter<W>) -> Result<(), std::io::Error> {
|
fn write_minibsod<W: Write>(writer: &mut BufWriter<W>) -> Result<(), std::io::Error> {
|
||||||
let mut info: libc::image_info = unsafe { std::mem::zeroed() };
|
let p = std::mem::MaybeUninit::<libc::image_info>::uninit();
|
||||||
|
let mut info = unsafe { p.assume_init() };
|
||||||
let mut c: i32 = 0;
|
let mut c: i32 = 0;
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
if unsafe { libc::get_next_image_info(0, &mut c, &mut info) } == libc::B_OK {
|
if unsafe { libc::get_next_image_info(0, &mut c, &mut info) } == libc::B_OK {
|
||||||
let i = format!(
|
let i = format!(
|
||||||
"{}-{} {:?}\n",
|
"{}-{} {:?}\n",
|
||||||
info.text as u64,
|
info.text as i64,
|
||||||
info.text as u64 + info.text_size as u64,
|
info.text as i64 + i64::from(info.text_size),
|
||||||
info.name
|
info.name
|
||||||
);
|
);
|
||||||
writer.write_all(&i.into_bytes())?;
|
writer.write_all(&i.into_bytes())?;
|
||||||
|
@ -10,9 +10,9 @@ use core::fmt::Display;
|
|||||||
use core::{cell::RefCell, fmt, mem::ManuallyDrop};
|
use core::{cell::RefCell, fmt, mem::ManuallyDrop};
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
use std::env;
|
use std::env;
|
||||||
#[cfg(all(unix, feature = "std"))]
|
#[cfg(all(unix, feature = "std", not(target_os = "haiku")))]
|
||||||
use std::io::Read;
|
use std::io::Read;
|
||||||
#[cfg(feature = "std")]
|
#[cfg(all(feature = "std", not(target_os = "haiku")))]
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
@ -27,7 +27,7 @@ pub use unix_shmem::{UnixShMem, UnixShMemProvider};
|
|||||||
#[cfg(all(windows, feature = "std"))]
|
#[cfg(all(windows, feature = "std"))]
|
||||||
pub use win32_shmem::{Win32ShMem, Win32ShMemProvider};
|
pub use win32_shmem::{Win32ShMem, Win32ShMemProvider};
|
||||||
|
|
||||||
#[cfg(all(unix, feature = "std"))]
|
#[cfg(all(unix, feature = "std", not(target_os = "haiku")))]
|
||||||
use crate::os::pipes::Pipe;
|
use crate::os::pipes::Pipe;
|
||||||
#[cfg(all(feature = "std", unix, not(target_os = "haiku")))]
|
#[cfg(all(feature = "std", unix, not(target_os = "haiku")))]
|
||||||
pub use crate::os::unix_shmem_server::{ServedShMemProvider, ShMemService};
|
pub use crate::os::unix_shmem_server::{ServedShMemProvider, ShMemService};
|
||||||
@ -411,7 +411,7 @@ impl<T: ShMemProvider> Drop for RcShMem<T> {
|
|||||||
/// that can use internal mutability.
|
/// that can use internal mutability.
|
||||||
/// Useful if the `ShMemProvider` needs to keep local state.
|
/// Useful if the `ShMemProvider` needs to keep local state.
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
#[cfg(all(unix, feature = "std"))]
|
#[cfg(all(unix, feature = "std", not(target_os = "haiku")))]
|
||||||
pub struct RcShMemProvider<SP>
|
pub struct RcShMemProvider<SP>
|
||||||
where
|
where
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
@ -505,7 +505,7 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(all(unix, feature = "std"))]
|
#[cfg(all(unix, feature = "std", not(target_os = "haiku")))]
|
||||||
impl<SP> RcShMemProvider<SP>
|
impl<SP> RcShMemProvider<SP>
|
||||||
where
|
where
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
@ -1457,7 +1457,7 @@ pub struct ShMemCursor<T: ShMem> {
|
|||||||
pos: usize,
|
pos: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(all(feature = "std", not(target_os = "haiku")))]
|
||||||
impl<T: ShMem> ShMemCursor<T> {
|
impl<T: ShMem> ShMemCursor<T> {
|
||||||
/// Create a new [`ShMemCursor`] around [`ShMem`]
|
/// Create a new [`ShMemCursor`] around [`ShMem`]
|
||||||
pub fn new(shmem: T) -> Self {
|
pub fn new(shmem: T) -> Self {
|
||||||
@ -1473,7 +1473,7 @@ impl<T: ShMem> ShMemCursor<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(all(feature = "std", not(target_os = "haiku")))]
|
||||||
impl<T: ShMem> Write for ShMemCursor<T> {
|
impl<T: ShMem> Write for ShMemCursor<T> {
|
||||||
fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
|
fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
|
||||||
match self.empty_slice_mut().write(buf) {
|
match self.empty_slice_mut().write(buf) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user