diff options
author | cbdev <cb@cbcdn.com> | 2019-08-10 20:30:07 +0200 |
---|---|---|
committer | cbdev <cb@cbcdn.com> | 2019-08-10 20:30:07 +0200 |
commit | 48bf96602023b2ead855f13477b6f5e26b663b45 (patch) | |
tree | dbdcb002c0211b566487c174834a408ba881958c /backends/osc.c | |
parent | cf93d280af47aea1bf8bdafa30eabb2c2de005b8 (diff) | |
download | midimonster-48bf96602023b2ead855f13477b6f5e26b663b45.tar.gz midimonster-48bf96602023b2ead855f13477b6f5e26b663b45.tar.bz2 midimonster-48bf96602023b2ead855f13477b6f5e26b663b45.zip |
Clean up & check unions
Diffstat (limited to 'backends/osc.c')
-rw-r--r-- | backends/osc.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/backends/osc.c b/backends/osc.c index 77bbde4..beb5527 100644 --- a/backends/osc.c +++ b/backends/osc.c @@ -13,14 +13,6 @@ #define osc_align(a) ((((a) / 4) + (((a) % 4) ? 1 : 0)) * 4) #define BACKEND_NAME "osc" -typedef union { - struct { - uint32_t channel; - uint32_t parameter; - } fields; - uint64_t label; -} osc_channel_ident; - static struct { uint8_t detect; } osc_global_config = { @@ -40,6 +32,11 @@ int init(){ .shutdown = osc_shutdown }; + if(sizeof(osc_channel_ident) != sizeof(uint64_t)){ + fprintf(stderr, "OSC channel identification union out of bounds\n"); + return 1; + } + //register backend if(mm_backend_register(osc)){ fprintf(stderr, "Failed to register OSC backend\n"); |