Rename some variables in the isCastable code

This commit is contained in:
Clay Sweetser 2014-05-26 10:16:59 -04:00
commit 9d68fe3782

View file

@ -184,18 +184,18 @@ proc isCastable(dst, src: PType): bool =
# castableTypeKinds = {tyInt, tyPtr, tyRef, tyCstring, tyString, # castableTypeKinds = {tyInt, tyPtr, tyRef, tyCstring, tyString,
# tySequence, tyPointer, tyNil, tyOpenArray, # tySequence, tyPointer, tyNil, tyOpenArray,
# tyProc, tySet, tyEnum, tyBool, tyChar} # tyProc, tySet, tyEnum, tyBool, tyChar}
var ds, ss: BiggestInt var dstSize, srcSize: BiggestInt
ds = computeSize(dst) dstSize = computeSize(dst)
ss = computeSize(src) srcSize = computeSize(src)
if ds < 0: if dstSize < 0:
result = false result = false
elif ss < 0: elif srcSize < 0:
result = false result = false
elif not typeAllowed(dst, skParam): elif not typeAllowed(dst, skParam):
result = false result = false
else: else:
result = (ds >= ss) or result = (dstSize >= srcSize) or
(skipTypes(dst, abstractInst).kind in IntegralTypes) or (skipTypes(dst, abstractInst).kind in IntegralTypes) or
(skipTypes(src, abstractInst-{tyTypeDesc}).kind in IntegralTypes) (skipTypes(src, abstractInst-{tyTypeDesc}).kind in IntegralTypes)