summaryrefslogtreecommitdiff
path: root/shared/nm-glib-aux/nm-macros-internal.h
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-04-10 08:11:51 +0200
committerThomas Haller <thaller@redhat.com>2020-04-10 08:11:52 +0200
commit2c2ed2374fbdeb8f41236fa1f5d732b3b6339768 (patch)
tree266ed51b904d6d2fd4b5024056334ea1bb4760ab /shared/nm-glib-aux/nm-macros-internal.h
parentbe8be0f0918e62e72d37d79e8ae095bbf7c08710 (diff)
downloadNetworkManager-2c2ed2374fbdeb8f41236fa1f5d732b3b6339768.tar.gz
shared: fix static assert in NM_MORE_ASSERT_ONCE()
NM_MORE_ASSERTS 0 means that more assertions are disabled. NM_MORE_ASSERT_ONCE() should never be triggered when more assertions are disabled altogether. It is thus not allowed to called "if (NM_MORE_ASSERT_ONCE (0))", because that code would always be enabled.
Diffstat (limited to 'shared/nm-glib-aux/nm-macros-internal.h')
-rw-r--r--shared/nm-glib-aux/nm-macros-internal.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/shared/nm-glib-aux/nm-macros-internal.h b/shared/nm-glib-aux/nm-macros-internal.h
index 9e3735d477..d5a8513e54 100644
--- a/shared/nm-glib-aux/nm-macros-internal.h
+++ b/shared/nm-glib-aux/nm-macros-internal.h
@@ -1046,7 +1046,7 @@ nm_str_realloc (char *str)
&& ({ \
static volatile int _assert_once = 0; \
\
- G_STATIC_ASSERT_EXPR ((more_assert_level) >= 0); \
+ G_STATIC_ASSERT_EXPR ((more_assert_level) > 0); \
\
G_UNLIKELY ( _assert_once == 0 \
&& g_atomic_int_compare_and_exchange (&_assert_once, 0, 1)); \