Mercurial > emacs
comparison src/floatfns.c @ 8825:5e5f6d06fb5b
(FLOAT_TO_INT, FLOAT_TO_INT2): Use EMACS_INT.
| author | Richard M. Stallman <rms@gnu.org> |
|---|---|
| date | Sat, 17 Sep 1994 00:31:05 +0000 |
| parents | bf93ac2d8409 |
| children | b2d1d925d5cc |
comparison
equal
deleted
inserted
replaced
| 8824:589f82d1bb32 | 8825:5e5f6d06fb5b |
|---|---|
| 178 /* Convert float to Lisp_Int if it fits, else signal a range error | 178 /* Convert float to Lisp_Int if it fits, else signal a range error |
| 179 using the given arguments. */ | 179 using the given arguments. */ |
| 180 #define FLOAT_TO_INT(x, i, name, num) \ | 180 #define FLOAT_TO_INT(x, i, name, num) \ |
| 181 do \ | 181 do \ |
| 182 { \ | 182 { \ |
| 183 if ((x) >= (1 << (VALBITS-1)) || (x) <= - (1 << (VALBITS-1)) - 1) \ | 183 if ((x) >= (((EMACS_INT) 1) << (VALBITS-1)) || \ |
| 184 (x) <= - (((EMACS_INT) 1) << (VALBITS-1)) - 1) \ | |
| 184 range_error (name, num); \ | 185 range_error (name, num); \ |
| 185 XSET (i, Lisp_Int, (int)(x)); \ | 186 XSET (i, Lisp_Int, (EMACS_INT)(x)); \ |
| 186 } \ | 187 } \ |
| 187 while (0) | 188 while (0) |
| 188 #define FLOAT_TO_INT2(x, i, name, num1, num2) \ | 189 #define FLOAT_TO_INT2(x, i, name, num1, num2) \ |
| 189 do \ | 190 do \ |
| 190 { \ | 191 { \ |
| 191 if ((x) >= (1 << (VALBITS-1)) || (x) <= - (1 << (VALBITS-1)) - 1) \ | 192 if ((x) >= (((EMACS_INT) 1) << (VALBITS-1)) || \ |
| 193 (x) <= - (((EMACS_INT) 1) << (VALBITS-1)) - 1) \ | |
| 192 range_error2 (name, num1, num2); \ | 194 range_error2 (name, num1, num2); \ |
| 193 XSET (i, Lisp_Int, (int)(x)); \ | 195 XSET (i, Lisp_Int, (EMACS_INT)(x)); \ |
| 194 } \ | 196 } \ |
| 195 while (0) | 197 while (0) |
| 196 | 198 |
| 197 #define arith_error(op,arg) \ | 199 #define arith_error(op,arg) \ |
| 198 Fsignal (Qarith_error, Fcons (build_string ((op)), Fcons ((arg), Qnil))) | 200 Fsignal (Qarith_error, Fcons (build_string ((op)), Fcons ((arg), Qnil))) |
