]> Shamusworld >> Repos - rmac/blobdiff - fltpoint.c
Fix for bug #167
[rmac] / fltpoint.c
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))));
 }