From: Shamus Hammons Date: Sat, 4 Jul 2020 16:09:52 +0000 (-0500) Subject: Fix for bug #149; thanks to ggn for the patch. Now at v2.0.15. X-Git-Tag: v2.1.0~27 X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=commitdiff_plain;h=63191aa1fc339b412390670ddf758d9f2ddad8f1;ds=sidebyside Fix for bug #149; thanks to ggn for the patch. Now at v2.0.15. --- diff --git a/fltpoint.c b/fltpoint.c index 2205a79..7e516fb 100644 --- a/fltpoint.c +++ b/fltpoint.c @@ -189,7 +189,8 @@ uint32_t DoubleToDSPFloat(double d) return 0x800000; } - return trunc(round(ldexp(d, 23))); + // The casts are here because some compilers do weird shit. See bug #149. + return (uint32_t)((int32_t)trunc(round(ldexp(d, 23)))); } diff --git a/version.h b/version.h index bcc6f2a..084a071 100644 --- a/version.h +++ b/version.h @@ -15,7 +15,7 @@ #define MAJOR 2 // Major version number #define MINOR 0 // Minor version number -#define PATCH 14 // Patch release number +#define PATCH 15 // Patch release number #endif // __VERSION_H__