diff --git a/ferretro_base/src/retro/loading.rs b/ferretro_base/src/retro/loading.rs index 28558ce..ddd283f 100644 --- a/ferretro_base/src/retro/loading.rs +++ b/ferretro_base/src/retro/loading.rs @@ -7,7 +7,7 @@ use libloading; use super::ffi::*; -pub type Result = std::result::Result>; +pub type Result = std::result::Result>; pub struct LibretroApi { _lib: libloading::Library, // for tying our lifetime to its own diff --git a/ferretro_base/src/retro/wrapped_types.rs b/ferretro_base/src/retro/wrapped_types.rs index b96dcdb..22444ea 100644 --- a/ferretro_base/src/retro/wrapped_types.rs +++ b/ferretro_base/src/retro/wrapped_types.rs @@ -108,7 +108,7 @@ impl TryFrom<(D, c_uint)> for InputDeviceId where D: TryInto, >::Error: std::error::Error + Send + Sync + 'static, { - type Error = Box; + type Error = Box; fn try_from(pair: (D, c_uint)) -> Result { let (device, id) = pair; diff --git a/ferretro_components/src/base/mod.rs b/ferretro_components/src/base/mod.rs index 22b950b..a66b18d 100644 --- a/ferretro_components/src/base/mod.rs +++ b/ferretro_components/src/base/mod.rs @@ -40,13 +40,15 @@ pub struct RetroComponentBase { _temp_dir: tempfile::TempDir, } +unsafe impl Send for RetroComponentBase {} + // TODO: replace with std::ops::ControlFlow when it becomes stable pub enum ControlFlow { Continue, Break, } -pub type Result = std::result::Result>; +pub type Result = std::result::Result>; #[rustfmt::skip] #[allow(unused_variables)] diff --git a/ferretro_components/src/provided/sdl2/audio.rs b/ferretro_components/src/provided/sdl2/audio.rs index 07d7674..64b38e6 100644 --- a/ferretro_components/src/provided/sdl2/audio.rs +++ b/ferretro_components/src/provided/sdl2/audio.rs @@ -61,7 +61,7 @@ impl RetroCallbacks for SimpleSdl2AudioComponent { } impl RetroComponent for SimpleSdl2AudioComponent { - fn post_load_game(&mut self, retro: &mut LibretroWrapper, _rom: &Path) -> Result<(), Box> { + fn post_load_game(&mut self, retro: &mut LibretroWrapper, _rom: &Path) -> Result<(), Box> { self.src_freq = retro.get_system_av_info().timing.sample_rate; self.queue.resume(); self.started = false; @@ -83,7 +83,7 @@ impl RetroComponent for SimpleSdl2AudioComponent { } impl SimpleSdl2AudioComponent { - pub fn new(sdl_context: &mut Sdl) -> Result> { + pub fn new(sdl_context: &mut Sdl) -> Result> { let audio = sdl_context.audio().unwrap(); let desired_spec = AudioSpecDesired { freq: None, diff --git a/ferretro_components/src/provided/sdl2/audio_ratecontrol.rs b/ferretro_components/src/provided/sdl2/audio_ratecontrol.rs index f2947dd..e464355 100644 --- a/ferretro_components/src/provided/sdl2/audio_ratecontrol.rs +++ b/ferretro_components/src/provided/sdl2/audio_ratecontrol.rs @@ -33,7 +33,7 @@ impl RetroCallbacks for Sdl2RateControlledAudioComponent { } impl RetroComponent for Sdl2RateControlledAudioComponent { - fn post_load_game(&mut self, _retro: &mut LibretroWrapper, _rom: &Path) -> Result<(), Box> { + fn post_load_game(&mut self, _retro: &mut LibretroWrapper, _rom: &Path) -> Result<(), Box> { self.queue.resume(); Ok(()) } diff --git a/ferretro_components/src/provided/sdl2/gamepad.rs b/ferretro_components/src/provided/sdl2/gamepad.rs index 2361de5..36db3fc 100644 --- a/ferretro_components/src/provided/sdl2/gamepad.rs +++ b/ferretro_components/src/provided/sdl2/gamepad.rs @@ -98,7 +98,7 @@ impl RetroComponent for SimpleSdl2GamepadComponent { ControlFlow::Continue } - fn post_load_game(&mut self, retro: &mut LibretroWrapper, _rom: &Path) -> Result<(), Box> { + fn post_load_game(&mut self, retro: &mut LibretroWrapper, _rom: &Path) -> Result<(), Box> { if let Some(device) = self.preferred_pad { for port in 0..self.gamepads.len() as u32 { retro.set_controller_port_device(port, device); diff --git a/ferretro_components/src/provided/sdl2/opengl.rs b/ferretro_components/src/provided/sdl2/opengl.rs index c18b344..bc20276 100644 --- a/ferretro_components/src/provided/sdl2/opengl.rs +++ b/ferretro_components/src/provided/sdl2/opengl.rs @@ -28,7 +28,7 @@ pub struct SimpleSdl2OpenglComponent { } impl SimpleSdl2OpenglComponent { - pub fn new(sdl_context: &mut Sdl, retro: &LibretroWrapper) -> Result> { + pub fn new(sdl_context: &mut Sdl, retro: &LibretroWrapper) -> Result> { let sys_info = retro.get_system_info(); let title = format!( "{} - ferretro SDL GL", diff --git a/ferretro_components/src/provided/sdl2/surface.rs b/ferretro_components/src/provided/sdl2/surface.rs index 8e52968..2f58763 100644 --- a/ferretro_components/src/provided/sdl2/surface.rs +++ b/ferretro_components/src/provided/sdl2/surface.rs @@ -9,7 +9,7 @@ pub struct Sdl2SurfaceComponent { } impl Sdl2SurfaceComponent { - pub fn new() -> Result> { + pub fn new() -> Result> { let pixel_format = sdl2::pixels::PixelFormatEnum::ARGB1555; // automatically replaced in video_refresh whenever size doesn't match