gobject-introspection r475 - trunk/girepository



Author: walters
Date: Sat Aug 23 21:30:01 2008
New Revision: 475
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=475&view=rev

Log:
Redo signature_offset to be cleaner and correct for vfuncs


Modified:
   trunk/girepository/ginfo.c

Modified: trunk/girepository/ginfo.c
==============================================================================
--- trunk/girepository/ginfo.c	(original)
+++ trunk/girepository/ginfo.c	Sat Aug 23 21:30:01 2008
@@ -515,16 +515,24 @@
 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;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]