Hey,
The following code gives 6 compiler notes on CMUCL 18e which I can't
seem to get rid of. Its the last three that really bother me. It seems
to me that if the second make-vector is ok then the third one should be
as well. Adding "the double-float" everywhere doesn't seem to help either.
If anyone has a solution to this I would be very grateful. I have code
similar to this in a number of frequently executed functions in my app.
;;; Simplified test code
(declaim (optimize (speed 3) (safety 0)))
(defstruct vec3
(x 0.0d0 :type double-float)
(y 0.0d0 :type double-float)
(z 0.0d0 :type double-float))
(defun normalize (v)
"Returns the normalized form of the vector V."
(let ((magnitude 1.25d0))
(declare (double-float magnitude))
(make-vec3 :x 0.0d0 :y 0.0d0 :z 0.0d0)
(make-vec3 :x (/ 0.0d0 1.0d0)
:y magnitude
:z (/ 1.0d0 magnitude))
(make-vec3 :x (/ (vec3-x v) magnitude)
:y (/ (vec3-y v) magnitude)
:z (/ (vec3-z v) magnitude))))
Thanks,
Jonathan Simpson