Skip to content

Commit 3f141f1

Browse files
committed
[Ref] PlaybackTest: Silence GCC -Wconversion warnings.
git-svn-id: https://source.openmpt.org/svn/openmpt/trunk/OpenMPT@22945 56274372-70c3-4bfc-bfc3-4c3a0b034d27
1 parent cd359f0 commit 3f141f1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

soundlib/PlaybackTest.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,8 @@ void PlaybackTest::ToTSV(std::ostream &output) const noexcept(false)
477477
<< channel.leftVol << "\t"
478478
<< channel.rightVol << "\t"
479479
<< ((channel.flags & TestDataChannel::kSurround) ? "yes" : "no") << "\t"
480-
<< (channel.increment * positionPrecision * header.mixingFreq) << "\t"
481-
<< ((channel.flags & TestDataChannel::kOPL) ? "OPL" : mpt::afmt::fmt(channel.position * positionPrecision, floatFormat)) << "\t"
480+
<< (static_cast<double>(channel.increment) * positionPrecision * header.mixingFreq) << "\t"
481+
<< ((channel.flags & TestDataChannel::kOPL) ? "OPL" : mpt::afmt::fmt(static_cast<double>(channel.position) * positionPrecision, floatFormat)) << "\t"
482482
<< filterType << "\t"
483483
<< channel.filterA0 * filterPrecision << "\t"
484484
<< channel.filterB0 * filterPrecision << "\t"
@@ -607,9 +607,9 @@ std::vector<mpt::ustring> PlaybackTest::Compare(const PlaybackTest &otherTest) c
607607
MPT_LOG_TEST_WITH_ROW_CHN("Left volume", l, r);
608608
if(const auto l = lChn.rightVol * lChannelVolumeScale, r = rChn.rightVol * rChannelVolumeScale; !FuzzyEquals(l, r, epsilon))
609609
MPT_LOG_TEST_WITH_ROW_CHN("Right volume", l, r);
610-
if(const auto l = lChn.increment * lPositionPrecision * header.mixingFreq, r = rChn.increment * rPositionPrecision * other.header.mixingFreq; !FuzzyEquals(l, r, epsilon))
610+
if(const auto l = static_cast<double>(lChn.increment) * lPositionPrecision * header.mixingFreq, r = static_cast<double>(rChn.increment) * rPositionPrecision * other.header.mixingFreq; !FuzzyEquals(l, r, epsilon))
611611
MPT_LOG_TEST_WITH_ROW_CHN("Speed", l, r);
612-
if(const auto l = lChn.position * lPositionPrecision, r = rChn.position * rPositionPrecision; !FuzzyEquals(l, r, epsilon))
612+
if(const auto l = static_cast<double>(lChn.position) * lPositionPrecision, r = static_cast<double>(rChn.position) * rPositionPrecision; !FuzzyEquals(l, r, epsilon))
613613
MPT_LOG_TEST_WITH_ROW_CHN("Position", l, r);
614614
if(const auto l = lChn.filterA0 * lFilterPrecision, r = rChn.filterA0 * rFilterPrecision; !FuzzyEquals(l, r, epsilon))
615615
MPT_LOG_TEST_WITH_ROW_CHN("Filter A0", l, r);
@@ -728,7 +728,7 @@ PlaybackTest CSoundFile::CreatePlaybackTest(PlaybackTestSettings settings)
728728

729729
auto &channel = m_PlayState.Chn[chn];
730730
auto &channelData = row.channels.emplace_back();
731-
channelData.channel = channel.nMasterChn ? -static_cast<int>(channel.nMasterChn) : (chn + 1);
731+
channelData.channel = static_cast<int16>(channel.nMasterChn ? -static_cast<int>(channel.nMasterChn) : (chn + 1));
732732
channelData.nnaAge = channel.nnaGeneration;
733733
if(channel.dwFlags[CHN_SURROUND])
734734
channelData.flags |= TestDataChannel::kSurround;

0 commit comments

Comments
 (0)