1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-02 06:04:39 -04:00

PVS-Studio static analysis corrections (2) issue #137

This commit is contained in:
f4exb
2018-02-22 03:04:42 +01:00
parent f01b90094b
commit 2b846f5d28
48 changed files with 160 additions and 147 deletions
@@ -87,7 +87,7 @@ bool PlutoSDRInput::start()
if ((m_plutoSDRInputThread = new PlutoSDRInputThread(PLUTOSDR_BLOCKSIZE_SAMPLES, m_deviceShared.m_deviceParams->getBox(), &m_sampleFifo)) == 0)
{
qFatal("PlutoSDRInput::start: cannot create thread");
qCritical("PlutoSDRInput::start: cannot create thread");
stop();
return false;
}
@@ -344,7 +344,6 @@ bool PlutoSDRInput::applySettings(const PlutoSDRInputSettings& settings, bool fo
{
bool forwardChangeOwnDSP = false;
bool forwardChangeOtherDSP = false;
bool suspendOwnThread = false;
bool ownThreadWasRunning = false;
bool suspendAllOtherThreads = false; // All others means Tx in fact
DevicePlutoSDRBox *plutoBox = m_deviceShared.m_deviceParams->getBox();
@@ -364,11 +363,6 @@ bool PlutoSDRInput::applySettings(const PlutoSDRInputSettings& settings, bool fo
(m_settings.m_LOppmTenths != settings.m_LOppmTenths) || force)
{
suspendAllOtherThreads = true;
suspendOwnThread = true;
}
else
{
suspendOwnThread = true;
}
if (suspendAllOtherThreads)
@@ -391,13 +385,10 @@ bool PlutoSDRInput::applySettings(const PlutoSDRInputSettings& settings, bool fo
}
}
if (suspendOwnThread)
if (m_plutoSDRInputThread && m_plutoSDRInputThread->isRunning())
{
if (m_plutoSDRInputThread && m_plutoSDRInputThread->isRunning())
{
m_plutoSDRInputThread->stopWork();
ownThreadWasRunning = true;
}
m_plutoSDRInputThread->stopWork();
ownThreadWasRunning = true;
}
// apply settings
@@ -557,11 +548,8 @@ bool PlutoSDRInput::applySettings(const PlutoSDRInputSettings& settings, bool fo
}
}
if (suspendOwnThread)
{
if (ownThreadWasRunning) {
m_plutoSDRInputThread->startWork();
}
if (ownThreadWasRunning) {
m_plutoSDRInputThread->startWork();
}
// TODO: forward changes to other (Tx) DSP