diff --git a/agb/.cargo/config.toml b/agb/.cargo/config.toml index 54493f4b..528c72a4 100644 --- a/agb/.cargo/config.toml +++ b/agb/.cargo/config.toml @@ -6,5 +6,5 @@ build-std-features = ["compiler-builtins-mem"] target = "thumbv4t-none-eabi" [target.thumbv4t-none-eabi] -rustflags = ["-Clink-arg=-Tgba.ld", "-Ctarget-cpu=arm7tdmi"] +rustflags = ["-Clink-arg=-Tgba.ld", "-Ctarget-cpu=arm7tdmi", "-Dwarnings", "-Dclippy::all"] runner = "mgba-test-runner" diff --git a/agb/src/display/object.rs b/agb/src/display/object.rs index 7336e916..4982b704 100644 --- a/agb/src/display/object.rs +++ b/agb/src/display/object.rs @@ -19,10 +19,6 @@ use crate::agb_alloc::bump_allocator::StartEnd; use crate::dma; use crate::fixnum::Vector2D; use crate::hash_map::HashMap; -use crate::interrupt::free; - -use bare_metal::Mutex; -use core::cell::RefCell; use attributes::*; @@ -52,13 +48,14 @@ impl DerefMut for ObjectControllerRef { } #[cfg(debug_assertions)] -static OBJECT_REFS_CURRENT: Mutex> = Mutex::new(RefCell::new(0)); +static OBJECT_REFS_CURRENT: bare_metal::Mutex> = + bare_metal::Mutex::new(core::cell::RefCell::new(0)); impl ObjectControllerRef { fn new() -> Self { #[cfg(debug_assertions)] { - let a = free(|c| { + let a = crate::interrupt::free(|c| { let mut b = OBJECT_REFS_CURRENT.borrow(*c).borrow_mut(); let a = *b; *b += 1; @@ -78,7 +75,7 @@ impl ObjectControllerRef { #[cfg(debug_assertions)] impl Drop for ObjectControllerRef { fn drop(&mut self) { - free(|c| { + crate::interrupt::free(|c| { let mut b = OBJECT_REFS_CURRENT.borrow(*c).borrow_mut(); *b -= 1; }) @@ -444,7 +441,7 @@ struct ObjectInner { } struct ObjectControllerStatic { - free_affine_matricies: Vec, + _free_affine_matricies: Vec, free_object: Vec, shadow_oam: Vec>, z_order: Vec, @@ -457,7 +454,7 @@ impl ObjectControllerStatic { shadow_oam: (0..128).map(|_| None).collect(), z_order: (0..128).collect(), free_object: (0..128).collect(), - free_affine_matricies: (0..32).collect(), + _free_affine_matricies: (0..32).collect(), sprite_controller: SpriteControllerInner::new(), } }