mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-24 20:05:08 +00:00
improve style
This commit is contained in:
@@ -776,11 +776,11 @@ proc genCastIntFloat(c: PCtx; n: PNode; dest: var TDest) =
|
||||
let src = n.sons[1].typ.skipTypes(abstractRange)#.kind
|
||||
let dst = n.sons[0].typ.skipTypes(abstractRange)#.kind
|
||||
let src_size = getSize(c.config, src)
|
||||
|
||||
let dst_size = getSize(c.config, dst)
|
||||
if c.config.target.intSize < 8:
|
||||
signedIntegers.incl(tyInt)
|
||||
unsignedIntegers.incl(tyUInt)
|
||||
if src_size == getSize(c.config, dst) and src.kind in allowedIntegers and
|
||||
if src_size == dst_size and src.kind in allowedIntegers and
|
||||
dst.kind in allowedIntegers:
|
||||
let tmp = c.genx(n.sons[1])
|
||||
var tmp2 = c.getTemp(n.sons[1].typ)
|
||||
@@ -809,7 +809,7 @@ proc genCastIntFloat(c: PCtx; n: PNode; dest: var TDest) =
|
||||
c.freeTemp(tmp)
|
||||
c.freeTemp(tmp2)
|
||||
c.freeTemp(tmp3)
|
||||
elif src_size == getSize(c.config, dst) and src.kind in allowedIntegers and
|
||||
elif src_size == dst_size and src.kind in allowedIntegers and
|
||||
dst.kind in {tyFloat, tyFloat32, tyFloat64}:
|
||||
|
||||
let tmp = c.getTemp(n.sons[1].typ)
|
||||
@@ -820,7 +820,7 @@ proc genCastIntFloat(c: PCtx; n: PNode; dest: var TDest) =
|
||||
c.gABC(n, opcAsgnFloat64FromInt, dest, tmp)
|
||||
c.freeTemp(tmp)
|
||||
|
||||
elif src_size == getSize(c.config, dst) and src.kind in {tyFloat, tyFloat32, tyFloat64} and
|
||||
elif src_size == dst_size and src.kind in {tyFloat, tyFloat32, tyFloat64} and
|
||||
dst.kind in allowedIntegers:
|
||||
|
||||
let tmp = c.getTemp(n.sons[1].typ)
|
||||
|
||||
Reference in New Issue
Block a user