Преглед изворни кода

2002-10-16 Nick Drochak <[email protected]>

	* Enum.cs (Parse): Then fix the code so that it works too.

svn path=/trunk/mcs/; revision=8295
Nick Drochak пре 23 година
родитељ
комит
cb8ee7adaf
2 измењених фајлова са 7 додато и 3 уклоњено
  1. 4 0
      mcs/class/corlib/System/ChangeLog
  2. 3 3
      mcs/class/corlib/System/Enum.cs

+ 4 - 0
mcs/class/corlib/System/ChangeLog

@@ -1,3 +1,7 @@
+2002-10-16  Nick Drochak  <[email protected]>
+
+	* Enum.cs (Parse): Then fix the code so that it works too.
+
 2002-10-15  Nick Drochak  <[email protected]>
 
 	* Enum.cs (Parse): Use unsigned casts to avoid compiler warnings.

+ 3 - 3
mcs/class/corlib/System/Enum.cs

@@ -253,17 +253,17 @@ namespace System {
 							case TypeCode.SByte:
 								// use the unsigned version in the cast to avoid 
 								// compiler warning
-								retVal |= (long)((byte)info.values.GetValue (i));
+								retVal |= (long)((byte)(SByte)info.values.GetValue (i));
 								break;
 							case TypeCode.Int16:
 								// use the unsigned version in the cast to avoid 
 								// compiler warning
-								retVal |= (long)((ushort)info.values.GetValue (i));
+								retVal |= (long)((ushort)(short)info.values.GetValue (i));
 								break;
 							case TypeCode.Int32:
 								// use the unsigned version in the cast to avoid 
 								// compiler warning
-								retVal |= (long)((uint)info.values.GetValue (i));
+								retVal |= (long)((uint)(int)info.values.GetValue (i));
 								break;
 							case TypeCode.Int64:
 								retVal |= (long)info.values.GetValue (i);