From d5040d2dec0f7e08b715ce6952d5568ed86d1812 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 29 Jul 2012 15:42:12 -0700 Subject: [PATCH] * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove. These macros are confusing and no longer need to be defined, as the enum values now suffice. Each use replaced with definiens. (Lisp_Int1, Lisp_String): Define directly; this is clearer. --- src/ChangeLog | 7 +++++++ src/buffer.c | 8 ++++---- src/data.c | 2 +- src/lisp.h | 9 +++------ 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 6dc07cffc46..3d490df4fe9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2012-07-29 Paul Eggert + + * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove. + These macros are confusing and no longer need to be defined, as + the enum values now suffice. All uses replaced with definiens. + (Lisp_Int1, Lisp_String): Define directly; this is clearer. + 2012-07-29 Juanma Barranquero * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O)) diff --git a/src/buffer.c b/src/buffer.c index 70630de53cb..833eb843168 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -5457,17 +5457,17 @@ Use the command `abbrev-mode' to change this variable. */); doc: /* Non-nil if searches and matches should ignore case. */); DEFVAR_PER_BUFFER ("fill-column", &BVAR (current_buffer, fill_column), - make_number (LISP_INT_TAG), + make_number (Lisp_Int0), doc: /* Column beyond which automatic line-wrapping should happen. Interactively, you can set the buffer local value using \\[set-fill-column]. */); DEFVAR_PER_BUFFER ("left-margin", &BVAR (current_buffer, left_margin), - make_number (LISP_INT_TAG), + make_number (Lisp_Int0), doc: /* Column for the default `indent-line-function' to indent to. Linefeed indents to this column in Fundamental mode. */); DEFVAR_PER_BUFFER ("tab-width", &BVAR (current_buffer, tab_width), - make_number (LISP_INT_TAG), + make_number (Lisp_Int0), doc: /* Distance between tab stops (for display of tab characters), in columns. This should be an integer greater than zero. */); @@ -5588,7 +5588,7 @@ If it is nil, that means don't auto-save this buffer. */); Backing up is done before the first time the file is saved. */); DEFVAR_PER_BUFFER ("buffer-saved-size", &BVAR (current_buffer, save_length), - make_number (LISP_INT_TAG), + make_number (Lisp_Int0), doc: /* Length of current buffer when last read in, saved or auto-saved. 0 initially. -1 means auto-saving turned off until next real save. diff --git a/src/data.c b/src/data.c index b23bcbe15b3..bef2888a969 100644 --- a/src/data.c +++ b/src/data.c @@ -928,7 +928,7 @@ store_symval_forwarding (union Lisp_Fwd *valcontents, register Lisp_Object newva Lisp_Object type = XBUFFER_OBJFWD (valcontents)->slottype; if (!(NILP (type) || NILP (newval) - || (XINT (type) == LISP_INT_TAG + || (XINT (type) == Lisp_Int0 ? INTEGERP (newval) : XTYPE (newval) == XINT (type)))) buffer_slot_type_mismatch (newval, XINT (type)); diff --git a/src/lisp.h b/src/lisp.h index a7d120a6985..a530148e4dd 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -213,11 +213,8 @@ enum enum_USE_LSB_TAG { USE_LSB_TAG = 0 }; /* Lisp integers use 2 tags, to give them one extra bit, thus extending their range from, e.g., -2^28..2^28-1 to -2^29..2^29-1. */ #define INTMASK (EMACS_INT_MAX >> (INTTYPEBITS - 1)) -#define LISP_INT_TAG Lisp_Int0 #define case_Lisp_Int case Lisp_Int0: case Lisp_Int1 -#define LISP_INT1_TAG (USE_LSB_TAG ? 1 << INTTYPEBITS : 1) -#define LISP_STRING_TAG (5 - LISP_INT1_TAG) -#define LISP_INT_TAG_P(x) (((x) & ~LISP_INT1_TAG) == 0) +#define LISP_INT_TAG_P(x) (((x) & ~Lisp_Int1) == 0) /* Stolen from GDB. The only known compiler that doesn't support enums in bitfields is MSVC. */ @@ -232,7 +229,7 @@ enum Lisp_Type { /* Integer. XINT (obj) is the integer value. */ Lisp_Int0 = 0, - Lisp_Int1 = LISP_INT1_TAG, + Lisp_Int1 = USE_LSB_TAG ? 1 << INTTYPEBITS : 1, /* Symbol. XSYMBOL (object) points to a struct Lisp_Symbol. */ Lisp_Symbol = 2, @@ -243,7 +240,7 @@ enum Lisp_Type /* String. XSTRING (object) points to a struct Lisp_String. The length of the string, and its contents, are stored therein. */ - Lisp_String = LISP_STRING_TAG, + Lisp_String = USE_LSB_TAG ? 1 : 1 << INTTYPEBITS, /* Vector of Lisp objects, or something resembling it. XVECTOR (object) points to a struct Lisp_Vector, which contains -- 2.11.4.GIT