aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2001-10-06 23:25:06 +0000
committerGerd Moellmann2001-10-06 23:25:06 +0000
commitdc8e8b07bdf1baa52dc5c1bd1ea4dd839aa6cb55 (patch)
tree184c88b3c55080c2b0626fe17fa80d57291c6b39
parent9542e3f5084a5fc3c9060da592595ceb3b4738e3 (diff)
downloademacs-dc8e8b07bdf1baa52dc5c1bd1ea4dd839aa6cb55.tar.gz
emacs-dc8e8b07bdf1baa52dc5c1bd1ea4dd839aa6cb55.zip
(MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM)
(FIXNUM_OVERFLOW_P): New macros.
-rw-r--r--src/lisp.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lisp.h b/src/lisp.h
index e7de504f464..2080cf6b4e2 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -387,6 +387,10 @@ extern size_t pure_size;
387#define make_number(N) \ 387#define make_number(N) \
388 ((((EMACS_INT) (N)) & VALMASK) | ((EMACS_INT) Lisp_Int) << VALBITS) 388 ((((EMACS_INT) (N)) & VALMASK) | ((EMACS_INT) Lisp_Int) << VALBITS)
389 389
390#define make_fixnum(x) make_number (x)
391#define MOST_NEGATIVE_FIXNUM ((EMACS_INT) 1 << (VALBITS - 1))
392#define MOST_POSITIVE_FIXNUM (MOST_NEGATIVE_FIXNUM - 1)
393
390/* During garbage collection, XGCTYPE must be used for extracting types 394/* During garbage collection, XGCTYPE must be used for extracting types
391 so that the mark bit is ignored. XMARKBIT accesses the markbit. 395 so that the mark bit is ignored. XMARKBIT accesses the markbit.
392 Markbits are used only in particular slots of particular structure types. 396 Markbits are used only in particular slots of particular structure types.
@@ -468,6 +472,16 @@ extern Lisp_Object make_number ();
468 472
469#endif /* NO_UNION_TYPE */ 473#endif /* NO_UNION_TYPE */
470 474
475/* Largest and smallest representable fixnum values. */
476
477#define MOST_NEGATIVE_FIXNUM ((EMACS_INT) 1 << (VALBITS - 1))
478#define MOST_POSITIVE_FIXNUM (MOST_NEGATIVE_FIXNUM - 1)
479
480/* Value is non-zero if C integer I doesn't fit into a Lisp fixnum. */
481
482#define FIXNUM_OVERFLOW_P(i) \
483 ((i) > MOST_POSITIVE_FIXNUM || (i) < MOST_NEGATIVE_FIXNUM)
484
471/* Extract a value or address from a Lisp_Object. */ 485/* Extract a value or address from a Lisp_Object. */
472 486
473#define XCONS(a) (eassert (GC_CONSP(a)),(struct Lisp_Cons *) XPNTR(a)) 487#define XCONS(a) (eassert (GC_CONSP(a)),(struct Lisp_Cons *) XPNTR(a))