From b9debfe3bf636e58521504744adf90361930c6ea Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Tue, 18 Feb 2020 08:41:14 -0800 Subject: [PATCH] Made GetHashCode public for primitives --- BeefLibs/corlib/src/Boolean.bf | 2 +- BeefLibs/corlib/src/Char16.bf | 2 +- BeefLibs/corlib/src/Char32.bf | 2 +- BeefLibs/corlib/src/Char8.bf | 2 +- BeefLibs/corlib/src/Double.bf | 2 +- BeefLibs/corlib/src/Float.bf | 2 +- BeefLibs/corlib/src/Int.bf | 2 +- BeefLibs/corlib/src/Int16.bf | 2 +- BeefLibs/corlib/src/Int32.bf | 2 +- BeefLibs/corlib/src/Int64.bf | 2 +- BeefLibs/corlib/src/Int8.bf | 2 +- BeefLibs/corlib/src/UInt.bf | 2 +- BeefLibs/corlib/src/UInt16.bf | 2 +- BeefLibs/corlib/src/UInt32.bf | 2 +- BeefLibs/corlib/src/UInt64.bf | 2 +- BeefLibs/corlib/src/UInt8.bf | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/BeefLibs/corlib/src/Boolean.bf b/BeefLibs/corlib/src/Boolean.bf index 1aa83484..eea5a28c 100644 --- a/BeefLibs/corlib/src/Boolean.bf +++ b/BeefLibs/corlib/src/Boolean.bf @@ -7,7 +7,7 @@ namespace System strBuffer.Append(((bool)this) ? "true" : "false"); } - int IHashable.GetHashCode() + public int GetHashCode() { return ((bool)this) ? 1 : 0; } diff --git a/BeefLibs/corlib/src/Char16.bf b/BeefLibs/corlib/src/Char16.bf index 6ae18e43..d9b791bd 100644 --- a/BeefLibs/corlib/src/Char16.bf +++ b/BeefLibs/corlib/src/Char16.bf @@ -14,7 +14,7 @@ namespace System internal const char16 HIGH_SURROGATE_END = (char16)0xdbff; internal const char16 LOW_SURROGATE_START = (char16)0xdc00; - int IHashable.GetHashCode() + public int GetHashCode() { return (int)this; } diff --git a/BeefLibs/corlib/src/Char32.bf b/BeefLibs/corlib/src/Char32.bf index cbff99f7..b519cbb7 100644 --- a/BeefLibs/corlib/src/Char32.bf +++ b/BeefLibs/corlib/src/Char32.bf @@ -2,7 +2,7 @@ namespace System { struct Char32 : char32, IHashable { - int IHashable.GetHashCode() + public int GetHashCode() { return (int)this; } diff --git a/BeefLibs/corlib/src/Char8.bf b/BeefLibs/corlib/src/Char8.bf index 3cbb039f..f665d87a 100644 --- a/BeefLibs/corlib/src/Char8.bf +++ b/BeefLibs/corlib/src/Char8.bf @@ -109,7 +109,7 @@ namespace System } } - int IHashable.GetHashCode() + public int GetHashCode() { return (int32)this; } diff --git a/BeefLibs/corlib/src/Double.bf b/BeefLibs/corlib/src/Double.bf index 7ba64dd4..9a2394c0 100644 --- a/BeefLibs/corlib/src/Double.bf +++ b/BeefLibs/corlib/src/Double.bf @@ -33,7 +33,7 @@ namespace System return (double)value; } - int IHashable.GetHashCode() + public int GetHashCode() { double d = (double)this; if (d == 0) diff --git a/BeefLibs/corlib/src/Float.bf b/BeefLibs/corlib/src/Float.bf index 84b95ab9..f332a427 100644 --- a/BeefLibs/corlib/src/Float.bf +++ b/BeefLibs/corlib/src/Float.bf @@ -32,7 +32,7 @@ namespace System } }*/ - int IHashable.GetHashCode() + public int GetHashCode() { var val = (float)this; return *(int32*)(&val); diff --git a/BeefLibs/corlib/src/Int.bf b/BeefLibs/corlib/src/Int.bf index 12614db5..ad11b7a0 100644 --- a/BeefLibs/corlib/src/Int.bf +++ b/BeefLibs/corlib/src/Int.bf @@ -26,7 +26,7 @@ namespace System return (SelfBase)value; } - int IHashable.GetHashCode() + public int GetHashCode() { return (int)this; } diff --git a/BeefLibs/corlib/src/Int16.bf b/BeefLibs/corlib/src/Int16.bf index b1dba83b..379d00d6 100644 --- a/BeefLibs/corlib/src/Int16.bf +++ b/BeefLibs/corlib/src/Int16.bf @@ -20,7 +20,7 @@ namespace System return (SelfBase)value; } - int IHashable.GetHashCode() + public int GetHashCode() { return (int)this; } diff --git a/BeefLibs/corlib/src/Int32.bf b/BeefLibs/corlib/src/Int32.bf index 7416fc6f..40edb415 100644 --- a/BeefLibs/corlib/src/Int32.bf +++ b/BeefLibs/corlib/src/Int32.bf @@ -29,7 +29,7 @@ namespace System return (SelfBase)value; } - int IHashable.GetHashCode() + public int GetHashCode() { return (int)this; } diff --git a/BeefLibs/corlib/src/Int64.bf b/BeefLibs/corlib/src/Int64.bf index 0977aa8a..300672df 100644 --- a/BeefLibs/corlib/src/Int64.bf +++ b/BeefLibs/corlib/src/Int64.bf @@ -30,7 +30,7 @@ namespace System return -(SelfBase)value; } - int IHashable.GetHashCode() + public int GetHashCode() { return (int)(int64)this; } diff --git a/BeefLibs/corlib/src/Int8.bf b/BeefLibs/corlib/src/Int8.bf index 8b524168..2ca5fe10 100644 --- a/BeefLibs/corlib/src/Int8.bf +++ b/BeefLibs/corlib/src/Int8.bf @@ -20,7 +20,7 @@ namespace System return (SelfBase)value; } - int IHashable.GetHashCode() + public int GetHashCode() { return (int)this; } diff --git a/BeefLibs/corlib/src/UInt.bf b/BeefLibs/corlib/src/UInt.bf index 113440b2..43d48847 100644 --- a/BeefLibs/corlib/src/UInt.bf +++ b/BeefLibs/corlib/src/UInt.bf @@ -27,7 +27,7 @@ namespace System return (SelfBase)lhs + (SelfBase)rhs; } - int IHashable.GetHashCode() + public int GetHashCode() { return (int)this; } diff --git a/BeefLibs/corlib/src/UInt16.bf b/BeefLibs/corlib/src/UInt16.bf index 6a674324..1664dc87 100644 --- a/BeefLibs/corlib/src/UInt16.bf +++ b/BeefLibs/corlib/src/UInt16.bf @@ -20,7 +20,7 @@ namespace System return (SelfBase)value; } - int IHashable.GetHashCode() + public int GetHashCode() { return (int)this; } diff --git a/BeefLibs/corlib/src/UInt32.bf b/BeefLibs/corlib/src/UInt32.bf index eb89137b..0da00fc9 100644 --- a/BeefLibs/corlib/src/UInt32.bf +++ b/BeefLibs/corlib/src/UInt32.bf @@ -22,7 +22,7 @@ namespace System return (SelfBase)lhs + (SelfBase)rhs; } - int IHashable.GetHashCode() + public int GetHashCode() { return (int)this; } diff --git a/BeefLibs/corlib/src/UInt64.bf b/BeefLibs/corlib/src/UInt64.bf index 94f6d7d7..44ed8c10 100644 --- a/BeefLibs/corlib/src/UInt64.bf +++ b/BeefLibs/corlib/src/UInt64.bf @@ -24,7 +24,7 @@ namespace System return (SelfBase)lhs + (SelfBase)rhs; } - int IHashable.GetHashCode() + public int GetHashCode() { return (int)this; } diff --git a/BeefLibs/corlib/src/UInt8.bf b/BeefLibs/corlib/src/UInt8.bf index ea7610b8..241007e1 100644 --- a/BeefLibs/corlib/src/UInt8.bf +++ b/BeefLibs/corlib/src/UInt8.bf @@ -20,7 +20,7 @@ namespace System return (SelfBase)value; } - int IHashable.GetHashCode() + public int GetHashCode() { return (int)this; }