summary refs log tree commit diff stats
path: root/lib/system
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2023-02-24 09:02:15 +0100
committerGitHub <noreply@github.com>2023-02-24 09:02:15 +0100
commit8a19ac20708c66fb3541533d55b60624cee56ab7 (patch)
tree0ddf7c34c2ecd76f8d1e1660de346c45e1bab145 /lib/system
parent7dc80a7fefb0d2cecbdc2696c71ea2fa94d6aa76 (diff)
downloadNim-8a19ac20708c66fb3541533d55b60624cee56ab7.tar.gz
fixes #21393 and misc style changes (#21419)
* fixes #21393 and misc style changes

* progress

---------

Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
Diffstat (limited to 'lib/system')
-rw-r--r--lib/system/seqs_v2.nim3
-rw-r--r--lib/system/strmantle.nim2
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/system/seqs_v2.nim b/lib/system/seqs_v2.nim
index 50f23111c..d7ace446d 100644
--- a/lib/system/seqs_v2.nim
+++ b/lib/system/seqs_v2.nim
@@ -83,7 +83,8 @@ proc shrink*[T](x: var seq[T]; newLen: Natural) {.tags: [], raises: [].} =
       for i in countdown(x.len - 1, newLen):
         reset x[i]
     # XXX This is wrong for const seqs that were moved into 'x'!
-    cast[ptr NimSeqV2[T]](addr x).len = newLen
+    {.noSideEffect.}:
+      cast[ptr NimSeqV2[T]](addr x).len = newLen
 
 proc grow*[T](x: var seq[T]; newLen: Natural; value: T) =
   let oldLen = x.len
diff --git a/lib/system/strmantle.nim b/lib/system/strmantle.nim
index f4733ed21..ab158d6b7 100644
--- a/lib/system/strmantle.nim
+++ b/lib/system/strmantle.nim
@@ -33,7 +33,7 @@ proc eqStrings(a, b: string): bool {.inline, compilerproc.} =
 proc hashString(s: string): int {.compilerproc.} =
   # the compiler needs exactly the same hash function!
   # this used to be used for efficient generation of string case statements
-  var h : uint = 0
+  var h = 0'u
   for i in 0..len(s)-1:
     h = h + uint(s[i])
     h = h + h shl 10