From 82b7423ceab7ac2ceacbca921d47e17c894965cb Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Thu, 27 Oct 2022 09:19:55 -0300 Subject: [PATCH] int128.nim fix warnings (#20666) * Silence warning false positive for int128.nim: Warning: target type is larger than source type * Silence warning false positive for int128.nim: Warning: target type is larger than source type * https://github.com/nim-lang/Nim/pull/20666#discussion_r1006162835 --- compiler/int128.nim | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/compiler/int128.nim b/compiler/int128.nim index d85f960840..4791954a29 100644 --- a/compiler/int128.nim +++ b/compiler/int128.nim @@ -345,11 +345,10 @@ proc low64(a: Int128): uint64 = bitconcat(a.udata[1], a.udata[0]) proc `*`*(lhs, rhs: Int128): Int128 = - let a32 = cast[uint64](lhs.udata[1]) - let a00 = cast[uint64](lhs.udata[0]) - let b32 = cast[uint64](rhs.udata[1]) - let b00 = cast[uint64](rhs.udata[0]) - + let a32 = uint64(lhs.udata[1]) + let a00 = uint64(lhs.udata[0]) + let b32 = uint64(rhs.udata[1]) + let b00 = uint64(rhs.udata[0]) result = makeInt128(high64(lhs) * low64(rhs) + low64(lhs) * high64(rhs) + a32 * b32, a00 * b00) result += toInt128(a32 * b00) shl 32 result += toInt128(a00 * b32) shl 32