Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added compile-time warnings.

  • Loading branch information...
commit 0125709ce2fd5c6cbf0e51011ff5769b45090645 1 parent 6170c6f
Josh Marchán authored
Showing with 12 additions and 9 deletions.
  1. +12 −9 utilities.lisp
View
21 utilities.lisp
@@ -68,16 +68,19 @@
(with-bound-image id
(get-integer :image-bits-per-pixel)))
-(defmacro define-replace-fun (deprecated new)
+(defmacro define-deprecated-image-fun (deprecated new)
`(progn (declaim (inline ,deprecated))
- (defun ,deprecated (&rest args)
- (apply #',new args))))
-
-(define-replace-fun width-of image-width)
-(define-replace-fun height-of image-height)
-(define-replace-fun pixel-format-of image-format)
-(define-replace-fun element-type-of image-type)
-(define-replace-fun bytes-per-pixel-of image-bytes-per-pixel)
+ (defun ,deprecated (id)
+ (,new id))
+ (define-compiler-macro ,deprecated (id)
+ (warn "~A is deprecated. Please use ~A instead." ',deprecated ',new)
+ (list ',new id))))
+
+(define-deprecated-image-fun width-of image-width)
+(define-deprecated-image-fun height-of image-height)
+(define-deprecated-image-fun pixel-format-of image-format)
+(define-deprecated-image-fun element-type-of image-type)
+(define-deprecated-image-fun bytes-per-pixel-of image-bytes-per-pixel)
(defun copy-palette (dest src)
(bind-image src)

0 comments on commit 0125709

Please sign in to comment.
Something went wrong with that request. Please try again.