Mercurial > emacs
changeset 9292:ec707cca800a
(XSETFASTINT): New macro.
(CHECK_NUMBER_COERCE_MARKER): Don't use XFASTINT as an lvalue.
(CHECK_NUMBER_OR_FLOAT_COERCE_MARKER): Likewise.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Tue, 04 Oct 1994 15:24:13 +0000 |
parents | 51aef3ec59f8 |
children | 9793cba6b65e |
files | src/lisp.h |
diffstat | 1 files changed, 10 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lisp.h Tue Oct 04 14:23:18 1994 +0000 +++ b/src/lisp.h Tue Oct 04 15:24:13 1994 +0000 @@ -313,9 +313,11 @@ #define XSETTYPE(a, b) ((a) = XUINT (a) | ((EMACS_INT)(b) << VALBITS)) #endif -/* Use XFASTINT for fast retrieval and storage of integers known - to be positive. This takes advantage of the fact that Lisp_Int is 0. */ +/* For integers known to be positive, XFASTINT provides fast retrieval + and XSETFASTINT provides fast storage. This takes advantage of the + fact that Lisp_Int is 0. */ #define XFASTINT(a) (a) +#define XSETFASTINT(a, b) ((a) = (b)) /* Extract the value of a Lisp_Object as a signed integer. */ @@ -395,9 +397,11 @@ #define XTYPE(a) ((enum Lisp_Type) (a).u.type) #define XSETTYPE(a, b) ((a).u.type = (char) (b)) -/* Use XFASTINT for fast retrieval and storage of integers known - to be positive. This takes advantage of the fact that Lisp_Int is 0. */ +/* For integers known to be positive, XFASTINT provides fast retrieval + and XSETFASTINT provides fast storage. This takes advantage of the + fact that Lisp_Int is 0. */ #define XFASTINT(a) ((a).i) +#define XSETFASTINT(a, b) ((a).i = (b)) #ifdef EXPLICIT_SIGN_EXTEND /* Make sure we sign-extend; compilers have been known to fail to do so. */ @@ -785,7 +789,7 @@ do { if (!MARKERP ((x))) x = wrong_type_argument (Qmarkerp, (x)); } while (0) #define CHECK_NUMBER_COERCE_MARKER(x, i) \ - do { if (MARKERP ((x))) XFASTINT (x) = marker_position (x); \ + do { if (MARKERP ((x))) XSETFASTINT (x, marker_position (x)); \ else if (!INTEGERP ((x))) x = wrong_type_argument (Qinteger_or_marker_p, (x)); } while (0) #ifdef LISP_FLOAT_TYPE @@ -805,7 +809,7 @@ x = wrong_type_argument (Qnumberp, (x)); } while (0) #define CHECK_NUMBER_OR_FLOAT_COERCE_MARKER(x, i) \ - do { if (MARKERP (x)) XFASTINT (x) = marker_position (x); \ + do { if (MARKERP (x)) XSETFASTINT (x, marker_position (x)); \ else if (!INTEGERP (x) && !FLOATP (x)) \ x = wrong_type_argument (Qnumber_or_marker_p, (x)); } while (0)