From: Stas Boukarev Date: Mon, 5 Dec 2011 11:22:53 +0000 (+0400) Subject: Remove unused variable warnings in some setf expansions. X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=3b46c751d4b14431841b2a2922e83394833047bb;p=sbcl.git Remove unused variable warnings in some setf expansions. (let (list) (setf (getf list 'x 0) 10)) produced a style-warning on a temporary variable for holding 0, which is unused. Fixes lp#492071. --- diff --git a/src/code/early-setf.lisp b/src/code/early-setf.lisp index b8a15d4..fdcac0c 100644 --- a/src/code/early-setf.lisp +++ b/src/code/early-setf.lisp @@ -467,6 +467,7 @@ `(,newval) `(let ((,(car stores) (%putf ,get ,ptemp ,newval)) ,@(cdr stores)) + ,def-temp ;; prevent unused style-warning ,set ,newval) `(getf ,get ,ptemp ,@(if default `(,def-temp))))))) @@ -479,7 +480,8 @@ (values `(,symbol-temp ,prop-temp ,@(if default `(,def-temp))) `(,symbol ,prop ,@(if default `(,default))) (list newval) - `(%put ,symbol-temp ,prop-temp ,newval) + `(progn ,def-temp ;; prevent unused style-warning + (%put ,symbol-temp ,prop-temp ,newval)) `(get ,symbol-temp ,prop-temp ,@(if default `(,def-temp)))))) (sb!xc:define-setf-expander gethash (key hashtable &optional default) @@ -491,7 +493,8 @@ `(,key-temp ,hashtable-temp ,@(if default `(,default-temp))) `(,key ,hashtable ,@(if default `(,default))) `(,new-value-temp) - `(%puthash ,key-temp ,hashtable-temp ,new-value-temp) + `(progn ,default-temp ;; prevent unused style-warning + (%puthash ,key-temp ,hashtable-temp ,new-value-temp)) `(gethash ,key-temp ,hashtable-temp ,@(if default `(,default-temp)))))) (sb!xc:define-setf-expander logbitp (index int &environment env)