Merge pull request #11 from ba0f3/patch-1
make tests/example compile and run w/ Nim 1.6.6
This commit is contained in:
commit
f22e460fbb
|
@ -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
|
||||
|
|
|
@ -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())
|
||||
|
||||
|
|
Loading…
Reference in New Issue