diff options
| author | Karl Heuer | 1994-10-04 15:24:13 +0000 |
|---|---|---|
| committer | Karl Heuer | 1994-10-04 15:24:13 +0000 |
| commit | 221f4ef367ee88772f82a25ed897e630006d3215 (patch) | |
| tree | 9a259fc95328aed9a32e464aee697540ec265148 /src | |
| parent | 8eec7551810172d75fa1bc3f1ec70d575e4ba7a7 (diff) | |
| download | emacs-221f4ef367ee88772f82a25ed897e630006d3215.tar.gz emacs-221f4ef367ee88772f82a25ed897e630006d3215.zip | |
(XSETFASTINT): New macro.
(CHECK_NUMBER_COERCE_MARKER): Don't use XFASTINT as an lvalue.
(CHECK_NUMBER_OR_FLOAT_COERCE_MARKER): Likewise.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lisp.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/lisp.h b/src/lisp.h index 0b52401dac1..95892c1507b 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -313,9 +313,11 @@ you lose | |||
| 313 | #define XSETTYPE(a, b) ((a) = XUINT (a) | ((EMACS_INT)(b) << VALBITS)) | 313 | #define XSETTYPE(a, b) ((a) = XUINT (a) | ((EMACS_INT)(b) << VALBITS)) |
| 314 | #endif | 314 | #endif |
| 315 | 315 | ||
| 316 | /* Use XFASTINT for fast retrieval and storage of integers known | 316 | /* For integers known to be positive, XFASTINT provides fast retrieval |
| 317 | to be positive. This takes advantage of the fact that Lisp_Int is 0. */ | 317 | and XSETFASTINT provides fast storage. This takes advantage of the |
| 318 | fact that Lisp_Int is 0. */ | ||
| 318 | #define XFASTINT(a) (a) | 319 | #define XFASTINT(a) (a) |
| 320 | #define XSETFASTINT(a, b) ((a) = (b)) | ||
| 319 | 321 | ||
| 320 | /* Extract the value of a Lisp_Object as a signed integer. */ | 322 | /* Extract the value of a Lisp_Object as a signed integer. */ |
| 321 | 323 | ||
| @@ -395,9 +397,11 @@ extern int pure_size; | |||
| 395 | #define XTYPE(a) ((enum Lisp_Type) (a).u.type) | 397 | #define XTYPE(a) ((enum Lisp_Type) (a).u.type) |
| 396 | #define XSETTYPE(a, b) ((a).u.type = (char) (b)) | 398 | #define XSETTYPE(a, b) ((a).u.type = (char) (b)) |
| 397 | 399 | ||
| 398 | /* Use XFASTINT for fast retrieval and storage of integers known | 400 | /* For integers known to be positive, XFASTINT provides fast retrieval |
| 399 | to be positive. This takes advantage of the fact that Lisp_Int is 0. */ | 401 | and XSETFASTINT provides fast storage. This takes advantage of the |
| 402 | fact that Lisp_Int is 0. */ | ||
| 400 | #define XFASTINT(a) ((a).i) | 403 | #define XFASTINT(a) ((a).i) |
| 404 | #define XSETFASTINT(a, b) ((a).i = (b)) | ||
| 401 | 405 | ||
| 402 | #ifdef EXPLICIT_SIGN_EXTEND | 406 | #ifdef EXPLICIT_SIGN_EXTEND |
| 403 | /* Make sure we sign-extend; compilers have been known to fail to do so. */ | 407 | /* Make sure we sign-extend; compilers have been known to fail to do so. */ |
| @@ -785,7 +789,7 @@ typedef unsigned char UCHAR; | |||
| 785 | do { if (!MARKERP ((x))) x = wrong_type_argument (Qmarkerp, (x)); } while (0) | 789 | do { if (!MARKERP ((x))) x = wrong_type_argument (Qmarkerp, (x)); } while (0) |
| 786 | 790 | ||
| 787 | #define CHECK_NUMBER_COERCE_MARKER(x, i) \ | 791 | #define CHECK_NUMBER_COERCE_MARKER(x, i) \ |
| 788 | do { if (MARKERP ((x))) XFASTINT (x) = marker_position (x); \ | 792 | do { if (MARKERP ((x))) XSETFASTINT (x, marker_position (x)); \ |
| 789 | else if (!INTEGERP ((x))) x = wrong_type_argument (Qinteger_or_marker_p, (x)); } while (0) | 793 | else if (!INTEGERP ((x))) x = wrong_type_argument (Qinteger_or_marker_p, (x)); } while (0) |
| 790 | 794 | ||
| 791 | #ifdef LISP_FLOAT_TYPE | 795 | #ifdef LISP_FLOAT_TYPE |
| @@ -805,7 +809,7 @@ typedef unsigned char UCHAR; | |||
| 805 | x = wrong_type_argument (Qnumberp, (x)); } while (0) | 809 | x = wrong_type_argument (Qnumberp, (x)); } while (0) |
| 806 | 810 | ||
| 807 | #define CHECK_NUMBER_OR_FLOAT_COERCE_MARKER(x, i) \ | 811 | #define CHECK_NUMBER_OR_FLOAT_COERCE_MARKER(x, i) \ |
| 808 | do { if (MARKERP (x)) XFASTINT (x) = marker_position (x); \ | 812 | do { if (MARKERP (x)) XSETFASTINT (x, marker_position (x)); \ |
| 809 | else if (!INTEGERP (x) && !FLOATP (x)) \ | 813 | else if (!INTEGERP (x) && !FLOATP (x)) \ |
| 810 | x = wrong_type_argument (Qnumber_or_marker_p, (x)); } while (0) | 814 | x = wrong_type_argument (Qnumber_or_marker_p, (x)); } while (0) |
| 811 | 815 | ||