improve style

This commit is contained in:
Andrii Riabushenko
2018-10-24 11:26:32 +01:00
parent a7c9533a73
commit bd68d3d8f4

View File

@@ -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)