From 3717af3f43be3a419ca4fca7493c60fb0e643d6c Mon Sep 17 00:00:00 2001 From: John Greb Date: Fri, 21 Nov 2014 19:44:19 +0000 Subject: [PATCH] Quiet more warnings. --- CMakeLists.txt | 2 +- plugins/channel/nfm/nfmdemod.h | 2 +- plugins/channel/ssb/ssbdemod.h | 6 +++--- plugins/channel/tcpsrc/tcpsrcgui.cpp | 2 +- plugins/channel/tcpsrc/tcpsrcgui.h | 2 +- plugins/channel/usb/usbdemod.h | 2 +- plugins/channel/wfm/wfmdemod.h | 4 ++-- plugins/samplesource/v4l/v4lplugin.cpp | 19 ++++--------------- plugins/samplesource/v4l/v4lsource.cpp | 5 ++--- sdrbase/util/simpleserializer.cpp | 2 +- 10 files changed, 17 insertions(+), 29 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6efaf80b6..be45d9c10 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ project(sdrangelove) set(CMAKE_BUILD_TYPE "Release") #set(CMAKE_BUILD_TYPE "ReleaseWithDebugInfo") #set(CMAKE_BUILD_TYPE "Debug") -#add_definitions(-Wall -fno-strict-aliasing) +add_definitions(-Wall -fno-strict-aliasing) set(QT_USE_QTOPENGL TRUE) diff --git a/plugins/channel/nfm/nfmdemod.h b/plugins/channel/nfm/nfmdemod.h index d293124e7..d64866944 100644 --- a/plugins/channel/nfm/nfmdemod.h +++ b/plugins/channel/nfm/nfmdemod.h @@ -95,10 +95,10 @@ private: AudioVector m_audioBuffer; uint m_audioBufferFill; - AudioFifo* m_audioFifo; SampleSink* m_sampleSink; SampleVector m_sampleBuffer; + AudioFifo* m_audioFifo; }; #endif // INCLUDE_NFMDEMOD_H diff --git a/plugins/channel/ssb/ssbdemod.h b/plugins/channel/ssb/ssbdemod.h index 0557a0ff8..a93a1c44b 100644 --- a/plugins/channel/ssb/ssbdemod.h +++ b/plugins/channel/ssb/ssbdemod.h @@ -84,12 +84,12 @@ private: Real m_sampleDistanceRemain; fftfilt* SSBFilter; + SampleSink* m_sampleSink; + SampleVector m_sampleBuffer; + AudioVector m_audioBuffer; uint m_audioBufferFill; AudioFifo* m_audioFifo; - - SampleSink* m_sampleSink; - SampleVector m_sampleBuffer; }; #endif // INCLUDE_SSBDEMOD_H diff --git a/plugins/channel/tcpsrc/tcpsrcgui.cpp b/plugins/channel/tcpsrc/tcpsrcgui.cpp index a7dcab29e..3b16a08c4 100644 --- a/plugins/channel/tcpsrc/tcpsrcgui.cpp +++ b/plugins/channel/tcpsrc/tcpsrcgui.cpp @@ -269,7 +269,7 @@ void TCPSrcGUI::addConnection(quint32 id, const QHostAddress& peerAddress, int p void TCPSrcGUI::delConnection(quint32 id) { for(int i = 0; i < ui->connections->topLevelItemCount(); i++) { - if(ui->connections->topLevelItem(i)->type() == id) { + if(ui->connections->topLevelItem(i)->type() == (int)id) { delete ui->connections->topLevelItem(i); ui->connectedClientsBox->setWindowTitle(tr("Connected Clients (%1)").arg(ui->connections->topLevelItemCount())); return; diff --git a/plugins/channel/tcpsrc/tcpsrcgui.h b/plugins/channel/tcpsrc/tcpsrcgui.h index b5a4dc0f4..e1f5611be 100644 --- a/plugins/channel/tcpsrc/tcpsrcgui.h +++ b/plugins/channel/tcpsrc/tcpsrcgui.h @@ -45,6 +45,7 @@ private slots: private: Ui::TCPSrcGUI* ui; PluginAPI* m_pluginAPI; + TCPSrc* m_tcpSrc; ChannelMarker* m_channelMarker; // settings @@ -57,7 +58,6 @@ private: // RF path ThreadedSampleSink* m_threadedSampleSink; Channelizer* m_channelizer; - TCPSrc* m_tcpSrc; SpectrumVis* m_spectrumVis; explicit TCPSrcGUI(PluginAPI* pluginAPI, QWidget* parent = NULL); diff --git a/plugins/channel/usb/usbdemod.h b/plugins/channel/usb/usbdemod.h index c64dce400..b5316689b 100644 --- a/plugins/channel/usb/usbdemod.h +++ b/plugins/channel/usb/usbdemod.h @@ -81,11 +81,11 @@ private: AudioVector m_audioBuffer; uint m_audioBufferFill; - AudioFifo* m_audioFifo; fftfilt* USBFilter; SampleSink* m_sampleSink; SampleVector m_sampleBuffer; + AudioFifo* m_audioFifo; }; #endif // INCLUDE_USBDEMOD_H diff --git a/plugins/channel/wfm/wfmdemod.h b/plugins/channel/wfm/wfmdemod.h index bf3fcfa09..e06c7c6fc 100644 --- a/plugins/channel/wfm/wfmdemod.h +++ b/plugins/channel/wfm/wfmdemod.h @@ -78,15 +78,15 @@ private: NCO m_nco; Interpolator m_interpolator; Real m_sampleDistanceRemain; - Complex m_lastSample; AudioVector m_audioBuffer; uint m_audioBufferFill; - AudioFifo* m_audioFifo; SampleSink* m_sampleSink; SampleVector m_sampleBuffer; + + AudioFifo* m_audioFifo; }; #endif // INCLUDE_WFMDEMOD_H diff --git a/plugins/samplesource/v4l/v4lplugin.cpp b/plugins/samplesource/v4l/v4lplugin.cpp index 57ad54663..4e5b33dc6 100644 --- a/plugins/samplesource/v4l/v4lplugin.cpp +++ b/plugins/samplesource/v4l/v4lplugin.cpp @@ -35,23 +35,12 @@ void V4LPlugin::initPlugin(PluginAPI* pluginAPI) PluginInterface::SampleSourceDevices V4LPlugin::enumSampleSources() { SampleSourceDevices result; - int count = 1; //rtlsdr_get_device_count(); - char vendor[256]; - char product[256]; - char serial[256]; - for(int i = 0; i < count; i++) { - vendor[0] = '\0'; - product[0] = '\0'; - serial[0] = '\0'; + QString displayedName(QString("Kernel Source #1")); + SimpleSerializer s(1); + s.writeS32(1, 0); + result.append(SampleSourceDevice(displayedName, "org.osmocom.sdr.samplesource.v4l", s.final())); -// if(rtlsdr_get_device_usb_strings((uint32_t)i, vendor, product, serial) != 0) -// continue; - QString displayedName(QString("SDR #%1").arg(i + 1)); - SimpleSerializer s(1); - s.writeS32(1, i); - result.append(SampleSourceDevice(displayedName, "org.osmocom.sdr.samplesource.v4l", s.final())); - } return result; } diff --git a/plugins/samplesource/v4l/v4lsource.cpp b/plugins/samplesource/v4l/v4lsource.cpp index 0ccd1a725..2ed077a0b 100644 --- a/plugins/samplesource/v4l/v4lsource.cpp +++ b/plugins/samplesource/v4l/v4lsource.cpp @@ -222,17 +222,16 @@ V4LThread::work(int noutput_items) struct timeval tv; struct v4l2_buffer buf; fd_set fds; - unsigned int i, items = 0; qint16 xreal, yimag; uint8_t* b; SampleVector::iterator it; - int pos = 0; + unsigned int pos = 0; // in is 4*8bit*2(IQ), 8 bytes; out is 1*16bit*2(IQ) , 4bytes it = m_convertBuffer.begin(); if (recebuf_len > 0) { b = (uint8_t *) recebuf_ptr; - int len = noutput_items * 8; + unsigned int len = noutput_items * 8; if (len > recebuf_len) len = recebuf_len; for (pos = 0; pos < len - 7; pos += 8) { diff --git a/sdrbase/util/simpleserializer.cpp b/sdrbase/util/simpleserializer.cpp index 9205095c9..206c9b468 100644 --- a/sdrbase/util/simpleserializer.cpp +++ b/sdrbase/util/simpleserializer.cpp @@ -669,7 +669,7 @@ bool SimpleDeserializer::parseAll() readOfs += length; - if(readOfs == m_data.size()) + if(readOfs == (uint)m_data.size()) return true; } return false;