Eliminate warnings on Windows. (#382)

This commit is contained in:
Eugene Kabanov 2023-04-30 20:09:36 +03:00 committed by GitHub
parent 3118f8c1b2
commit 9ba418cd3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 9 deletions

View File

@ -10,7 +10,7 @@
import std/sequtils
import stew/base10
import "."/[config, srcloc]
import "."/srcloc
export srcloc
when defined(nimHasStacktracesModule):

View File

@ -117,14 +117,14 @@ suite "Asynchronous issues test suite":
let inpTransp = await afut
let bytesSent = await outTransp.write(msg)
check bytesSent == messageSize
var rfut = inpTransp.readExactly(addr buffer[0], messageSize)
var rfut {.used.} = inpTransp.readExactly(addr buffer[0], messageSize)
proc waiterProc(udata: pointer) {.raises: [Defect], gcsafe.} =
try:
waitFor(sleepAsync(0.milliseconds))
except CatchableError as exc:
except CatchableError:
raiseAssert "Unexpected exception happened"
let timer = setTimer(Moment.fromNow(0.seconds), waiterProc, nil)
let timer {.used.} = setTimer(Moment.fromNow(0.seconds), waiterProc, nil)
await sleepAsync(100.milliseconds)
await inpTransp.closeWait()

View File

@ -5,7 +5,7 @@
# Licensed under either of
# Apache License, version 2.0, (LICENSE-APACHEv2)
# MIT license (LICENSE-MIT)
import std/[strutils, strutils, sha1]
import std/[strutils, sha1]
import unittest2
import ../chronos, ../chronos/apps/http/[httpserver, shttpserver, httpclient]
import stew/base10

View File

@ -5,7 +5,7 @@
# Licensed under either of
# Apache License, version 2.0, (LICENSE-APACHEv2)
# MIT license (LICENSE-MIT)
import std/[strutils, algorithm, strutils]
import std/[strutils, algorithm]
import unittest2
import ../chronos, ../chronos/apps/http/httpserver,
../chronos/apps/http/httpcommon

View File

@ -5,7 +5,7 @@
# Licensed under either of
# Apache License, version 2.0, (LICENSE-APACHEv2)
# MIT license (LICENSE-MIT)
import std/[strutils, strutils]
import std/strutils
import unittest2
import ../chronos, ../chronos/apps/http/shttpserver
import stew/base10

View File

@ -1286,10 +1286,11 @@ suite "Stream Transport test suite":
var transp3 = await connect(dst2, localAddress = dst3, flags={SocketFlags.ReusePort})
expect(TransportOsError):
var transp2 = await connect(dst3, localAddress = ta)
var transp2 {.used.} = await connect(dst3, localAddress = ta)
expect(TransportOsError):
var transp3 = await connect(dst3, localAddress = initTAddress(":::35000"))
var transp3 {.used.} =
await connect(dst3, localAddress = initTAddress(":::35000"))
await transp1.closeWait()
await transp2.closeWait()