mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-28 13:12:10 +01:00
Redo signature_offset to be cleaner and correct for vfuncs
svn path=/trunk/; revision=475
This commit is contained in:
parent
4c2a09226b
commit
5daf51a580
14
ginfo.c
14
ginfo.c
@ -515,16 +515,24 @@ g_function_info_get_vfunc (GIFunctionInfo *info)
|
||||
static guint32
|
||||
signature_offset (GICallableInfo *info)
|
||||
{
|
||||
int sigoff = -1;
|
||||
switch (info->base.type)
|
||||
{
|
||||
case GI_INFO_TYPE_FUNCTION:
|
||||
sigoff = G_STRUCT_OFFSET (FunctionBlob, signature);
|
||||
break;
|
||||
case GI_INFO_TYPE_VFUNC:
|
||||
return *(guint32 *)&info->base.typelib->data[info->base.offset + 12];
|
||||
sigoff = G_STRUCT_OFFSET (VFuncBlob, signature);
|
||||
break;
|
||||
case GI_INFO_TYPE_CALLBACK:
|
||||
sigoff = G_STRUCT_OFFSET (CallbackBlob, signature);
|
||||
break;
|
||||
case GI_INFO_TYPE_SIGNAL:
|
||||
return *(guint32 *)&info->base.typelib->data[info->base.offset + 8];
|
||||
sigoff = G_STRUCT_OFFSET (SignalBlob, signature);
|
||||
break;
|
||||
}
|
||||
|
||||
if (sigoff >= 0)
|
||||
return *(guint32 *)&info->base.typelib->data[info->base.offset + sigoff];
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user