Skip to content

Commit 65dcb64

Browse files
authored
Merge pull request #27 from linkmauve/edition-2024
Bump to edition 2024
2 parents 9b58426 + 60f9b6d commit 65dcb64

File tree

8 files changed

+32
-30
lines changed

8 files changed

+32
-30
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "luma"
33
version = "0.1.0"
44
authors = ["rust-wii"]
5-
edition = "2018"
5+
edition = "2024"
66

77
[profile]
88
dev = { panic = "abort" }

luma_core/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "luma_core"
33
version = "0.1.0"
44
authors = ["rust-wii"]
5-
edition = "2018"
5+
edition = "2024"
66

77
[dependencies]
88
bitflags = "2"

luma_core/src/allocate.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use alloc::alloc::{alloc, Layout};
1+
use alloc::alloc::{Layout, alloc};
22
use alloc::boxed::Box;
33
use core::pin::Pin;
44
use core::slice;
@@ -31,6 +31,6 @@ pub unsafe fn ptr_as_pinned_array<T: Copy, const LENGTH: usize>(
3131
ptr: *mut T,
3232
) -> Pin<Box<[T; LENGTH]>> {
3333
let array = ptr as *mut [T; LENGTH];
34-
let boxed = Box::from_raw(array);
34+
let boxed = unsafe { Box::from_raw(array) };
3535
Pin::from(boxed)
3636
}

luma_core/src/cache.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use core::arch::{asm, global_asm};
88
global_asm!(include_str!("../asm/cache.S"));
99

1010
// Load cache functions from global assembly.
11-
extern "C" {
11+
unsafe extern "C" {
1212
/// Enable the L1 d(ata)-cache.
1313
///
1414
/// **NOTE**: This function calls ``sync`` before enabling.

luma_core/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ pub mod ipc;
4646
///
4747
/// Unlike puts(), it doesn’t require a null-terminated CStr, so in the optimal case we can pass a
4848
/// &str’s pointer as is, without doing any extra allocation.
49-
#[no_mangle]
49+
#[unsafe(no_mangle)]
5050
#[inline(never)]
51-
unsafe extern "C" fn __write_console(_unused: u32, message: *const u8, size: *const u32) {
52-
asm!("/* {0} {1} */", in(reg) message, in(reg) size);
51+
extern "C" fn __write_console(_unused: u32, message: *const u8, size: *const u32) {
52+
unsafe { asm!("/* {0} {1} */", in(reg) message, in(reg) size) };
5353
}
5454

5555
/// Implements Write using Dolphin’s HLE.
@@ -59,7 +59,7 @@ impl fmt::Write for DolphinHle {
5959
#[inline(always)]
6060
fn write_str(&mut self, s: &str) -> fmt::Result {
6161
let len = s.len() as u32;
62-
unsafe { __write_console(0, s.as_ptr(), &len as *const u32) };
62+
__write_console(0, s.as_ptr(), &len as *const u32);
6363
Ok(())
6464
}
6565

luma_core/src/vi.rs

+19-17
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,11 @@ unsafe fn set_xfb(addr: u32, xfb: &Xfb, bottom: bool) {
154154
}
155155

156156
unsafe fn set_top_xfb(xfb: &Xfb) {
157-
set_xfb(BASE + 0x1c, xfb, false);
157+
unsafe { set_xfb(BASE + 0x1c, xfb, false) };
158158
}
159159

160160
unsafe fn set_bottom_xfb(xfb: &Xfb) {
161-
set_xfb(BASE + 0x24, xfb, true);
161+
unsafe { set_xfb(BASE + 0x24, xfb, true) };
162162
}
163163

164164
/*
@@ -219,21 +219,23 @@ unsafe fn set_border() {
219219
}
220220

221221
unsafe fn setup_interlaced(width: usize, height: usize, xfb: &Xfb) {
222-
set_vertical_timing(height as u16, 6);
223-
configure(ConfigureFlags::PAL | ConfigureFlags::INTERLACED | ConfigureFlags::ENABLE);
224-
// TODO: figure out why 0x40 becomes 0x42 once read here…
225-
set_horizontal_timing(71, 105, 429, 373, 162, 64);
226-
set_field_vertical_timing(3, 24, 2, 25);
227-
set_burst_blanking_interval_1(520, 12, 520, 12);
228-
set_burst_blanking_interval_2(519, 13, 519, 13);
229-
set_top_xfb(xfb);
230-
set_bottom_xfb(xfb);
231-
set_display_interrupts();
232-
// 0x40 and 0x44 are display latch registers, unused?
233-
set_scaled_width(width as u16);
234-
set_aa_filters();
235-
set_clock(27 /* MHz */);
236-
set_border();
222+
unsafe {
223+
set_vertical_timing(height as u16, 6);
224+
configure(ConfigureFlags::PAL | ConfigureFlags::INTERLACED | ConfigureFlags::ENABLE);
225+
// TODO: figure out why 0x40 becomes 0x42 once read here…
226+
set_horizontal_timing(71, 105, 429, 373, 162, 64);
227+
set_field_vertical_timing(3, 24, 2, 25);
228+
set_burst_blanking_interval_1(520, 12, 520, 12);
229+
set_burst_blanking_interval_2(519, 13, 519, 13);
230+
set_top_xfb(xfb);
231+
set_bottom_xfb(xfb);
232+
set_display_interrupts();
233+
// 0x40 and 0x44 are display latch registers, unused?
234+
set_scaled_width(width as u16);
235+
set_aa_filters();
236+
set_clock(27 /* MHz */);
237+
set_border();
238+
}
237239
}
238240

239241
/// A struct representing the Video Interface, or VI. This is the piece of hardware which scans

luma_runtime/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "luma_runtime"
33
version = "0.1.0"
44
authors = ["rust-wii"]
5-
edition = "2018"
5+
edition = "2024"
66

77
[dependencies]
88
luma_core = { path = "../luma_core" }

luma_runtime/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use luma_core::cache::*;
1919
use luma_core::println;
2020

2121
// Import linker symbols for allocator initialization.
22-
extern "C" {
22+
unsafe extern "C" {
2323
pub static __stack_addr: usize;
2424
pub static __stack_end: usize;
2525
}
@@ -69,13 +69,13 @@ impl Termination for () {}
6969

7070
/// This function is called on panic.
7171
#[cfg_attr(not(test), panic_handler)]
72-
#[no_mangle]
72+
#[unsafe(no_mangle)]
7373
fn panic(info: &PanicInfo) -> ! {
7474
println!("{}", info);
7575
loop {}
7676
}
7777

7878
/// Error handler personality language item (current no-op, to satisfy clippy).
7979
#[cfg_attr(not(test), lang = "eh_personality")]
80-
#[no_mangle]
80+
#[unsafe(no_mangle)]
8181
extern "C" fn rust_eh_personality() {}

0 commit comments

Comments
 (0)