From c5f88ab59fcbda3f6ac1e76b0175a5197624a63a Mon Sep 17 00:00:00 2001 From: Raulshc <33253777+Raulshc@users.noreply.github.com> Date: Sat, 9 Nov 2019 12:12:53 +0100 Subject: EFX: Add explicit cast to a square function MSVC 2015 and above returns the expression according to its datatype. In this case, returns 4294967295 instead of -1. --- alc/effects/modulator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alc/effects/modulator.cpp b/alc/effects/modulator.cpp index 23bae63f..aee896fb 100644 --- a/alc/effects/modulator.cpp +++ b/alc/effects/modulator.cpp @@ -52,7 +52,7 @@ inline float Saw(ALuint index) { return static_cast(index)*(2.0f/WAVEFORM_FRACONE) - 1.0f; } inline float Square(ALuint index) -{ return static_cast(((index>>(WAVEFORM_FRACBITS-2))&2) - 1); } +{ return static_cast(static_cast((index>>(WAVEFORM_FRACBITS-2))&2) - 1); } inline float One(ALuint) { return 1.0f; } -- cgit v1.2.3