From 95b91474ceacfc2f5d9e1ca605a9f11aec5f37f3 Mon Sep 17 00:00:00 2001 From: tersec Date: Thu, 8 Jun 2023 10:53:38 +0000 Subject: [PATCH] remove Nim 1.2 and 1.4 support --- .github/workflows/ci.yml | 2 +- stint.nimble | 9 ++------- stint/private/int_addsub.nim | 5 +---- stint/private/uint_div.nim | 5 +---- tests/test_io.nim | 5 ++--- 5 files changed, 7 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf6346d..5264454 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: cpu: amd64 #- os: windows #cpu: i386 - branch: [version-1-2, version-1-4, version-1-6, version-2-0, devel] + branch: [version-1-6, version-2-0, devel] include: - target: os: linux diff --git a/stint.nimble b/stint.nimble index a129bb0..fafeb9c 100644 --- a/stint.nimble +++ b/stint.nimble @@ -7,21 +7,16 @@ skipDirs = @["tests", "benchmarks"] ### Dependencies # TODO test only requirements don't work: https://github.com/nim-lang/nimble/issues/482 -requires "nim >= 1.2.0", +requires "nim >= 1.6.0", "stew" #, "https://github.com/alehander42/nim-quicktest >= 0.18.0", "https://github.com/status-im/nim-ttmath" proc test(args, path: string) = if not dirExists "build": mkDir "build" - let styleCheckStyle = - if (NimMajor, NimMinor) < (1, 6): - "hint" - else: - "error" exec "nim " & getEnv("TEST_LANG", "c") & " " & getEnv("NIMFLAGS") & " " & args & " --outdir:build -r --hints:off --warnings:off --skipParentCfg" & - " --styleCheck:usages --styleCheck:" & styleCheckStyle & " " & path + " --styleCheck:usages --styleCheck:error " & path if (NimMajor, NimMinor) > (1, 6): exec "nim " & getEnv("TEST_LANG", "c") & " " & getEnv("NIMFLAGS") & " " & args & " --outdir:build -r --mm:refc --hints:off --warnings:off --skipParentCfg" & diff --git a/stint/private/int_addsub.nim b/stint/private/int_addsub.nim index aadd699..b8d38e4 100644 --- a/stint/private/int_addsub.nim +++ b/stint/private/int_addsub.nim @@ -1,5 +1,5 @@ # Stint -# Copyright 2018 Status Research & Development GmbH +# Copyright 2018-2023 Status Research & Development GmbH # Licensed under either of # # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) @@ -11,9 +11,6 @@ import ./datatypes, ./conversion, ./int_comparison, ./uint_addsub, ./uint_comparison -# TODO remove when stint removes Nim 1.2 support -import stew/shims/stddefects - func `+`*(x, y: IntImpl): IntImpl {.inline.}= # Addition for multi-precision signed int. type SubTy = type x.hi diff --git a/stint/private/uint_div.nim b/stint/private/uint_div.nim index 2427cdd..8afe840 100644 --- a/stint/private/uint_div.nim +++ b/stint/private/uint_div.nim @@ -1,5 +1,5 @@ # Stint -# Copyright 2018 Status Research & Development GmbH +# Copyright 2018-2023 Status Research & Development GmbH # Licensed under either of # # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) @@ -229,9 +229,6 @@ func divmodBS(x, y: UintImpl, q, r: var UintImpl) = const BinaryShiftThreshold = 8 # If the difference in bit-length is below 8 # binary shift is probably faster -# TODO remove when stint removes Nim 1.2 support -import stew/shims/stddefects - func divmod*[T](x, y: UintImpl[T]): tuple[quot, rem: UintImpl[T]]= let x_clz = x.leadingZeros diff --git a/tests/test_io.nim b/tests/test_io.nim index 3b2abf2..a0d1243 100644 --- a/tests/test_io.nim +++ b/tests/test_io.nim @@ -179,9 +179,8 @@ template testIO(chk, tst: untyped) = nativeStuint(chk, low(uint), 32) nativeStuint(chk, high(int), 32) else: - when (NimMajor, NimMinor, NimPatch) >= (1, 0, 0): - nativeStuint(chk, high(uint), 64) - nativeStuint(chk, low(uint), 64) + nativeStuint(chk, high(uint), 64) + nativeStuint(chk, low(uint), 64) nativeStuint(chk, high(int), 64) nativeStuint(chk, 0, 128)