diff options
author | Raulshc <[email protected]> | 2019-11-09 12:12:53 +0100 |
---|---|---|
committer | Raulshc <[email protected]> | 2019-11-09 12:12:53 +0100 |
commit | c5f88ab59fcbda3f6ac1e76b0175a5197624a63a (patch) | |
tree | 1e071eab02ff0b8be88e4ed8a92206a62b452acb | |
parent | d2608e4bde41b3005a06346bea99bbe06404ef22 (diff) |
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.
-rw-r--r-- | alc/effects/modulator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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<float>(index)*(2.0f/WAVEFORM_FRACONE) - 1.0f; } inline float Square(ALuint index) -{ return static_cast<float>(((index>>(WAVEFORM_FRACBITS-2))&2) - 1); } +{ return static_cast<float>(static_cast<int>((index>>(WAVEFORM_FRACBITS-2))&2) - 1); } inline float One(ALuint) { return 1.0f; } |