aboutsummaryrefslogtreecommitdiffstats
path: root/src/lisp.h
diff options
context:
space:
mode:
authorTom Tromey2018-08-07 18:08:53 -0600
committerTom Tromey2018-08-07 18:08:53 -0600
commitd1ec3a0a8e4d7d56ebc1e4fa743130b9974ac6a8 (patch)
tree04c920acf142f686d3cac11080b17a2fb0dfc9af /src/lisp.h
parent68ebff23f7057090da260830500cb278f7b886a5 (diff)
downloademacs-d1ec3a0a8e4d7d56ebc1e4fa743130b9974ac6a8.tar.gz
emacs-d1ec3a0a8e4d7d56ebc1e4fa743130b9974ac6a8.zip
More macro renamings for bignum
* src/alloc.c, src/bidi.c, src/buffer.c, src/buffer.h, src/bytecode.c, src/callint.c, src/callproc.c, src/casefiddle.c, src/casetab.c, src/category.c, src/ccl.c, src/character.c, src/character.h, src/charset.c, src/charset.h, src/chartab.c, src/cmds.c, src/coding.c, src/composite.c, src/composite.h, src/data.c, src/dbusbind.c, src/decompress.c, src/dired.c, src/dispextern.h, src/dispnew.c, src/disptab.h, src/doc.c, src/dosfns.c, src/editfns.c, src/emacs-module.c, src/emacs.c, src/eval.c, src/fileio.c, src/floatfns.c, src/fns.c, src/font.c, src/font.h, src/fontset.c, src/frame.c, src/frame.h, src/fringe.c, src/ftcrfont.c, src/ftfont.c, src/gfilenotify.c, src/gnutls.c, src/gtkutil.c, src/image.c, src/indent.c, src/insdel.c, src/intervals.c, src/json.c, src/keyboard.c, src/keymap.c, src/kqueue.c, src/lcms.c, src/lisp.h, src/lread.c, src/macros.c, src/marker.c, src/menu.c, src/minibuf.c, src/msdos.c, src/print.c, src/process.c, src/profiler.c, src/search.c, src/sound.c, src/syntax.c, src/syntax.h, src/sysdep.c, src/term.c, src/termhooks.h, src/textprop.c, src/undo.c, src/w32.c, src/w32console.c, src/w32fns.c, src/w32font.c, src/w32inevt.c, src/w32proc.c, src/w32select.c, src/w32term.c, src/w32term.h, src/w32uniscribe.c, src/window.c, src/xdisp.c, src/xfaces.c, src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c, src/xml.c, src/xrdb.c, src/xselect.c, src/xsettings.c, src/xterm.c, src/xwidget.c Rename XINT->XFIXNUM, XFASTINT->XFIXNAT, XUINT->XUFIXNUM.
Diffstat (limited to 'src/lisp.h')
-rw-r--r--src/lisp.h60
1 files changed, 30 insertions, 30 deletions
diff --git a/src/lisp.h b/src/lisp.h
index b404f9d89aa..9047d217249 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -382,15 +382,15 @@ typedef EMACS_INT Lisp_Word;
382#define lisp_h_XCDR(c) XCONS (c)->u.s.u.cdr 382#define lisp_h_XCDR(c) XCONS (c)->u.s.u.cdr
383#define lisp_h_XCONS(a) \ 383#define lisp_h_XCONS(a) \
384 (eassert (CONSP (a)), XUNTAG (a, Lisp_Cons, struct Lisp_Cons)) 384 (eassert (CONSP (a)), XUNTAG (a, Lisp_Cons, struct Lisp_Cons))
385#define lisp_h_XHASH(a) XUINT (a) 385#define lisp_h_XHASH(a) XUFIXNUM (a)
386#ifndef GC_CHECK_CONS_LIST 386#ifndef GC_CHECK_CONS_LIST
387# define lisp_h_check_cons_list() ((void) 0) 387# define lisp_h_check_cons_list() ((void) 0)
388#endif 388#endif
389#if USE_LSB_TAG 389#if USE_LSB_TAG
390# define lisp_h_make_fixnum(n) \ 390# define lisp_h_make_fixnum(n) \
391 XIL ((EMACS_INT) (((EMACS_UINT) (n) << INTTYPEBITS) + Lisp_Int0)) 391 XIL ((EMACS_INT) (((EMACS_UINT) (n) << INTTYPEBITS) + Lisp_Int0))
392# define lisp_h_XFASTINT(a) XINT (a) 392# define lisp_h_XFIXNAT(a) XFIXNUM (a)
393# define lisp_h_XINT(a) (XLI (a) >> INTTYPEBITS) 393# define lisp_h_XFIXNUM(a) (XLI (a) >> INTTYPEBITS)
394# ifdef __CHKP__ 394# ifdef __CHKP__
395# define lisp_h_XSYMBOL(a) \ 395# define lisp_h_XSYMBOL(a) \
396 (eassert (SYMBOLP (a)), \ 396 (eassert (SYMBOLP (a)), \
@@ -448,8 +448,8 @@ typedef EMACS_INT Lisp_Word;
448# endif 448# endif
449# if USE_LSB_TAG 449# if USE_LSB_TAG
450# define make_fixnum(n) lisp_h_make_fixnum (n) 450# define make_fixnum(n) lisp_h_make_fixnum (n)
451# define XFASTINT(a) lisp_h_XFASTINT (a) 451# define XFIXNAT(a) lisp_h_XFIXNAT (a)
452# define XINT(a) lisp_h_XINT (a) 452# define XFIXNUM(a) lisp_h_XFIXNUM (a)
453# define XSYMBOL(a) lisp_h_XSYMBOL (a) 453# define XSYMBOL(a) lisp_h_XSYMBOL (a)
454# define XTYPE(a) lisp_h_XTYPE (a) 454# define XTYPE(a) lisp_h_XTYPE (a)
455# endif 455# endif
@@ -486,7 +486,7 @@ enum Lisp_Type
486 whose first member indicates the subtype. */ 486 whose first member indicates the subtype. */
487 Lisp_Misc = 1, 487 Lisp_Misc = 1,
488 488
489 /* Integer. XINT (obj) is the integer value. */ 489 /* Integer. XFIXNUM (obj) is the integer value. */
490 Lisp_Int0 = 2, 490 Lisp_Int0 = 2,
491 Lisp_Int1 = USE_LSB_TAG ? 6 : 3, 491 Lisp_Int1 = USE_LSB_TAG ? 6 : 3,
492 492
@@ -1038,15 +1038,15 @@ INLINE Lisp_Object
1038} 1038}
1039 1039
1040INLINE EMACS_INT 1040INLINE EMACS_INT
1041(XINT) (Lisp_Object a) 1041(XFIXNUM) (Lisp_Object a)
1042{ 1042{
1043 return lisp_h_XINT (a); 1043 return lisp_h_XFIXNUM (a);
1044} 1044}
1045 1045
1046INLINE EMACS_INT 1046INLINE EMACS_INT
1047(XFASTINT) (Lisp_Object a) 1047(XFIXNAT) (Lisp_Object a)
1048{ 1048{
1049 EMACS_INT n = lisp_h_XFASTINT (a); 1049 EMACS_INT n = lisp_h_XFIXNAT (a);
1050 eassume (0 <= n); 1050 eassume (0 <= n);
1051 return n; 1051 return n;
1052} 1052}
@@ -1079,7 +1079,7 @@ make_fixnum (EMACS_INT n)
1079 1079
1080/* Extract A's value as a signed integer. */ 1080/* Extract A's value as a signed integer. */
1081INLINE EMACS_INT 1081INLINE EMACS_INT
1082XINT (Lisp_Object a) 1082XFIXNUM (Lisp_Object a)
1083{ 1083{
1084 EMACS_INT i = XLI (a); 1084 EMACS_INT i = XLI (a);
1085 if (! USE_LSB_TAG) 1085 if (! USE_LSB_TAG)
@@ -1090,14 +1090,14 @@ XINT (Lisp_Object a)
1090 return i >> INTTYPEBITS; 1090 return i >> INTTYPEBITS;
1091} 1091}
1092 1092
1093/* Like XINT (A), but may be faster. A must be nonnegative. 1093/* Like XFIXNUM (A), but may be faster. A must be nonnegative.
1094 If ! USE_LSB_TAG, this takes advantage of the fact that Lisp 1094 If ! USE_LSB_TAG, this takes advantage of the fact that Lisp
1095 integers have zero-bits in their tags. */ 1095 integers have zero-bits in their tags. */
1096INLINE EMACS_INT 1096INLINE EMACS_INT
1097XFASTINT (Lisp_Object a) 1097XFIXNAT (Lisp_Object a)
1098{ 1098{
1099 EMACS_INT int0 = Lisp_Int0; 1099 EMACS_INT int0 = Lisp_Int0;
1100 EMACS_INT n = USE_LSB_TAG ? XINT (a) : XLI (a) - (int0 << VALBITS); 1100 EMACS_INT n = USE_LSB_TAG ? XFIXNUM (a) : XLI (a) - (int0 << VALBITS);
1101 eassume (0 <= n); 1101 eassume (0 <= n);
1102 return n; 1102 return n;
1103} 1103}
@@ -1106,14 +1106,14 @@ XFASTINT (Lisp_Object a)
1106 1106
1107/* Extract A's value as an unsigned integer. */ 1107/* Extract A's value as an unsigned integer. */
1108INLINE EMACS_UINT 1108INLINE EMACS_UINT
1109XUINT (Lisp_Object a) 1109XUFIXNUM (Lisp_Object a)
1110{ 1110{
1111 EMACS_UINT i = XLI (a); 1111 EMACS_UINT i = XLI (a);
1112 return USE_LSB_TAG ? i >> INTTYPEBITS : i & INTMASK; 1112 return USE_LSB_TAG ? i >> INTTYPEBITS : i & INTMASK;
1113} 1113}
1114 1114
1115/* Return A's (Lisp-integer sized) hash. Happens to be like XUINT 1115/* Return A's (Lisp-integer sized) hash. Happens to be like XUFIXNUM
1116 right now, but XUINT should only be applied to objects we know are 1116 right now, but XUFIXNUM should only be applied to objects we know are
1117 integers. */ 1117 integers. */
1118 1118
1119INLINE EMACS_INT 1119INLINE EMACS_INT
@@ -1218,7 +1218,7 @@ INLINE bool
1218 bits set, which makes this conversion inherently unportable. */ 1218 bits set, which makes this conversion inherently unportable. */
1219 1219
1220INLINE void * 1220INLINE void *
1221XINTPTR (Lisp_Object a) 1221XFIXNUMPTR (Lisp_Object a)
1222{ 1222{
1223 return XUNTAG (a, Lisp_Int0, char); 1223 return XUNTAG (a, Lisp_Int0, char);
1224} 1224}
@@ -1227,7 +1227,7 @@ INLINE Lisp_Object
1227make_pointer_integer (void *p) 1227make_pointer_integer (void *p)
1228{ 1228{
1229 Lisp_Object a = TAG_PTR (Lisp_Int0, p); 1229 Lisp_Object a = TAG_PTR (Lisp_Int0, p);
1230 eassert (FIXNUMP (a) && XINTPTR (a) == p); 1230 eassert (FIXNUMP (a) && XFIXNUMPTR (a) == p);
1231 return a; 1231 return a;
1232} 1232}
1233 1233
@@ -2378,10 +2378,10 @@ extern Lisp_Object make_misc_ptr (void *);
2378 2378
2379/* A mint_ptr object OBJ represents a C-language pointer P efficiently. 2379/* A mint_ptr object OBJ represents a C-language pointer P efficiently.
2380 Preferably (and typically), OBJ is a Lisp integer I such that 2380 Preferably (and typically), OBJ is a Lisp integer I such that
2381 XINTPTR (I) == P, as this represents P within a single Lisp value 2381 XFIXNUMPTR (I) == P, as this represents P within a single Lisp value
2382 without requiring any auxiliary memory. However, if P would be 2382 without requiring any auxiliary memory. However, if P would be
2383 damaged by being tagged as an integer and then untagged via 2383 damaged by being tagged as an integer and then untagged via
2384 XINTPTR, then OBJ is a Lisp_Misc_Ptr with pointer component P. 2384 XFIXNUMPTR, then OBJ is a Lisp_Misc_Ptr with pointer component P.
2385 2385
2386 mint_ptr objects are efficiency hacks intended for C code. 2386 mint_ptr objects are efficiency hacks intended for C code.
2387 Although xmint_ptr can be given any mint_ptr generated by non-buggy 2387 Although xmint_ptr can be given any mint_ptr generated by non-buggy
@@ -2395,7 +2395,7 @@ INLINE Lisp_Object
2395make_mint_ptr (void *a) 2395make_mint_ptr (void *a)
2396{ 2396{
2397 Lisp_Object val = TAG_PTR (Lisp_Int0, a); 2397 Lisp_Object val = TAG_PTR (Lisp_Int0, a);
2398 return FIXNUMP (val) && XINTPTR (val) == a ? val : make_misc_ptr (a); 2398 return FIXNUMP (val) && XFIXNUMPTR (val) == a ? val : make_misc_ptr (a);
2399} 2399}
2400 2400
2401INLINE bool 2401INLINE bool
@@ -2409,7 +2409,7 @@ xmint_pointer (Lisp_Object a)
2409{ 2409{
2410 eassert (mint_ptrp (a)); 2410 eassert (mint_ptrp (a));
2411 if (FIXNUMP (a)) 2411 if (FIXNUMP (a))
2412 return XINTPTR (a); 2412 return XFIXNUMPTR (a);
2413 return XUNTAG (a, Lisp_Misc, struct Lisp_Misc_Ptr)->pointer; 2413 return XUNTAG (a, Lisp_Misc, struct Lisp_Misc_Ptr)->pointer;
2414} 2414}
2415 2415
@@ -2766,14 +2766,14 @@ FIXED_OR_FLOATP (Lisp_Object x)
2766INLINE bool 2766INLINE bool
2767FIXNATP (Lisp_Object x) 2767FIXNATP (Lisp_Object x)
2768{ 2768{
2769 return FIXNUMP (x) && 0 <= XINT (x); 2769 return FIXNUMP (x) && 0 <= XFIXNUM (x);
2770} 2770}
2771INLINE bool 2771INLINE bool
2772NATNUMP (Lisp_Object x) 2772NATNUMP (Lisp_Object x)
2773{ 2773{
2774 if (BIGNUMP (x)) 2774 if (BIGNUMP (x))
2775 return mpz_cmp_si (XBIGNUM (x)->value, 0) >= 0; 2775 return mpz_cmp_si (XBIGNUM (x)->value, 0) >= 0;
2776 return FIXNUMP (x) && 0 <= XINT (x); 2776 return FIXNUMP (x) && 0 <= XFIXNUM (x);
2777} 2777}
2778INLINE bool 2778INLINE bool
2779NUMBERP (Lisp_Object x) 2779NUMBERP (Lisp_Object x)
@@ -2784,13 +2784,13 @@ NUMBERP (Lisp_Object x)
2784INLINE bool 2784INLINE bool
2785RANGED_FIXNUMP (intmax_t lo, Lisp_Object x, intmax_t hi) 2785RANGED_FIXNUMP (intmax_t lo, Lisp_Object x, intmax_t hi)
2786{ 2786{
2787 return FIXNUMP (x) && lo <= XINT (x) && XINT (x) <= hi; 2787 return FIXNUMP (x) && lo <= XFIXNUM (x) && XFIXNUM (x) <= hi;
2788} 2788}
2789 2789
2790#define TYPE_RANGED_FIXNUMP(type, x) \ 2790#define TYPE_RANGED_FIXNUMP(type, x) \
2791 (FIXNUMP (x) \ 2791 (FIXNUMP (x) \
2792 && (TYPE_SIGNED (type) ? TYPE_MINIMUM (type) <= XINT (x) : 0 <= XINT (x)) \ 2792 && (TYPE_SIGNED (type) ? TYPE_MINIMUM (type) <= XFIXNUM (x) : 0 <= XFIXNUM (x)) \
2793 && XINT (x) <= TYPE_MAXIMUM (type)) 2793 && XFIXNUM (x) <= TYPE_MAXIMUM (type))
2794 2794
2795INLINE bool 2795INLINE bool
2796AUTOLOADP (Lisp_Object x) 2796AUTOLOADP (Lisp_Object x)
@@ -2892,7 +2892,7 @@ CHECK_FIXNAT (Lisp_Object x)
2892#define CHECK_RANGED_INTEGER(x, lo, hi) \ 2892#define CHECK_RANGED_INTEGER(x, lo, hi) \
2893 do { \ 2893 do { \
2894 CHECK_FIXNUM (x); \ 2894 CHECK_FIXNUM (x); \
2895 if (! ((lo) <= XINT (x) && XINT (x) <= (hi))) \ 2895 if (! ((lo) <= XFIXNUM (x) && XFIXNUM (x) <= (hi))) \
2896 args_out_of_range_3 \ 2896 args_out_of_range_3 \
2897 (x, \ 2897 (x, \
2898 make_fixnum ((lo) < 0 && (lo) < MOST_NEGATIVE_FIXNUM \ 2898 make_fixnum ((lo) < 0 && (lo) < MOST_NEGATIVE_FIXNUM \
@@ -2921,7 +2921,7 @@ XFLOATINT (Lisp_Object n)
2921{ 2921{
2922 if (BIGNUMP (n)) 2922 if (BIGNUMP (n))
2923 return mpz_get_d (XBIGNUM (n)->value); 2923 return mpz_get_d (XBIGNUM (n)->value);
2924 return FLOATP (n) ? XFLOAT_DATA (n) : XINT (n); 2924 return FLOATP (n) ? XFLOAT_DATA (n) : XFIXNUM (n);
2925} 2925}
2926 2926
2927INLINE void 2927INLINE void