Enable --styleCheck:usages
This commit is contained in:
parent
1b561a9e71
commit
1f62235d4f
9 changed files with 39 additions and 37 deletions
|
|
@ -652,13 +652,13 @@ proc writeMemCopy*(s: OutputStream, value: auto) =
|
|||
|
||||
when fsAsyncSupport:
|
||||
proc writeBytesAsyncImpl(sp: OutputStream,
|
||||
bytes: openarray[byte]): Future[void] =
|
||||
bytes: openArray[byte]): Future[void] =
|
||||
let s = sp
|
||||
writeBytesImpl(s, bytes):
|
||||
return s.vtable.writeAsync(s, unsafeAddr bytes[0], bytes.len)
|
||||
|
||||
proc writeBytesAsyncImpl(s: OutputStream,
|
||||
chars: openarray[char]): Future[void] =
|
||||
chars: openArray[char]): Future[void] =
|
||||
writeBytesAsyncImpl s, charsToBytes(chars)
|
||||
|
||||
proc writeBytesAsyncImpl(s: OutputStream,
|
||||
|
|
@ -684,7 +684,7 @@ when fsAsyncSupport:
|
|||
template writeMemCopyAndWait*(sp: AsyncOutputStream, value: auto) =
|
||||
writeAndWait(sp, memCopyToBytes(value))
|
||||
|
||||
proc writeBytesToCursor(c: var WriteCursor, bytes: openarray[byte]) =
|
||||
proc writeBytesToCursor(c: var WriteCursor, bytes: openArray[byte]) =
|
||||
var
|
||||
runway = c.span.len
|
||||
inputPos = unsafeAddr bytes[0]
|
||||
|
|
@ -713,11 +713,11 @@ proc writeBytesToCursor(c: var WriteCursor, bytes: openarray[byte]) =
|
|||
copyMem(c.span.startAddr, inputPos, inputLen)
|
||||
c.span.startAddr = offset(c.span.startAddr, inputLen)
|
||||
|
||||
template write*(c: var WriteCursor, bytes: openarray[byte]) =
|
||||
template write*(c: var WriteCursor, bytes: openArray[byte]) =
|
||||
bind writeBytesToCursor
|
||||
writeBytesToCursor(c, bytes)
|
||||
|
||||
proc write*(c: var WriteCursor, chars: openarray[char]) {.inline.} =
|
||||
proc write*(c: var WriteCursor, chars: openArray[char]) {.inline.} =
|
||||
var charsStart = unsafeAddr chars[0]
|
||||
writeBytesToCursor(c, makeOpenArray(cast[ptr byte](charsStart), chars.len))
|
||||
|
||||
|
|
@ -749,7 +749,7 @@ template consumeOutputs*(s: OutputStream, bytesVar, body: untyped) =
|
|||
##
|
||||
## Before consuming the outputs, all outstanding delayed writes must
|
||||
## be finalized.
|
||||
proc consumer(bytesVar: openarray[byte]) {.gcsafe, raises: [Defect].} =
|
||||
proc consumer(bytesVar: openArray[byte]) {.gcsafe, raises: [Defect].} =
|
||||
body
|
||||
|
||||
consumeOutputsImpl(s, consumer)
|
||||
|
|
@ -795,7 +795,7 @@ template consumeContiguousOutput*(s: OutputStream, bytesVar, body: untyped) =
|
|||
## Before consuming the output, all outstanding delayed writes must
|
||||
## be finalized.
|
||||
##
|
||||
proc consumer(bytesVar: openarray[byte]) {.gcsafe, raises: [Defect].} =
|
||||
proc consumer(bytesVar: openArray[byte]) {.gcsafe, raises: [Defect].} =
|
||||
body
|
||||
|
||||
consumeContiguousOutputImpl(s, consumer)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue