mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-12-23 12:05:34 +00:00
generator: remove bitfields from Equals/GetHashCode
This commit is contained in:
parent
f6fef3a402
commit
21c9c9ff8c
|
@ -176,32 +176,18 @@ namespace GtkSharp.Generation
|
|||
equals.Append ("true");
|
||||
|
||||
foreach (StructField field in fields) {
|
||||
if (field.IsPadding || !field.Visible)
|
||||
if (field.IsPadding || !field.Visible || field.IsBitfield)
|
||||
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;
|
||||
equals.Append (" && ");
|
||||
equals.Append (field.EqualityName);
|
||||
equals.Append (".Equals (other.");
|
||||
equals.Append (field.EqualityName);
|
||||
equals.Append (")");
|
||||
hashcode.Append (" ^ ");
|
||||
hashcode.Append (field.EqualityName);
|
||||
hashcode.Append (".GetHashCode ()");
|
||||
}
|
||||
|
||||
need_field = true;
|
||||
equals.Append (" && ");
|
||||
equals.Append (field.EqualityName);
|
||||
equals.Append (".Equals (other.");
|
||||
equals.Append (field.EqualityName);
|
||||
equals.Append (")");
|
||||
hashcode.Append (" ^ ");
|
||||
hashcode.Append (field.EqualityName);
|
||||
hashcode.Append (".GetHashCode ()");
|
||||
}
|
||||
sw.WriteLine ("\t\t\treturn {0};", equals.ToString ());
|
||||
sw.WriteLine ("\t\t}");
|
||||
|
|
Loading…
Reference in a new issue