about summary refs log tree commit diff stats
path: root/src/loader/loader.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-07-13 19:35:34 +0200
committerbptato <nincsnevem662@gmail.com>2024-07-13 19:51:42 +0200
commit224640dc58ee7a4837597ed7a10a17dac4d95629 (patch)
treed2a2b40081a65e49d23bfb4df2725236542e201c /src/loader/loader.nim
parentbf231d2e50c342fdd688b7e944ff5c934610e08b (diff)
downloadchawan-224640dc58ee7a4837597ed7a10a17dac4d95629.tar.gz
32-bit compilation fixes
It seems registerHandle/unregister doesn't accept cint as handles. Not
sure why it even works on 64-bit targets... (maybe some converter
weirdness?)

Seems best to explicitly cast it away.
Diffstat (limited to 'src/loader/loader.nim')
-rw-r--r--src/loader/loader.nim10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/loader/loader.nim b/src/loader/loader.nim
index 78f5f0d7..29913031 100644
--- a/src/loader/loader.nim
+++ b/src/loader/loader.nim
@@ -176,12 +176,12 @@ type PushBufferResult = enum
 
 proc register(ctx: LoaderContext; output: OutputHandle) =
   assert not output.registered
-  ctx.selector.registerHandle(output.ostream.fd, {Write}, 0)
+  ctx.selector.registerHandle(int(output.ostream.fd), {Write}, 0)
   output.registered = true
 
 proc unregister(ctx: LoaderContext; output: OutputHandle) =
   assert output.registered
-  ctx.selector.unregister(output.ostream.fd)
+  ctx.selector.unregister(int(output.ostream.fd))
   output.registered = false
 
 # Either write data to the target output, or append it to the list of buffers to
@@ -271,7 +271,7 @@ proc addFd(ctx: LoaderContext; handle: LoaderHandle) =
   let output = handle.output
   output.ostream.setBlocking(false)
   handle.istream.setBlocking(false)
-  ctx.selector.registerHandle(handle.istream.fd, {Read}, 0)
+  ctx.selector.registerHandle(int(handle.istream.fd), {Read}, 0)
   assert handle.istream.fd notin ctx.handleMap
   assert output.ostream.fd notin ctx.outputMap
   ctx.handleMap[handle.istream.fd] = handle
@@ -826,7 +826,7 @@ proc finishCycle(ctx: LoaderContext; unregRead: var seq[LoaderHandle];
   # unregistered handles to nil.
   for handle in unregRead:
     if handle.istream != nil:
-      ctx.selector.unregister(handle.istream.fd)
+      ctx.selector.unregister(int(handle.istream.fd))
       ctx.handleMap.del(handle.istream.fd)
       if handle.parser != nil:
         handle.finishParse()
@@ -847,7 +847,7 @@ proc finishCycle(ctx: LoaderContext; unregRead: var seq[LoaderHandle];
         handle.outputs.del(i)
         if handle.outputs.len == 0 and handle.istream != nil:
           # premature end of all output streams; kill istream too
-          ctx.selector.unregister(handle.istream.fd)
+          ctx.selector.unregister(int(handle.istream.fd))
           ctx.handleMap.del(handle.istream.fd)
           if handle.parser != nil:
             handle.finishParse()