summaryrefslogtreecommitdiff
path: root/dbus/dbus-hash.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-09-11 12:55:52 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-09-15 12:22:23 +0100
commit31b38090183b8bd77c86c1195d57b4a3b5df04da (patch)
tree9fb5c3a97c9b6de33f92ae351977f5ed1352e3cd /dbus/dbus-hash.c
parent0e3d08d45cb9a9ceb2c077875eeb38306dad37b8 (diff)
downloaddbus-31b38090183b8bd77c86c1195d57b4a3b5df04da.tar.gz
Replace some runtime assertions with compile-time assertions
This requires a little bit of code re-ordering, because _DBUS_STATIC_ASSERT can appear anywhere that a variable declaration would be valid, i.e. not after executable code. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83767 Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk>
Diffstat (limited to 'dbus/dbus-hash.c')
-rw-r--r--dbus/dbus-hash.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/dbus/dbus-hash.c b/dbus/dbus-hash.c
index c80835aa..8f7d04bb 100644
--- a/dbus/dbus-hash.c
+++ b/dbus/dbus-hash.c
@@ -519,7 +519,7 @@ _dbus_hash_iter_init (DBusHashTable *table,
{
DBusRealHashIter *real;
- _dbus_assert (sizeof (DBusHashIter) == sizeof (DBusRealHashIter));
+ _DBUS_STATIC_ASSERT (sizeof (DBusHashIter) == sizeof (DBusRealHashIter));
real = (DBusRealHashIter*) iter;
@@ -544,7 +544,7 @@ _dbus_hash_iter_next (DBusHashIter *iter)
{
DBusRealHashIter *real;
- _dbus_assert (sizeof (DBusHashIter) == sizeof (DBusRealHashIter));
+ _DBUS_STATIC_ASSERT (sizeof (DBusHashIter) == sizeof (DBusRealHashIter));
real = (DBusRealHashIter*) iter;
@@ -746,7 +746,7 @@ _dbus_hash_iter_lookup (DBusHashTable *table,
DBusHashEntry *entry;
DBusHashEntry **bucket;
- _dbus_assert (sizeof (DBusHashIter) == sizeof (DBusRealHashIter));
+ _DBUS_STATIC_ASSERT (sizeof (DBusHashIter) == sizeof (DBusRealHashIter));
real = (DBusRealHashIter*) iter;