From f07effd9faf3fdaa677f659d6bbccf98931c5e5a Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 22 Feb 2022 16:29:17 -0400 Subject: No more automatic conversions of primitive types in JVM FFI. --- stdlib/source/unsafe/lux/data/binary.lux | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'stdlib/source/unsafe') 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 [ (: ..Binary reference') (: ..Binary sample') - (java/util/Arrays::equals )] + (java/util/Arrays::equals ) + (ffi.of_boolean )] (template: .public (= reference' sample') [(for [@.old @.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 [ (java/lang/System::arraycopy source (.int source_offset) - target (.int target_offset) - (.int bytes)) + (with_expansions [ (java/lang/System::arraycopy source (ffi.as_int (.int source_offset)) + target (ffi.as_int (.int target_offset)) + (ffi.as_int (.int bytes))) (exec target)] @@ -311,8 +312,8 @@ ... TODO: Turn into a template ASAP. (with_expansions [ (java/util/Arrays::copyOfRange binary - (.int offset) - (.int limit)) + (ffi.as_int (.int offset)) + (ffi.as_int (.int limit))) (let [limit ("lux i64 +" size offset)] )] (inline: .public (slice offset size binary) -- cgit v1.2.3