From 25a0259b53bb534131fd25de894ffd95c2426dee Mon Sep 17 00:00:00 2001
From: Liam Healy <liam@thinkpad.local>
Date: Mon, 27 Apr 2009 22:17:11 -0400
Subject: [PATCH] Redeclare foreign-allocated variables called by reference

Also cdot, solve-quadratic-complex, solve-cubic-complex generate
complex scalars in the argument returned by reference.
---
 init/number-conversion.lisp | 4 ++--
 linear-algebra/blas1.lisp   | 4 ++--
 polynomial.lisp             | 7 ++++---
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/init/number-conversion.lisp b/init/number-conversion.lisp
index 248d5115..45f00fd7 100644
--- a/init/number-conversion.lisp
+++ b/init/number-conversion.lisp
@@ -1,6 +1,6 @@
 ;; Conversion of numbers C->CL
 ;; Liam Healy, Sun May 28 2006 - 22:04
-;; Time-stamp: <2009-04-25 23:44:15EDT number-conversion.lisp>
+;; Time-stamp: <2009-04-27 21:24:36EDT number-conversion.lisp>
 ;; $Id$
 
 (in-package :gsl)
@@ -42,7 +42,7 @@
 
 (defun cl-convert-form (decl)
   "Generate a form that calls the appropriate converter from C/GSL to CL."
-  (case (st-type decl)
+  (case (st-actual-type decl)
     (sf-result 
      `((val ,(st-symbol decl))
        (err ,(st-symbol decl))))
diff --git a/linear-algebra/blas1.lisp b/linear-algebra/blas1.lisp
index 1328754d..e1f12db7 100644
--- a/linear-algebra/blas1.lisp
+++ b/linear-algebra/blas1.lisp
@@ -1,6 +1,6 @@
 ;; BLAS level 1, Vector operations
 ;; Liam Healy, Wed Apr 26 2006 - 15:23
-;; Time-stamp: <2009-04-26 23:01:57EDT blas1.lisp>
+;; Time-stamp: <2009-04-27 21:30:47EDT blas1.lisp>
 ;; $Id$
 
 (in-package :gsl)
@@ -32,7 +32,7 @@
 (defmfun cdot ((x vector) (y vector))
   ("gsl_blas_" :type "dotc")
   (((mpointer x) :pointer) ((mpointer y) :pointer)
-   (result :element-c-type))
+   (result (:pointer :element-c-type)))
   :definition :generic
   :element-types :complex
   :inputs (x y)
diff --git a/polynomial.lisp b/polynomial.lisp
index 087217a2..55c8182f 100644
--- a/polynomial.lisp
+++ b/polynomial.lisp
@@ -1,6 +1,6 @@
 ;; Polynomials
 ;; Liam Healy, Tue Mar 21 2006 - 18:33
-;; Time-stamp: <2009-04-26 22:49:47EDT polynomial.lisp>
+;; Time-stamp: <2009-04-27 21:25:42EDT polynomial.lisp>
 ;; $Id$
 
 (in-package :gsl)
@@ -114,7 +114,7 @@
 (defmfun solve-quadratic-complex (a b c)
   "gsl_poly_complex_solve_quadratic"
   ((a :double) (b :double) (c :double)
-   (root1 complex-double-c) (root2 complex-double-c))
+   (root1 (:pointer complex-double-c)) (root2 (:pointer complex-double-c)))
   :c-return :number-of-answers
   :documentation			; FDL
   "The complex roots of the quadratic equation a x^2 + b x + c = 0.
@@ -140,7 +140,8 @@
 (defmfun solve-cubic-complex (a b c)
   "gsl_poly_complex_solve_cubic"
   ((a :double) (b :double) (c :double)
-   (root1 complex-double-c) (root2 complex-double-c) (root3 complex-double-c))
+   (root1 (:pointer complex-double-c)) (root2 (:pointer complex-double-c))
+   (root3 (:pointer complex-double-c)))
   :c-return :number-of-answers
   :documentation			; FDL
   "Find the complex roots of the cubic equation, x^3 + a x^2 + b x + c = 0
-- 
GitLab