removed asserts

This commit is contained in:
f4exb 2020-11-04 20:05:11 +01:00
parent 379096cbdd
commit 19ecf12c22
13 changed files with 9 additions and 31 deletions

View File

@ -17,7 +17,6 @@
#include <stdio.h>
#include <errno.h>
#include <assert.h>
#include <algorithm>
#include <QDebug>
@ -39,7 +38,6 @@ FileOutputWorker::FileOutputWorker(std::ofstream *samplesStream, SampleSourceFif
m_throttleToggle(false),
m_buf(nullptr)
{
assert(m_ofstream != nullptr);
}
FileOutputWorker::~FileOutputWorker()

View File

@ -18,7 +18,6 @@
#include <stdint.h>
#include <sstream>
#include <iostream>
#include <cassert>
#include <QDebug>
#include <QMessageBox>

View File

@ -17,7 +17,6 @@
#include <stdio.h>
#include <errno.h>
#include <assert.h>
#include <algorithm>
#include <QDebug>

View File

@ -17,7 +17,6 @@
#include <stdio.h>
#include <errno.h>
#include <assert.h>
#include <algorithm>
#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);
}
}

View File

@ -17,7 +17,6 @@
#include <stdio.h>
#include <errno.h>
#include <assert.h>
#include <QDebug>
#include "dsp/filerecord.h"
@ -49,7 +48,6 @@ FileInputWorker::FileInputWorker(std::ifstream *samplesStream,
m_throttlems(FILESOURCE_THROTTLE_MS),
m_throttleToggle(false)
{
assert(m_ifstream != nullptr);
}
FileInputWorker::~FileInputWorker()

View File

@ -18,7 +18,6 @@
#include <stdint.h>
#include <sstream>
#include <iostream>
#include <cassert>
#include <QDebug>
#include <QMessageBox>

View File

@ -16,7 +16,6 @@
///////////////////////////////////////////////////////////////////////////////////
#include <QDebug>
#include <cassert>
#include <cstring>
#include <cmath>
#include <algorithm>

View File

@ -18,7 +18,6 @@
#include <stdint.h>
#include <sstream>
#include <iostream>
#include <cassert>
#include <QDebug>
#include <QMessageBox>

View File

@ -26,7 +26,6 @@
#include <stdint.h>
#include <string.h>
#include <assert.h>
template <typename Type, uint32_t Order> class IIRFilter
{
@ -61,8 +60,6 @@ private:
template <typename Type, uint32_t Order>
IIRFilter<Type, Order>::IIRFilter(const Type *a, const Type *b)
{
assert(Order > 1);
m_a = new Type[Order+1];
m_b = new Type[Order+1];
m_x = new Type[Order];

View File

@ -16,7 +16,6 @@
///////////////////////////////////////////////////////////////////////////////////
#include <algorithm>
#include <assert.h>
#include "samplesourcefifodb.h"
SampleSourceFifoDB::SampleSourceFifoDB(uint32_t size, QObject* parent) :
@ -60,7 +59,7 @@ void SampleSourceFifoDB::init()
void SampleSourceFifoDB::readAdvance(SampleVector::iterator& readUntil, unsigned int nbSamples)
{
// QMutexLocker mutexLocker(&m_mutex);
assert(nbSamples <= m_size/2);
nbSamples = nbSamples > m_size/2 ? m_size/2 : nbSamples;
emit dataWrite(nbSamples);
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)
{
// QMutexLocker mutexLocker(&m_mutex);
assert(nbSamples <= m_size/2);
nbSamples = nbSamples > m_size/2 ? m_size/2 : nbSamples;
emit dataWrite(nbSamples);
m_ir = (m_ir + nbSamples) % m_size;

View File

@ -21,7 +21,6 @@
#include <QObject>
#include <QMutex>
#include <stdint.h>
#include <assert.h>
#include "export.h"
#include "dsp/dsptypes.h"

View File

@ -17,18 +17,16 @@
#include "util/db.h"
#include <cmath>
#include <cassert>
double CalcDb::dbPower(double magsq, double floor)
{
assert(floor > 0.0);
if (magsq > floor)
{
return 10.0 * log10(magsq);
if (floor <= 0.0) {
return -100.0;
}
else
{
if (magsq > floor) {
return 10.0 * log10(magsq);
} else {
return 10.0 * log10(floor);
}
}

View File

@ -24,8 +24,6 @@
#include <QUdpSocket>
#include <QHostAddress>
#include <cassert>
template<typename T>
class UDPSinkUtil
{
@ -37,7 +35,6 @@ public:
m_port(9999),
m_sampleBufferIndex(0)
{
assert(m_udpSamples > 0);
m_sampleBuffer = new T[m_udpSamples];
m_socket = new QUdpSocket(parent);
}
@ -49,7 +46,6 @@ public:
m_port(port),
m_sampleBufferIndex(0)
{
assert(m_udpSamples > 0);
m_sampleBuffer = new T[m_udpSamples];
m_socket = new QUdpSocket(parent);
}
@ -61,7 +57,6 @@ public:
m_port(port),
m_sampleBufferIndex(0)
{
assert(m_udpSamples > 0);
m_sampleBuffer = new T[m_udpSamples];
m_socket = new QUdpSocket(parent);
}