Index: src/bessel.lisp
===================================================================
RCS file: /cvsroot/maxima/maxima/src/bessel.lisp,v
retrieving revision 1.23
diff -u -r1.23 bessel.lisp
--- src/bessel.lisp	13 Jun 2003 16:52:02 -0000	1.23
+++ src/bessel.lisp	16 Jul 2003 11:32:10 -0000
@@ -560,6 +560,9 @@
 		       (setq h (*$ 1.6 s) h2 (*$ 2.0 h) capn (f+ 6. (fix (*$ 23.0 s))))
 		       (setq nu (f+ 9. (fix (*$ 21.0 s)))))
 		      (t (setq h 0.0) (setq capn 0.) (setq nu 8.)))
+		;; Uhm.  H2 is a double-float; CAPN is a fixnum.
+		;; Something is going wrong here, because ^$ wants
+		;; both its arguments to be double-floats.
 		(and (> h 0.0) (setq lamb (^$ h2 capn)))
 		(setq bool (or (= h 0.0) (= lamb 0.0)))
 		(do ((n nu (f1- n)))
@@ -670,7 +673,7 @@
 	   (declare (double-float x)
 		    (optimize (speed 3) (safety 0)))
 	   (exp (* -0.5d0 x x))))
-    (declaim (inline density))
+    (declare (inline density))
     (multiple-value-bind (k-table w-table f-table)
 	(ziggurat-init 127 r 9.91256303526217d-3 31
 		       #'density
Index: src/comm2.lisp
===================================================================
RCS file: /cvsroot/maxima/maxima/src/comm2.lisp,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 comm2.lisp
--- src/comm2.lisp	8 May 2000 06:09:41 -0000	1.1.1.1
+++ src/comm2.lisp	16 Jul 2003 11:32:12 -0000
@@ -866,6 +866,10 @@
 	     (MERROR "Incorrect 2nd argument to GETCHAR: ~M" Y))
 ;	    ((char= (SETQ N (GETCHARN (FULLSTRIP1 X) Y)) 0) NIL)
 	    ((char= (GETCHARN X 1) '#\&) (IMPLODE (LIST #\& N)))
+	    ;; Given that the above-commented line is the only one
+	    ;; that mutates N, the code below is dead (noted by a
+	    ;; compile-time type-failure warning by SBCL)
+	    #+nil
 	    ((ASCII-NUMBERP N) (f- (char-code N) (char-code #\0)))
 	    (T (IMPLODE (LIST #\$ N))))))
 
Index: src/cpoly.lisp
===================================================================
RCS file: /cvsroot/maxima/maxima/src/cpoly.lisp,v
retrieving revision 1.3
diff -u -r1.3 cpoly.lisp
--- src/cpoly.lisp	12 Dec 2001 14:43:46 -0000	1.3
+++ src/cpoly.lisp	16 Jul 2003 11:32:18 -0000
@@ -952,7 +952,9 @@
 	      (store (aref *HR-SL* 0.) 0.0)
 	      (store (aref *HR-SL* 1.) 0.0)
 	      (do ((i 2. (f1+ i))) ((> i n)) (store (aref *HR-SL* i) (aref *QHR-SL* (f- i 2.)))))
-	     ((> (abs a1) (*$ (abs (cond ((= type 1.) b) (a))) 10.0 are))
+	     ((> (abs a1) (*$ (abs (cond ((= type 1.) b)
+					 (a)
+					 (t (error "a is NIL")))) 10.0 are))
 	      (setq a7 (//$ a7 a1) a3 (//$ a3 a1))
 	      (store (aref *HR-SL* 0.) (aref *QPR-SL* 0.))
 	      (store (aref *HR-SL* 1.) (-$ (aref *QPR-SL* 1.) (*$ a7 (aref *QPR-SL* 0.))))
Index: src/db.lisp
===================================================================
RCS file: /cvsroot/maxima/maxima/src/db.lisp,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 db.lisp
--- src/db.lisp	8 May 2000 06:09:42 -0000	1.1.1.1
+++ src/db.lisp	16 Jul 2003 11:32:18 -0000
@@ -232,7 +232,7 @@
   (COND ((DO ((L LPRS (CDR L))) ((NULL L))
 	     (IF (AND (LABEQ M (CAAAR L)) (LABEQ N (CDAAR L)))
 		 (RETURN (CDAR L)))))
-	((= (SETQ LPRINDEX (f1- LPRINDEX)) LABINDEX) (BREAK 'LPR T))
+	((= (SETQ LPRINDEX (f1- LPRINDEX)) LABINDEX) ($BREAK 'LPR T))
 	(T (SETQ LPRS (CONS (CONS (CONS M N) (LSH 1 LPRINDEX)) LPRS))
 	   (CDAR LPRS))))
 
@@ -240,7 +240,7 @@
 
 (DEFUN MARKND (ND)
   (COND ((+LABS ND))
-  	((= LPRINDEX (SETQ LABINDEX (f1+ LABINDEX))) (BREAK 'MARKND T))
+  	((= LPRINDEX (SETQ LABINDEX (f1+ LABINDEX))) ($BREAK 'MARKND T))
 	(T (SETQ LABS (CONS (CONS ND (LAB LABINDEX)) LABS))
 	   (BEG ND (LAB LABINDEX))
 	   (CDAR LABS))))
@@ -336,6 +336,15 @@
 	 (PUT ND (COPYN (LOGIOR LAB-HIGH-BIT LAB)) '+LABS))
 	((SUBP LAB *) NIL)
 	((SUBP LAB-HIGH-LAB *) (IORM * LAB) NIL)
+	;; --> RPLACA LET PROGN SETF SB-KERNEL:%RPLACA LOGIOR 
+	;; ==>
+	;;   (CAR (LOGIOR MAXIMA::LAB-HIGH-BIT (MAXIMA::UNLAB MAXIMA::LAB)))
+	;; caught WARNING:
+	;;   Asserted type LIST conflicts with derived type
+	;;   (VALUES INTEGER &OPTIONAL).
+	;;
+	;; (in other words, this, and similar examples below, is
+	;; broken)
 	(T (IORM * (LOGIOR LAB-HIGH-BIT (UNLAB LAB))))))
 
 (DEFUN QUEUE-P (ND LAB)
@@ -680,6 +689,12 @@
 	     (END- (CAAR DAT) (LPR LAB (-LABS (CADDAR DAT))))))))
 
 (DEFUN MARK+3 (CL LAB DAT) CL LAB ;Ignored
+       ;; in: DEFMACRO +LABZ
+       ;;     '(0)
+       ;; 
+       ;; caught WARNING:
+       ;;   This is not a FIXNUM:
+       ;;   (0)
   (IFN (= 0 (LOGAND (UNLAB (+LABZ (CADDAR DAT)))
 		    (UNLAB (DBV (+LABZ (CADAR DAT)) (-LABZ (CAAR DAT))))))
        (BEG- (SEL DAT WN) WORLD)))
Index: src/ellipt.lisp
===================================================================
RCS file: /cvsroot/maxima/maxima/src/ellipt.lisp,v
retrieving revision 1.6
diff -u -r1.6 ellipt.lisp
--- src/ellipt.lisp	18 Mar 2003 01:58:40 -0000	1.6
+++ src/ellipt.lisp	16 Jul 2003 11:32:19 -0000
@@ -76,7 +76,7 @@
 		(mu (* root-mu root-mu))
 		(v (/ u (1+ root-mu))))
 	   (values v mu root-mu))))
-  (declaim (inline descending-transform ascending-transform))
+  (declare (inline descending-transform ascending-transform))
 
 
   ;; Could use the descending transform, but some of my tests show
Index: src/hayat.lisp
===================================================================
RCS file: /cvsroot/maxima/maxima/src/hayat.lisp,v
retrieving revision 1.2
diff -u -r1.2 hayat.lisp
--- src/hayat.lisp	24 Feb 2001 02:21:59 -0000	1.2
+++ src/hayat.lisp	16 Jul 2003 11:32:22 -0000
@@ -1217,7 +1217,7 @@
 (defun adjoin-pvar (g)
    (let ((kernel (get g 'disrep)) g* lim datum ans
 	 (no (f1+ (cdr (int-var (car (last tlist)))))) (pow (rcone)) expt)
-      (when (assol kernel tlist) (break 'bad1))
+      (when (assol kernel tlist) (break "bad1"))
      (if (and (eq (caar kernel) 'MEXPT) (eq (cadr kernel) '$%E)
 	      (not (atom (setq expt (caddr kernel))))
 	      (eq (caar expt) 'MTIMES) (not (mfree expt (ncons '$%I))))
@@ -1243,7 +1243,7 @@
 	    (putprop g kernel 'disrep)
 	    ;(push g genvar) (push kernel varlist)
 	    (push (cons g* kernel) key-vars))
-	 (when (assol kernel tlist) (break 'bad2))
+	 (when (assol kernel tlist) (break "bad2"))
 	 (setq datum (list* kernel
 			    ;(mapcar #'(lambda (e) (emax e (rczero)))
 			    ;	    (trunc-stack (car tlist)))
Index: src/homog.lisp
===================================================================
RCS file: /cvsroot/maxima/maxima/src/homog.lisp,v
retrieving revision 1.2
diff -u -r1.2 homog.lisp
--- src/homog.lisp	31 Jan 2001 05:31:22 -0000	1.2
+++ src/homog.lisp	16 Jul 2003 11:32:22 -0000
@@ -116,7 +116,8 @@
 		    ((null p) sum)))))
 
 (defun hexpand (p &optional (hl *hmat) (vl *hvar))
-  (if (andmapc #'onep hl) p
+  ;; ONEP is a macro; can't use it as a function.
+  (if (andmapc (lambda (x) (= x 1)) hl) p
     (progn
        (do ((hl hl (cdr hl))
 	   (i 1 (f1+ i))
Index: src/hyp.lisp
===================================================================
RCS file: /cvsroot/maxima/maxima/src/hyp.lisp,v
retrieving revision 1.6
diff -u -r1.6 hyp.lisp
--- src/hyp.lisp	28 Oct 2002 02:47:07 -0000	1.6
+++ src/hyp.lisp	16 Jul 2003 11:32:22 -0000
@@ -1158,6 +1158,7 @@
 					-1)
 				 ($atan z)))))))
 
+#+nil
 (defun trig-log-1
        (l1 l2)
        (prog (a b c z1 $exponentialize)
Index: src/mdebug.lisp
===================================================================
RCS file: /cvsroot/maxima/maxima/src/mdebug.lisp,v
retrieving revision 1.17
diff -u -r1.17 mdebug.lisp
--- src/mdebug.lisp	11 Mar 2003 04:02:15 -0000	1.17
+++ src/mdebug.lisp	16 Jul 2003 11:32:22 -0000
@@ -568,14 +568,6 @@
   ;; note  need to make the redefine function, fixup the break point
   ;; list.. 
 
-(defun first-form-line (form line &aux tem)
-  (cond ((atom form) nil)
-	((and (setq tem (get-lineinfo form)) (eql (car tem) line))
-	 form)
-	(t (sloop for v in (cdr form)
-		  when (setq tem (first-form-line v line))
-		  do (return-from first-form-line tem)))))
-
 (defun make-break-point (fun ar i)
   (declare (fixnum i) (type (vector t) ar))
   (let* ((tem (aref ar i))
Index: src/mlisp.lisp
===================================================================
RCS file: /cvsroot/maxima/maxima/src/mlisp.lisp,v
retrieving revision 1.6
diff -u -r1.6 mlisp.lisp
--- src/mlisp.lisp	18 Mar 2003 01:59:55 -0000	1.6
+++ src/mlisp.lisp	16 Jul 2003 11:32:23 -0000
@@ -139,7 +139,10 @@
 	   (SETQ FN (GETOPR FN)) (BADFUNCHK FNNAME FN NIL)
 	   (LET ((NOEVALARGS T)) (MEVAL (CONS (NCONS FN) ARGS)))))
 	 )))
-       #+cl
+       #+(and cl nil)
+       ;; This branch is dead, at least in Common Lisp; we only get
+       ;; here if FN is not an ATOM, which implies that it is a CONS,
+       ;; and CONSes and FUNCTIONs are disjoint.
        ((functionp fn)
 	(apply fn args))
        #+cl
Index: src/mtrace.lisp
===================================================================
RCS file: /cvsroot/maxima/maxima/src/mtrace.lisp,v
retrieving revision 1.4
diff -u -r1.4 mtrace.lisp
--- src/mtrace.lisp	13 Mar 2003 02:49:30 -0000	1.4
+++ src/mtrace.lisp	16 Jul 2003 11:32:23 -0000
@@ -355,10 +355,15 @@
 (defun trace-fshadow (fun type value)
    (let ((shadow (get! type 'shadow)))
       (cond ((memq shadow '(expr subr))
-	     (setf (trace-oldfun fun) (and (fboundp fun) (symbol-function fun)))
+	     (setf (trace-oldfun fun)
+		   (and (fboundp fun) (symbol-function fun)))
 	     (setf (symbol-function  fun)  value))
 	    ((memq shadow '(fexpr fsubr))
 	     (setf (trace-oldfun fun) (symbol-function fun))
+	     ;; I don't know what this is doing, but setting
+	     ;; SYMBOL-FUNCTION of something to something that's a
+	     ;; list is definitely not going to work.
+	     #+nil
 	     (setf (symbol-function  fun)  (cons 'nlambda (cdr value))))
 	    (t (setplist fun
 			 `(,shadow ,value ,@(symbol-plist fun)))))))
Index: src/nparse.lisp
===================================================================
RCS file: /cvsroot/maxima/maxima/src/nparse.lisp,v
retrieving revision 1.13
diff -u -r1.13 nparse.lisp
--- src/nparse.lisp	16 May 2003 00:38:11 -0000	1.13
+++ src/nparse.lisp	16 Jul 2003 11:32:27 -0000
@@ -369,7 +369,8 @@
   (IMPLODE1 scan (not (member #\| scan)))
   ))
 (DEFUN SCAN-keyword-TOKEN ()
-  (let ((*package* 'keyword)) (IMPLODE (SCAN-TOKEN ()))))
+  (let ((*package* (find-package 'keyword)))
+    (IMPLODE (SCAN-TOKEN ()))))
 
 (defvar $bothcases t)
 (DEFUN SCAN-TOKEN (FLAG)
Index: src/plot.lisp
===================================================================
RCS file: /cvsroot/maxima/maxima/src/plot.lisp,v
retrieving revision 1.29
diff -u -r1.29 plot.lisp
--- src/plot.lisp	25 May 2003 17:43:06 -0000	1.29
+++ src/plot.lisp	16 Jul 2003 11:32:27 -0000
@@ -843,13 +843,15 @@
 
       (format t "Points = ~D~%" (length result))
       ;; Fix up out-of-range values
-      (do ((x result (cddr x))
-	   (y (cdr result) (cddr y)))
-	  ((null y))
-	(unless (and (numberp (car y))
-		     (<= ymin (car y) ymax))
-	  (setf (car x) 'moveto)
-	  (setf (car y) 'moveto)))
+      ;;
+      ;; don't reuse variables declared as double floats
+      (do ((lx result (cddr lx))
+	   (ly (cdr result) (cddr ly)))
+	  ((null ly))
+	(unless (and (numberp (car ly))
+		     (<= ymin (car ly) ymax))
+	  (setf (car lx) 'moveto)
+	  (setf (car ly) 'moveto)))
       (cons '(mlist) result))))
 
 (defun get-range (lis)
Index: src/suprv1.lisp
===================================================================
RCS file: /cvsroot/maxima/maxima/src/suprv1.lisp,v
retrieving revision 1.10
diff -u -r1.10 suprv1.lisp
--- src/suprv1.lisp	13 Mar 2003 03:49:04 -0000	1.10
+++ src/suprv1.lisp	16 Jul 2003 11:32:27 -0000
@@ -244,7 +244,8 @@
 (DEFMFUN TYI* NIL
  #+Multics (CLEAR-INPUT NIL)
  (DO ((N (TYI) (TYI))) (NIL)
-     (COND ((OR (char= N #\NewLine) (AND (> N 31) (NOT (char= N #\RUBOUT))))
+     (COND ((OR (char= N #\NewLine) (AND (> (char-code N) 31)
+					 (NOT (char= N #\RUBOUT))))
 	    (RETURN N))
 	   ((char= N #\Page) (FORMFEED) (PRINC (STRIPDOLLAR $PROMPT))))))
 
Index: src/transs.lisp
===================================================================
RCS file: /cvsroot/maxima/maxima/src/transs.lisp,v
retrieving revision 1.5
diff -u -r1.5 transs.lisp
--- src/transs.lisp	5 Mar 2003 01:36:26 -0000	1.5
+++ src/transs.lisp	16 Jul 2003 11:32:29 -0000
@@ -11,6 +11,7 @@
 (in-package "MAXIMA")
 (macsyma-module transs)
 
+#+nil ; symbols are not strings or streams.
 (defun set-up-translate ()
   (load '|<macsym>transl.autolo|)
   (load '|<macsym>trdata.fasl|)
Index: src/trmode.lisp
===================================================================
RCS file: /cvsroot/maxima/maxima/src/trmode.lisp,v
retrieving revision 1.5
diff -u -r1.5 trmode.lisp
--- src/trmode.lisp	11 Jan 2002 05:30:09 -0000	1.5
+++ src/trmode.lisp	16 Jul 2003 11:32:31 -0000
@@ -268,27 +268,6 @@
 ;;; 1/2 is not $RATIONAL. bad name. it means CRE form.
 
 (DEFUN IR (X)
-       (CASE X
-	      (($FLOAT $REAL $FLOATP $FLONUM $FLOATNUM) '$FLOAT)
-	      (($FIXP $FIXNUM) '$FIXNUM)
-	      (($RATIONAL $RAT) '$RATIONAL)
-	      (($NUMBER $BIGNUM $BIG) '$NUMBER)
-	      (($BOOLEAN $BOOL) '$BOOLEAN)
-	      (($LIST $LISTP) '$LIST)
-	      (($ANY $NONE $ANY_CHECK) '$ANY)
-	      (T (UDM-ERR X) X)))
-
-(DEFUN UDM-ERR (MODE)
-       (MTELL "Warning:  ~:M is not a known mode declaration ~
-	      maybe you want ~:M mode.~%"
-	      MODE
-	      (CASE MODE
-		     (($INTEGER $INTEGERP) '$FIXNUM)
-		     (($COMPLEX) "&to ask about this")
-		     (($FUCKED $SHITTY) "&to watch your language")
-		     (T "&to see the documentation on"))))
-
-(DEFUN IR (X)
   (CASE X
 	 (($FLOAT $REAL $FLOATP $FLONUM $FLOATNUM) '$FLOAT)
 	 (($FIXP $FIXNUM) '$FIXNUM)
Index: src/numerical/f2cl-lib.lisp
===================================================================
RCS file: /cvsroot/maxima/maxima/src/numerical/f2cl-lib.lisp,v
retrieving revision 1.3
diff -u -r1.3 f2cl-lib.lisp
--- src/numerical/f2cl-lib.lisp	19 May 2002 20:24:22 -0000	1.3
+++ src/numerical/f2cl-lib.lisp	16 Jul 2003 11:32:35 -0000
@@ -1081,7 +1081,7 @@
 #+gcl
 (defconstant least-positive-normalized-single-float least-positive-single-float)
 
-
+(declaim (ftype (function ((integer 1 5)) double-float) d1mach))
 (defun d1mach (i)
   (ecase i
     (1
@@ -1092,6 +1092,7 @@
     (4 (scale-float double-float-epsilon 1))
     (5 (log (float (float-radix 1d0) 1d0) 10d0))))
 
+(declaim (ftype (function ((integer 1 5)) single-float) r1mach))
 (defun r1mach (i)
   (ecase i
     (1
Index: src/numerical/slatec/derf.lisp
===================================================================
RCS file: /cvsroot/maxima/maxima/src/numerical/slatec/derf.lisp,v
retrieving revision 1.2
diff -u -r1.2 derf.lisp
--- src/numerical/slatec/derf.lisp	8 May 2002 13:34:34 -0000	1.2
+++ src/numerical/slatec/derf.lisp	16 Jul 2003 11:32:38 -0000
@@ -61,8 +61,8 @@
           (setf derf (* x (+ 1.0 (dcsevl (- (* 2.0 x x) 1.0) erfcs nterf)))))
       (go end_label)
      label20
-      (if (<= y xbig) (setf derf (f2cl-lib:sign (- 1.0 (derfc y)) x)))
-      (if (> y xbig) (setf derf (f2cl-lib:sign 1.0 x)))
+      (if (<= y xbig) (setf derf (f2cl-lib:dsign (- 1.0 (derfc y)) x)))
+      (if (> y xbig) (setf derf (f2cl-lib:dsign 1.0 x)))
       (go end_label)
      end_label
       (return (values derf nil)))))
