about summary refs log tree commit diff stats
path: root/src/display/client.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-07-03 16:47:20 +0200
committerbptato <nincsnevem662@gmail.com>2023-07-03 16:59:39 +0200
commit519e5fa0986320d55ddcc5c0fa2b8e44dbff779b (patch)
tree43dfbc2c03c3283185688710bad1518ffe136a01 /src/display/client.nim
parentd86abdbfcf081d6a91d0cfc37c5c854527b7b551 (diff)
downloadchawan-519e5fa0986320d55ddcc5c0fa2b8e44dbff779b.tar.gz
Fix CastSize warnings
Introduced by 1.6.14. Warns of undefined behavior.
Diffstat (limited to 'src/display/client.nim')
-rw-r--r--src/display/client.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/display/client.nim b/src/display/client.nim
index 6b18e092..7dbf4713 100644
--- a/src/display/client.nim
+++ b/src/display/client.nim
@@ -370,7 +370,9 @@ proc inputLoop(client: Client) =
   selector.registerHandle(int(client.console.tty.getFileHandle()), {Read}, nil)
   let sigwinch = selector.registerSignal(int(SIGWINCH), nil)
   while true:
+    {.warning[CastSizes]:off.} # not our bug. TODO remove when fixed
     let events = client.selector.select(-1)
+    {.warning[CastSizes]:on.}
     for event in events:
       if Read in event.events:
         client.handleRead(event.fd)
@@ -503,7 +505,7 @@ proc launchClient*(client: Client, pages: seq[string], ctype: Option[string],
     else:
       dump = true
   client.ssock = initServerSocket(false, false)
-  client.fd = cast[int](client.ssock.sock.getFd())
+  client.fd = int(client.ssock.sock.getFd())
   let selector = newSelector[Container]()
   selector.registerHandle(client.fd, {Read}, nil)
   let efd = int(client.dispatcher.forkserver.estream.fd)