diff options
| author | Paul Eggert | 2017-03-04 23:14:52 -0800 |
|---|---|---|
| committer | Paul Eggert | 2017-03-04 23:18:39 -0800 |
| commit | 0d55c44a9a00da3b8542e92586654adeb2bcf228 (patch) | |
| tree | 1105e60b43ef80d105ca613ece1c8cfc6ee64f07 /src/dbusbind.c | |
| parent | 44e7ee2e356452139156e8175c46f646835d27ff (diff) | |
| download | emacs-0d55c44a9a00da3b8542e92586654adeb2bcf228.tar.gz emacs-0d55c44a9a00da3b8542e92586654adeb2bcf228.zip | |
Compare and round more carefully
* etc/NEWS: Document this.
* src/data.c (store_symval_forwarding):
* src/sound.c (parse_sound):
Do not botch NaN comparison.
* src/data.c (cons_to_unsigned, cons_to_signed):
Signal an error if a floating-point arg is not integral.
* src/data.c (cons_to_unsigned, cons_to_signed):
* src/fileio.c (file_offset):
Use simpler overflow check.
* src/dbusbind.c (xd_extract_signed, xd_extract_unsigned):
Avoid rounding error in overflow check.
(Fcar_less_than_car): Use arithcompare directly.
* test/src/charset-tests.el: New file.
Diffstat (limited to 'src/dbusbind.c')
| -rw-r--r-- | src/dbusbind.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dbusbind.c b/src/dbusbind.c index e7c3251c14b..d2460fd886e 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c | |||
| @@ -526,7 +526,7 @@ xd_extract_signed (Lisp_Object x, intmax_t lo, intmax_t hi) | |||
| 526 | else | 526 | else |
| 527 | { | 527 | { |
| 528 | double d = XFLOAT_DATA (x); | 528 | double d = XFLOAT_DATA (x); |
| 529 | if (lo <= d && d <= hi) | 529 | if (lo <= d && d < 1.0 + hi) |
| 530 | { | 530 | { |
| 531 | intmax_t n = d; | 531 | intmax_t n = d; |
| 532 | if (n == d) | 532 | if (n == d) |
| @@ -554,7 +554,7 @@ xd_extract_unsigned (Lisp_Object x, uintmax_t hi) | |||
| 554 | else | 554 | else |
| 555 | { | 555 | { |
| 556 | double d = XFLOAT_DATA (x); | 556 | double d = XFLOAT_DATA (x); |
| 557 | if (0 <= d && d <= hi) | 557 | if (0 <= d && d < 1.0 + hi) |
| 558 | { | 558 | { |
| 559 | uintmax_t n = d; | 559 | uintmax_t n = d; |
| 560 | if (n == d) | 560 | if (n == d) |