generator: remove bitfields from Equals/GetHashCode
This commit is contained in:
parent
f6fef3a402
commit
21c9c9ff8c
1 changed files with 11 additions and 25 deletions
|
@ -176,22 +176,9 @@ namespace GtkSharp.Generation
|
||||||
equals.Append ("true");
|
equals.Append ("true");
|
||||||
|
|
||||||
foreach (StructField field in fields) {
|
foreach (StructField field in fields) {
|
||||||
if (field.IsPadding || !field.Visible)
|
if (field.IsPadding || !field.Visible || field.IsBitfield)
|
||||||
continue;
|
continue;
|
||||||
if (field.IsBitfield) {
|
|
||||||
if (need_field) {
|
|
||||||
equals.Append (" && _bitfield");
|
|
||||||
equals.Append (bitfields);
|
|
||||||
equals.Append (".Equals (other._bitfield");
|
|
||||||
equals.Append (bitfields);
|
|
||||||
equals.Append (")");
|
|
||||||
hashcode.Append (" ^ ");
|
|
||||||
hashcode.Append ("_bitfield");
|
|
||||||
hashcode.Append (bitfields++);
|
|
||||||
hashcode.Append (".GetHashCode ()");
|
|
||||||
need_field = false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
need_field = true;
|
need_field = true;
|
||||||
equals.Append (" && ");
|
equals.Append (" && ");
|
||||||
equals.Append (field.EqualityName);
|
equals.Append (field.EqualityName);
|
||||||
|
@ -202,7 +189,6 @@ namespace GtkSharp.Generation
|
||||||
hashcode.Append (field.EqualityName);
|
hashcode.Append (field.EqualityName);
|
||||||
hashcode.Append (".GetHashCode ()");
|
hashcode.Append (".GetHashCode ()");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
sw.WriteLine ("\t\t\treturn {0};", equals.ToString ());
|
sw.WriteLine ("\t\t\treturn {0};", equals.ToString ());
|
||||||
sw.WriteLine ("\t\t}");
|
sw.WriteLine ("\t\t}");
|
||||||
sw.WriteLine ();
|
sw.WriteLine ();
|
||||||
|
|
Loading…
Add table
Reference in a new issue