summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2020-01-03 00:29:40 +0100
committerStanislaw Halik <sthalik@misaki.pl>2020-01-03 00:29:56 +0100
commitfb994308266093382fffecb8a3fd2645ab811117 (patch)
tree7d23119d5342412571eea78e2103ee28046a2de0
parentc40fdb23b468bbecbb1aec9be89b2d529903e971 (diff)
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
-rw-r--r--tracker-freepie-udp/ftnoir_tracker_freepie-udp.cpp14
1 files 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
{