From 95ff261189fb648d99e46f61b78cf90e9e2985f0 Mon Sep 17 00:00:00 2001 From: Joshua Suskalo Date: Tue, 18 Jan 2022 15:49:29 -0600 Subject: [PATCH] Use big-endian stuff as an example --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d87a0f9..8ce2187 100644 --- a/README.md +++ b/README.md @@ -589,8 +589,8 @@ Handles](#unwrapped-native-handles). Convenience functions are provided to both read and write all primitive types and addresses, including byte order. -As an example, when wrapping a function that returns an array of floats, the -following code might be used. +As an example, when wrapping a function that returns an array of big-endian +floats, the following code might be used. ``` clojure (let [function-handle (ffi/make-downcall "returns_float_array" [::mem/pointer] ::mem/int) @@ -608,7 +608,9 @@ following code might be used. index 0] (if (>= index num-floats) (persistent! floats) - (recur (conj! floats (mem/read-float floats-slice (unchecked-multiply-int index float-size))) + (recur (conj! floats (mem/read-float floats-slice + (unchecked-multiply-int index float-size) + mem/big-endian)) (inc index))))] (release-floats floats-addr) ret))))