From d3050c34ffc92c45202656a3055884103fc35c65 Mon Sep 17 00:00:00 2001 From: Joshua Suskalo Date: Mon, 11 Oct 2021 11:19:13 -0500 Subject: [PATCH] Move arg and ret types into the cfn call in defcfn This is in preparation for an optimization in cfn with constant arg and ret types. --- src/clj/coffi/ffi.clj | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/clj/coffi/ffi.clj b/src/clj/coffi/ffi.clj index 9c2d015..e6fd9c5 100644 --- a/src/clj/coffi/ffi.clj +++ b/src/clj/coffi/ffi.clj @@ -549,8 +549,6 @@ :style/indent [:defn]} [& args] (let [args (s/conform ::defcfn-args args) - args-types (gensym "args-types") - ret-type (gensym "ret-type") address (gensym "symbol") native-sym (gensym "native") [arity fn-tail] (-> args :wrapper :fn-tail) @@ -562,10 +560,8 @@ :single-arity [fn-tail] :multi-arity fn-tail nil))] - `(let [~args-types ~(:native-arglist args) - ~ret-type ~(:return-type args) - ~address (find-symbol ~(name (:symbol args))) - ~native-sym (cfn ~address ~args-types ~ret-type) + `(let [~address (find-symbol ~(name (:symbol args))) + ~native-sym (cfn ~address ~(:native-arglist args) ~(:return-type args)) fun# ~(if (:wrapper args) `(fn ~(:name args) ~@fn-tail)