Fix several gcc, cppcheck and clang warnings

This commit is contained in:
Roland Winklmeier
2014-12-01 00:46:58 +01:00
parent 646589fe22
commit 562cadee8a
9 changed files with 18 additions and 7 deletions

View File

@@ -48,7 +48,7 @@ namespace BlackCore
s = connection.connect(serviceName, IContextApplication::ObjectPath(), IContextApplication::InterfaceName(),
"componentChanged", this, SIGNAL(componentChanged(uint, uint)));
Q_ASSERT(s);
Q_UNUSED(s);
}
/*

View File

@@ -49,6 +49,7 @@ namespace BlackGui
Q_ASSERT(connected);
connected = this->connect(this->ui->pb_AtcStationsLoadMetar, SIGNAL(clicked()), this, SLOT(getMetar()));
Q_ASSERT(connected);
Q_UNUSED(connected);
connect(this, &QTabWidget::currentChanged, this, &CAtcStationComponent::ps_atcStationsTabChanged); // "local" tab changed (booked, online)
connect(this->ui->tvp_AtcStationsOnline, &QTableView::clicked, this, &CAtcStationComponent::ps_onlineAtcStationSelected);
connect(this->ui->tvp_AtcStationsOnline, &CAtcStationView::testRequestDummyAtcOnlineStations, this, &CAtcStationComponent::ps_testCreateDummyOnlineAtcStations);

View File

@@ -59,6 +59,7 @@ namespace BlackGui
Q_ASSERT(connected);
connected = this->connect(this->ui->cb_SetupAudioOutputDevice, SIGNAL(currentIndexChanged(int)), this, SLOT(ps_audioDeviceSelected(int)));
Q_ASSERT(connected);
Q_UNUSED(connected);
this->connect(this->ui->pb_SetupAudioMicrophoneTest, &QPushButton::clicked, this, &CAudioSetupComponent::ps_startAudioTest);
this->connect(this->ui->pb_SetupAudioSquelchTest, &QPushButton::clicked, this, &CAudioSetupComponent::ps_startAudioTest);

View File

@@ -49,6 +49,7 @@ namespace BlackGui
// to audio audio context
c = connect(this->ui->pb_Mute, &QPushButton::toggled, this->getIContextAudio(), &IContextAudio::setMute);
Q_ASSERT(c);
Q_UNUSED(c);
}
void CAudioVolumeComponent::ps_onMuteChanged(bool muted)

View File

@@ -171,7 +171,6 @@ namespace BlackGui
}
else if (this->getIContextAudio())
{
CSelcal selcal(selcal);
this->getIContextAudio()->playSelcalTone(selcal);
}
else

View File

@@ -62,8 +62,8 @@ namespace BlackGui
static const QString &ledsOriginator();
QScopedPointer<BlackGui::CLedWidget> m_ledStandby;
QScopedPointer<BlackGui::CLedWidget> m_ledIdent;
QScopedPointer<BlackGui::CLedWidget> m_ledModes;
QScopedPointer<BlackGui::CLedWidget> m_ledIdent;
};

View File

@@ -133,6 +133,7 @@ namespace BlackGui
connected = this->connect(this->ui->cb_SettingsGuiFontStyle, SIGNAL(currentIndexChanged(QString)), this, SLOT(ps_fontChanged()));
Q_ASSERT(connected);
this->connect(this->ui->tb_SettingsGuiFontColor, &QToolButton::clicked, this, &CSettingsComponent::ps_fontColorDialog);
Q_UNUSED(connected);
}
/*

View File

@@ -64,7 +64,7 @@ namespace BlackMisc
// not all classes have implemented nesting
const QString m = QString("Property by index not found (setter), index: ").append(index.toQString());
qFatal(m.toLatin1().constData());
qFatal("%s", qPrintable(m));
}
/*
@@ -88,7 +88,7 @@ namespace BlackMisc
// not all classes have implemented nesting
const QString m = QString("Property by index not found, index: ").append(index.toQString());
qFatal(m.toLatin1().constData());
qFatal("%s", qPrintable(m));
return QVariant(m); // avoid compiler warning
}

View File

@@ -159,8 +159,16 @@ namespace BlackSimPlugin
if (m_hostStatus == Terminated) return hr;
BlackMisc::CLogMessage(this).info("Hosting terminated!");
hr = m_directPlayPeer->TerminateSession(nullptr, 0, 0);
hr = m_directPlayPeer->Close(0);
if (FAILED(hr = m_directPlayPeer->TerminateSession(nullptr, 0, 0)))
{
return printDirectPlayError(hr);
}
if (FAILED(hr = m_directPlayPeer->Close(0)))
{
return printDirectPlayError(hr);
}
m_hostStatus = Terminated;
emit statusChanged(m_hostStatus);