Commit 9223686a by Liam M. Healy

Reduce number of warnings during compilation

Minor fixes to reduce number of warnings during compilation, mostly by
updating the foreign structure refrences for CFFI.
parent b6d30715
;; Combinations
;; Liam Healy, Sun Mar 26 2006 - 11:51
;; Time-stamp: <2012-01-13 12:01:36EST combination.lisp>
;; Time-stamp: <2016-06-14 23:37:59EDT combination.lisp>
;;
;; Copyright 2006, 2007, 2008, 2009, 2010, 2011 Liam M. Healy
;; Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2016 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -33,14 +33,14 @@
(defmethod initialize-instance :after
((object combination) &key range dimensions &allow-other-keys)
(let ((mptr (cffi:foreign-alloc 'gsl-combination-c)))
(let ((mptr (cffi:foreign-alloc '(:struct gsl-combination-c))))
(setf (grid:metadata-slot object 'mpointer)
mptr
(cffi:foreign-slot-value mptr 'gsl-combination-c 'data)
(cffi:foreign-slot-value mptr '(:struct gsl-combination-c) 'data)
(grid:foreign-pointer object)
(cffi:foreign-slot-value mptr 'gsl-combination-c 'range)
(cffi:foreign-slot-value mptr '(:struct gsl-combination-c) 'range)
range
(cffi:foreign-slot-value mptr 'gsl-combination-c 'size)
(cffi:foreign-slot-value mptr '(:struct gsl-combination-c) 'size)
(first dimensions))
(tg:finalize object (lambda () (cffi:foreign-free mptr)))))
......
;; A grid:foreign-array with added metadata for GSL.
;; Liam Healy 2008-04-06 21:23:41EDT
;; Time-stamp: <2011-10-30 09:45:20EDT foreign-array.lisp>
;; Time-stamp: <2016-06-14 23:30:39EDT foreign-array.lisp>
;;
;; Copyright 2008, 2009, 2010, 2011 Liam M. Healy
;; Copyright 2008, 2009, 2010, 2011, 2016 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -40,10 +40,10 @@
(unless (grid:metadata-slot object 'mpointer)
(when (zerop (size object))
(error "Object ~a has zero total dimension." object))
(let ((blockptr (cffi:foreign-alloc 'gsl-block-c)))
(setf (cffi:foreign-slot-value blockptr 'gsl-block-c 'size)
(let ((blockptr (cffi:foreign-alloc '(:struct gsl-block-c))))
(setf (cffi:foreign-slot-value blockptr '(:struct gsl-block-c) 'size)
(size object)
(cffi:foreign-slot-value blockptr 'gsl-block-c 'data)
(cffi:foreign-slot-value blockptr '(:struct gsl-block-c) 'data)
(grid:foreign-pointer object)
(grid:metadata-slot object 'block-pointer) blockptr)
(let ((array-struct (alloc-from-block object blockptr)))
......
;; Permutations
;; Liam Healy, Sun Mar 26 2006 - 11:51
;; Time-stamp: <2014-12-08 23:19:56EST permutation.lisp>
;; Time-stamp: <2016-06-14 23:31:07EDT permutation.lisp>
;;
;; Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2014 Liam M. Healy
;; Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2014, 2016 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -34,12 +34,12 @@
(defmethod initialize-instance :after
((object permutation) &key dimensions &allow-other-keys)
(let ((mptr (cffi:foreign-alloc 'gsl-permutation-c)))
(let ((mptr (cffi:foreign-alloc '(:struct gsl-permutation-c))))
(setf (grid:metadata-slot object 'mpointer)
mptr
(cffi:foreign-slot-value mptr 'gsl-permutation-c 'data)
(cffi:foreign-slot-value mptr '(:struct gsl-permutation-c) 'data)
(grid:foreign-pointer object)
(cffi:foreign-slot-value mptr 'gsl-permutation-c 'size)
(cffi:foreign-slot-value mptr '(:struct gsl-permutation-c) 'size)
(first dimensions))
(tg:finalize object (lambda () (cffi:foreign-free mptr)))))
......
;; Eigensystems for nonsymmetric real matrices
;; Liam Healy 2009-02-16 12:51:18EST nonsymmetric.lisp
;; Time-stamp: <2012-01-13 12:01:33EST nonsymmetric.lisp>
;; Time-stamp: <2016-06-14 23:38:36EDT nonsymmetric.lisp>
;;
;; Copyright 2009, 2011 Liam M. Healy
;; Copyright 2009, 2011, 2012, 2016 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -74,7 +74,7 @@
:outputs (A eigenvalues)
:return
(eigenvalues
(cffi:foreign-slot-value (mpointer ws) 'gsl-nonsymm-ws 'n-evals))
(cffi:foreign-slot-value (mpointer ws) '(:struct gsl-nonsymm-ws) 'n-evals))
:documentation ; FDL
"Compute the eigenvalues of the real nonsymmetric matrix A and
stores them in the vector 'eigenvalues. If T is desired, it is
......
;; Macro for defining GSL functions.
;; Liam Healy 2008-04-16 20:49:50EDT defmfun.lisp
;; Time-stamp: <2014-02-16 09:11:46EST defmfun.lisp>
;; Time-stamp: <2016-06-14 23:39:02EDT defmfun.lisp>
;;
;; Copyright 2008, 2009, 2010, 2014 Liam M. Healy
;; Copyright 2008, 2009, 2010, 2014, 2016 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -95,7 +95,7 @@
documentation inputs outputs before after enumeration qualifier
gsl-version switch ((:callbacks cbinfo)) callback-dynamic callback-object)
,key-args
(declare (ignorable c-return return definition element-types
(declare (ignorable c-return return return-supplied-p definition element-types
index export documentation inputs outputs
before after enumeration qualifier
gsl-version switch cbinfo callback-dynamic callback-object)
......
;; Nonlinear least squares fitting.
;; Liam Healy, 2008-02-09 12:59:16EST nonlinear-least-squares.lisp
;; Time-stamp: <2012-01-13 12:01:17EST nonlinear-least-squares.lisp>
;; Time-stamp: <2016-06-14 23:34:23EDT nonlinear-least-squares.lisp>
;;
;; Copyright 2008, 2009, 2011 Liam M. Healy
;; Copyright 2008, 2009, 2011, 2012, 2016 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -135,15 +135,15 @@
;;; Why doesn't GSL have functions to extract these values?
(defmethod function-value ((solver nonlinear-fdffit))
(make-foreign-array-from-mpointer
(cffi:foreign-slot-value (mpointer solver) 'gsl-fdffit-solver 'f)))
(cffi:foreign-slot-value (mpointer solver) '(:struct gsl-fdffit-solver) 'f)))
(defmethod last-step ((solver nonlinear-fdffit))
;; Raw pointer, because we presume we're passing it on to another GSL function.
(cffi:foreign-slot-value (mpointer solver) 'gsl-fdffit-solver 'dx))
(cffi:foreign-slot-value (mpointer solver) '(:struct gsl-fdffit-solver) 'dx))
(defun jacobian (solver)
;; Raw pointer, because we presume we're passing it on to another GSL function.
(cffi:foreign-slot-value (mpointer solver) 'gsl-fdffit-solver 'jacobian))
(cffi:foreign-slot-value (mpointer solver) '(:struct gsl-fdffit-solver) 'jacobian))
;;;;****************************************************************************
;;;; Search stopping
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment