gobject-introspection r946 - in trunk: . girepository



Author: walters
Date: Tue Nov 18 18:42:36 2008
New Revision: 946
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=946&view=rev

Log:
Use sizeof() instead of hard-coding struct sizes

Modified:
   trunk/ChangeLog
   trunk/girepository/girnode.c

Modified: trunk/girepository/girnode.c
==============================================================================
--- trunk/girepository/girnode.c	(original)
+++ trunk/girepository/girnode.c	Tue Nov 18 18:42:36 2008
@@ -1576,8 +1576,8 @@
 	signature = *offset2;
 	n = g_list_length (function->parameters);
 
-	*offset += 16;
-	*offset2 += 8 + n * 12;
+	*offset += sizeof(FunctionBlob);
+	*offset2 += sizeof(SignatureBlob) + n * sizeof(ArgBlob);
 
 	blob->blob_type = BLOB_TYPE_FUNCTION;
 	blob->deprecated = function->deprecated;
@@ -1628,8 +1628,8 @@
 	signature = *offset2;
 	n = g_list_length (function->parameters);
 
-	*offset += 12;
-	*offset2 += 8 + n * 12;
+	*offset += sizeof(CallbackBlob);
+	*offset2 += sizeof(SignatureBlob) + n * sizeof(ArgBlob);
 
 	blob->blob_type = BLOB_TYPE_CALLBACK;
 	blob->deprecated = function->deprecated;
@@ -1671,8 +1671,8 @@
 	signature = *offset2;
 	n = g_list_length (signal->parameters);
 
-	*offset += 12;
-	*offset2 += 8 + n * 12;
+	*offset += sizeof(SignalBlob);
+	*offset2 += sizeof(SignatureBlob) + n * sizeof(ArgBlob);
 
 	blob->deprecated = signal->deprecated;
 	blob->run_first = signal->run_first;
@@ -1722,8 +1722,8 @@
 	signature = *offset2;
 	n = g_list_length (vfunc->parameters);
 
-	*offset += 16;
-	*offset2 += 8 + n * 12;
+	*offset += sizeof(VFuncBlob);
+	*offset2 += sizeof(SignatureBlob) + n * sizeof(ArgBlob);
 
 	blob->name = write_string (node->name, strings, data, offset2);
 	blob->must_chain_up = 0; /* FIXME */



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