mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2025-12-22 23:00:08 +01:00
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.
This commit is contained in:
parent
6b2af67ae1
commit
f5bb7fc1b0
2 changed files with 13 additions and 5 deletions
|
|
@ -1,3 +1,10 @@
|
||||||
|
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>
|
2005-06-16 Colin Walters <walters@verbum.org>
|
||||||
|
|
||||||
* bus/bus.c (bus_context_new): Set parser to NULL
|
* bus/bus.c (bus_context_new): Set parser to NULL
|
||||||
|
|
|
||||||
|
|
@ -1314,11 +1314,12 @@ funcsig_hash (gconstpointer key)
|
||||||
const DBusGFuncSignature *sig = key;
|
const DBusGFuncSignature *sig = key;
|
||||||
GType *types;
|
GType *types;
|
||||||
guint ret;
|
guint ret;
|
||||||
|
guint i;
|
||||||
|
|
||||||
ret = sig->rettype;
|
ret = sig->rettype;
|
||||||
types = sig->params;
|
types = sig->params;
|
||||||
|
|
||||||
while (*types != G_TYPE_INVALID)
|
for (i = 0; i < sig->n_params; i++)
|
||||||
{
|
{
|
||||||
ret += (int) (*types);
|
ret += (int) (*types);
|
||||||
types++;
|
types++;
|
||||||
|
|
@ -1335,22 +1336,22 @@ funcsig_equal (gconstpointer aval,
|
||||||
const DBusGFuncSignature *b = bval;
|
const DBusGFuncSignature *b = bval;
|
||||||
const GType *atypes;
|
const GType *atypes;
|
||||||
const GType *btypes;
|
const GType *btypes;
|
||||||
|
guint i, j;
|
||||||
|
|
||||||
if (a->rettype != b->rettype)
|
if (a->rettype != b->rettype
|
||||||
|
|| a->n_params != b->n_params)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
atypes = a->params;
|
atypes = a->params;
|
||||||
btypes = b->params;
|
btypes = b->params;
|
||||||
|
|
||||||
while (*atypes != G_TYPE_INVALID)
|
for (i = 0; i < a->n_params; i++)
|
||||||
{
|
{
|
||||||
if (*btypes != *atypes)
|
if (*btypes != *atypes)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
atypes++;
|
atypes++;
|
||||||
btypes++;
|
btypes++;
|
||||||
}
|
}
|
||||||
if (*btypes != G_TYPE_INVALID)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue