[movitz-cvs] CVS update: movitz/losp/muerte/integers.lisp

Frode Vatvedt Fjeld ffjeld at common-lisp.net
Tue Nov 23 16:05:28 UTC 2004


Update of /project/movitz/cvsroot/movitz/losp/muerte
In directory common-lisp.net:/tmp/cvs-serv7292

Modified Files:
	integers.lisp 
Log Message:
Try to be a bit more clever in dpb.

Date: Tue Nov 23 17:05:25 2004
Author: ffjeld

Index: movitz/losp/muerte/integers.lisp
diff -u movitz/losp/muerte/integers.lisp:1.101 movitz/losp/muerte/integers.lisp:1.102
--- movitz/losp/muerte/integers.lisp:1.101	Sun Nov 21 01:10:11 2004
+++ movitz/losp/muerte/integers.lisp	Tue Nov 23 17:05:23 2004
@@ -9,7 +9,7 @@
 ;;;; Created at:    Wed Nov  8 18:44:57 2000
 ;;;; Distribution:  See the accompanying file COPYING.
 ;;;;                
-;;;; $Id: integers.lisp,v 1.101 2004/11/21 00:10:11 ffjeld Exp $
+;;;; $Id: integers.lisp,v 1.102 2004/11/23 16:05:23 ffjeld Exp $
 ;;;;                
 ;;;;------------------------------------------------------------------
 
@@ -2119,8 +2119,12 @@
 	 
 
 (defun dpb (newbyte bytespec integer)
-  (logior (mask-field bytespec (ash newbyte (byte-position bytespec)))
-	  (logandc2 integer (mask-field bytespec -1))))
+  (logior (if (= 0 newbyte)
+	      0
+	    (mask-field bytespec (ash newbyte (byte-position bytespec))))
+	  (if (= 0 integer)
+	      0
+	    (logandc2 integer (mask-field bytespec -1)))))
 
 (defun mask-field (bytespec integer)
   (ash (ldb bytespec integer) (byte-position bytespec)))





More information about the Movitz-cvs mailing list