mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-05-29 13:32:26 -04:00
removed asserts
This commit is contained in:
parent
379096cbdd
commit
19ecf12c22
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <assert.h>
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
@ -39,7 +38,6 @@ FileOutputWorker::FileOutputWorker(std::ofstream *samplesStream, SampleSourceFif
|
|||||||
m_throttleToggle(false),
|
m_throttleToggle(false),
|
||||||
m_buf(nullptr)
|
m_buf(nullptr)
|
||||||
{
|
{
|
||||||
assert(m_ofstream != nullptr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FileOutputWorker::~FileOutputWorker()
|
FileOutputWorker::~FileOutputWorker()
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <assert.h>
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <assert.h>
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
@ -225,4 +224,4 @@ void TestSinkWorker::feedSpectrum(int16_t *buf, unsigned int bufSize)
|
|||||||
);
|
);
|
||||||
|
|
||||||
m_spectrumSink->feed(m_samplesVector.m_vector.begin(), m_samplesVector.m_vector.begin() + (bufSize/2), false);
|
m_spectrumSink->feed(m_samplesVector.m_vector.begin(), m_samplesVector.m_vector.begin() + (bufSize/2), false);
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <assert.h>
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
#include "dsp/filerecord.h"
|
#include "dsp/filerecord.h"
|
||||||
@ -49,7 +48,6 @@ FileInputWorker::FileInputWorker(std::ifstream *samplesStream,
|
|||||||
m_throttlems(FILESOURCE_THROTTLE_MS),
|
m_throttlems(FILESOURCE_THROTTLE_MS),
|
||||||
m_throttleToggle(false)
|
m_throttleToggle(false)
|
||||||
{
|
{
|
||||||
assert(m_ifstream != nullptr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FileInputWorker::~FileInputWorker()
|
FileInputWorker::~FileInputWorker()
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <cassert>
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
template <typename Type, uint32_t Order> class IIRFilter
|
template <typename Type, uint32_t Order> class IIRFilter
|
||||||
{
|
{
|
||||||
@ -61,8 +60,6 @@ private:
|
|||||||
template <typename Type, uint32_t Order>
|
template <typename Type, uint32_t Order>
|
||||||
IIRFilter<Type, Order>::IIRFilter(const Type *a, const Type *b)
|
IIRFilter<Type, Order>::IIRFilter(const Type *a, const Type *b)
|
||||||
{
|
{
|
||||||
assert(Order > 1);
|
|
||||||
|
|
||||||
m_a = new Type[Order+1];
|
m_a = new Type[Order+1];
|
||||||
m_b = new Type[Order+1];
|
m_b = new Type[Order+1];
|
||||||
m_x = new Type[Order];
|
m_x = new Type[Order];
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <assert.h>
|
|
||||||
#include "samplesourcefifodb.h"
|
#include "samplesourcefifodb.h"
|
||||||
|
|
||||||
SampleSourceFifoDB::SampleSourceFifoDB(uint32_t size, QObject* parent) :
|
SampleSourceFifoDB::SampleSourceFifoDB(uint32_t size, QObject* parent) :
|
||||||
@ -60,7 +59,7 @@ void SampleSourceFifoDB::init()
|
|||||||
void SampleSourceFifoDB::readAdvance(SampleVector::iterator& readUntil, unsigned int nbSamples)
|
void SampleSourceFifoDB::readAdvance(SampleVector::iterator& readUntil, unsigned int nbSamples)
|
||||||
{
|
{
|
||||||
// QMutexLocker mutexLocker(&m_mutex);
|
// QMutexLocker mutexLocker(&m_mutex);
|
||||||
assert(nbSamples <= m_size/2);
|
nbSamples = nbSamples > m_size/2 ? m_size/2 : nbSamples;
|
||||||
emit dataWrite(nbSamples);
|
emit dataWrite(nbSamples);
|
||||||
|
|
||||||
m_ir = (m_ir + nbSamples) % m_size;
|
m_ir = (m_ir + nbSamples) % m_size;
|
||||||
@ -71,7 +70,7 @@ void SampleSourceFifoDB::readAdvance(SampleVector::iterator& readUntil, unsigned
|
|||||||
void SampleSourceFifoDB::readAdvance(SampleVector::const_iterator& readUntil, unsigned int nbSamples)
|
void SampleSourceFifoDB::readAdvance(SampleVector::const_iterator& readUntil, unsigned int nbSamples)
|
||||||
{
|
{
|
||||||
// QMutexLocker mutexLocker(&m_mutex);
|
// QMutexLocker mutexLocker(&m_mutex);
|
||||||
assert(nbSamples <= m_size/2);
|
nbSamples = nbSamples > m_size/2 ? m_size/2 : nbSamples;
|
||||||
emit dataWrite(nbSamples);
|
emit dataWrite(nbSamples);
|
||||||
|
|
||||||
m_ir = (m_ir + nbSamples) % m_size;
|
m_ir = (m_ir + nbSamples) % m_size;
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <assert.h>
|
|
||||||
#include "export.h"
|
#include "export.h"
|
||||||
#include "dsp/dsptypes.h"
|
#include "dsp/dsptypes.h"
|
||||||
|
|
||||||
|
@ -17,18 +17,16 @@
|
|||||||
|
|
||||||
#include "util/db.h"
|
#include "util/db.h"
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cassert>
|
|
||||||
|
|
||||||
double CalcDb::dbPower(double magsq, double floor)
|
double CalcDb::dbPower(double magsq, double floor)
|
||||||
{
|
{
|
||||||
assert(floor > 0.0);
|
if (floor <= 0.0) {
|
||||||
|
return -100.0;
|
||||||
if (magsq > floor)
|
|
||||||
{
|
|
||||||
return 10.0 * log10(magsq);
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
if (magsq > floor) {
|
||||||
|
return 10.0 * log10(magsq);
|
||||||
|
} else {
|
||||||
return 10.0 * log10(floor);
|
return 10.0 * log10(floor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,8 +24,6 @@
|
|||||||
#include <QUdpSocket>
|
#include <QUdpSocket>
|
||||||
#include <QHostAddress>
|
#include <QHostAddress>
|
||||||
|
|
||||||
#include <cassert>
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class UDPSinkUtil
|
class UDPSinkUtil
|
||||||
{
|
{
|
||||||
@ -37,7 +35,6 @@ public:
|
|||||||
m_port(9999),
|
m_port(9999),
|
||||||
m_sampleBufferIndex(0)
|
m_sampleBufferIndex(0)
|
||||||
{
|
{
|
||||||
assert(m_udpSamples > 0);
|
|
||||||
m_sampleBuffer = new T[m_udpSamples];
|
m_sampleBuffer = new T[m_udpSamples];
|
||||||
m_socket = new QUdpSocket(parent);
|
m_socket = new QUdpSocket(parent);
|
||||||
}
|
}
|
||||||
@ -49,7 +46,6 @@ public:
|
|||||||
m_port(port),
|
m_port(port),
|
||||||
m_sampleBufferIndex(0)
|
m_sampleBufferIndex(0)
|
||||||
{
|
{
|
||||||
assert(m_udpSamples > 0);
|
|
||||||
m_sampleBuffer = new T[m_udpSamples];
|
m_sampleBuffer = new T[m_udpSamples];
|
||||||
m_socket = new QUdpSocket(parent);
|
m_socket = new QUdpSocket(parent);
|
||||||
}
|
}
|
||||||
@ -61,7 +57,6 @@ public:
|
|||||||
m_port(port),
|
m_port(port),
|
||||||
m_sampleBufferIndex(0)
|
m_sampleBufferIndex(0)
|
||||||
{
|
{
|
||||||
assert(m_udpSamples > 0);
|
|
||||||
m_sampleBuffer = new T[m_udpSamples];
|
m_sampleBuffer = new T[m_udpSamples];
|
||||||
m_socket = new QUdpSocket(parent);
|
m_socket = new QUdpSocket(parent);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user