enable style:usages for stdlib tests [backport: 1.6] (#19715)

* enable style:usages for stdlib tests

* freeAddrInfo

* more tests

* importc

* bufSize

* fix more

* => parseSql and renderSql
This commit is contained in:
flywind 2022-04-13 17:53:02 +08:00 • committed by GitHub
commit 98cebad7de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 149 additions and 146 deletions

View file

@ -648,9 +648,9 @@ proc bindAddr*(socket: AsyncSocket, port = Port(0), address = "") {.
var aiList = getAddrInfo(realaddr, port, socket.domain)
if bindAddr(socket.fd, aiList.ai_addr, aiList.ai_addrlen.SockLen) < 0'i32:
freeaddrinfo(aiList)
freeAddrInfo(aiList)
raiseOSError(osLastError())
freeaddrinfo(aiList)
freeAddrInfo(aiList)
proc hasDataBuffered*(s: AsyncSocket): bool {.since: (1, 5).} =
## Determines whether an AsyncSocket has data buffered.
@ -859,7 +859,7 @@ proc sendTo*(socket: AsyncSocket, address: string, port: Port, data: string,
it = it.ai_next
freeaddrinfo(aiList)
freeAddrInfo(aiList)
if not success:
if lastException != nil: