From: Paul Eggert Date: Sun, 22 May 2011 07:12:24 +0000 (-0700) Subject: * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN. X-Git-Tag: emacs-pretest-24.0.90~104^2~618^2~139^2~13 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2e6578fb5e17cef7505aa9a1e76332c3b9eddd30;p=emacs.git * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN. --- diff --git a/src/ChangeLog b/src/ChangeLog index 5518531bea8..67eaa09bf02 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2011-05-22 Paul Eggert + + * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN. + 2011-05-21 Paul Eggert * data.c: Avoid integer truncation in expressions involving floats. diff --git a/src/lisp.h b/src/lisp.h index b2beeffa79e..6618a754145 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -544,11 +544,10 @@ extern Lisp_Object make_number (EMACS_INT); /* Value is non-zero if I doesn't fit into a Lisp fixnum. It is written this way so that it also works if I is of unsigned - type. */ + type or if I is a NaN. */ #define FIXNUM_OVERFLOW_P(i) \ - ((i) > MOST_POSITIVE_FIXNUM \ - || ((i) < 0 && (i) < MOST_NEGATIVE_FIXNUM)) + (! ((0 <= (i) || MOST_NEGATIVE_FIXNUM <= (i)) && (i) <= MOST_POSITIVE_FIXNUM)) /* Extract a value or address from a Lisp_Object. */