diff options
author | Araq <rumpf_a@web.de> | 2014-11-20 21:39:08 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-11-20 21:39:08 +0100 |
commit | 57689037c54056dec22bab9084a9a501d4521440 (patch) | |
tree | 22bc5dcda7a09c538627e6f988b034ca1be0a6f8 /compiler | |
parent | 0e7220ff9ceaa54fa873aac555fc779ea415ebea (diff) | |
download | Nim-57689037c54056dec22bab9084a9a501d4521440.tar.gz |
fixes #916
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/semfold.nim | 2 | ||||
-rw-r--r-- | compiler/vm.nim | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/semfold.nim b/compiler/semfold.nim index 76ac23e0d..ba7f3cabd 100644 --- a/compiler/semfold.nim +++ b/compiler/semfold.nim @@ -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 diff --git a/compiler/vm.nim b/compiler/vm.nim index f75db56b8..3d2ddfc82 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -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: |