diff options
author | bptato <nincsnevem662@gmail.com> | 2023-07-03 16:47:20 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-07-03 16:59:39 +0200 |
commit | 519e5fa0986320d55ddcc5c0fa2b8e44dbff779b (patch) | |
tree | 43dfbc2c03c3283185688710bad1518ffe136a01 /src/buffer/buffer.nim | |
parent | d86abdbfcf081d6a91d0cfc37c5c854527b7b551 (diff) | |
download | chawan-519e5fa0986320d55ddcc5c0fa2b8e44dbff779b.tar.gz |
Fix CastSize warnings
Introduced by 1.6.14. Warns of undefined behavior.
Diffstat (limited to 'src/buffer/buffer.nim')
-rw-r--r-- | src/buffer/buffer.nim | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/buffer/buffer.nim b/src/buffer/buffer.nim index 7354d94b..9b464dfd 100644 --- a/src/buffer/buffer.nim +++ b/src/buffer/buffer.nim @@ -649,7 +649,7 @@ proc setupSource(buffer: Buffer): ConnectResult = #TODO clone should probably just fork() the buffer instead. let s = connectSocketStream(source.clonepid, blocking = false) buffer.istream = s - buffer.fd = cast[int](s.source.getFd()) + buffer.fd = int(s.source.getFd()) if buffer.istream == nil: result.code = ERROR_SOURCE_NOT_FOUND return @@ -671,7 +671,7 @@ proc setupSource(buffer: Buffer): ConnectResult = buffer.contenttype = response.contenttype buffer.istream = response.body let fd = SocketStream(response.body).source.getFd() - buffer.fd = cast[int](fd) + buffer.fd = int(fd) result.needsAuth = response.status == 401 # Unauthorized result.redirect = response.redirect if "Set-Cookie" in response.headers.table: @@ -1206,7 +1206,9 @@ proc handleError(buffer: Buffer, fd: int, err: OSErrorCode) = proc runBuffer(buffer: Buffer, rfd: int) = buffer.rfd = rfd while buffer.alive: + {.warning[CastSizes]:off.} # not our bug. TODO remove when fixed let events = buffer.selector.select(-1) + {.warning[CastSizes]:on.} for event in events: if Read in event.events: buffer.handleRead(event.fd) |