Ticket #53: enum_uint32.patch
File enum_uint32.patch, 1.1 KB (added by khjklujn, 16 years ago) |
---|
-
Enums.cobra
32 32 clrType = (_nativeType to ClrType).theClrType # TODO: fix native 33 33 isByte = Enum.getUnderlyingType(clrType).name == 'Byte' 34 34 is64 = Enum.getUnderlyingType(clrType).name == 'Int64' 35 isU32 = Enum.getUnderlyingType(clrType).name == 'UInt32' 36 isU64 = Enum.getUnderlyingType(clrType).name == 'UInt64' 35 37 values = Enum.getValues(clrType) 36 38 i = 0 37 39 for name in Enum.getNames(clrType) … … 44 46 intValue = int.parse((value to Int64).toString) 45 47 catch OverflowException 46 48 intValue = 999 # CC: omg. but probably doesn't affect anything. we're reading the DLL here, not creating one 49 else if isU32 50 try 51 intValue = int.parse((value to UInt32).toString) 52 catch OverflowException 53 intValue = 2147483647 54 else if isU64 55 try 56 intValue = int.parse((value to UInt64).toString) 57 catch OverflowException 58 intValue = 2147483647 47 59 else 48 60 intValue = value to int 49 61 member = EnumMember(name, intValue)