diff options
author | Max Horn | 2009-07-01 20:51:04 +0000 |
---|---|---|
committer | Max Horn | 2009-07-01 20:51:04 +0000 |
commit | a6b57dc3a986f749ca8f915b461b184d48390757 (patch) | |
tree | d6c3e5e46743dd5073b8853613d61e501fa76fcd /sound/softsynth/mt32/partial.cpp | |
parent | 62acda5fdbe0daaeae9e1d0f08044b8be4ee98cf (diff) | |
download | scummvm-rg350-a6b57dc3a986f749ca8f915b461b184d48390757.tar.gz scummvm-rg350-a6b57dc3a986f749ca8f915b461b184d48390757.tar.bz2 scummvm-rg350-a6b57dc3a986f749ca8f915b461b184d48390757.zip |
- Added GCC_PRINTF attribute to several funcs where it makes sense
- change some constants from double to float, to avoid "loss of precision due to implicit conversion" warnings
- removed duplicate prototypes for some funcs
- fixed some "increases required alignment of target type" warnings
svn-id: r42009
Diffstat (limited to 'sound/softsynth/mt32/partial.cpp')
-rw-r--r-- | sound/softsynth/mt32/partial.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sound/softsynth/mt32/partial.cpp b/sound/softsynth/mt32/partial.cpp index 02610798dc..871eff03d2 100644 --- a/sound/softsynth/mt32/partial.cpp +++ b/sound/softsynth/mt32/partial.cpp @@ -35,9 +35,9 @@ // powf, resulting in a linker error because of multiple definitions. // Hence we re-define them here. The only potential drawback is that it // might be a little bit slower this way. -#define powf pow -#define floorf floor -#define fabsf fabs +#define powf(x,y) ((float)pow(x,y)) +#define floorf(x) ((float)floorf(x)) +#define fabsf(x) ((float)fabs(x)) #endif #define FIXEDPOINT_UDIV(x, y, point) (((x) << (point)) / ((y))) @@ -504,10 +504,10 @@ Bit16s *Partial::mixBuffersRingMix(Bit16s * buf1, Bit16s *buf2, int len) { a = ((float)*buf1) / 8192.0f; b = ((float)*buf2) / 8192.0f; a = (a * b) + a; - if (a>1.0) - a = 1.0; - if (a<-1.0) - a = -1.0; + if (a > 1.0f) + a = 1.0f; + if (a < -1.0f) + a = -1.0f; *buf1 = (Bit16s)(a * 8192.0f); buf1++; buf2++; @@ -537,10 +537,10 @@ Bit16s *Partial::mixBuffersRing(Bit16s * buf1, Bit16s *buf2, int len) { a = ((float)*buf1) / 8192.0f; b = ((float)*buf2) / 8192.0f; a *= b; - if (a>1.0) - a = 1.0; - if (a<-1.0) - a = -1.0; + if (a > 1.0f) + a = 1.0f; + if (a < -1.0f) + a = -1.0f; *buf1 = (Bit16s)(a * 8192.0f); buf1++; buf2++; |