Fix for bug #149; thanks to ggn for the patch. Now at v2.0.15.
authorShamus Hammons <jlhamm@acm.org>
Sat, 4 Jul 2020 16:09:52 +0000 (11:09 -0500)
committerShamus Hammons <jlhamm@acm.org>
Sat, 4 Jul 2020 16:09:52 +0000 (11:09 -0500)
fltpoint.c
version.h

index 2205a79f4c0d8d5a30d20216b8f08d17d84c7808..7e516fbd360686985aa160bb45f7f38658c6a67a 100644 (file)
@@ -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))));
 }
 
 
index bcc6f2a91f94485d31aa32f2b7e8b024969325a4..084a0715fa2f94ba6ebf1f346fa0ff627208d556 100644 (file)
--- 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__