From 638528d31211a6ff4ded641f038d36252555dbb7 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 20 Oct 2015 14:08:04 +0200 Subject: [PATCH] platform: move static asserts from header to source file No point in having every user of the header file evaluate the static assertion. --- src/platform/nm-platform.c | 4 ++++ src/platform/nm-platform.h | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c index 7da3e97be5..565cf42bb7 100644 --- a/src/platform/nm-platform.c +++ b/src/platform/nm-platform.c @@ -41,6 +41,10 @@ #define ADDRESS_LIFETIME_PADDING 5 G_STATIC_ASSERT (sizeof ( ((NMPlatformLink *) NULL)->addr.data ) == NM_UTILS_HWADDR_LEN_MAX); +G_STATIC_ASSERT (G_STRUCT_OFFSET (NMPlatformIPAddress, address_ptr) == G_STRUCT_OFFSET (NMPlatformIP4Address, address)); +G_STATIC_ASSERT (G_STRUCT_OFFSET (NMPlatformIPAddress, address_ptr) == G_STRUCT_OFFSET (NMPlatformIP6Address, address)); +G_STATIC_ASSERT (G_STRUCT_OFFSET (NMPlatformIPRoute, network_ptr) == G_STRUCT_OFFSET (NMPlatformIP4Route, network)); +G_STATIC_ASSERT (G_STRUCT_OFFSET (NMPlatformIPRoute, network_ptr) == G_STRUCT_OFFSET (NMPlatformIP6Route, network)); #define _NMLOG_DOMAIN LOGD_PLATFORM #define _NMLOG_PREFIX_NAME "platform" diff --git a/src/platform/nm-platform.h b/src/platform/nm-platform.h index 33fc480c92..e894504028 100644 --- a/src/platform/nm-platform.h +++ b/src/platform/nm-platform.h @@ -222,7 +222,6 @@ struct _NMPlatformIP4Address { in_addr_t peer_address; /* PTP peer address */ char label[IFNAMSIZ]; }; -G_STATIC_ASSERT (G_STRUCT_OFFSET (NMPlatformIPAddress, address_ptr) == G_STRUCT_OFFSET (NMPlatformIP4Address, address)); /** * NMPlatformIP6Address: @@ -234,7 +233,6 @@ struct _NMPlatformIP6Address { struct in6_addr peer_address; guint flags; /* ifa_flags from , field type "unsigned int" is as used in rtnl_addr_get_flags. */ }; -G_STATIC_ASSERT (G_STRUCT_OFFSET (NMPlatformIPAddress, address_ptr) == G_STRUCT_OFFSET (NMPlatformIP6Address, address)); typedef union { NMPlatformIPAddress ax; @@ -291,14 +289,12 @@ struct _NMPlatformIP4Route { * no pref-src is set. */ guint32 pref_src; }; -G_STATIC_ASSERT (G_STRUCT_OFFSET (NMPlatformIPRoute, network_ptr) == G_STRUCT_OFFSET (NMPlatformIP4Route, network)); struct _NMPlatformIP6Route { __NMPlatformIPRoute_COMMON; struct in6_addr network; struct in6_addr gateway; }; -G_STATIC_ASSERT (G_STRUCT_OFFSET (NMPlatformIPRoute, network_ptr) == G_STRUCT_OFFSET (NMPlatformIP6Route, network)); typedef union { NMPlatformIPRoute rx;