summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2005-06-16 19:45:49 +0000
committerColin Walters <walters@verbum.org>2005-06-16 19:45:49 +0000
commitf5bb7fc1b08cd2600135f0cf98ff53b23d1cc78c (patch)
tree59dd8a6215e44dff4e0f7af7b0c4663177b573f5
parent6b2af67ae1c675eda69bd0995f5e694591160ec5 (diff)
2005-06-16 Colin Walters <walters@verbum.org>
* glib/dbus-gobject.c (funcsig_hash, funcsig_equal): Use n_params to iterate instead of walking to G_TYPE_INVALID. Patch based on a patch from Ryan Gammon.
-rw-r--r--ChangeLog7
-rw-r--r--glib/dbus-gobject.c11
2 files changed, 13 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 2dd32ad9..808dc95c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2005-06-16 Colin Walters <walters@verbum.org>
+ * glib/dbus-gobject.c (funcsig_hash, funcsig_equal): Use n_params
+ to iterate instead of walking to G_TYPE_INVALID.
+
+ Patch based on a patch from Ryan Gammon.
+
+2005-06-16 Colin Walters <walters@verbum.org>
+
* bus/bus.c (bus_context_new): Set parser to NULL
after we unref it (Patch from Chris Boscolo, #2174).
diff --git a/glib/dbus-gobject.c b/glib/dbus-gobject.c
index da5da3b2..8e43155a 100644
--- a/glib/dbus-gobject.c
+++ b/glib/dbus-gobject.c
@@ -1314,11 +1314,12 @@ funcsig_hash (gconstpointer key)
const DBusGFuncSignature *sig = key;
GType *types;
guint ret;
+ guint i;
ret = sig->rettype;
types = sig->params;
- while (*types != G_TYPE_INVALID)
+ for (i = 0; i < sig->n_params; i++)
{
ret += (int) (*types);
types++;
@@ -1335,22 +1336,22 @@ funcsig_equal (gconstpointer aval,
const DBusGFuncSignature *b = bval;
const GType *atypes;
const GType *btypes;
+ guint i, j;
- if (a->rettype != b->rettype)
+ if (a->rettype != b->rettype
+ || a->n_params != b->n_params)
return FALSE;
atypes = a->params;
btypes = b->params;
- while (*atypes != G_TYPE_INVALID)
+ for (i = 0; i < a->n_params; i++)
{
if (*btypes != *atypes)
return FALSE;
atypes++;
btypes++;
}
- if (*btypes != G_TYPE_INVALID)
- return FALSE;
return TRUE;
}