mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-11 09:31:34 +11:00
clippy autofix
This commit is contained in:
parent
e01a3c41b6
commit
c90e8de893
|
@ -43,7 +43,7 @@ impl BumpAllocator {
|
||||||
let resulting_ptr = ptr + amount_to_add;
|
let resulting_ptr = ptr + amount_to_add;
|
||||||
let new_current_ptr = resulting_ptr + layout.size();
|
let new_current_ptr = resulting_ptr + layout.size();
|
||||||
|
|
||||||
if new_current_ptr as usize >= (self.start_end.borrow(cs).end)() {
|
if new_current_ptr >= (self.start_end.borrow(cs).end)() {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -627,7 +627,7 @@ impl ObjectController {
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
(OBJECT_ATTRIBUTE_MEMORY as *mut u16)
|
(OBJECT_ATTRIBUTE_MEMORY as *mut u16)
|
||||||
.add((i as usize) * 4)
|
.add(i * 4)
|
||||||
.write_volatile(HIDDEN_VALUE);
|
.write_volatile(HIDDEN_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -794,7 +794,7 @@ impl ObjectController {
|
||||||
});
|
});
|
||||||
|
|
||||||
let loan = Loan {
|
let loan = Loan {
|
||||||
index: index as u8,
|
index,
|
||||||
phantom: PhantomData,
|
phantom: PhantomData,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -916,8 +916,8 @@ impl<'a> Object<'a> {
|
||||||
/// [ObjectController::commit] is called.
|
/// [ObjectController::commit] is called.
|
||||||
pub fn set_x(&mut self, x: u16) -> &mut Self {
|
pub fn set_x(&mut self, x: u16) -> &mut Self {
|
||||||
let object_inner = unsafe { self.object_inner() };
|
let object_inner = unsafe { self.object_inner() };
|
||||||
object_inner.attrs.a1a.set_x(x.rem_euclid(1 << 9) as u16);
|
object_inner.attrs.a1a.set_x(x.rem_euclid(1 << 9));
|
||||||
object_inner.attrs.a1s.set_x(x.rem_euclid(1 << 9) as u16);
|
object_inner.attrs.a1s.set_x(x.rem_euclid(1 << 9));
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -224,7 +224,7 @@ impl VRamManager {
|
||||||
slice::from_raw_parts_mut(
|
slice::from_raw_parts_mut(
|
||||||
tiles
|
tiles
|
||||||
.as_mut_ptr()
|
.as_mut_ptr()
|
||||||
.add((index * tile_format.tile_size()) as usize)
|
.add(index * tile_format.tile_size())
|
||||||
.cast(),
|
.cast(),
|
||||||
tile_format.tile_size() / core::mem::size_of::<u32>(),
|
tile_format.tile_size() / core::mem::size_of::<u32>(),
|
||||||
)
|
)
|
||||||
|
|
|
@ -51,7 +51,7 @@ fn set_bank(bank: u8) -> Result<(), Error> {
|
||||||
Err(Error::OutOfBounds)
|
Err(Error::OutOfBounds)
|
||||||
} else if bank != CURRENT_BANK.read() {
|
} else if bank != CURRENT_BANK.read() {
|
||||||
issue_flash_command(CMD_SET_BANK);
|
issue_flash_command(CMD_SET_BANK);
|
||||||
FLASH_PORT_BANK.set(bank as u8);
|
FLASH_PORT_BANK.set(bank);
|
||||||
CURRENT_BANK.write(bank);
|
CURRENT_BANK.write(bank);
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue