aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/unsafe
diff options
context:
space:
mode:
authorEduardo Julian2022-02-22 16:29:17 -0400
committerEduardo Julian2022-02-22 16:29:17 -0400
commitf07effd9faf3fdaa677f659d6bbccf98931c5e5a (patch)
tree0b51a4b8492d06db6b3eca38a3b9143de1c1d735 /stdlib/source/unsafe
parent2d1348a73159ec87fa0da2bd3768d641236693fb (diff)
No more automatic conversions of primitive types in JVM FFI.
Diffstat (limited to 'stdlib/source/unsafe')
-rw-r--r--stdlib/source/unsafe/lux/data/binary.lux13
1 files changed, 7 insertions, 6 deletions
diff --git a/stdlib/source/unsafe/lux/data/binary.lux b/stdlib/source/unsafe/lux/data/binary.lux
index ffc2b5e84..91726c57a 100644
--- a/stdlib/source/unsafe/lux/data/binary.lux
+++ b/stdlib/source/unsafe/lux/data/binary.lux
@@ -271,7 +271,8 @@
(with_expansions [<reference> (: ..Binary reference')
<sample> (: ..Binary sample')
- <jvm> (java/util/Arrays::equals <reference> <sample>)]
+ <jvm> (java/util/Arrays::equals <reference> <sample>)
+ <jvm> (ffi.of_boolean <jvm>)]
(template: .public (= reference' sample')
[(for [@.old <jvm>
@.jvm <jvm>]
@@ -290,9 +291,9 @@
... TODO: Turn into a template ASAP.
(inline: .public (copy! bytes source_offset source target_offset target)
(-> Nat Nat ..Binary Nat ..Binary ..Binary)
- (with_expansions [<jvm> (java/lang/System::arraycopy source (.int source_offset)
- target (.int target_offset)
- (.int bytes))
+ (with_expansions [<jvm> (java/lang/System::arraycopy source (ffi.as_int (.int source_offset))
+ target (ffi.as_int (.int target_offset))
+ (ffi.as_int (.int bytes)))
<jvm> (exec
<jvm>
target)]
@@ -311,8 +312,8 @@
... TODO: Turn into a template ASAP.
(with_expansions [<jvm> (java/util/Arrays::copyOfRange binary
- (.int offset)
- (.int limit))
+ (ffi.as_int (.int offset))
+ (ffi.as_int (.int limit)))
<jvm> (let [limit ("lux i64 +" size offset)]
<jvm>)]
(inline: .public (slice offset size binary)