This commit is contained in:
Araq 2014-11-20 21:39:08 +01:00
commit 57689037c5
3 changed files with 14 additions and 5 deletions

View file

@ -502,7 +502,7 @@ proc foldConv*(n, a: PNode; check = false): PNode =
of tyInt..tyInt64:
case skipTypes(a.typ, abstractRange).kind
of tyFloat..tyFloat64:
result = newIntNodeT(system.toInt(getFloat(a)), n)
result = newIntNodeT(int(getFloat(a)), n)
of tyChar: result = newIntNodeT(getOrdValue(a), n)
else:
result = a

View file

@ -328,7 +328,7 @@ proc opConv*(dest: var TFullReg, src: TFullReg, desttyp, srctyp: PType): bool =
myreset(dest); dest.kind = rkInt
case skipTypes(srctyp, abstractRange).kind
of tyFloat..tyFloat64:
dest.intVal = system.toInt(src.floatVal)
dest.intVal = int(src.floatVal)
else:
dest.intVal = src.intVal
if dest.intVal < firstOrd(desttyp) or dest.intVal > lastOrd(desttyp):
@ -338,7 +338,7 @@ proc opConv*(dest: var TFullReg, src: TFullReg, desttyp, srctyp: PType): bool =
myreset(dest); dest.kind = rkInt
case skipTypes(srctyp, abstractRange).kind
of tyFloat..tyFloat64:
dest.intVal = system.toInt(src.floatVal)
dest.intVal = int(src.floatVal)
else:
dest.intVal = src.intVal and ((1 shl (desttyp.size*8))-1)
of tyFloat..tyFloat64: