From c004b44ad7d0dba8e602875e8a367cd7c4008df1 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 12 Jan 2015 18:59:47 +0100 Subject: Remove union, set defaults for DabComponent fields --- src/MuxElements.h | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/MuxElements.h b/src/MuxElements.h index 6607c20..a061bc6 100644 --- a/src/MuxElements.h +++ b/src/MuxElements.h @@ -189,6 +189,10 @@ public: struct dabAudioComponent { + dabAudioComponent() : + uaType(0xFFFF) {} + + uint16_t uaType; // User Application Type }; @@ -201,6 +205,12 @@ struct dabFidcComponent { struct dabPacketComponent { + dabPacketComponent() : + id(0), + address(0), + appType(0xFFFF), + datagroup(false) { } + uint16_t id; uint16_t address; uint16_t appType; @@ -222,12 +232,11 @@ class DabComponent : public RemoteControllable uint8_t subchId; uint8_t type; uint8_t SCIdS; - union { - dabAudioComponent audio; - dabDataComponent data; - dabFidcComponent fidc; - dabPacketComponent packet; - }; + + dabAudioComponent audio; + dabDataComponent data; + dabFidcComponent fidc; + dabPacketComponent packet; bool isPacketComponent(std::vector& subchannels); -- cgit v1.2.3