Permalink
Browse files

Move all warning logic back to WARN-IF-KW-OR-BELONGS-TO-CL

  • Loading branch information...
1 parent 294164f commit d1d2eb4147004d3a567fb1ca48ff7d6572a96d6c @sionescu sionescu committed Feb 23, 2013
Showing with 4 additions and 6 deletions.
  1. +1 −3 src/early-types.lisp
  2. +3 −3 src/utils.lisp
View
4 src/early-types.lisp
@@ -69,9 +69,7 @@
(defmacro define-parse-method (name lambda-list &body body)
"Define a type parser on NAME and lists whose CAR is NAME."
(discard-docstring body)
- (unless (member (package-name *package*) '(#:cffi #:cffi-sys #:cffi-tests)
- :key #'string)
- (warn-if-kw-or-belongs-to-cl name))
+ (warn-if-kw-or-belongs-to-cl name)
`(eval-when (:compile-toplevel :load-toplevel :execute)
(setf (find-type-parser ',name)
(lambda ,lambda-list ,@body))
View
6 src/utils.lisp
@@ -48,9 +48,9 @@ set twos-complement bit."
;;; packages. CFFI itself gets to use keywords without a warning.
(defun warn-if-kw-or-belongs-to-cl (name)
(let ((package (symbol-package name)))
- (when (or (eq package (find-package '#:cl))
- (and (not (eq *package* (find-package '#:cffi)))
- (eq package (find-package '#:keyword))))
+ (when (and (not (eq *package* (find-package '#:cffi)))
+ (member package '(#:common-lisp #:keyword)
+ :key #'find-package))
(warn "Defining a foreign type named ~S. This symbol belongs to the ~A ~
package and that may interfere with other code using CFFI."
name (package-name package)))))

0 comments on commit d1d2eb4

Please sign in to comment.