From 137a9c6de0adc626b37f0259be98c1ecdf942e0d Mon Sep 17 00:00:00 2001 From: James Osborn Date: Thu, 14 Nov 2024 20:37:37 -0600 Subject: [PATCH] fix some Nim warnings --- configure | 3 ++- src/examples/testlapl1.nim | 2 +- src/io/crc32.nim | 2 +- src/io/readerQiolite.nim | 2 +- src/io/writerQiolite.nim | 4 ++-- src/physics/wilsonD.nim | 2 +- src/physics/wilsonSolve.nim | 4 ++-- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/configure b/configure index 4c78216a..d4616f86 100755 --- a/configure +++ b/configure @@ -15,5 +15,6 @@ if [ "X$NIM" = "X" ]; then fi echo "Using Nim compiler: $NIM" -echo "Runing: $NIM $dir/build/configure.nims ${@@Q}" +echo "Runing: $NIM $dir/build/configure.nims $@" +#echo "Runing: $NIM $dir/build/configure.nims ${@@Q}" $NIM $dir/build/configure.nims "$@" diff --git a/src/examples/testlapl1.nim b/src/examples/testlapl1.nim index 925751b1..d890ca7e 100644 --- a/src/examples/testlapl1.nim +++ b/src/examples/testlapl1.nim @@ -5,7 +5,7 @@ import io/timesliceIo import physics/wilsonD import physics/wilsonSolve import contract -import xmlparser, xmltree, strutils, sequtils, endians, times +import xmlparser, xmltree, strutils, sequtils, times template `&&`(x: int32): untyped = cast[pointer](unsafeAddr(x)) template `&&`(x: Field): untyped = cast[pointer](unsafeAddr(x[0])) diff --git a/src/io/crc32.nim b/src/io/crc32.nim index e06c6a4a..f994f566 100644 --- a/src/io/crc32.nim +++ b/src/io/crc32.nim @@ -1,4 +1,4 @@ -import strutils +#import strutils type Crc32* = uint32 const InitCrc32* = Crc32(not 0'u32) diff --git a/src/io/readerQiolite.nim b/src/io/readerQiolite.nim index 0a722480..d4d421d7 100644 --- a/src/io/readerQiolite.nim +++ b/src/io/readerQiolite.nim @@ -111,7 +111,7 @@ proc putP[T](buf: cstring; index: int, count: int; arg: openArray[ptr T]) = template `&`[T](x: seq[T]): untyped = cast[ptr T](unsafeaddr x[0]) template `+`(x: ptr char, i: SomeInteger): untyped = - cast[ptr char](cast[ByteAddress](x) + ByteAddress(i)) + cast[ptr char](cast[uint](x) + uint(i)) proc read[T](rd: var Reader, v: openArray[ptr T]) = let t0 = getMonoTime() diff --git a/src/io/writerQiolite.nim b/src/io/writerQiolite.nim index 28cd7957..db52f80e 100644 --- a/src/io/writerQiolite.nim +++ b/src/io/writerQiolite.nim @@ -1,6 +1,6 @@ import base import layout -import strutils, strformat +import strformat import field import os import scidacio @@ -87,7 +87,7 @@ proc getP[T](buf: cstring; index: int; count: int; arg: openArray[ptr T]) = template `&`[T](x: seq[T]): untyped = cast[ptr T](unsafeaddr x[0]) template `+`(x: ptr char, i: SomeInteger): untyped = - cast[ptr char](cast[ByteAddress](x) + ByteAddress(i)) + cast[ptr char](cast[uint](x) + uint(i)) proc write[T](wr: var Writer, v: var openArray[ptr T], lat: openArray[int], md="", ps="") = diff --git a/src/physics/wilsonD.nim b/src/physics/wilsonD.nim index d5890f7d..a6ecca17 100644 --- a/src/physics/wilsonD.nim +++ b/src/physics/wilsonD.nim @@ -11,7 +11,7 @@ setForceInline(false) import os import times -import strUtils +#import strutils import base import layout diff --git a/src/physics/wilsonSolve.nim b/src/physics/wilsonSolve.nim index cae6fbd4..1e2ba13d 100644 --- a/src/physics/wilsonSolve.nim +++ b/src/physics/wilsonSolve.nim @@ -2,7 +2,7 @@ import physics/wilsonD import os import times -import strUtils +#import strutils import base import layout import field @@ -11,7 +11,7 @@ import qcdTypes import solvers/cg export cg import solvers/bicgstab -import solvers/solverUtils +#import solvers/solverUtils #import types #import profile #import metaUtils