Skip to content

Commit 45dd11c

Browse files
committed
Remove unnecessary #[repr(C)] annotations
1 parent be41164 commit 45dd11c

File tree

12 files changed

+0
-18
lines changed

12 files changed

+0
-18
lines changed

core/src/cpu/interpreter/regs.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use crate::{
44
utils::Savestate,
55
};
66

7-
#[repr(C)]
87
#[derive(Clone, Debug, Savestate)]
98
pub struct Regs {
109
pub cur: [u32; 16],

core/src/ds_slot/rom/key1.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::{cpu::arm7, utils::Bytes};
22

33
#[derive(Clone)]
4-
#[repr(C)]
54
pub struct KeyBuffer<const LEVEL_3: bool> {
65
key_buf: [u32; 0x412],
76
key_code: [u32; 3],

core/src/gpu/engine_3d.rs

-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ proc_bitfield::bitfield! {
163163
}
164164

165165
#[derive(Clone, Copy, Debug, PartialEq, Eq, Savestate)]
166-
#[repr(C)]
167166
pub struct Polygon {
168167
pub verts: [VertexAddr; 10],
169168
pub depth_values: [u32; 10],

core/src/gpu/engine_3d/vertex.rs

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ pub type InterpColor = u16x4;
1515
pub type ScreenCoords = u16x2;
1616

1717
#[derive(Clone, Copy, Debug, PartialEq, Eq, Savestate)]
18-
#[repr(C)]
1918
pub struct Vertex {
2019
pub coords: i32x4,
2120
pub uv: TexCoords,

core/src/gpu/vram.rs

-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ proc_bitfield::bitfield! {
2727
}
2828
}
2929

30-
#[repr(C)]
3130
#[derive(Savestate)]
3231
pub struct Banks {
3332
pub a: OwnedBytesCellPtr<0x2_0000>,
@@ -41,7 +40,6 @@ pub struct Banks {
4140
pub i: OwnedBytesCellPtr<0x4000>,
4241
}
4342

44-
#[repr(C)]
4543
#[derive(Savestate)]
4644
struct Map {
4745
// NOTE: The cells are an ugly hack to avoid macros but also work around simultaneous mutable
@@ -57,7 +55,6 @@ struct Map {
5755
arm7: [Cell<u8>; 2],
5856
}
5957

60-
#[repr(C)]
6158
struct Writeback {
6259
// NOTE: Same as `Map`
6360
a_bg: UnsafeCell<[usize; 0x8_0000 / usize::BITS as usize]>,
@@ -77,7 +74,6 @@ pub struct Updates {
7774
pub oam: bool, // One 1 KiB (0x400 bytes) region
7875
}
7976

80-
#[repr(C)]
8177
#[derive(Savestate)]
8278
#[load(in_place_only, post = "self.post_load()")]
8379
#[store(pre = "self.flush_writeback()")]

frontend/desktop/src/audio/input.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ use std::{
1111

1212
pub const OUTPUT_SAMPLE_RATE: u32 = SYS_CLOCK_RATE / 128;
1313

14-
#[repr(C)]
1514
struct Buffer {
1615
write_pos: AtomicUsize,
1716
data: Box<UnsafeCell<[i16; MIC_SAMPLES_PER_FRAME * 2]>>,

frontend/desktop/src/audio/output.rs

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ pub const DEFAULT_INPUT_SAMPLE_RATE: u32 = SYS_CLOCK_RATE >> 10;
1919

2020
const BUFFER_BASE_CAPACITY: usize = 0x800;
2121

22-
#[repr(C)]
2322
struct Buffer {
2423
read_pos: AtomicUsize,
2524
write_pos: AtomicUsize,

frontend/desktop/src/frame_data.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
use crate::debug_views;
33
use dust_core::gpu::Framebuffer;
44

5-
#[repr(C)]
65
pub struct FrameData {
76
pub fb: Box<Framebuffer>,
87
pub fps: f32,

render/soft-2d/src/threaded/lockstep_scanlines.rs

-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use dust_core::{
2222
};
2323
use std::{sync::Arc, thread};
2424

25-
#[repr(C)]
2625
struct Vram<R: Role>
2726
where
2827
[(); R::BG_VRAM_LEN]: Sized,
@@ -36,7 +35,6 @@ where
3635
oam: Bytes<0x400>,
3736
}
3837

39-
#[repr(C)]
4038
#[allow(clippy::type_complexity)]
4139
struct SharedData {
4240
stopped: AtomicBool,

render/soft-3d/src/data.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use dust_core::{
77
utils::Bytes,
88
};
99

10-
#[repr(C)]
1110
pub struct RenderingData {
1211
pub control: RenderingControl,
1312
pub w_buffering: bool,

render/wgpu-2d/src/threaded/lockstep_scanlines.rs

-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ use dust_core::{
2323
};
2424
use std::{sync::Arc, thread};
2525

26-
#[repr(C)]
2726
struct Vram<R: Role>
2827
where
2928
[(); R::BG_VRAM_LEN]: Sized,
@@ -37,7 +36,6 @@ where
3736
oam: Bytes<0x400>,
3837
}
3938

40-
#[repr(C)]
4139
#[allow(clippy::type_complexity)]
4240
struct SharedData {
4341
stopped: AtomicBool,

render/wgpu-3d/src/data.rs

-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ impl GxData {
4141
}
4242
}
4343

44-
#[repr(C)]
4544
pub struct RenderingData {
4645
pub control: RenderingControl,
4746

@@ -120,7 +119,6 @@ impl RenderingData {
120119
}
121120
}
122121

123-
#[repr(C)]
124122
pub struct FrameData {
125123
pub rendering: RenderingData,
126124
pub gx: GxData,

0 commit comments

Comments
 (0)