diff --git a/src/emu/emu_ev.c b/src/emu/emu_ev.c index 05af80e..62acfec 100644 --- a/src/emu/emu_ev.c +++ b/src/emu/emu_ev.c @@ -7,9 +7,9 @@ void emu_ev(struct emu_ev *ev, const struct ovni_ev *oev, int64_t sclock, int64_t dclock) { - ev->mcv[0] = ev->m = oev->header.model; - ev->mcv[1] = ev->c = oev->header.category; - ev->mcv[2] = ev->v = oev->header.value; + ev->m = oev->header.model; + ev->c = oev->header.category; + ev->v = oev->header.value; ev->mcv[3] = '\0'; ev->rclock = oev->header.clock; diff --git a/src/emu/emu_ev.h b/src/emu/emu_ev.h index 10cdf17..3278d4c 100644 --- a/src/emu/emu_ev.h +++ b/src/emu/emu_ev.h @@ -9,10 +9,15 @@ /* Easier to parse emulation event */ struct emu_ev { - uint8_t m; - uint8_t c; - uint8_t v; - char mcv[4]; + union { + struct { + uint8_t m; + uint8_t c; + uint8_t v; + uint8_t nil; + }; + char mcv[4]; + }; int64_t rclock; /* As-is clock in the binary stream */ int64_t sclock; /* Corrected clock with stream offset */