From: <sv...@op...> - 2024-11-01 12:23:15
|
Author: sagamusix Date: Fri Nov 1 13:23:03 2024 New Revision: 22045 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22045 Log: [Ref] Silence various gcc warnings. Modified: trunk/OpenMPT/soundlib/InstrumentSynth.cpp trunk/OpenMPT/soundlib/Load_fc.cpp Modified: trunk/OpenMPT/soundlib/InstrumentSynth.cpp ============================================================================== --- trunk/OpenMPT/soundlib/InstrumentSynth.cpp Thu Oct 31 21:50:32 2024 (r22044) +++ trunk/OpenMPT/soundlib/InstrumentSynth.cpp Fri Nov 1 13:23:03 2024 (r22045) @@ -439,7 +439,7 @@ if(m_flags[kFCPitchBendStep]) { m_fcPitchBendRemain--; - m_periodAdd -= m_fcPitchBendSpeed * 4; + m_periodAdd -= static_cast<int16>(m_fcPitchBendSpeed * 4); } } } @@ -483,7 +483,7 @@ if(doVibratoFC) { - uint16 note = (fcNote * 2) + 160; + int note = (fcNote * 2) + 160; while(note < 256) { vibratoFC *= 2; @@ -906,7 +906,7 @@ { uint8 waveform = event.Byte1() + 1; if(event.Byte0() == 0xE9) - waveform += event.Byte2() * 10 + 90; + waveform += static_cast<uint8>(event.Byte2() * 10 + 90); ChannelSetSample(chn, sndFile, waveform, event.Byte0() == 0xE4); } return false; Modified: trunk/OpenMPT/soundlib/Load_fc.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_fc.cpp Thu Oct 31 21:50:32 2024 (r22044) +++ trunk/OpenMPT/soundlib/Load_fc.cpp Fri Nov 1 13:23:03 2024 (r22045) @@ -138,7 +138,7 @@ // Luckily this is not possible with frequency sequences - as multiple frequency sequences can be chained using command E7, // not having to care for that bug there makes the book-keeping a bit easier for us, as jumps will always be "local" within the currently selected sequence, // and a jump target address cannot belong to two parsed sequences. - const uint16 maxScriptJumpPos = currentSequenceOffset + (isVolume ? 260 : 63); + const uint16 maxScriptJumpPos = static_cast<uint16>(currentSequenceOffset + (isVolume ? 260 : 63)); uint16 maxJump = 0; bool nextByteIsPitch = false; while(file.CanRead(1)) @@ -224,7 +224,7 @@ if(isVolume && script[0] > 1) { events.push_back(InstrumentSynth::Event::SetStepSpeed(1, true)); - events.push_back(InstrumentSynth::Event::Delay(delay + script[0] - 2)); + events.push_back(InstrumentSynth::Event::Delay(static_cast<uint16>(delay + script[0] - 2))); events.push_back(InstrumentSynth::Event::SetStepSpeed(script[0], true)); } else if(delay) { @@ -414,7 +414,7 @@ const auto freqSeq = mpt::as_span(freqSequences).subspan((volSeq[1] * 64u) % freqSequences.size()); uint8 defaultSample = freqSeq[1]; if(freqSeq[0] == 0xE9) - defaultSample = 90 + defaultSample * 10 + freqSeq[2]; + defaultSample = static_cast<uint8>(90 + defaultSample * 10 + freqSeq[2]); ModInstrument *instr = AllocateInstrument(ins, defaultSample + 1); if(!instr) |