Skip to content

Commit

Permalink
avoid some sbcl warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
death committed Nov 27, 2020
1 parent 48dedd7 commit e6823a9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 8 additions & 8 deletions consix.lisp
Expand Up @@ -83,7 +83,7 @@
(- 1.0
(/ (current-unclaimed grid)
(total-unclaimed grid)))))

(defsubst row-1+ (location) (+ location grid-cols))
(defsubst row-1- (location) (- location grid-cols))
(defsubst col-1+ (location) (+ location 1))
Expand Down Expand Up @@ -131,7 +131,7 @@
(funcall function)
(when (eq :delay value)
(compute-cell-weights (weights grid) grid))))

(defmacro with-weight-computation ((value grid) &body forms)
`(call-with-weight-computation (lambda () ,@forms) ,value ,grid))

Expand Down Expand Up @@ -554,7 +554,7 @@

(defsubst (setf head-angle) (new-value enemy)
(setf (first (enemy-structure enemy)) new-value))

(defsubst angle-between-positions (source-position target-position)
(if (vec=~ source-position target-position)
0.0
Expand Down Expand Up @@ -713,7 +713,7 @@
(when (< (length (enemy-structure enemy)) (max-size enemy))
(setf (growth-tick enemy) 0)
(appendf (enemy-structure enemy) (list (lastcar (enemy-structure enemy))))))

(defun enemy-check-growth (enemy)
(when (and (null (growth-tick enemy))
(plusp *tick*)
Expand Down Expand Up @@ -753,10 +753,10 @@

(defun add-score-entry (score-entry scores)
(if (plusp (score-entry-score score-entry))
(loop repeat scores-top-n
for score in (merge 'list (list score-entry) scores
#'> :key #'score-entry-score)
collect score)
(let ((new-scores
(merge 'list (list score-entry) scores
#'> :key #'score-entry-score)))
(subseq new-scores 0 (min scores-top-n (length new-scores))))
scores))

(defun score-top-n-p (score scores)
Expand Down
2 changes: 2 additions & 0 deletions gob.lisp
Expand Up @@ -198,6 +198,7 @@
v)

(defsubst unit (&optional (dir 0.0))
(declare (type (or real cons) dir))
(if (consp dir)
(vec/ dir (vec-mag dir))
(vec (- (cosd dir)) (- (sind dir)))))
Expand Down Expand Up @@ -758,6 +759,7 @@
(declare (ignore slot-names))
(flet ((initarg (name &optional default-value)
(getf initargs name default-value)))
(declare (ignorable #'initarg))
(let ,object-names
,@(loop for object in objects
for name = (object-name object)
Expand Down

0 comments on commit e6823a9

Please sign in to comment.