gnu: Add kafs-client
[jackhill/guix/guix.git] / gnu / packages / patches / sbcl-clml-fix-types.patch
1 commit 9920bf86604b536c735b6478488a3cb89413e000
2 Author: Guillaume Le Vaillant <glv@posteo.net>
3 Date: Tue Dec 1 09:38:41 2020 +0100
4
5 Fix some type declarations
6
7 This allows compiling with SBCL 2.0.11 which is less tolerant with wrong type
8 declarations.
9
10 diff --git a/som/src/lvq_pak.lisp b/som/src/lvq_pak.lisp
11 index 1a062cc..4006ed6 100644
12 --- a/som/src/lvq_pak.lisp
13 +++ b/som/src/lvq_pak.lisp
14 @@ -53,7 +53,7 @@
15 (current :accessor entries-current :initarg :current :initform 0
16 :documentation "index of current data-entry inside data-entries")
17 (entries :accessor entries-entries :initarg :entries :initform nil
18 - :type #-ccl cons #+ccl list
19 + :type #-ccl (or null cons) #+ccl list
20 :documentation "list of data-entries")
21 (num-loaded :accessor entries-num-loaded :initarg :num-loaded :initform nil
22 :documentation "number of lines loaded in entries list")
23 diff --git a/statistics/src/rand/rand.lisp b/statistics/src/rand/rand.lisp
24 index 3cd806a..c8f9952 100644
25 --- a/statistics/src/rand/rand.lisp
26 +++ b/statistics/src/rand/rand.lisp
27 @@ -154,7 +154,7 @@
28 (xn (make-array (1+ n) :element-type 'double-float)))
29 (declare (type double-float r v d)
30 (type fixnum k n n-minus-1)
31 - (type (vector double-float *) xn))
32 + (type (simple-array double-float (*)) xn))
33 ;; build xn
34 (setf (aref xn n) (* v (exp (/ (* r r) 2))))
35 (setf (aref xn (1- n)) r)
36 @@ -233,8 +233,8 @@
37 (base (expt 2 (- +bit-operation-m+ k 1))))
38 (declare (type double-float r v d)
39 (type fixnum k n n-minus-1 base)
40 - (type (vector double-float *) wn fn)
41 - (type (vector fixnum *) kn))
42 + (type (simple-array double-float (*)) wn fn)
43 + (type (simple-array fixnum (*)) kn))
44 ;; build arrays
45 (setf (aref wn (- n 1)) (/ (* v (exp (/ (* r r) 2))) base))
46 (setf (aref wn (- n 2)) (/ r base))
47 @@ -347,8 +347,8 @@
48 (base (expt 2 (- +bit-operation-m+ k))))
49 (declare (type double-float r v d)
50 (type fixnum k n n-minus-1 base)
51 - (type (vector double-float *) wn fn)
52 - (type (vector fixnum *) kn))
53 + (type (simple-array double-float (*)) wn fn)
54 + (type (simple-array fixnum (*)) kn))
55 ;; build arrays
56 (setf (aref wn (- n 1)) (/ (* v (exp (/ (* r r) 2))) base))
57 (setf (aref wn (- n 2)) (/ r base))
58 @@ -546,8 +546,8 @@
59 (base (expt 2 (- +bit-operation-m+ k 1))))
60 (declare (type double-float r v tr1 tr2)
61 (type fixnum k n n-minus-1 base)
62 - (type (vector double-float *) wn fn)
63 - (type (vector fixnum *) kn))
64 + (type (simple-array double-float (*)) wn fn)
65 + (type (simple-array fixnum (*)) kn))
66 ;; build arrays
67 (setf (aref wn (- n 1)) (/ (* v (+ 1 (* r r))) base))
68 (setf (aref wn (- n 2)) (/ r base))
69 @@ -663,8 +663,8 @@
70 (base (expt 2 (- +bit-operation-m+ k))))
71 (declare (type double-float r v)
72 (type fixnum k n n-minus-1 base)
73 - (type (vector double-float *) wn fn)
74 - (type (vector fixnum *) kn))
75 + (type (simple-array double-float (*)) wn fn)
76 + (type (simple-array fixnum (*)) kn))
77 ;; build arrays
78 (setf (aref wn (- n 1)) (/ (* v (exp r)) base))
79 (setf (aref wn (- n 2)) (/ r base))
80 @@ -804,8 +804,8 @@
81 (base (expt 2 (- +bit-operation-m+ k 1))))
82 (declare (type double-float r v)
83 (type fixnum k n n-minus-1 base)
84 - (type (vector double-float *) wn fn)
85 - (type (vector fixnum *) kn))
86 + (type (simple-array double-float (*)) wn fn)
87 + (type (simple-array fixnum (*)) kn))
88 ;; build arrays
89 (setf (aref wn (- n 1)) (/ (* v (exp r)) base))
90 (setf (aref wn (- n 2)) (/ r base))
91 @@ -2083,8 +2083,8 @@
92 (base (expt 2 (- +bit-operation-m+ k 1))))
93 (declare (type double-float r v tr)
94 (type fixnum k n n-minus-1 base)
95 - (type (vector double-float *) wn fn)
96 - (type (vector fixnum *) kn))
97 + (type (simple-array double-float (*)) wn fn)
98 + (type (simple-array fixnum (*)) kn))
99 ;; build arrays
100 (setf (aref wn (- n 1)) (/ (* (expt (+ 1d0 tr) 2) v) tr base))
101 (setf (aref wn (- n 2)) (/ r base))
102 @@ -2383,7 +2383,7 @@
103 ans)))
104 (declare (type double-float s a d)
105 (type vector tix)
106 - (type (vector fixnum *) si))
107 + (type (simple-array fixnum (*)) si))
108 (values tix si)))
109
110 (defun binomial-table-lookup (tix si)
111 @@ -2415,7 +2415,7 @@
112 (b (expt 2 k)))
113 (declare (type double-float s a)
114 (type fixnum nsq k b)
115 - (type (vector double-float *) pbins))
116 + (type (simple-array double-float (*)) pbins))
117 ;; build pbins
118 (setf (aref pbins 0) (int-power (- 1d0 probability) size))
119 (loop for i from 1 to size do
120 @@ -2438,7 +2438,7 @@
121 do (incf j tx)) :initial-element -1 :element-type 'fixnum))
122 (thetan 0d0))
123 (declare (type double-float w thetan)
124 - (type (vector fixnum *) table))
125 + (type (simple-array fixnum (*)) table))
126 (loop with j = 0
127 for x from 0
128 for pbin across pbins
129 @@ -2454,8 +2454,8 @@
130 (vi (make-array nsq :element-type 'double-float
131 :initial-contents (loop for i from 0 to size collect (dfloat (/ (+ i 1) nsq)))))
132 (c (dfloat (/ nsq))))
133 - (declare (type (vector fixnum *) ki)
134 - (type (vector double-float *) vi)
135 + (declare (type (simple-array fixnum (*)) ki)
136 + (type (simple-array double-float (*)) vi)
137 (type double-float c))
138 (loop repeat size do
139 (let ((maxp 0)
140 @@ -2658,7 +2658,7 @@
141 (thetan 0d0)
142 (sum 0d0))
143 (declare (type double-float w thetan sum)
144 - (type (vector fixnum *) table))
145 + (type (simple-array fixnum (*)) table))
146 (loop with j = 0
147 for x from 0
148 for pgeo across pgeos
149 @@ -2675,8 +2675,8 @@
150 (vi (make-array nsq :element-type 'double-float
151 :initial-contents (loop for i from 0 below nsq collect (dfloat (/ (+ i 1) nsq)))))
152 (c (dfloat (/ nsq))))
153 - (declare (type (vector fixnum *) ki)
154 - (type (vector double-float *) vi)
155 + (declare (type (simple-array fixnum (*)) ki)
156 + (type (simple-array double-float (*)) vi)
157 (type double-float c))
158 (loop repeat (1- nsq) do
159 (let ((maxp 0)
160 @@ -2911,7 +2911,7 @@
161 (sum 0d0))
162 (declare (type double-float w thetan sum pl pu)
163 (type fixnum nsq d)
164 - (type (vector fixnum *) table))
165 + (type (simple-array fixnum (*)) table))
166 (unless (= xl 0)
167 (setf pps (subseq pps xl)))
168 (loop with j = 0
169 @@ -2930,8 +2930,8 @@
170 (vi (make-array nsq :element-type 'double-float
171 :initial-contents (loop for i from 0 below nsq collect (dfloat (/ (+ i 1) nsq)))))
172 (c (dfloat (/ nsq))))
173 - (declare (type (vector fixnum *) ki)
174 - (type (vector double-float *) vi)
175 + (declare (type (simple-array fixnum (*)) ki)
176 + (type (simple-array double-float (*)) vi)
177 (type double-float c))
178 (loop repeat (1- nsq) do
179 (let ((maxp 0)
180 @@ -3174,7 +3174,7 @@
181 (k 7)
182 (b (expt 2 k)))
183 (declare (type fixnum a1 a2 nsq k b)
184 - (type (vector double-float *) phs))
185 + (type (simple-array double-float (*)) phs))
186 ;; build phs
187 (setf (aref phs 0)
188 (/ (dfloat (the fixnum (* (combination successes a1) (combination (- elements successes) (- samples a1)))))
189 @@ -3200,7 +3200,7 @@
190 (table (make-array b :initial-element -1 :element-type 'fixnum))
191 (thetan 0d0))
192 (declare (type double-float w thetan)
193 - (type (vector fixnum *) table))
194 + (type (simple-array fixnum (*)) table))
195 (loop with j = 0
196 for x from a1
197 for i from 0
198 @@ -3217,8 +3217,8 @@
199 (vi (make-array nsq :element-type 'double-float
200 :initial-contents (loop for i from 0 below nsq collect (dfloat (/ (+ i 1) nsq)))))
201 (c (dfloat (/ nsq))))
202 - (declare (type (vector fixnum *) ki)
203 - (type (vector double-float *) vi)
204 + (declare (type (simple-array fixnum (*)) ki)
205 + (type (simple-array double-float (*)) vi)
206 (type double-float c))
207 (loop repeat (1- nsq) do
208 (let ((maxp 0)
209 @@ -3442,7 +3442,7 @@
210 (sum 0d0))
211 (declare (type double-float w thetan sum pl pu)
212 (type fixnum nsq d)
213 - (type (vector fixnum *) table))
214 + (type (simple-array fixnum (*)) table))
215 (unless (= xl 0)
216 (setf pnbs (subseq pnbs xl)))
217 (loop with j = 0
218 @@ -3461,8 +3461,8 @@
219 (vi (make-array nsq :element-type 'double-float
220 :initial-contents (loop for i from 0 below nsq collect (dfloat (/ (+ i 1) nsq)))))
221 (c (dfloat (/ nsq))))
222 - (declare (type (vector fixnum *) ki)
223 - (type (vector double-float *) vi)
224 + (declare (type (simple-array fixnum (*)) ki)
225 + (type (simple-array double-float (*)) vi)
226 (type double-float c))
227 (loop repeat (1- nsq) do
228 (let ((maxp 0)
229 diff --git a/time-series/src/ts-read-data.lisp b/time-series/src/ts-read-data.lisp
230 index 09ad933..a692514 100644
231 --- a/time-series/src/ts-read-data.lisp
232 +++ b/time-series/src/ts-read-data.lisp
233 @@ -5,7 +5,7 @@
234 ((frequency :initarg :frequency
235 :accessor ts-freq
236 :initform nil
237 - :type number)
238 + :type (or null number))
239 (start :initarg :start :accessor ts-start :initform nil)
240 (end :initarg :end :accessor ts-end :initform nil)
241 (ts-type :initarg :ts-type :accessor ts-type :initform nil)
242 diff --git a/time-series/src/ts-state-space-model.lisp b/time-series/src/ts-state-space-model.lisp
243 index 4dbf56a..ad9e5cc 100644
244 --- a/time-series/src/ts-state-space-model.lisp
245 +++ b/time-series/src/ts-state-space-model.lisp
246 @@ -348,8 +348,8 @@
247 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
248 (eval-when (:execute :compile-toplevel :load-toplevel)
249 (defclass trend-model (gaussian-stsp-model)
250 - ((diff-k :initarg :diff-k :initform nil :type integer :accessor diff-k)
251 - (tau^2 :initarg :tau^2 :initform nil :type number :accessor tau^2)
252 + ((diff-k :initarg :diff-k :initform nil :type (or null integer) :accessor diff-k)
253 + (tau^2 :initarg :tau^2 :initform nil :type (or null number) :accessor tau^2)
254 (aic :initarg :aic :initform +nan+ :type number))
255 (:documentation "- parent: gaussian-stsp-model
256 - accessors:
257 @@ -492,9 +492,9 @@
258 ; seasonal model ;
259 ;;;;;;;;;;;;;;;;;;
260 (defclass seasonal-model (gaussian-stsp-model)
261 - ((s-deg :initarg :s-deg :initform nil :type fixnum :accessor s-deg)
262 - (s-freq :initarg :s-freq :initform nil :type fixnum :accessor s-freq)
263 - (tau^2 :initarg :tau^2 :initform nil :type number :accessor tau^2))
264 + ((s-deg :initarg :s-deg :initform nil :type (or null fixnum) :accessor s-deg)
265 + (s-freq :initarg :s-freq :initform nil :type (or null fixnum) :accessor s-freq)
266 + (tau^2 :initarg :tau^2 :initform nil :type (or null number) :accessor tau^2))
267 (:documentation "- parent: gaussian-stsp-model
268 - accessors
269 - s-deg : Degree for seasonal model
270 @@ -593,8 +593,8 @@
271 ; seasonal-adjustment-model ;
272 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
273 (defclass seasonal-adjustment-model (gaussian-stsp-model)
274 - ((trend :initarg :trend :initform nil :type trend-model :accessor trend-model)
275 - (seasonal :initarg :seasonal :initform nil :type seasonal-model :accessor seasonal-model))
276 + ((trend :initarg :trend :initform nil :type (or null trend-model) :accessor trend-model)
277 + (seasonal :initarg :seasonal :initform nil :type (or null seasonal-model) :accessor seasonal-model))
278 (:documentation "Standard seasonal adjustment model ( Trend + Seasonal )
279 - parent: gaussian-stsp-model
280 - accessors