From fb994308266093382fffecb8a3fd2645ab811117 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 3 Jan 2020 00:29:40 +0100 Subject: tracker/freepie-udp: fix pack pragma Due to typo "#pragma pack(push)" was used rather than, "#pragma pack(push, 1)" that does the right thing. Add an assert. PR: #1018 --- tracker-freepie-udp/ftnoir_tracker_freepie-udp.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/tracker-freepie-udp/ftnoir_tracker_freepie-udp.cpp b/tracker-freepie-udp/ftnoir_tracker_freepie-udp.cpp index 28d29351..c9d374ed 100644 --- a/tracker-freepie-udp/ftnoir_tracker_freepie-udp.cpp +++ b/tracker-freepie-udp/ftnoir_tracker_freepie-udp.cpp @@ -17,21 +17,15 @@ tracker_freepie::~tracker_freepie() } void tracker_freepie::run() { -#ifndef __clang__ -#pragma pack(push) -struct -#else -struct __attribute__((packed)) -#endif -{ +#pragma pack(push, 1) + struct { uint8_t pad1; uint8_t flags; float fl[12]; -} data; -#ifndef __clang__ + } data; #pragma pack(pop) -#endif + static_assert(sizeof(data) == 50); enum F { -- cgit v1.2.3