Merge pull request #11 from ba0f3/patch-1

make tests/example compile and run w/ Nim 1.6.6
This commit is contained in:
Antonis Geralis 2022-09-04 18:29:00 +03:00 committed by GitHub
commit f22e460fbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -168,7 +168,7 @@ proc write*[T](data: var openArray[byte], pos: var int, input: T) =
proc readData*(data: openArray[byte], pos: var int, buffer: pointer, bufLen: int): int =
result = min(bufLen, data.len - pos)
if result > 0:
copyMem(buffer, data[pos].addr, result)
copyMem(buffer, data[pos].unsafeAddr, result)
inc(pos, result)
else:
result = 0

View File

@ -558,7 +558,7 @@ template mutatorImpl*(target, mutator, typ: untyped) =
var pos = 1
toData(buffer, pos, x)
assert pos == len
copyMem(addr data, addr buffer[0], len)
copyMem(unsafeAddr data, addr buffer[0], len)
cached = move x
proc clearBuffer() {.inline.} =
@ -604,7 +604,7 @@ template mutatorImpl*(target, mutator, typ: untyped) =
{.emit: "nimTestErrorFlag();".}
proc commonImpl(target, mutator: NimNode): NimNode =
let typ = getTypeImpl(target).params[^1][1]
let typ = getImpl(target).params[^1][1]
result = getAst(mutatorImpl(target, mutator, typ))
result.add getAst(initializeImpl())