mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-07-28 04:54:13 -04:00
PVS-Studio static analysis corrections (2) issue #137
This commit is contained in:
@@ -165,7 +165,7 @@ bool AirspyInput::start()
|
||||
|
||||
if((m_airspyThread = new AirspyThread(m_dev, &m_sampleFifo)) == 0)
|
||||
{
|
||||
qFatal("AirspyInput::start: out of memory");
|
||||
qCritical("AirspyInput::start: out of memory");
|
||||
stop();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ bool AirspyHFInput::start()
|
||||
|
||||
if ((m_airspyHFThread = new AirspyHFThread(m_dev, &m_sampleFifo)) == 0)
|
||||
{
|
||||
qFatal("AirspyHFInput::start: out of memory");
|
||||
qCritical("AirspyHFInput::start: out of memory");
|
||||
stop();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ bool AirspyHFIInput::start()
|
||||
|
||||
if ((m_airspyHFThread = new AirspyHFIThread(m_dev, &m_sampleFifo)) == 0)
|
||||
{
|
||||
qFatal("AirspyHFInput::start: out of memory");
|
||||
qCritical("AirspyHFInput::start: out of memory");
|
||||
stop();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ bool BladerfInput::start()
|
||||
if (m_running) stop();
|
||||
|
||||
if((m_bladerfThread = new BladerfInputThread(m_dev, &m_sampleFifo)) == 0) {
|
||||
qFatal("BladerfInput::start: out of memory");
|
||||
qCritical("BladerfInput::start: out of memory");
|
||||
stop();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ bool FCDProInput::start()
|
||||
|
||||
if ((m_FCDThread = new FCDProThread(&m_sampleFifo)) == NULL)
|
||||
{
|
||||
qFatal("out of memory");
|
||||
qCritical("out of memory");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ bool FCDProPlusInput::start()
|
||||
|
||||
if ((m_FCDThread = new FCDProPlusThread(&m_sampleFifo)) == NULL)
|
||||
{
|
||||
qFatal("out of memory");
|
||||
qCritical("out of memory");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ bool FileSourceInput::start()
|
||||
//openFileStream();
|
||||
|
||||
if((m_fileSourceThread = new FileSourceThread(&m_ifstream, &m_sampleFifo)) == NULL) {
|
||||
qFatal("out of memory");
|
||||
qCritical("out of memory");
|
||||
stop();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ bool HackRFInput::start()
|
||||
|
||||
if ((m_hackRFThread = new HackRFInputThread(m_dev, &m_sampleFifo)) == 0)
|
||||
{
|
||||
qFatal("HackRFInput::start: out of memory");
|
||||
qCritical("HackRFInput::start: out of memory");
|
||||
stop();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -395,7 +395,7 @@ bool LimeSDRInput::start()
|
||||
|
||||
if ((m_limeSDRInputThread = new LimeSDRInputThread(&m_streamId, &m_sampleFifo)) == 0)
|
||||
{
|
||||
qFatal("LimeSDRInput::start: cannot create thread");
|
||||
qCritical("LimeSDRInput::start: cannot create thread");
|
||||
stop();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ bool PerseusInput::start()
|
||||
|
||||
if ((m_perseusThread = new PerseusThread(m_perseusDescriptor, &m_sampleFifo)) == 0)
|
||||
{
|
||||
qFatal("PerseusInput::start: cannot create thread");
|
||||
qCritical("PerseusInput::start: cannot create thread");
|
||||
stop();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -189,7 +189,7 @@ bool RTLSDRInput::start()
|
||||
|
||||
if ((m_rtlSDRThread = new RTLSDRThread(m_dev, &m_sampleFifo)) == NULL)
|
||||
{
|
||||
qFatal("RTLSDRInput::start: out of memory");
|
||||
qCritical("RTLSDRInput::start: out of memory");
|
||||
stop();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ bool SDRPlayInput::start()
|
||||
|
||||
if((m_sdrPlayThread = new SDRPlayThread(m_dev, &m_sampleFifo)) == 0)
|
||||
{
|
||||
qFatal("SDRPlayInput::start: failed to create thread");
|
||||
qCritical("SDRPlayInput::start: failed to create thread");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ bool TestSourceInput::start()
|
||||
|
||||
if ((m_testSourceThread = new TestSourceThread(&m_sampleFifo)) == 0)
|
||||
{
|
||||
qFatal("TestSourceInput::start: out of memory");
|
||||
qCritical("TestSourceInput::start: out of memory");
|
||||
stop();
|
||||
return false;
|
||||
}
|
||||
@@ -257,10 +257,10 @@ bool TestSourceInput::applySettings(const TestSourceSettings& settings, bool for
|
||||
}
|
||||
}
|
||||
|
||||
if (force || (m_settings.m_centerFrequency != settings.m_centerFrequency)
|
||||
|| (m_settings.m_fcPos != settings.m_fcPos)
|
||||
|| (m_settings.m_frequencyShift != settings.m_frequencyShift)
|
||||
|| (m_settings.m_log2Decim != settings.m_log2Decim) || force)
|
||||
if ((m_settings.m_centerFrequency != settings.m_centerFrequency)
|
||||
|| (m_settings.m_fcPos != settings.m_fcPos)
|
||||
|| (m_settings.m_frequencyShift != settings.m_frequencyShift)
|
||||
|| (m_settings.m_log2Decim != settings.m_log2Decim) || force)
|
||||
{
|
||||
qint64 deviceCenterFrequency = settings.m_centerFrequency;
|
||||
int frequencyShift = settings.m_frequencyShift;
|
||||
|
||||
Reference in New Issue
Block a user