Do not check padding ABI offset correctness

As it will break the test build as soon as the padding
starts actually being used.
This commit is contained in:
Thibault Saunier 2017-11-30 21:59:07 -03:00 committed by Harry
parent c980ef4f90
commit 939111a348
4 changed files with 11 additions and 2 deletions

View file

@ -1005,4 +1005,8 @@
<move-node path="/api/namespace/class[@cname='GtkGlobal']/method[@name='PaintVline']">/api/namespace/object[@cname='GtkStyle']</move-node>
<remove-node path="/api/namespace/struct[@cname='IconSize']" />
<remove-node path="/api/namespace/struct[@cname='Range']" />
<!-- Mark reserved fields as padding -->
<attr path="//*[contains(@cname, 'gtk_reserved')]" name="padding">true</attr>
<attr path="//*[contains(@vm, 'gtk_reserved')]" name="padding">true</attr>
</metadata>

View file

@ -182,6 +182,7 @@
<xs:element name="method" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:attribute name="vm" type="xs:string" use="optional"/>
<xs:attribute name="padding" type="xs:string" use="optional"/>
<xs:attribute name="signal_vm" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
@ -211,6 +212,7 @@
<xs:complexType name="fieldType">
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="cname" type="xs:string"/>
<xs:attribute name="padding" type="xs:boolean" use="optional"/>
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="array" type="xs:boolean" use="optional"/>
<xs:attribute name="array_len" type="xs:positiveInteger" use="optional"/>

View file

@ -252,8 +252,11 @@ namespace GtkSharp.Generation {
var field = _fields[i];
next = _fields.Count > i +1 ? _fields[i + 1] : null;
prev = field.Generate(gen_info, "\t\t\t\t\t", prev, next, cs_parent_struct,
field_alignment_structures_writer);
if (field.IsPadding)
continue;
var union = field as UnionABIField;
if (union == null && gen_info.CAbiWriter != null && !field.IsBitfield) {
gen_info.AbiWriter.WriteLine("\t\t\tConsole.WriteLine(\"\\\"{0}.{3}\\\": \\\"\" + {1}.{2}." + info_name + ".GetFieldOffset(\"{3}\") + \"\\\"\");", structname, NS, Name, field.CName);

View file

@ -152,8 +152,8 @@ namespace GtkSharp.Generation {
public bool IsPadding {
get {
if (elem.GetAttributeAsBoolean ("is-padding"))
return elem.GetAttributeAsBoolean ("is-padding");
if (elem.GetAttributeAsBoolean ("padding"))
return elem.GetAttributeAsBoolean ("padding");
return (elem.GetAttribute ("access") == "private" && (
CName.StartsWith ("dummy") || CName.StartsWith ("padding")));