Skip to content

Commit

Permalink
Merge pull request #22701 from Jojo-Schmitz/compiler-warnings
Browse files Browse the repository at this point in the history
Fix MSVC compiler warnings
  • Loading branch information
Eism committed May 17, 2024
2 parents b98074f + 63e01f1 commit 2e494cf
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 18 deletions.
2 changes: 1 addition & 1 deletion buildscripts/ci/withoutqt/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ sudo apt-get install -y --no-install-recommends \

# COMPILER

gcc_version="11"
gcc_version="10"
sudo apt-get install -y --no-install-recommends "g++-${gcc_version}"
sudo update-alternatives \
--install /usr/bin/gcc gcc "/usr/bin/gcc-${gcc_version}" 40 \
Expand Down
8 changes: 4 additions & 4 deletions src/app/internal/consoleapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ void ConsoleApp::perform()
// ====================================================
// Process Autobot
// ====================================================
CmdOptions::Autobot autobot = options.autobot;
if (!autobot.testCaseNameOrFile.isEmpty()) {
QMetaObject::invokeMethod(qApp, [this, autobot]() {
processAutobot(autobot);
CmdOptions::Autobot autobotOptions = options.autobot;
if (!autobotOptions.testCaseNameOrFile.isEmpty()) {
QMetaObject::invokeMethod(qApp, [this, autobotOptions]() {
processAutobot(autobotOptions);
}, Qt::QueuedConnection);
} else {
// ====================================================
Expand Down
4 changes: 2 additions & 2 deletions src/notation/view/widgets/measureproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ void MeasurePropertiesDialog::initMeasure()
return;
}

INotationInteraction::HitElementContext context = m_notation->interaction()->hitElementContext();
mu::engraving::Measure* measure = mu::engraving::toMeasure(context.element);
INotationInteraction::HitElementContext ctx = m_notation->interaction()->hitElementContext();
mu::engraving::Measure* measure = mu::engraving::toMeasure(ctx.element);

if (!measure) {
INotationSelectionPtr selection = m_notation->interaction()->selection();
Expand Down
15 changes: 4 additions & 11 deletions src/playback/internal/playbackcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1457,24 +1457,17 @@ MeasureBeat PlaybackController::currentBeat() const

msecs_t PlaybackController::beatToMilliseconds(int measureIndex, int beatIndex) const
{
if (!notationPlayback()) {
return 0;
}

int tick = notationPlayback()->beatToTick(measureIndex, beatIndex);
return tickToMsecs(tick);
return notationPlayback() ? tickToMsecs(notationPlayback()->beatToTick(measureIndex, beatIndex)) : 0;
}

double PlaybackController::tempoMultiplier() const
{
INotationPlaybackPtr playback = notationPlayback();
return playback ? playback->tempoMultiplier() : 1.0;
return notationPlayback() ? notationPlayback()->tempoMultiplier() : 1.0;
}

void PlaybackController::setTempoMultiplier(double multiplier)
{
INotationPlaybackPtr playback = notationPlayback();
if (!playback) {
if (!notationPlayback()) {
return;
}

Expand All @@ -1485,7 +1478,7 @@ void PlaybackController::setTempoMultiplier(double multiplier)
pause();
}

playback->setTempoMultiplier(multiplier);
notationPlayback()->setTempoMultiplier(multiplier);
seek(tick);
updateLoop();

Expand Down

0 comments on commit 2e494cf

Please sign in to comment.