]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix 779: Union casting is non-portable.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 14 Jun 2016 10:23:56 +0000 (10:23 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 14 Jun 2016 10:23:56 +0000 (10:23 +0000)
git-svn-id: file:///svn/unbound/trunk@3789 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
util/ub_event.c
util/ub_event_pluggable.c

index 6a51e317e450c4fea46136d5add8d76f21630c42..2f289cae4b56b3769954e5dad6f7250e92af0a6f 100644 (file)
@@ -3,6 +3,7 @@
          null delete for wsaevent.
        - Fix spelling in freebind option man page text.
        - Fix windows link of ssl with crypt32.
+       - Fix 779:  Union casting is non-portable.
 
 13 June 2016: Ralph
        - Use QTYPE=A for QNAME minimisation.
index af2a18ea0fc82f7fd22d59f114f24d6618ff5429..ebf9029e731235e1494e9775ab9af820bdccac5b 100644 (file)
@@ -132,14 +132,10 @@ static void (*NATIVE_BITS_CB(void (*cb)(int, short, void*)))(int, short, void*)
 #define EVFLAG_AUTO 0
 #endif
 
-#define AS_EVENT_BASE(x) \
-       (((union {struct ub_event_base* a; struct event_base* b;})x).b)
-#define AS_UB_EVENT_BASE(x) \
-       (((union {struct event_base* a; struct ub_event_base* b;})x).b)
-#define AS_EVENT(x) \
-       (((union {struct ub_event* a; struct event* b;})x).b)
-#define AS_UB_EVENT(x) \
-       (((union {struct event* a; struct ub_event* b;})x).b)
+#define AS_EVENT_BASE(x) ((struct event_base*)x)
+#define AS_UB_EVENT_BASE(x) ((struct ub_event_base*)x)
+#define AS_EVENT(x) ((struct event*)x)
+#define AS_UB_EVENT(x) ((struct ub_event*)x)
 
 const char* ub_event_get_version()
 {
index f8a4b9a6f312bfc3b7590f5955e7c3795888fd43..c30880a5492a5ad48656cc0429841592f18f403a 100644 (file)
@@ -144,10 +144,8 @@ struct my_event {
        struct event ev;
 };
 
-#define AS_MY_EVENT_BASE(x) \
-       (((union {struct ub_event_base* a; struct my_event_base* b;})x).b)
-#define AS_MY_EVENT(x) \
-       (((union {struct ub_event* a; struct my_event* b;})x).b)
+#define AS_MY_EVENT_BASE(x) ((struct my_event_base*)x)
+#define AS_MY_EVENT(x) ((struct my_event*)x)
 
 const char* ub_event_get_version()
 {