summaryrefslogtreecommitdiff
path: root/src/bin/eolian_mono/eolian/mono/struct_definition.hh
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2019-11-20 18:34:08 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2019-11-20 18:34:08 -0300
commit0c9ddb0f345c400e6d7db1a38123a9a0d2fb27bb (patch)
treec752a4dba31227ac00591e393084de871007f31d /src/bin/eolian_mono/eolian/mono/struct_definition.hh
parent6772a78d0238ee5fbc04126e9de26c4201e3ef57 (diff)
csharp: CA1307 Add CultureInfo to generated code.
Summary: For the struct fields with strings when implementing `GetHashCode`. Ref T8405 Reviewers: brunobelo, felipealmeida, YOhoho Reviewed By: brunobelo Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8405 Differential Revision: https://phab.enlightenment.org/D10696
Diffstat (limited to 'src/bin/eolian_mono/eolian/mono/struct_definition.hh')
-rw-r--r--src/bin/eolian_mono/eolian/mono/struct_definition.hh5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/struct_definition.hh b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
index 973eb27149..70332c9889 100644
--- a/src/bin/eolian_mono/eolian/mono/struct_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
@@ -29,6 +29,7 @@
29#include "documentation.hh" 29#include "documentation.hh"
30#include "struct_fields.hh" 30#include "struct_fields.hh"
31#include "blacklist.hh" 31#include "blacklist.hh"
32#include "culture_info.hh"
32 33
33namespace eolian_mono { 34namespace eolian_mono {
34 35
@@ -485,7 +486,6 @@ struct struct_definition_generator
485 indent << scope_tab << "/// <summary>Get a hash code for this item.\n" 486 indent << scope_tab << "/// <summary>Get a hash code for this item.\n"
486 << since_line 487 << since_line
487 << indent << scope_tab << "/// </summary>\n" 488 << indent << scope_tab << "/// </summary>\n"
488 << "#pragma warning disable CA1307\n"
489 << indent << scope_tab << "public override int GetHashCode()\n" 489 << indent << scope_tab << "public override int GetHashCode()\n"
490 << indent << scope_tab << "{\n" 490 << indent << scope_tab << "{\n"
491 ).generate(sink, attributes::unused, context)) 491 ).generate(sink, attributes::unused, context))
@@ -500,7 +500,7 @@ struct struct_definition_generator
500 // return hash 500 // return hash
501 if (!as_generator( 501 if (!as_generator(
502 indent << scope_tab << scope_tab << "int hash = 17;\n" 502 indent << scope_tab << scope_tab << "int hash = 17;\n"
503 << *(indent << scope_tab << scope_tab << "hash = hash * 23 + " << name_helpers::struct_field_name << ".GetHashCode();\n") 503 << *(grammar::attribute_reorder<-1, -1>(indent << scope_tab << scope_tab << "hash = hash * 23 + " << name_helpers::struct_field_name << ".GetHashCode(" << culture_info << ");\n"))
504 << indent << scope_tab << scope_tab << "return hash;\n" 504 << indent << scope_tab << scope_tab << "return hash;\n"
505 ).generate(sink, struct_.fields, context)) 505 ).generate(sink, struct_.fields, context))
506 return false; 506 return false;
@@ -516,7 +516,6 @@ struct struct_definition_generator
516 516
517 if (!as_generator( 517 if (!as_generator(
518 indent << scope_tab << "}\n" 518 indent << scope_tab << "}\n"
519 << "#pragma warning restore CA1307\n\n"
520 ).generate(sink, attributes::unused, context)) 519 ).generate(sink, attributes::unused, context))
521 return false; 520 return false;
522 521