mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-16 05:11:49 -05:00
Quiet some warnings.
This commit is contained in:
parent
dcc9f1917c
commit
0311f64527
@ -9,6 +9,8 @@ project(sdrangelove)
|
||||
set(CMAKE_BUILD_TYPE "Release")
|
||||
#set(CMAKE_BUILD_TYPE "ReleaseWithDebugInfo")
|
||||
#set(CMAKE_BUILD_TYPE "Debug")
|
||||
#add_definitions(-Wall -fno-strict-aliasing)
|
||||
|
||||
|
||||
set(QT_USE_QTOPENGL TRUE)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
|
@ -94,10 +94,8 @@ void NFMDemod::feed(SampleVector::const_iterator begin, SampleVector::const_iter
|
||||
++m_audioBufferFill;
|
||||
if(m_audioBufferFill >= m_audioBuffer.size()) {
|
||||
uint res = m_audioFifo->write((const quint8*)&m_audioBuffer[0], m_audioBufferFill, 1);
|
||||
/*
|
||||
if(res != m_audioBufferFill)
|
||||
qDebug("lost %u samples", m_audioBufferFill - res);
|
||||
*/
|
||||
m_audioBufferFill = 0;
|
||||
}
|
||||
}
|
||||
|
@ -87,6 +87,8 @@ void SSBDemod::feed(SampleVector::const_iterator begin, SampleVector::const_iter
|
||||
++m_audioBufferFill;
|
||||
if(m_audioBufferFill >= m_audioBuffer.size()) {
|
||||
uint res = m_audioFifo->write((const quint8*)&m_audioBuffer[0], m_audioBufferFill, 1);
|
||||
if (res != m_audioBufferFill)
|
||||
qDebug("lost %u samples", m_audioBufferFill - res);
|
||||
m_audioBufferFill = 0;
|
||||
}
|
||||
}
|
||||
|
@ -77,9 +77,8 @@ void USBDemod::feed(SampleVector::const_iterator begin, SampleVector::const_iter
|
||||
{
|
||||
Real a, b;
|
||||
Complex c;
|
||||
int n_out;
|
||||
int i, n_out;
|
||||
cmplx *sideband;
|
||||
bool consumed;
|
||||
int samplestep = 2;
|
||||
|
||||
if ((m_sampleRate == 72000)||(m_sampleRate == 144000))
|
||||
@ -99,8 +98,8 @@ void USBDemod::feed(SampleVector::const_iterator begin, SampleVector::const_iter
|
||||
n_out += USBFilter->run(c, &sideband, true);
|
||||
if (m_sampleRate == 64000)
|
||||
n_out += USBFilter->run(c, &sideband, true);
|
||||
for (m_i; m_i < n_out; m_i += samplestep) {
|
||||
Real demod = (sideband[m_i].real() + sideband[m_i].imag()) * 32768.0;
|
||||
for (i = m_i ; i < n_out; i += samplestep) {
|
||||
Real demod = (sideband[i].real() + sideband[i].imag()) * 32768.0;
|
||||
|
||||
// Downsample by 4x for audio display
|
||||
if (!(m_undersampleCount++ & 3))
|
||||
@ -112,10 +111,12 @@ void USBDemod::feed(SampleVector::const_iterator begin, SampleVector::const_iter
|
||||
++m_audioBufferFill;
|
||||
if(m_audioBufferFill >= m_audioBuffer.size()) {
|
||||
uint res = m_audioFifo->write((const quint8*)&m_audioBuffer[0], m_audioBufferFill, 1);
|
||||
if (res != m_audioBufferFill)
|
||||
qDebug("lost %u samples", m_audioBufferFill - res);
|
||||
m_audioBufferFill = 0;
|
||||
}
|
||||
}
|
||||
m_i -= n_out;
|
||||
m_i = i - n_out;
|
||||
}
|
||||
if(m_audioFifo->write((const quint8*)&m_audioBuffer[0], m_audioBufferFill, 0) != m_audioBufferFill)
|
||||
;//qDebug("lost samples");
|
||||
|
@ -72,10 +72,8 @@ void WFMDemod::feed(SampleVector::const_iterator begin, SampleVector::const_iter
|
||||
++m_audioBufferFill;
|
||||
if(m_audioBufferFill >= m_audioBuffer.size()) {
|
||||
uint res = m_audioFifo->write((const quint8*)&m_audioBuffer[0], m_audioBufferFill, 1);
|
||||
/*
|
||||
if(res != m_audioBufferFill)
|
||||
qDebug("lost %u samples", m_audioBufferFill - res);
|
||||
*/
|
||||
m_audioBufferFill = 0;
|
||||
}
|
||||
|
||||
@ -83,7 +81,7 @@ void WFMDemod::feed(SampleVector::const_iterator begin, SampleVector::const_iter
|
||||
}
|
||||
}
|
||||
if(m_audioFifo->write((const quint8*)&m_audioBuffer[0], m_audioBufferFill, 0) != m_audioBufferFill)
|
||||
;//qDebug("lost samples");
|
||||
qDebug("lost samples");
|
||||
m_audioBufferFill = 0;
|
||||
|
||||
if(m_sampleSink != NULL)
|
||||
|
@ -144,8 +144,8 @@ WFMDemodGUI::WFMDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
m_spectrumVis->configure(m_threadedSampleSink->getMessageQueue(), 64, 10, FFTWindow::BlackmanHarris);
|
||||
|
||||
m_channelMarker = new ChannelMarker(this);
|
||||
m_channelMarker->setColor(Qt::red);
|
||||
m_channelMarker->setBandwidth(16000);
|
||||
m_channelMarker->setColor(Qt::blue);
|
||||
m_channelMarker->setBandwidth(32000);
|
||||
m_channelMarker->setCenterFrequency(0);
|
||||
m_channelMarker->setVisible(true);
|
||||
connect(m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged()));
|
||||
|
@ -123,7 +123,7 @@ void RTLSDRThread::decimate16(SampleVector::iterator* it, const quint8* buf, qin
|
||||
// Offset tuning: 4x downsample and rotate, then
|
||||
// downsample 4x more. [ rotate: 0, 1, -3, 2, -4, -5, 7, -6]
|
||||
qint16 xreal[4], yimag[4];
|
||||
bool b;
|
||||
|
||||
for (int pos = 0; pos < len - 31; ) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
xreal[i] = (buf[pos+0] - buf[pos+3] + buf[pos+7] - buf[pos+4]) << 4;
|
||||
@ -147,7 +147,6 @@ void RTLSDRThread::decimate16(SampleVector::iterator* it, const quint8* buf, qin
|
||||
// Decimate everything by 16x, except 288kHz
|
||||
void RTLSDRThread::callback(const quint8* buf, qint32 len)
|
||||
{
|
||||
qint16 xreal, yimag, phase;
|
||||
SampleVector::iterator it = m_convertBuffer.begin();
|
||||
|
||||
int mode = 0;
|
||||
|
@ -110,15 +110,13 @@ bool AudioOutput::open(OpenMode mode)
|
||||
|
||||
qint64 AudioOutput::readData(char* data, qint64 maxLen)
|
||||
{
|
||||
if(maxLen == 0)
|
||||
return 0;
|
||||
|
||||
QMutexLocker mutexLocker(&m_mutex);
|
||||
|
||||
maxLen -= maxLen % 4;
|
||||
int framesPerBuffer = maxLen / 4;
|
||||
unsigned int framesPerBuffer = maxLen / 4;
|
||||
if(framesPerBuffer == 0)
|
||||
return 0;
|
||||
|
||||
if((int)m_mixBuffer.size() < framesPerBuffer * 2) {
|
||||
if(m_mixBuffer.size() < framesPerBuffer * 2) {
|
||||
m_mixBuffer.resize(framesPerBuffer * 2); // allocate 2 qint32 per frame (stereo)
|
||||
if(m_mixBuffer.size() != framesPerBuffer * 2)
|
||||
return 0;
|
||||
@ -144,7 +142,7 @@ qint64 AudioOutput::readData(char* data, qint64 maxLen)
|
||||
// convert to int16
|
||||
std::vector<qint32>::const_iterator src = m_mixBuffer.begin();
|
||||
qint16* dst = (qint16*)data;
|
||||
for(int i = 0; i < framesPerBuffer; ++i) {
|
||||
for(uint i = 0; i < framesPerBuffer; i++) {
|
||||
// left channel
|
||||
qint32 s = *src++;
|
||||
if(s < -32768)
|
||||
|
@ -323,7 +323,7 @@ void DSPEngine::handleSetSource(SampleSource* source)
|
||||
void DSPEngine::generateReport()
|
||||
{
|
||||
bool needReport = false;
|
||||
int sampleRate;
|
||||
unsigned int sampleRate;
|
||||
quint64 centerFrequency;
|
||||
|
||||
if(m_sampleSource != NULL) {
|
||||
|
@ -90,18 +90,18 @@ void Interpolator::create(int phaseSteps, double sampleRate, double cutoff)
|
||||
|
||||
// move taps around to match sse storage requirements
|
||||
m_taps = new float[2 * taps.size() + 8];
|
||||
for(int i = 0; i < 2 * taps.size() + 8; ++i)
|
||||
for(uint i = 0; i < 2 * taps.size() + 8; ++i)
|
||||
m_taps[i] = 0;
|
||||
m_alignedTaps = (float*)((((quint64)m_taps) + 15) & ~15);
|
||||
for(int i = 0; i < taps.size(); ++i) {
|
||||
for(uint i = 0; i < taps.size(); ++i) {
|
||||
m_alignedTaps[2 * i + 0] = polyphase[i];
|
||||
m_alignedTaps[2 * i + 1] = polyphase[i];
|
||||
}
|
||||
m_taps2 = new float[2 * taps.size() + 8];
|
||||
for(int i = 0; i < 2 * taps.size() + 8; ++i)
|
||||
for(uint i = 0; i < 2 * taps.size() + 8; ++i)
|
||||
m_taps2[i] = 0;
|
||||
m_alignedTaps2 = (float*)((((quint64)m_taps2) + 15) & ~15);
|
||||
for(int i = 1; i < taps.size(); ++i) {
|
||||
for(uint i = 1; i < taps.size(); ++i) {
|
||||
m_alignedTaps2[2 * (i - 1) + 0] = polyphase[i];
|
||||
m_alignedTaps2[2 * (i - 1) + 1] = polyphase[i];
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ void ThreadedSampleSink::handleData()
|
||||
size_t count = m_sampleFifo.readBegin(m_sampleFifo.fill(), &part1begin, &part1end, &part2begin, &part2end);
|
||||
|
||||
// first part of FIFO data
|
||||
if(part1begin != part1end) {
|
||||
if(count > 0) {
|
||||
// handle data
|
||||
if(m_sampleSink != NULL)
|
||||
m_sampleSink->feed(part1begin, part1end, positiveOnly);
|
||||
|
@ -118,7 +118,7 @@ void GLScope::paintGL()
|
||||
|
||||
handleMode();
|
||||
|
||||
if(m_displayTrace->size() != m_oldTraceSize) {
|
||||
if(m_displayTrace->size() - m_oldTraceSize != 0) {
|
||||
m_oldTraceSize = m_displayTrace->size();
|
||||
emit traceSizeChanged(m_displayTrace->size());
|
||||
}
|
||||
|
@ -663,7 +663,7 @@ void GLSpectrum::paintGL()
|
||||
|
||||
// paint max hold lines on top of histogram
|
||||
if(m_displayMaxHold) {
|
||||
if(m_maxHold.size() < m_fftSize)
|
||||
if(m_maxHold.size() < (uint)m_fftSize)
|
||||
m_maxHold.resize(m_fftSize);
|
||||
for(int i = 0; i < m_fftSize; i++) {
|
||||
int j;
|
||||
@ -818,12 +818,12 @@ void GLSpectrum::applyChanges()
|
||||
int topMargin = fm.ascent() * 1.5;
|
||||
int bottomMargin = fm.ascent() * 1.5;
|
||||
|
||||
int waterfallHeight;
|
||||
int waterfallTop;
|
||||
int waterfallHeight = 0;
|
||||
int waterfallTop = 0;
|
||||
int frequencyScaleHeight = fm.height() * 2;
|
||||
int frequencyScaleTop;
|
||||
int histogramTop;
|
||||
int histogramHeight;
|
||||
int histogramTop = 0;
|
||||
int histogramHeight = 20;
|
||||
int leftMargin;
|
||||
int rightMargin = fm.width("000");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user