Commit 9718ac2d authored by David Reid's avatar David Reid

Fix some warnings with GCC and -std=c89.

parent 3fcef2fc
...@@ -31046,7 +31046,13 @@ static MA_INLINE ma_int64 ma_clip_s24(ma_int64 x) ...@@ -31046,7 +31046,13 @@ static MA_INLINE ma_int64 ma_clip_s24(ma_int64 x)
static MA_INLINE ma_int32 ma_clip_s32(ma_int64 x) static MA_INLINE ma_int32 ma_clip_s32(ma_int64 x)
{ {
return (ma_int32)ma_clamp(x, -(ma_int64)2147483648, (ma_int64)2147483647); /* This dance is to silence warnings with -std=c89. A good compiler should be able to optimize this away. */
ma_int64 clipMin;
ma_int64 clipMax;
clipMin = -((ma_int64)2147483647 + 1);
clipMax = (ma_int64)2147483647;
return (ma_int32)ma_clamp(x, clipMin, clipMax);
} }
...@@ -37376,7 +37382,7 @@ static ma_result ma_channel_converter_process_pcm_frames__weights(ma_channel_con ...@@ -37376,7 +37382,7 @@ static ma_result ma_channel_converter_process_pcm_frames__weights(ma_channel_con
ma_int64 s = pFramesOutS32[iFrame*pConverter->channelsOut + iChannelOut]; ma_int64 s = pFramesOutS32[iFrame*pConverter->channelsOut + iChannelOut];
s += (pFramesInS32[iFrame*pConverter->channelsIn + iChannelIn] * pConverter->weights.s16[iChannelIn][iChannelOut]) >> MA_CHANNEL_CONVERTER_FIXED_POINT_SHIFT; s += (pFramesInS32[iFrame*pConverter->channelsIn + iChannelIn] * pConverter->weights.s16[iChannelIn][iChannelOut]) >> MA_CHANNEL_CONVERTER_FIXED_POINT_SHIFT;
pFramesOutS32[iFrame*pConverter->channelsOut + iChannelOut] = (ma_int32)ma_clamp(s, -(ma_int64)2147483648, (ma_int64)2147483647); pFramesOutS32[iFrame*pConverter->channelsOut + iChannelOut] = ma_clip_s32(s);
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment