From ce054406206c1e0d6973cb64421ca3aad501450f Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 18 Nov 2017 11:28:06 +1000 Subject: [PATCH] Fix compilation errors and warnings with the Android build. --- mini_al.h | 6 +++--- resources/format_conversions.txt | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mini_al.h b/mini_al.h index 2dcf3e71..5a1acbfd 100644 --- a/mini_al.h +++ b/mini_al.h @@ -6802,7 +6802,7 @@ static SLuint32 mal_channel_id_to_opensl(mal_uint8 id) } // Converts a channel mapping to an OpenSL-style channel mask. -static SLuint32 mal_channel_map_to_channel_mask__opensl(mal_uint8 channelMap[MAL_MAX_CHANNELS], mal_uint32 channels) +static SLuint32 mal_channel_map_to_channel_mask__opensl(const mal_uint8 channelMap[MAL_MAX_CHANNELS], mal_uint32 channels) { SLuint32 channelMask = 0; for (mal_uint32 iChannel = 0; iChannel < channels; ++iChannel) { @@ -10528,7 +10528,7 @@ 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 + 2147483648); + t = (double)(x + 2147483648LL); t = t * 0.0000000004656612873077392578125; r = (float)(t - 1); pOut[i] = (float)r; @@ -10586,7 +10586,7 @@ 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 - 2147483648); + r = (int)(t - 2147483648LL); pOut[i] = (int)r; } } diff --git a/resources/format_conversions.txt b/resources/format_conversions.txt index a85f2f4d..b6c1018e 100644 --- a/resources/format_conversions.txt +++ b/resources/format_conversions.txt @@ -119,7 +119,7 @@ s32->s24 { # r = ((x + 2147483648) * 0.0000000004656612873077392578125) - 1 s32->f32 { dbl t; - add (dbl)t x 2147483648; + add (dbl)t x 2147483648LL; mul t t 0.0000000004656612873077392578125; sub (flt)r t 1; } @@ -159,5 +159,5 @@ f32->s32 { clip c x; add c c 1; mul (lng)t c 2147483647.5; - sub (int)r t 2147483648; + sub (int)r t 2147483648LL; }