diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 08a4414..5264454 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -152,9 +152,6 @@ jobs: # https://github.com/status-im/nimbus-eth2/issues/3121 export NIMFLAGS="-d:nimRawSetjmp" fi - if [[ "${{ matrix.branch }}" == "devel" ]]; then - export NIMFLAGS="${NIMFLAGS} -d:nimDevelFixVarParam" - fi nim --version nimble --version nimble install -y --depsOnly diff --git a/stint/io.nim b/stint/io.nim index 345fb3f..43c62fe 100644 --- a/stint/io.nim +++ b/stint/io.nim @@ -64,7 +64,7 @@ func truncate*(num: StUint, T: typedesc[SomeInteger]): T {.inline.}= ## Note that int and uint are 32-bit on 32-bit platform. ## For unsigned result type, result is modulo 2^(sizeof T in bit) ## For signed result type, result is undefined if input does not fit in the target type. - when T is SomeSignedInt: + when T is SomeSignedInt and sizeof(T) <= sizeof(Word): result = T(num.leastSignificantWord() and Word(T.high)) else: result = T(num.leastSignificantWord()) diff --git a/stint/private/primitives/extended_precision_64bit_uint128.nim b/stint/private/primitives/extended_precision_64bit_uint128.nim index a3183b0..ad8cdf1 100644 --- a/stint/private/primitives/extended_precision_64bit_uint128.nim +++ b/stint/private/primitives/extended_precision_64bit_uint128.nim @@ -16,11 +16,8 @@ import ../datatypes # ############################################################ const - # at the time of writing June 14th 2023 - # only devel branch codegen can generate - # ptr deref when using var param - # while version-1-6 and version-2-0 branch cannot - noExplicitPtrDeref = defined(cpp) or defined(nimDevelFixVarParam) + newerNim = (NimMajor, NimMinor) > (1, 6) + noExplicitPtrDeref = defined(cpp) or newerNim static: doAssert GCC_Compatible diff --git a/tests/test_io.nim b/tests/test_io.nim index 0c38ef3..63dc185 100644 --- a/tests/test_io.nim +++ b/tests/test_io.nim @@ -724,14 +724,14 @@ template testIO(chk, tst, handleErr: untyped) = chkDumpHexStint(chk, "abcdef0012345678abcdef1122334455", "5544332211efcdab7856341200efcdab", 128) -#static: - #testIO(ctCheck, ctTest, ctExpect) +static: + testIO(ctCheck, ctTest, ctExpect) proc main() = # Nim GC protests we are using too much global variables # so put it in a proc suite "Testing input and output procedures": - #testIO(check, test, expect) + testIO(check, test, expect) test "toByteArrayBE CT vs RT": chkCTvsRT(check, 0xab'u64, 64)