APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1300709965 0
# Node ID a32a108ae8156a56b45e541414ec06f80bd65efb
# Parent 4f0a1f4cc1117446ab7cd1252fcda433a3fd68d5
#'cl-non-fixnum-number-p: return t for integers > #x3fffffff and < -#x40000000
2011-03-21 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-macs.el (cl-non-fixnum-number-p):
This should return t under 64-bit builds for fixnums that would
be bignums on a 32-bit machine; make it so.
diff -r 4f0a1f4cc111 -r a32a108ae815 lisp/ChangeLog
--- a/lisp/ChangeLog Sat Mar 19 22:13:14 2011 +0900
+++ b/lisp/ChangeLog Mon Mar 21 12:19:25 2011 +0000
@@ -1,3 +1,9 @@
+2011-03-21 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * cl-macs.el (cl-non-fixnum-number-p):
+ This should return t under 64-bit builds for fixnums that would
+ be bignums on a 32-bit machine; make it so.
+
2011-03-19 Stephen J. Turnbull <stephen(a)xemacs.org>
* faces.el (face-spec-set-match-display):
diff -r 4f0a1f4cc111 -r a32a108ae815 lisp/cl-macs.el
--- a/lisp/cl-macs.el Sat Mar 19 22:13:14 2011 +0900
+++ b/lisp/cl-macs.el Mon Mar 21 12:19:25 2011 +0000
@@ -3230,14 +3230,26 @@
argns argvs)))
(if lets (list 'let lets body) body))))
+;; When a 64-bit build is byte-compiling code, some of its native fixnums
+;; will not be represented as fixnums if the byte-compiled code is read by
+;; the Lisp reader in a 32-bit build. So in that case we need to check the
+;; range of fixnums as well as their types. XEmacs doesn't support machines
+;; with word size less than 32, so it's OK to have that as the minimum.
+(macrolet
+ ((most-negative-fixnum-on-32-bit-machines () (lognot (1- (lsh 1 30))))
+ (most-positive-fixnum-on-32-bit-machines () (lsh 1 30)))
+ (defun cl-non-fixnum-number-p (object)
+ "Return t if OBJECT is a number not guaranteed to be immediate."
+ (and (numberp object)
+ (or (not (fixnump object))
+ (not (<= (most-negative-fixnum-on-32-bit-machines)
+ object
+ (most-positive-fixnum-on-32-bit-machines)))))))
;;; Compile-time optimizations for some functions defined in this package.
;;; Note that cl.el arranges to force cl-macs to be loaded at compile-time,
;;; mainly to make sure these macros will be present.
-(defun cl-non-fixnum-number-p (object)
- (and (numberp object) (not (fixnump object))))
-
(define-compiler-macro eql (&whole form a b)
(cond ((eq (cl-const-expr-p a) t)
(let ((val (cl-const-expr-val a)))
--
“Apart from the nine-banded armadillo, man is the only natural host of
Mycobacterium leprae, although it can be grown in the footpads of mice.”
-- Kumar & Clark, Clinical Medicine, summarising improbable leprosy research
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches