diff --git a/src/gui/gui.h b/src/gui/gui.h index 7557b46..c348dcd 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -16,6 +16,9 @@ struct Clip { float end; }; +struct Empty { +}; + enum GuiActionTag { gui_action_none, gui_action_toggle_pause, @@ -30,6 +33,7 @@ enum GuiActionTag { struct GuiAction { enum GuiActionTag tag; union { + struct Empty none; float seek_position; struct Clip clip; uint64_t id; diff --git a/src/gui/rust/src/lib.rs b/src/gui/rust/src/lib.rs index 160c2a0..444121c 100644 --- a/src/gui/rust/src/lib.rs +++ b/src/gui/rust/src/lib.rs @@ -20,11 +20,7 @@ mod gui_actions { use crate::c_bindings::*; fn make_action(tag: GuiActionTag) -> GuiAction { - unsafe { - let mut ret = std::mem::MaybeUninit::::zeroed(); - (*ret.as_mut_ptr()).tag = tag; - ret.assume_init() - } + GuiAction { tag }; } pub fn none() -> GuiAction {