From d62166d5d7b880591576a4eb492cd3f8e02e98de Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Tue, 12 May 2020 18:12:14 -0400 Subject: [PATCH] Call proper conversion function --- libs/cyclone/foreign.sld | 6 +++--- libs/test-foreign.scm | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/cyclone/foreign.sld b/libs/cyclone/foreign.sld index d3b9e499..15dbcb98 100644 --- a/libs/cyclone/foreign.sld +++ b/libs/cyclone/foreign.sld @@ -203,7 +203,7 @@ var (cond (arg-cust-type - (if (= 3 (length arg-cust-type)) + (if (> (length arg-cust-type) 1) (set! arg-cust-convert #t)) (car arg-cust-type)) (else @@ -249,8 +249,8 @@ (hash-table-ref *foreign-types* (quote ,type))))) (pass-arg (if (and arg-cust-type - (= 3 (length arg-cust-type))) - `(,(caddr arg-cust-type) ,sym) + (> (length arg-cust-type) 1)) + `(,(cadr arg-cust-type) ,sym) sym)) ) (cons sym ;; Arg diff --git a/libs/test-foreign.scm b/libs/test-foreign.scm index 79f2710c..f6fbb7d7 100644 --- a/libs/test-foreign.scm +++ b/libs/test-foreign.scm @@ -44,7 +44,7 @@ ;(c-define scm-strlen "int" "strlen" string) (c-define scm-strlend double "strlen" string) (c-define scm-strlen2 integer "strlen" my-string) -(c-define scm-strlen3 integer "strlen" my-integer-as-string) +(c-define scm-strlen3 integer "strlen" string-as-integer) (test-group "foreign lambda" (test 15 (scm-strlen "testing 1, 2, 3"))