summaryrefslogtreecommitdiff
path: root/src/sound.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2017-03-04 23:14:52 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2017-03-04 23:18:39 -0800
commit0d55c44a9a00da3b8542e92586654adeb2bcf228 (patch)
tree1105e60b43ef80d105ca613ece1c8cfc6ee64f07 /src/sound.c
parent44e7ee2e356452139156e8175c46f646835d27ff (diff)
downloademacs-0d55c44a9a00da3b8542e92586654adeb2bcf228.tar.gz
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/sound.c')
-rw-r--r--src/sound.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sound.c b/src/sound.c
index 84754165db5..4714ac1796b 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -387,14 +387,14 @@ parse_sound (Lisp_Object sound, Lisp_Object *attrs)
{
if (INTEGERP (attrs[SOUND_VOLUME]))
{
- if (XINT (attrs[SOUND_VOLUME]) < 0
- || XINT (attrs[SOUND_VOLUME]) > 100)
+ EMACS_INT volume = XINT (attrs[SOUND_VOLUME]);
+ if (! (0 <= volume && volume <= 100))
return 0;
}
else if (FLOATP (attrs[SOUND_VOLUME]))
{
- if (XFLOAT_DATA (attrs[SOUND_VOLUME]) < 0
- || XFLOAT_DATA (attrs[SOUND_VOLUME]) > 1)
+ double volume = XFLOAT_DATA (attrs[SOUND_VOLUME]);
+ if (! (0 <= volume && volume <= 1))
return 0;
}
else