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/evdev.c | |
parent | cf93d280af47aea1bf8bdafa30eabb2c2de005b8 (diff) | |
download | midimonster-48bf96602023b2ead855f13477b6f5e26b663b45.tar.gz midimonster-48bf96602023b2ead855f13477b6f5e26b663b45.tar.bz2 midimonster-48bf96602023b2ead855f13477b6f5e26b663b45.zip |
Clean up & check unions
Diffstat (limited to 'backends/evdev.c')
-rw-r--r-- | backends/evdev.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/backends/evdev.c b/backends/evdev.c index 7a7913d..bd2098d 100644 --- a/backends/evdev.c +++ b/backends/evdev.c @@ -18,15 +18,6 @@ #define BACKEND_NAME "evdev" -typedef union { - struct { - uint32_t pad; - uint16_t type; - uint16_t code; - } fields; - uint64_t label; -} evdev_channel_ident; - static struct { uint8_t detect; } evdev_config = { @@ -46,6 +37,11 @@ int init(){ .shutdown = evdev_shutdown }; + if(sizeof(evdev_channel_ident) != sizeof(uint64_t)){ + fprintf(stderr, "evdev channel identification union out of bounds\n"); + return 1; + } + if(mm_backend_register(evdev)){ fprintf(stderr, "Failed to register evdev backend\n"); return 1; |