Fix VC6 build.

This commit is contained in:
David Reid
2017-11-21 19:34:17 +10:00
parent 3acd03b133
commit 695dc2b902
2 changed files with 8 additions and 4 deletions
+4 -2
View File
@@ -11197,7 +11197,8 @@ void mal_pcm_s32_to_f32(float* pOut, const int* pIn, unsigned int count)
for (unsigned int i = 0; i < count; ++i) {
int x = pIn[i];
double t;
t = (double)(x + 2147483648LL);
t = (double)(x + 2147483647);
t = t + 1;
t = t * 0.0000000004656612873077392578125;
r = (float)(t - 1);
pOut[i] = (float)r;
@@ -11255,7 +11256,8 @@ void mal_pcm_f32_to_s32(int* pOut, const float* pIn, unsigned int count)
c = ((x < -1) ? -1 : ((x > 1) ? 1 : x));
c = c + 1;
t = (mal_int64)(c * 2147483647.5);
r = (int)(t - 2147483648LL);
t = t - 2147483647;
r = (int)(t - 1);
pOut[i] = (int)r;
}
}
+4 -2
View File
@@ -119,7 +119,8 @@ s32->s24 {
# r = ((x + 2147483648) * 0.0000000004656612873077392578125) - 1
s32->f32 {
dbl t;
add (dbl)t x 2147483648LL;
add (dbl)t x 2147483647;
add t t 1;
mul t t 0.0000000004656612873077392578125;
sub (flt)r t 1;
}
@@ -159,5 +160,6 @@ f32->s32 {
clip c x;
add c c 1;
mul (lng)t c 2147483647.5;
sub (int)r t 2147483648LL;
sub t t 2147483647;
sub (int)r t 1;
}