summaryrefslogtreecommitdiff
path: root/src/bindings/mono/eo_mono
diff options
context:
space:
mode:
authorBruno da Silva Belo <bruno.belo@expertisesolutions.com.br>2019-11-20 16:57:14 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2019-11-20 17:47:44 -0300
commit6772a78d0238ee5fbc04126e9de26c4201e3ef57 (patch)
tree25f5385b518b710f6165cc89bc0f01c5f89e8621 /src/bindings/mono/eo_mono
parent9f67ad59b0cf52fb2fe949c22c366229b4a64409 (diff)
csharp: Specifying StringComparison.
Summary: ref T8405 Reviewers: lauromoura, felipealmeida, YOhoho, segfaultxavi Reviewed By: lauromoura Subscribers: segfaultxavi, cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8405 Differential Revision: https://phab.enlightenment.org/D10650
Diffstat (limited to 'src/bindings/mono/eo_mono')
-rw-r--r--src/bindings/mono/eo_mono/iwrapper.cs11
-rw-r--r--src/bindings/mono/eo_mono/workaround.cs2
2 files changed, 7 insertions, 6 deletions
diff --git a/src/bindings/mono/eo_mono/iwrapper.cs b/src/bindings/mono/eo_mono/iwrapper.cs
index 4e3e2e4486..c84433c23e 100644
--- a/src/bindings/mono/eo_mono/iwrapper.cs
+++ b/src/bindings/mono/eo_mono/iwrapper.cs
@@ -867,16 +867,17 @@ internal static class ClassRegister
867 { 867 {
868 throw new System.InvalidOperationException($"Could not get Native class name. Handle: {klass}"); 868 throw new System.InvalidOperationException($"Could not get Native class name. Handle: {klass}");
869 } 869 }
870 870#pragma warning disable CA1307
871 string name = Eina.StringConversion.NativeUtf8ToManagedString(namePtr) 871 string name = Eina.StringConversion.NativeUtf8ToManagedString(namePtr)
872 .Replace("_", ""); // Convert Efl C name to C# name 872 .Replace("_", ""); // Convert Efl C name to C# name
873#pragma warning restore CA1307
873 874
874 // Check if this is an internal implementation of an abstract class 875 // Check if this is an internal implementation of an abstract class
875 var abstract_impl_suffix = "Realized"; 876 var abstract_impl_suffix = "Realized";
876 if (name.EndsWith(abstract_impl_suffix)) 877 if (name.EndsWith(abstract_impl_suffix, StringComparison.Ordinal))
877 { 878 {
878 name = name.Substring(0, name.Length - abstract_impl_suffix.Length); 879 name = name.Substring(0, name.Length - abstract_impl_suffix.Length);
879 var lastDot = name.LastIndexOf("."); 880 var lastDot = name.LastIndexOf(".", StringComparison.Ordinal);
880 var klassName = name.Substring(lastDot + 1); 881 var klassName = name.Substring(lastDot + 1);
881 name += "+" + klassName + abstract_impl_suffix; // '+' is the separator for nested classes 882 name += "+" + klassName + abstract_impl_suffix; // '+' is the separator for nested classes
882 } 883 }
@@ -885,7 +886,7 @@ internal static class ClassRegister
885 var klass_type = Efl.Eo.Globals.efl_class_type_get(klass); 886 var klass_type = Efl.Eo.Globals.efl_class_type_get(klass);
886 if (klass_type == Efl.Eo.Globals.EflClassType.Interface || klass_type == Efl.Eo.Globals.EflClassType.Mixin) 887 if (klass_type == Efl.Eo.Globals.EflClassType.Interface || klass_type == Efl.Eo.Globals.EflClassType.Mixin)
887 { 888 {
888 var pos = name.LastIndexOf("."); 889 var pos = name.LastIndexOf(".", StringComparison.Ordinal);
889 name = name.Insert(pos + 1, "I"); // -1 if not found, inserts at 0 normally 890 name = name.Insert(pos + 1, "I"); // -1 if not found, inserts at 0 normally
890 } 891 }
891 892
diff --git a/src/bindings/mono/eo_mono/workaround.cs b/src/bindings/mono/eo_mono/workaround.cs
index 107a7cd237..de8ab97efd 100644
--- a/src/bindings/mono/eo_mono/workaround.cs
+++ b/src/bindings/mono/eo_mono/workaround.cs
@@ -44,7 +44,7 @@ internal struct ClassDescription : IEquatable<ClassDescription>
44 /// </summary> 44 /// </summary>
45 /// <returns>A hash code.</returns> 45 /// <returns>A hash code.</returns>
46 public override int GetHashCode() 46 public override int GetHashCode()
47 => version.GetHashCode() ^ name.GetHashCode() 47 => version.GetHashCode() ^ name.GetHashCode(StringComparison.Ordinal)
48 ^ class_type ^ data_size.GetHashCode(); 48 ^ class_type ^ data_size.GetHashCode();
49 49
50 /// <summary>Returns whether this <see cref="ClassDescription" /> 50 /// <summary>Returns whether this <see cref="ClassDescription" />