From ccb4133ebd70e69b07deb02fc5653d8d05e36834 Mon Sep 17 00:00:00 2001 From: stevenj Date: Sat, 12 Jun 2010 22:07:26 -0400 Subject: [PATCH] bug fix in guile wrapper, to match latest C++ api darcs-hash:20100613020726-c8de0-c70e2d5c022756ef40e0b493e46dbfb9dcd37849.gz --- swig/nlopt-guile.i | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/swig/nlopt-guile.i b/swig/nlopt-guile.i index f70b6e0..aea3110 100644 --- a/swig/nlopt-guile.i +++ b/swig/nlopt-guile.i @@ -10,7 +10,7 @@ static void *free_guilefunc(void *p) { static void *dup_guilefunc(void *p) { scm_gc_protect_object((SCM) p); return p; } -// vfunc wrapper around Guile function (val . grad) = f(x) +// func wrapper around Guile function (val . grad) = f(x) static double func_guile(unsigned n, const double *x, double *grad, void *f) { SCM xscm = scm_c_make_vector(n, SCM_UNSPECIFIED); for (unsigned i = 0; i < n; ++i) @@ -36,13 +36,13 @@ static double func_guile(unsigned n, const double *x, double *grad, void *f) { } %} -%typemap(in)(nlopt::vfunc vf, void *f_data, nlopt_munge md, nlopt_munge mc) { - $1 = vfunc_guile; +%typemap(in)(nlopt::func f, void *f_data, nlopt_munge md, nlopt_munge mc) { + $1 = func_guile; $2 = dup_guilefunc((void*) $input); // input = SCM pointer to Scheme function $3 = free_guilefunc; $4 = dup_guilefunc; } -%typecheck(SWIG_TYPECHECK_POINTER)(nlopt::vfunc vf, void *f_data, nlopt_munge md, nlopt_munge mc) { +%typecheck(SWIG_TYPECHECK_POINTER)(nlopt::func f, void *f_data, nlopt_munge md, nlopt_munge mc) { $1 = SCM_NFALSEP(scm_procedure_p($input)); } -- 2.30.2