reduce compiler warnings

This commit is contained in:
jangko 2023-02-23 12:09:45 +07:00
parent 3472a16fbc
commit 493f31de63
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
1 changed files with 5 additions and 2 deletions

View File

@ -11,6 +11,9 @@ import
./datatypes, ./conversion, ./int_comparison, ./datatypes, ./conversion, ./int_comparison,
./uint_addsub, ./uint_comparison ./uint_addsub, ./uint_comparison
# TODO remove when stint removes Nim 1.2 support
import stew/shims/stddefects
func `+`*(x, y: IntImpl): IntImpl {.inline.}= func `+`*(x, y: IntImpl): IntImpl {.inline.}=
# Addition for multi-precision signed int. # Addition for multi-precision signed int.
type SubTy = type x.hi type SubTy = type x.hi
@ -23,7 +26,7 @@ func `+`*(x, y: IntImpl): IntImpl {.inline.}=
not(result.isNegative xor y.isNegative) not(result.isNegative xor y.isNegative)
): ):
return return
raise newException(OverflowError, "Addition overflow") raise newException(OverflowDefect, "Addition overflow")
func `+=`*(x: var IntImpl, y: IntImpl) {.inline.}= func `+=`*(x: var IntImpl, y: IntImpl) {.inline.}=
## In-place addition for multi-precision signed int. ## In-place addition for multi-precision signed int.
@ -42,7 +45,7 @@ func `-`*(x, y: IntImpl): IntImpl {.inline.}=
not(result.isNegative xor y.isNegative.not) not(result.isNegative xor y.isNegative.not)
): ):
return return
raise newException(OverflowError, "Substraction underflow") raise newException(OverflowDefect, "Substraction underflow")
func `-=`*(x: var IntImpl, y: IntImpl) {.inline.}= func `-=`*(x: var IntImpl, y: IntImpl) {.inline.}=
## In-place substraction for multi-precision signed int. ## In-place substraction for multi-precision signed int.