about summary refs log tree commit diff stats
path: root/src/bindings
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/bindings
parentd86abdbfcf081d6a91d0cfc37c5c854527b7b551 (diff)
downloadchawan-519e5fa0986320d55ddcc5c0fa2b8e44dbff779b.tar.gz
Fix CastSize warnings
Introduced by 1.6.14. Warns of undefined behavior.
Diffstat (limited to 'src/bindings')
-rw-r--r--src/bindings/quickjs.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bindings/quickjs.nim b/src/bindings/quickjs.nim
index c84b54d9..c438ae21 100644
--- a/src/bindings/quickjs.nim
+++ b/src/bindings/quickjs.nim
@@ -41,10 +41,10 @@ when sizeof(int) < sizeof(int64):
     cast[pointer](v)
 
   template JS_MKVAL*(t, val: untyped): JSValue =
-    JSValue((cast[uint64](t) shl 32) or cast[uint32](val))
+    JSValue((cast[uint64](int64(t)) shl 32) or uint32(val))
 
   template JS_MKPTR*(t, p: untyped): JSValue =
-    JSValue((cast[uint64](t) shl 32) or cast[uint](p))
+    JSValue((cast[uint64](int64(t)) shl 32) or cast[uint](p))
 
   proc `==`*(a, b: JSValue): bool {.borrow.}
 else: