[issue33781] audioop.c: fbound() casts double to int for its return value

STINNER Victor report at bugs.python.org
Wed Jun 6 07:02:16 EDT 2018


STINNER Victor <vstinner at redhat.com> added the comment:

Oh, fbound() cast to (int) has been done by... myself :-D

commit f2b9a340ef143099726fb642951410e4ad793c7f
Author: Victor Stinner <victor.stinner at gmail.com>
Date:   Tue May 7 23:49:15 2013 +0200

    audioop: explicit cast to fix a compiler warning

diff --git a/Modules/audioop.c b/Modules/audioop.c
index 7e40bbddc6..4f2b25f33a 100644
--- a/Modules/audioop.c
+++ b/Modules/audioop.c
@@ -37,7 +37,7 @@ fbound(double val, double minval, double maxval)
         val = maxval;
     else if (val < minval + 1)
         val = minval;
-    return val;
+    return (int)val;
 }


Stupid me!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33781>
_______________________________________


More information about the Python-bugs-list mailing list