1
0
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:
John Greb 2014-11-21 15:41:58 +00:00
parent dcc9f1917c
commit 0311f64527
13 changed files with 31 additions and 33 deletions

View File

@ -9,6 +9,8 @@ project(sdrangelove)
set(CMAKE_BUILD_TYPE "Release") set(CMAKE_BUILD_TYPE "Release")
#set(CMAKE_BUILD_TYPE "ReleaseWithDebugInfo") #set(CMAKE_BUILD_TYPE "ReleaseWithDebugInfo")
#set(CMAKE_BUILD_TYPE "Debug") #set(CMAKE_BUILD_TYPE "Debug")
#add_definitions(-Wall -fno-strict-aliasing)
set(QT_USE_QTOPENGL TRUE) set(QT_USE_QTOPENGL TRUE)
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)

View File

@ -94,10 +94,8 @@ void NFMDemod::feed(SampleVector::const_iterator begin, SampleVector::const_iter
++m_audioBufferFill; ++m_audioBufferFill;
if(m_audioBufferFill >= m_audioBuffer.size()) { if(m_audioBufferFill >= m_audioBuffer.size()) {
uint res = m_audioFifo->write((const quint8*)&m_audioBuffer[0], m_audioBufferFill, 1); uint res = m_audioFifo->write((const quint8*)&m_audioBuffer[0], m_audioBufferFill, 1);
/*
if(res != m_audioBufferFill) if(res != m_audioBufferFill)
qDebug("lost %u samples", m_audioBufferFill - res); qDebug("lost %u samples", m_audioBufferFill - res);
*/
m_audioBufferFill = 0; m_audioBufferFill = 0;
} }
} }

View File

@ -87,6 +87,8 @@ void SSBDemod::feed(SampleVector::const_iterator begin, SampleVector::const_iter
++m_audioBufferFill; ++m_audioBufferFill;
if(m_audioBufferFill >= m_audioBuffer.size()) { if(m_audioBufferFill >= m_audioBuffer.size()) {
uint res = m_audioFifo->write((const quint8*)&m_audioBuffer[0], m_audioBufferFill, 1); 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_audioBufferFill = 0;
} }
} }

View File

@ -77,9 +77,8 @@ void USBDemod::feed(SampleVector::const_iterator begin, SampleVector::const_iter
{ {
Real a, b; Real a, b;
Complex c; Complex c;
int n_out; int i, n_out;
cmplx *sideband; cmplx *sideband;
bool consumed;
int samplestep = 2; int samplestep = 2;
if ((m_sampleRate == 72000)||(m_sampleRate == 144000)) 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); n_out += USBFilter->run(c, &sideband, true);
if (m_sampleRate == 64000) if (m_sampleRate == 64000)
n_out += USBFilter->run(c, &sideband, true); n_out += USBFilter->run(c, &sideband, true);
for (m_i; m_i < n_out; m_i += samplestep) { for (i = m_i ; i < n_out; i += samplestep) {
Real demod = (sideband[m_i].real() + sideband[m_i].imag()) * 32768.0; Real demod = (sideband[i].real() + sideband[i].imag()) * 32768.0;
// Downsample by 4x for audio display // Downsample by 4x for audio display
if (!(m_undersampleCount++ & 3)) if (!(m_undersampleCount++ & 3))
@ -112,10 +111,12 @@ void USBDemod::feed(SampleVector::const_iterator begin, SampleVector::const_iter
++m_audioBufferFill; ++m_audioBufferFill;
if(m_audioBufferFill >= m_audioBuffer.size()) { if(m_audioBufferFill >= m_audioBuffer.size()) {
uint res = m_audioFifo->write((const quint8*)&m_audioBuffer[0], m_audioBufferFill, 1); 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_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) if(m_audioFifo->write((const quint8*)&m_audioBuffer[0], m_audioBufferFill, 0) != m_audioBufferFill)
;//qDebug("lost samples"); ;//qDebug("lost samples");

View File

@ -72,10 +72,8 @@ void WFMDemod::feed(SampleVector::const_iterator begin, SampleVector::const_iter
++m_audioBufferFill; ++m_audioBufferFill;
if(m_audioBufferFill >= m_audioBuffer.size()) { if(m_audioBufferFill >= m_audioBuffer.size()) {
uint res = m_audioFifo->write((const quint8*)&m_audioBuffer[0], m_audioBufferFill, 1); uint res = m_audioFifo->write((const quint8*)&m_audioBuffer[0], m_audioBufferFill, 1);
/*
if(res != m_audioBufferFill) if(res != m_audioBufferFill)
qDebug("lost %u samples", m_audioBufferFill - res); qDebug("lost %u samples", m_audioBufferFill - res);
*/
m_audioBufferFill = 0; 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) if(m_audioFifo->write((const quint8*)&m_audioBuffer[0], m_audioBufferFill, 0) != m_audioBufferFill)
;//qDebug("lost samples"); qDebug("lost samples");
m_audioBufferFill = 0; m_audioBufferFill = 0;
if(m_sampleSink != NULL) if(m_sampleSink != NULL)

View File

@ -144,8 +144,8 @@ WFMDemodGUI::WFMDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
m_spectrumVis->configure(m_threadedSampleSink->getMessageQueue(), 64, 10, FFTWindow::BlackmanHarris); m_spectrumVis->configure(m_threadedSampleSink->getMessageQueue(), 64, 10, FFTWindow::BlackmanHarris);
m_channelMarker = new ChannelMarker(this); m_channelMarker = new ChannelMarker(this);
m_channelMarker->setColor(Qt::red); m_channelMarker->setColor(Qt::blue);
m_channelMarker->setBandwidth(16000); m_channelMarker->setBandwidth(32000);
m_channelMarker->setCenterFrequency(0); m_channelMarker->setCenterFrequency(0);
m_channelMarker->setVisible(true); m_channelMarker->setVisible(true);
connect(m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged())); connect(m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged()));

View File

@ -123,7 +123,7 @@ void RTLSDRThread::decimate16(SampleVector::iterator* it, const quint8* buf, qin
// Offset tuning: 4x downsample and rotate, then // Offset tuning: 4x downsample and rotate, then
// downsample 4x more. [ rotate: 0, 1, -3, 2, -4, -5, 7, -6] // downsample 4x more. [ rotate: 0, 1, -3, 2, -4, -5, 7, -6]
qint16 xreal[4], yimag[4]; qint16 xreal[4], yimag[4];
bool b;
for (int pos = 0; pos < len - 31; ) { for (int pos = 0; pos < len - 31; ) {
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
xreal[i] = (buf[pos+0] - buf[pos+3] + buf[pos+7] - buf[pos+4]) << 4; 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 // Decimate everything by 16x, except 288kHz
void RTLSDRThread::callback(const quint8* buf, qint32 len) void RTLSDRThread::callback(const quint8* buf, qint32 len)
{ {
qint16 xreal, yimag, phase;
SampleVector::iterator it = m_convertBuffer.begin(); SampleVector::iterator it = m_convertBuffer.begin();
int mode = 0; int mode = 0;

View File

@ -110,15 +110,13 @@ bool AudioOutput::open(OpenMode mode)
qint64 AudioOutput::readData(char* data, qint64 maxLen) qint64 AudioOutput::readData(char* data, qint64 maxLen)
{ {
if(maxLen == 0)
return 0;
QMutexLocker mutexLocker(&m_mutex); QMutexLocker mutexLocker(&m_mutex);
maxLen -= maxLen % 4; unsigned int framesPerBuffer = maxLen / 4;
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) m_mixBuffer.resize(framesPerBuffer * 2); // allocate 2 qint32 per frame (stereo)
if(m_mixBuffer.size() != framesPerBuffer * 2) if(m_mixBuffer.size() != framesPerBuffer * 2)
return 0; return 0;
@ -144,7 +142,7 @@ qint64 AudioOutput::readData(char* data, qint64 maxLen)
// convert to int16 // convert to int16
std::vector<qint32>::const_iterator src = m_mixBuffer.begin(); std::vector<qint32>::const_iterator src = m_mixBuffer.begin();
qint16* dst = (qint16*)data; qint16* dst = (qint16*)data;
for(int i = 0; i < framesPerBuffer; ++i) { for(uint i = 0; i < framesPerBuffer; i++) {
// left channel // left channel
qint32 s = *src++; qint32 s = *src++;
if(s < -32768) if(s < -32768)

View File

@ -323,7 +323,7 @@ void DSPEngine::handleSetSource(SampleSource* source)
void DSPEngine::generateReport() void DSPEngine::generateReport()
{ {
bool needReport = false; bool needReport = false;
int sampleRate; unsigned int sampleRate;
quint64 centerFrequency; quint64 centerFrequency;
if(m_sampleSource != NULL) { if(m_sampleSource != NULL) {

View File

@ -90,18 +90,18 @@ void Interpolator::create(int phaseSteps, double sampleRate, double cutoff)
// move taps around to match sse storage requirements // move taps around to match sse storage requirements
m_taps = new float[2 * taps.size() + 8]; 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_taps[i] = 0;
m_alignedTaps = (float*)((((quint64)m_taps) + 15) & ~15); 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 + 0] = polyphase[i];
m_alignedTaps[2 * i + 1] = polyphase[i]; m_alignedTaps[2 * i + 1] = polyphase[i];
} }
m_taps2 = new float[2 * taps.size() + 8]; 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_taps2[i] = 0;
m_alignedTaps2 = (float*)((((quint64)m_taps2) + 15) & ~15); 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) + 0] = polyphase[i];
m_alignedTaps2[2 * (i - 1) + 1] = polyphase[i]; m_alignedTaps2[2 * (i - 1) + 1] = polyphase[i];
} }

View File

@ -65,7 +65,7 @@ void ThreadedSampleSink::handleData()
size_t count = m_sampleFifo.readBegin(m_sampleFifo.fill(), &part1begin, &part1end, &part2begin, &part2end); size_t count = m_sampleFifo.readBegin(m_sampleFifo.fill(), &part1begin, &part1end, &part2begin, &part2end);
// first part of FIFO data // first part of FIFO data
if(part1begin != part1end) { if(count > 0) {
// handle data // handle data
if(m_sampleSink != NULL) if(m_sampleSink != NULL)
m_sampleSink->feed(part1begin, part1end, positiveOnly); m_sampleSink->feed(part1begin, part1end, positiveOnly);

View File

@ -118,7 +118,7 @@ void GLScope::paintGL()
handleMode(); handleMode();
if(m_displayTrace->size() != m_oldTraceSize) { if(m_displayTrace->size() - m_oldTraceSize != 0) {
m_oldTraceSize = m_displayTrace->size(); m_oldTraceSize = m_displayTrace->size();
emit traceSizeChanged(m_displayTrace->size()); emit traceSizeChanged(m_displayTrace->size());
} }

View File

@ -663,7 +663,7 @@ void GLSpectrum::paintGL()
// paint max hold lines on top of histogram // paint max hold lines on top of histogram
if(m_displayMaxHold) { if(m_displayMaxHold) {
if(m_maxHold.size() < m_fftSize) if(m_maxHold.size() < (uint)m_fftSize)
m_maxHold.resize(m_fftSize); m_maxHold.resize(m_fftSize);
for(int i = 0; i < m_fftSize; i++) { for(int i = 0; i < m_fftSize; i++) {
int j; int j;
@ -818,12 +818,12 @@ void GLSpectrum::applyChanges()
int topMargin = fm.ascent() * 1.5; int topMargin = fm.ascent() * 1.5;
int bottomMargin = fm.ascent() * 1.5; int bottomMargin = fm.ascent() * 1.5;
int waterfallHeight; int waterfallHeight = 0;
int waterfallTop; int waterfallTop = 0;
int frequencyScaleHeight = fm.height() * 2; int frequencyScaleHeight = fm.height() * 2;
int frequencyScaleTop; int frequencyScaleTop;
int histogramTop; int histogramTop = 0;
int histogramHeight; int histogramHeight = 20;
int leftMargin; int leftMargin;
int rightMargin = fm.width("000"); int rightMargin = fm.width("000");