diff options
author | Thomas Haller <thaller@redhat.com> | 2015-10-10 20:51:17 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-10-10 20:51:19 +0200 |
commit | 90b5e4e3c57013a28333f47a057a3b49e182fa4b (patch) | |
tree | 5f57c816ff008ad88e235a570ebfba604f306092 | |
parent | 3e767019615e4d569b8a02bc801fd8f3ee7e6e77 (diff) | |
download | NetworkManager-90b5e4e3c57013a28333f47a057a3b49e182fa4b.tar.gz |
core: disable assertion in nm_ip[46]_config_replace() by default
Only enable the assertion when compiling with nm-more-asserts.
-rw-r--r-- | src/nm-ip4-config.c | 8 | ||||
-rw-r--r-- | src/nm-ip6-config.c | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c index 02257d8c31..23af6aa713 100644 --- a/src/nm-ip4-config.c +++ b/src/nm-ip4-config.c @@ -940,7 +940,7 @@ nm_ip4_config_intersect (NMIP4Config *dst, const NMIP4Config *src) gboolean nm_ip4_config_replace (NMIP4Config *dst, const NMIP4Config *src, gboolean *relevant_changes) { -#ifndef G_DISABLE_ASSERT +#if NM_MORE_ASSERTS gboolean config_equal; #endif gboolean has_minor_changes = FALSE, has_relevant_changes = FALSE, are_equal; @@ -953,7 +953,7 @@ nm_ip4_config_replace (NMIP4Config *dst, const NMIP4Config *src, gboolean *relev g_return_val_if_fail (dst != NULL, FALSE); g_return_val_if_fail (src != dst, FALSE); -#ifndef G_DISABLE_ASSERT +#if NM_MORE_ASSERTS config_equal = nm_ip4_config_equal (dst, src); #endif @@ -1167,9 +1167,11 @@ nm_ip4_config_replace (NMIP4Config *dst, const NMIP4Config *src, gboolean *relev has_minor_changes = TRUE; } +#if NM_MORE_ASSERTS /* config_equal does not compare *all* the fields, therefore, we might have has_minor_changes * regardless of config_equal. But config_equal must correspond to has_relevant_changes. */ - g_assert (config_equal == !has_relevant_changes); + nm_assert (config_equal == !has_relevant_changes); +#endif g_object_thaw_notify (G_OBJECT (dst)); diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c index d1ffbaa1fb..4b18ceab80 100644 --- a/src/nm-ip6-config.c +++ b/src/nm-ip6-config.c @@ -959,7 +959,7 @@ nm_ip6_config_intersect (NMIP6Config *dst, const NMIP6Config *src) gboolean nm_ip6_config_replace (NMIP6Config *dst, const NMIP6Config *src, gboolean *relevant_changes) { -#ifndef G_DISABLE_ASSERT +#if NM_MORE_ASSERTS gboolean config_equal; #endif gboolean has_minor_changes = FALSE, has_relevant_changes = FALSE, are_equal; @@ -972,7 +972,7 @@ nm_ip6_config_replace (NMIP6Config *dst, const NMIP6Config *src, gboolean *relev g_return_val_if_fail (dst != NULL, FALSE); g_return_val_if_fail (src != dst, FALSE); -#ifndef G_DISABLE_ASSERT +#if NM_MORE_ASSERTS config_equal = nm_ip6_config_equal (dst, src); #endif @@ -1132,9 +1132,11 @@ nm_ip6_config_replace (NMIP6Config *dst, const NMIP6Config *src, gboolean *relev has_minor_changes = TRUE; } +#if NM_MORE_ASSERTS /* config_equal does not compare *all* the fields, therefore, we might have has_minor_changes * regardless of config_equal. But config_equal must correspond to has_relevant_changes. */ - g_assert (config_equal == !has_relevant_changes); + nm_assert (config_equal == !has_relevant_changes); +#endif g_object_thaw_notify (G_OBJECT (dst)); |