diff options
author | Simon McVittie <smcv@collabora.com> | 2018-09-28 16:57:13 +0100 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2019-01-21 15:22:06 +0000 |
commit | 4cc474a5de4cd925d3d21f7f7003edaa657ab084 (patch) | |
tree | bc488f9bacac15a096594adf0fafb05129aaf651 /dbus/dbus-signature.c | |
parent | cccb35dfef8ac4e28594154f8a9a6337fd9d8d7f (diff) | |
download | dbus-4cc474a5de4cd925d3d21f7f7003edaa657ab084.tar.gz |
dbus-signature: Move static assertion outside test code
This always needs to be true, even if we're not embedding test goo
in the library. These static assertions have no runtime overhead, only
compile-time, so it's OK to make it unconditional.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'dbus/dbus-signature.c')
-rw-r--r-- | dbus/dbus-signature.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/dbus/dbus-signature.c b/dbus/dbus-signature.c index 2df893c8..006ac6a5 100644 --- a/dbus/dbus-signature.c +++ b/dbus/dbus-signature.c @@ -40,6 +40,8 @@ typedef struct unsigned int in_array : 1; /**< true if we are a subiterator pointing to an array's element type */ } DBusSignatureRealIter; +_DBUS_STATIC_ASSERT (sizeof (DBusSignatureIter) >= sizeof (DBusSignatureRealIter)); + /** macro that checks whether a typecode is a container type */ #define TYPE_IS_CONTAINER(typecode) \ ((typecode) == DBUS_TYPE_STRUCT || \ @@ -430,8 +432,6 @@ _dbus_signature_test (const char *test_data_dir _DBUS_GNUC_UNUSED) const char *sig; dbus_bool_t boolres; - _DBUS_STATIC_ASSERT (sizeof (DBusSignatureIter) >= sizeof (DBusSignatureRealIter)); - sig = ""; _dbus_assert (dbus_signature_validate (sig, NULL)); _dbus_assert (!dbus_signature_validate_single (sig, NULL)); |