mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-09-20 08:31:47 +00:00
core: disable assertion in nm_ip[46]_config_replace() by default
Only enable the assertion when compiling with nm-more-asserts.
This commit is contained in:
parent
3e76701961
commit
90b5e4e3c5
|
@ -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));
|
||||
|
||||
|
|
|
@ -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));
|
||||
|
||||
|
|
Loading…
Reference in a new issue