Skip to content

Commit d3be048

Browse files
committed
mark all structs Copy and make all struct fields pub
1 parent 98bb0a4 commit d3be048

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/lib.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ pub mod time_info_flags {
134134
}
135135

136136
#[repr(C)]
137+
#[derive(Copy, Clone)]
137138
pub struct MidiEvent {
138139
pub event_type: i32,
139140
pub byte_size: i32,
@@ -149,6 +150,7 @@ pub struct MidiEvent {
149150
}
150151

151152
#[repr(C)]
153+
#[derive(Copy, Clone)]
152154
pub struct SysExEvent {
153155
pub event_type: i32,
154156
pub byte_size: i32,
@@ -161,15 +163,17 @@ pub struct SysExEvent {
161163
}
162164

163165
#[repr(C)]
166+
#[derive(Copy, Clone)]
164167
pub struct Event {
165-
dump: [u8; mem::size_of::<MidiEvent>()],
168+
pub dump: [u8; mem::size_of::<MidiEvent>()],
166169
}
167170

168171
#[repr(C)]
172+
#[derive(Copy, Clone)]
169173
pub struct Events {
170-
num_events: i32,
171-
reserved: *const c_void,
172-
events: [*const Event; 2],
174+
pub num_events: i32,
175+
pub reserved: *const c_void,
176+
pub events: [*const Event; 2],
173177
}
174178

175179
pub mod string_constants {
@@ -197,6 +201,7 @@ pub mod plug_category {
197201
}
198202

199203
#[repr(C)]
204+
#[derive(Copy, Clone)]
200205
pub struct ParameterProperties {
201206
pub step_float: f32,
202207
pub small_step_float: f32,
@@ -227,6 +232,7 @@ pub mod parameter_flags {
227232
}
228233

229234
#[repr(C)]
235+
#[derive(Copy, Clone)]
230236
pub struct AEffect {
231237
pub magic: i32,
232238
pub dispatcher: extern "C" fn(*mut AEffect, i32, i32, isize, *mut c_void, f32) -> isize,
@@ -251,6 +257,7 @@ pub struct AEffect {
251257
}
252258

253259
#[repr(C)]
260+
#[derive(Copy, Clone)]
254261
pub struct TimeInfo {
255262
pub sample_pos: f64,
256263
pub sample_rate: f64,

0 commit comments

Comments
 (0)