diff --git a/faststreams/buffers.nim b/faststreams/buffers.nim index 267616d..d7747b7 100644 --- a/faststreams/buffers.nim +++ b/faststreams/buffers.nim @@ -11,7 +11,7 @@ type startAddr*, endAddr*: ptr byte Page* = object - consumedTo*: Natural + consumedTo*: int writtenTo*: Natural data*: ref string diff --git a/faststreams/inputs.nim b/faststreams/inputs.nim index 5dc051b..e646338 100644 --- a/faststreams/inputs.nim +++ b/faststreams/inputs.nim @@ -442,7 +442,7 @@ proc fileInput*(filename: string, return fileInput(file, offset, pageSize) proc unsafeMemoryInput*(mem: openArray[byte]): InputStreamHandle = - let head = unsafeAddr mem[0] + let head = cast[ptr byte](mem) makeHandle InputStream( span: PageSpan( diff --git a/tests/base64.nim b/tests/base64.nim index 3bd9c88..74b310a 100644 --- a/tests/base64.nim +++ b/tests/base64.nim @@ -121,7 +121,7 @@ proc base64decode*(i: InputStream, o: OutputStream) {.fsMultiSync.} = inputChar(d) outputChar(c shl 6 or d shr 0) elif i.readable: - raise newException(ValueError, "The input stream has insufficient nymber of bytes for base64 decoding") + raise newException(ValueError, "The input stream has insufficient number of bytes for base64 decoding") close o diff --git a/tests/test_pipelines.nim b/tests/test_pipelines.nim index 6952a9e..5640616 100644 --- a/tests/test_pipelines.nim +++ b/tests/test_pipelines.nim @@ -41,7 +41,7 @@ when fsAsyncSupport: template timeit(timerVar: var Nanos, code: untyped) = let t0 = getTicks() code - timerVar = int(getTicks() - t0) div 1000000 + timerVar = int64(getTicks() - t0) div 1000000 proc getOutput(sp: AsyncInputStream, T: type string): Future[string] {.async.} = # this proc is a quick hack to let the test pass