1From 9f5994077aed134d284c168b61c3167ac9837c98 Mon Sep 17 00:00:00 2001
2From: Michael Forney <mforney@mforney.org>
3Date: Sun, 11 Aug 2019 03:41:23 +0000
4Subject: [PATCH] Avoid statement expressions for get_aligned_le*
5
6---
7 src/utils/platform.h | 15 +++++++++++++--
8 1 file changed, 13 insertions(+), 2 deletions(-)
9
10diff --git a/src/utils/platform.h b/src/utils/platform.h
11index b2ad856..a76c87f 100644
12--- a/src/utils/platform.h
13+++ b/src/utils/platform.h
14@@ -12,7 +12,18 @@
15 #include "includes.h"
16 #include "common.h"
17
18-#define get_unaligned_le16(p) WPA_GET_LE16((void *) (p))
19-#define get_unaligned_le32(p) WPA_GET_LE32((void *) (p))
20+static inline u16 get_unaligned_le16(void *p)
21+{
22+ u16 v;
23+ memcpy(&v, p, sizeof(v));
24+ return le_to_host16(v);
25+}
26+
27+static inline u32 get_unaligned_le32(void *p)
28+{
29+ u32 v;
30+ memcpy(&v, p, sizeof(v));
31+ return le_to_host32(v);
32+}
33
34 #endif /* PLATFORM_H */
35--
362.45.1
37