Skip to content

Commit

Permalink
fewer warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
melisgl committed Jul 20, 2023
1 parent 0cff90d commit fe4f335
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 34 deletions.
3 changes: 2 additions & 1 deletion dref/src/base/extension-api.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,13 @@
types. This function is for extending LOCATE. Do not call it
directly.")
(:method :around (name locative-type locative-args)
(declare (ignorable name locative-type locative-args))
(let ((located (call-next-method)))
(assert (or (not (typep located 'xref))
(typep located 'dref)))
located))
(:method (name locative-type locative-args)
(declare (ignore name locative-type locative-args))
(declare (ignorable name locative-type locative-args))
(locate-error)))

(defvar *resolving-dref*)
Expand Down
3 changes: 2 additions & 1 deletion dref/src/full/swank-util.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
(first dspec-forms)
(progn
(format *error-output* "!!! No definition for ~S." name)
`'(,(gensym "NOTIMPLEMENTED"))))))))
`'(,(gensym "NOTIMPLEMENTED") ,name)))))))

#-(or allegro ecl)
(defun normalize-dspec (dspec)
Expand Down Expand Up @@ -327,6 +327,7 @@
(:or :ccl :cmucl) `(class ,name))

(define-dspec swank-package-dspec (name)
(:or :abcl :allegro :ecl :cmucl) `(:no-such-dspec ,name)
:ccl `(package ,name)
:sbcl `(defpackage ,name))

Expand Down
3 changes: 2 additions & 1 deletion src/asdf.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
(funcall continuation)))

(defun compile-without-some-warnings (continuation)
(let (#+allegro (compiler:*cltl1-compile-file-toplevel-compatibility-p* nil))
(let (#+allegro (compiler:*cltl1-compile-file-toplevel-compatibility-p* nil)
#+allegro (excl:*redefinition-warnings* nil))
(funcall continuation)))

(defun compile-pax (continuation)
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/basics.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,13 @@
(defmethod exportable-reference-p (package symbol
(locative-type (eql 'section))
locative-args)
(declare (ignore symbol locative-args))
(declare (ignore package symbol locative-args))
nil)

(defmethod exportable-reference-p (package symbol
(locative-type (eql 'glossary-term))
locative-args)
(declare (ignore symbol locative-args))
(declare (ignore package symbol locative-args))
nil)

(defgeneric exportable-locative-type-p (locative-type)
Expand Down
4 changes: 3 additions & 1 deletion src/document/document.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,7 @@

(defgeneric document-object (object stream)
(:method :around (object stream)
(declare (ignorable stream))
(let ((*objects-being-documented* (cons object *objects-being-documented*)))
(call-next-method)))
(:method (object stream)
Expand Down Expand Up @@ -2251,7 +2252,8 @@

(defgeneric title (object)
(:method (object)
nil)
(declare (ignore object))
nil)
(:method ((section section))
(values (section-title section) t))
(:method ((glossary-term glossary-term))
Expand Down
3 changes: 1 addition & 2 deletions src/document/hyperspec.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -1117,8 +1117,7 @@
obj))

(defun hyperspec-locatives-for-name (name)
(loop for (locative filename)
in (gethash name *hyperspec-name-to-locatives*)
(loop for (locative *) in (gethash name *hyperspec-name-to-locatives*)
collect locative))


Expand Down
34 changes: 18 additions & 16 deletions src/document/markdown.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -214,22 +214,24 @@
;;; of new tree (which must be a LIST) are added. No slice is like
;;; MAPCAR, slice is is MAPCAN.
(defun transform-tree (fn tree)
(labels ((foo (parent tree)
(multiple-value-bind (new-tree recurse slice)
(funcall fn parent tree)
(assert (or (not slice) (listp new-tree)))
(if (or (atom new-tree)
(not recurse))
(values new-tree slice)
(values (loop for sub-tree in new-tree
append (multiple-value-bind
(new-sub-tree slice)
(foo new-tree sub-tree)
(if slice
new-sub-tree
(list new-sub-tree))))
slice)))))
(foo nil tree)))
(declare (optimize speed))
(let ((fn (coerce fn 'function)))
(labels ((foo (parent tree)
(multiple-value-bind (new-tree recurse slice)
(funcall fn parent tree)
(assert (or (not slice) (listp new-tree)))
(if (or (atom new-tree)
(not recurse))
(values new-tree slice)
(values (loop for sub-tree in new-tree
nconc (multiple-value-bind
(new-sub-tree slice)
(foo new-tree sub-tree)
(if slice
(copy-list new-sub-tree)
(list new-sub-tree))))
slice)))))
(foo nil tree))))

;;; When used as the FN argument to TRANSFORM-TREE, leave the tree
;;; intact except for subtrees (lists) whose CAR is in TAGS, whose
Expand Down
17 changes: 7 additions & 10 deletions src/navigate/locatives.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
(add-dref-actualizer 'actualize-variable-to-section)

(defmethod docstring* ((dref section-dref))
(declare (ignore dref))
nil)


Expand Down Expand Up @@ -149,6 +148,7 @@
:target-dref go-dref))))

(defmethod map-definitions (name (locative-type (eql 'go)))
(declare (ignorable name))
;; There are no real GO definitions.
(values))

Expand Down Expand Up @@ -177,9 +177,8 @@
DISLOCATED references do not RESOLVE.")

(defmethod dref* (symbol (locative-type (eql 'dislocated))
locative-args)
(declare (ignore symbol locative-args))
(defmethod dref* (symbol (locative-type (eql 'dislocated)) locative-args)
(declare (ignorable symbol locative-args))
(locate-error "~S can never be located." 'dislocated))


Expand All @@ -204,9 +203,8 @@
ARGUMENT references do not RESOLVE.""")

(defmethod dref* (symbol (locative-type (eql 'argument))
locative-args)
(declare (ignore symbol locative-args))
(defmethod dref* (symbol (locative-type (eql 'argument)) locative-args)
(declare (ignorable symbol locative-args))
(locate-error "~S can never be located." 'argument))


Expand All @@ -217,9 +215,8 @@
There is no way to LOCATE DOCSTRINGs, so nothing to RESOLVE either.")

(defmethod dref* (symbol (locative-type (eql 'docstring))
locative-args)
(declare (ignore symbol locative-args))
(defmethod dref* (symbol (locative-type (eql 'docstring)) locative-args)
(declare (ignorable symbol locative-args))
(locate-error "DOCSTRING can never be located."))


Expand Down
1 change: 1 addition & 0 deletions src/web/web.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@

(defmethod hunchentoot:acceptor-dispatch-request
:around ((acceptor (eql *server*)) request)
(declare (ignorable request))
(let ((hunchentoot:*dispatch-table* (append *dispatch-table*
*hyperspec-dispatch-table*))
(*document-hyperspec-root*
Expand Down

0 comments on commit fe4f335

Please sign in to comment.