gobject-introspection r877 - in trunk: . girepository tests tests/scanner tools
- From: otaylor svn gnome org
- To: svn-commits-list gnome org
- Subject: gobject-introspection r877 - in trunk: . girepository tests tests/scanner tools
- Date: Tue, 11 Nov 2008 05:10:47 +0000 (UTC)
Author: otaylor
Date: Tue Nov 11 05:10:47 2008
New Revision: 877
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=877&view=rev
Log:
Remove field offsets from g-ir-generate output and test inputs
Field offsets are a) architecture dependent so they shouldn't be part
of the architecture-independent gir format which is installed in
datadir. b) Are architecture-dependent so they shouldn't be in test
expected output. Remove field offsets from girs.
(Virtual function and discriminator offsets are not removed, as they
aren't fully hooked up to the field-offset computation machinery yet.)
Modified:
trunk/ChangeLog
trunk/girepository/girparser.c
trunk/tests/boxed.gir
trunk/tests/scanner/annotation-1.0-expected.tgir
trunk/tests/scanner/drawable-1.0-expected.tgir
trunk/tests/scanner/drawable-injected-1.0-expected.tgir
trunk/tests/scanner/foo-1.0-expected.tgir
trunk/tests/scanner/utility-1.0-expected.tgir
trunk/tests/struct.gir
trunk/tests/union.gir
trunk/tools/generate.c
Modified: trunk/girepository/girparser.c
==============================================================================
--- trunk/girepository/girparser.c (original)
+++ trunk/girepository/girparser.c Tue Nov 11 05:10:47 2008
@@ -892,7 +892,6 @@
writable = find_attribute ("writable", attribute_names, attribute_values);
bits = find_attribute ("bits", attribute_names, attribute_values);
branch = find_attribute ("branch", attribute_names, attribute_values);
- offset = find_attribute ("offset", attribute_names, attribute_values);
if (name == NULL)
{
@@ -914,11 +913,6 @@
else
field->bits = 0;
- if (offset)
- field->offset = atoi (offset);
- else
- field->offset = 0;
-
switch (ctx->current_node->type)
{
case G_IR_NODE_OBJECT:
Modified: trunk/tests/boxed.gir
==============================================================================
--- trunk/tests/boxed.gir (original)
+++ trunk/tests/boxed.gir Tue Nov 11 05:10:47 2008
@@ -5,13 +5,13 @@
xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
<namespace name="Foo" version="1.0">
<glib:boxed glib:name="BoxedType1" glib:type-name="boxed1" glib:get-type="boxed1_get_type" deprecated="1">
- <field name="field1" writable="1" offset="0">
+ <field name="field1" writable="1">
<type name="uint32"/>
</field>
- <field name="field2" writable="1" offset="4">
+ <field name="field2" writable="1">
<type name="uint32"/>
</field>
- <field name="field3" writable="1" offset="8">
+ <field name="field3" writable="1">
<type name="uint32"/>
</field>
<method name="frob_boxed1" c:identifier="frob_boxed1">
Modified: trunk/tests/scanner/annotation-1.0-expected.tgir
==============================================================================
--- trunk/tests/scanner/annotation-1.0-expected.tgir (original)
+++ trunk/tests/scanner/annotation-1.0-expected.tgir Tue Nov 11 05:10:47 2008
@@ -32,7 +32,7 @@
</parameters>
</callback>
<class name="Object" parent="GObject.Object" glib:type-name="AnnotationObject" glib:get-type="annotation_object_get_type">
- <field name="parent_instance" offset="0">
+ <field name="parent_instance">
<type name="GObject.Object"/>
</field>
<method name="method" c:identifier="annotation_object_method">
@@ -193,7 +193,7 @@
</method>
</class>
<record name="ObjectClass">
- <field name="parent_class" offset="0">
+ <field name="parent_class">
<type name="GObject.ObjectClass"/>
</field>
</record>
Modified: trunk/tests/scanner/drawable-1.0-expected.tgir
==============================================================================
--- trunk/tests/scanner/drawable-1.0-expected.tgir (original)
+++ trunk/tests/scanner/drawable-1.0-expected.tgir Tue Nov 11 05:10:47 2008
@@ -8,7 +8,7 @@
<include name="GLib" version="2.0"/>
<namespace name="drawable" version="1.0" shared-library="drawable">
<class name="TestDrawable" parent="GObject.Object" abstract="1" glib:type-name="TestDrawable" glib:get-type="test_drawable_get_type">
- <field name="parent_instance" offset="0">
+ <field name="parent_instance">
<type name="GObject.Object"/>
</field>
<method name="do_foo" c:identifier="test_drawable_do_foo">
@@ -59,12 +59,12 @@
</method>
</class>
<record name="TestDrawableClass">
- <field name="parent_class" offset="0">
+ <field name="parent_class">
<type name="GObject.ObjectClass"/>
</field>
</record>
<record name="TestPixmapObjectClass">
- <field name="parent_class" offset="0">
+ <field name="parent_class">
<type name="TestDrawableClass"/>
</field>
</record>
Modified: trunk/tests/scanner/drawable-injected-1.0-expected.tgir
==============================================================================
--- trunk/tests/scanner/drawable-injected-1.0-expected.tgir (original)
+++ trunk/tests/scanner/drawable-injected-1.0-expected.tgir Tue Nov 11 05:10:47 2008
@@ -8,7 +8,7 @@
<include name="GLib" version="2.0"/>
<namespace name="drawable" version="1.0" shared-library="drawable">
<class name="TestDrawable" parent="GObject.Object" abstract="1" glib:type-name="TestDrawable" glib:get-type="test_drawable_get_type">
- <field name="parent_instance" offset="0">
+ <field name="parent_instance">
<type name="GObject.Object"/>
</field>
<method name="do_foo" c:identifier="test_drawable_do_foo">
@@ -64,12 +64,12 @@
</method>
</class>
<record name="TestDrawableClass">
- <field name="parent_class" offset="0">
+ <field name="parent_class">
<type name="GObject.ObjectClass"/>
</field>
</record>
<record name="TestPixmapObjectClass">
- <field name="parent_class" offset="0">
+ <field name="parent_class">
<type name="TestDrawableClass"/>
</field>
</record>
Modified: trunk/tests/scanner/foo-1.0-expected.tgir
==============================================================================
--- trunk/tests/scanner/foo-1.0-expected.tgir (original)
+++ trunk/tests/scanner/foo-1.0-expected.tgir Tue Nov 11 05:10:47 2008
@@ -9,13 +9,13 @@
<namespace name="foo" version="1.0" shared-library="foo">
<interface name="Interface" glib:type-name="FooInterface" glib:get-type="foo_interface_get_type"/>
<record name="InterfaceIface">
- <field name="parent_iface" offset="0">
+ <field name="parent_iface">
<type name="GObject.TypeInterface"/>
</field>
</record>
<class name="Object" parent="GObject.Object" glib:type-name="FooObject" glib:get-type="foo_object_get_type">
<implements name="Interface"/>
- <field name="parent_instance" offset="0">
+ <field name="parent_instance">
<type name="GObject.Object"/>
</field>
<constructor name="new" c:identifier="foo_object_new">
@@ -111,13 +111,13 @@
</glib:signal>
</class>
<record name="ObjectClass">
- <field name="parent_class" offset="0">
+ <field name="parent_class">
<type name="GObject.ObjectClass"/>
</field>
</record>
<class name="Subobject" parent="Object" abstract="1" glib:type-name="FooSubobject" glib:get-type="foo_subobject_get_type">
<implements name="Interface"/>
- <field name="parent_instance" offset="0">
+ <field name="parent_instance">
<type name="GObject.Object"/>
</field>
<constructor name="new" c:identifier="foo_subobject_new">
@@ -127,7 +127,7 @@
</constructor>
</class>
<record name="SubobjectClass">
- <field name="parent_class" offset="0">
+ <field name="parent_class">
<type name="GObject.ObjectClass"/>
</field>
</record>
@@ -213,25 +213,25 @@
</parameters>
</callback>
<record name="Struct">
- <field name="priv" writable="1" offset="0">
+ <field name="priv" writable="1">
<type name="StructPrivate"/>
</field>
- <field name="member" writable="1" offset="0">
+ <field name="member" writable="1">
<type name="int"/>
</field>
</record>
<record name="StructPrivate"/>
<record name="Rectangle">
- <field name="x" writable="1" offset="0">
+ <field name="x" writable="1">
<type name="int"/>
</field>
- <field name="y" writable="1" offset="0">
+ <field name="y" writable="1">
<type name="int"/>
</field>
- <field name="width" writable="1" offset="0">
+ <field name="width" writable="1">
<type name="int"/>
</field>
- <field name="height" writable="1" offset="0">
+ <field name="height" writable="1">
<type name="int"/>
</field>
</record>
@@ -287,34 +287,34 @@
</parameters>
</function>
<record name="EventAny">
- <field name="send_event" writable="1" offset="0">
+ <field name="send_event" writable="1">
<type name="int8"/>
</field>
</record>
<record name="EventExpose">
- <field name="send_event" writable="1" offset="0">
+ <field name="send_event" writable="1">
<type name="int8"/>
</field>
- <field name="count" writable="1" offset="0">
+ <field name="count" writable="1">
<type name="int"/>
</field>
</record>
<union name="Event">
- <field name="type" writable="1" offset="0">
+ <field name="type" writable="1">
<type name="int"/>
</field>
- <field name="any" writable="1" offset="0">
+ <field name="any" writable="1">
<type name="EventAny"/>
</field>
- <field name="expose" writable="1" offset="0">
+ <field name="expose" writable="1">
<type name="EventExpose"/>
</field>
</union>
<record name="BRect" glib:type-name="FooBRect" glib:get-type="foo_brect_get_type">
- <field name="x" writable="1" offset="0">
+ <field name="x" writable="1">
<type name="double"/>
</field>
- <field name="y" writable="1" offset="0">
+ <field name="y" writable="1">
<type name="double"/>
</field>
<constructor name="new" c:identifier="foo_brect_new">
@@ -342,13 +342,13 @@
</method>
</record>
<union name="BUnion" type-name="FooBUnion" get-type="foo_bunion_get_type">
- <field name="type" writable="1" offset="0">
+ <field name="type" writable="1">
<type name="int"/>
</field>
- <field name="v" writable="1" offset="0">
+ <field name="v" writable="1">
<type name="double"/>
</field>
- <field name="rect" writable="1" offset="0">
+ <field name="rect" writable="1">
<type name="BRect"/>
</field>
<constructor name="new" c:identifier="foo_bunion_new">
@@ -363,7 +363,7 @@
</method>
</union>
<union name="Union">
- <field name="foo" writable="1" offset="0">
+ <field name="foo" writable="1">
<type name="int"/>
</field>
</union>
Modified: trunk/tests/scanner/utility-1.0-expected.tgir
==============================================================================
--- trunk/tests/scanner/utility-1.0-expected.tgir (original)
+++ trunk/tests/scanner/utility-1.0-expected.tgir Tue Nov 11 05:10:47 2008
@@ -7,12 +7,12 @@
<include name="GLib" version="2.0"/>
<namespace name="utility" version="1.0" shared-library="utility">
<class name="Object" parent="GObject.Object" glib:type-name="UtilityObject" glib:get-type="utility_object_get_type">
- <field name="parent_instance" offset="0">
+ <field name="parent_instance">
<type name="GObject.Object"/>
</field>
</class>
<record name="ObjectClass">
- <field name="parent_class" offset="0">
+ <field name="parent_class">
<type name="GObject.ObjectClass"/>
</field>
</record>
@@ -27,29 +27,29 @@
<member name="c" value="2"/>
</enumeration>
<record name="Struct">
- <field name="field" writable="1" offset="0">
+ <field name="field" writable="1">
<type name="int"/>
</field>
- <field name="bitfield1" writable="1" offset="0">
+ <field name="bitfield1" writable="1">
<type name="uint"/>
</field>
- <field name="bitfield2" writable="1" offset="0">
+ <field name="bitfield2" writable="1">
<type name="uint"/>
</field>
- <field name="data" writable="1" offset="0">
+ <field name="data" writable="1">
<array fixed-size="16">
<type name="uint8"/>
</array>
</field>
</record>
<union name="Union">
- <field name="pointer" writable="1" offset="0">
+ <field name="pointer" writable="1">
<type name="utf8"/>
</field>
- <field name="integer" writable="1" offset="0">
+ <field name="integer" writable="1">
<type name="long"/>
</field>
- <field name="real" writable="1" offset="0">
+ <field name="real" writable="1">
<type name="double"/>
</field>
</union>
Modified: trunk/tests/struct.gir
==============================================================================
--- trunk/tests/struct.gir (original)
+++ trunk/tests/struct.gir Tue Nov 11 05:10:47 2008
@@ -5,27 +5,27 @@
xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
<namespace name="Foo" version="1.0">
<record name="FooStruct">
- <field name="foo_int" writable="1" offset="0">
+ <field name="foo_int" writable="1">
<type name="int"/>
</field>
- <field name="foo_int64" writable="1" offset="4">
+ <field name="foo_int64" writable="1">
<type name="int64"/>
</field>
- <field name="foo_uint" writable="1" offset="12">
+ <field name="foo_uint" writable="1">
<type name="uint"/>
</field>
- <field name="foo_uint64" writable="1" offset="16">
+ <field name="foo_uint64" writable="1">
<type name="uint64"/>
</field>
- <field name="string" writable="1" offset="24">
+ <field name="string" writable="1">
<type name="utf8"/>
</field>
</record>
<record name="FooStruct2">
- <field name="sub" writable="1" offset="0">
+ <field name="sub" writable="1">
<type name="FooStruct"/>
</field>
- <field name="string" writable="1" offset="24">
+ <field name="string" writable="1">
<type name="utf8"/>
</field>
</record>
Modified: trunk/tests/union.gir
==============================================================================
--- trunk/tests/union.gir (original)
+++ trunk/tests/union.gir Tue Nov 11 05:10:47 2008
@@ -6,12 +6,12 @@
<namespace name="Foo" version="1.0">
<union name="union1" type-name="UnionType1" get-type="union1_get_type">
<discriminator offset="-4" type="gint" />
- <field name="field1" readable="1" writable="1" offset="0" type="guint32" branch="0" />
- <field name="field1" readable="1" writable="1" offset="0" type="gdouble" branch="1" />
+ <field name="field1" readable="1" writable="1" type="guint32" branch="0" />
+ <field name="field1" readable="1" writable="1" type="gdouble" branch="1" />
</union>
<union name="union2" type-name="UnionType1" get-type="union1_get_type">
- <field name="field1" readable="1" writable="1" offset="0" type="guint32" />
- <field name="field1" readable="1" writable="1" offset="0" type="gdouble" />
+ <field name="field1" readable="1" writable="1" type="guint32" />
+ <field name="field1" readable="1" writable="1" type="gdouble" />
</union>
</namespace>
</repository>
Modified: trunk/tools/generate.c
==============================================================================
--- trunk/tools/generate.c (original)
+++ trunk/tools/generate.c Tue Nov 11 05:10:47 2008
@@ -354,8 +354,6 @@
if (size)
xml_printf (file, " bits=\"%d\"", size);
- xml_printf (file, " offset=\"%d\"", offset);
-
type = g_field_info_get_type (info);
if (branch)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]