From 8b4460e310886499f5018cdd264c0e3e835fe6fa Mon Sep 17 00:00:00 2001 From: D G Turner Date: Sun, 15 Jan 2017 07:10:38 +0000 Subject: ADL: Fix Signed vs. Unsigned Compiler Warnings. This is a subtle issue associated with the Common::Frac usage. The frac_t type is signed (int32), but the symbols such as FRAC_ONE are defined by an enumeration which will default to unsigned int for members. Unsure if the common code needs changing, but other usages fix the warning by casting the enumeration values to frac_t so doing this for now. --- engines/adl/sound.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/adl') diff --git a/engines/adl/sound.cpp b/engines/adl/sound.cpp index 17f4955a12..63eea45953 100644 --- a/engines/adl/sound.cpp +++ b/engines/adl/sound.cpp @@ -55,7 +55,7 @@ Speaker::Speaker(int sampleRate) : void Speaker::startTone(double freq) { _halfWaveLen = _halfWaveRem = doubleToFrac(_rate / freq / 2); - if (_halfWaveLen < FRAC_ONE) { + if (_halfWaveLen < (frac_t)FRAC_ONE) { // Tone out of range at this sample rate stopTone(); } @@ -70,7 +70,7 @@ void Speaker::generateSamples(int16 *buffer, int numSamples) { int offset = 0; while (offset < numSamples) { - if (_halfWaveRem >= 0 && _halfWaveRem < FRAC_ONE) { + if (_halfWaveRem >= 0 && _halfWaveRem < (frac_t)FRAC_ONE) { // Rising/falling edge // Switch level _curSample = ~_curSample; -- cgit v1.2.3