From 1964946afe0f50176d1794786a5c86c5bd03d11e Mon Sep 17 00:00:00 2001 From: hexameron Date: Sun, 23 Nov 2014 09:22:02 +0000 Subject: [PATCH] More warnings. --- Readme.md | 2 ++ plugins/samplesource/gnuradio/gnuradiogui.cpp | 18 +++++++++--------- plugins/samplesource/gnuradio/gnuradiogui.h | 4 ++-- .../samplesource/gnuradio/gnuradioinput.cpp | 8 ++++---- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Readme.md b/Readme.md index c977e269a..0e7654f95 100644 --- a/Readme.md +++ b/Readme.md @@ -7,3 +7,5 @@ For Ubuntu: Use "cmake ../ -DKERNEL=ON" to build the Linux kernel driver (Experimental). Needs a recent kernel and libv4l2. Will need extra work to support Airspy and Hackrf. +The Gnuradio plugin source needs extra packages, including "liblog4cpp-dev libboost-system-dev gnuradio-dev libosmosdr-dev" + diff --git a/plugins/samplesource/gnuradio/gnuradiogui.cpp b/plugins/samplesource/gnuradio/gnuradiogui.cpp index c9d3bbb43..537894a22 100644 --- a/plugins/samplesource/gnuradio/gnuradiogui.cpp +++ b/plugins/samplesource/gnuradio/gnuradiogui.cpp @@ -137,7 +137,7 @@ void GNURadioGui::displaySettings() osmosdr::devices_t devices = osmosdr::device::find(); - for ( int i = 0; i < devices.size(); i++ ) + for ( uint i = 0; i < devices.size(); i++ ) { osmosdr::device_t dev = devices[i]; @@ -199,7 +199,7 @@ void GNURadioGui::displaySettings() delete layout; } - for ( int i = 0; i < m_namedGains.size(); i++ ) + for ( uint i = 0; i < m_namedGains.size(); i++ ) { std::pair< QString, std::vector > pair = m_namedGains[i]; @@ -236,7 +236,7 @@ void GNURadioGui::displaySettings() oldIndex = ui->cboSampleRate->currentIndex(); ui->cboSampleRate->clear(); - for ( int i = 0; i < m_sampRates.size(); i++ ) + for ( uint i = 0; i < m_sampRates.size(); i++ ) ui->cboSampleRate->addItem( QString::number(m_sampRates[i] / 1e6) ); if ( oldIndex > ui->cboSampleRate->count() - 1 ) @@ -255,7 +255,7 @@ void GNURadioGui::displaySettings() ui->cboAntennas->clear(); if ( m_antennas.size() ) { - for ( int i = 0; i < m_antennas.size(); i++ ) + for ( uint i = 0; i < m_antennas.size(); i++ ) ui->cboAntennas->addItem( m_antennas[i] ); if ( oldIndex > ui->cboAntennas->count() - 1 ) @@ -273,7 +273,7 @@ void GNURadioGui::displaySettings() ui->cboDCOffset->clear(); if ( m_dcoffs.size() ) { - for ( int i = 0; i < m_dcoffs.size(); i++ ) + for ( uint i = 0; i < m_dcoffs.size(); i++ ) ui->cboDCOffset->addItem( m_dcoffs[i] ); if ( ui->cboDCOffset->count() && oldIndex >= 0 ) @@ -288,7 +288,7 @@ void GNURadioGui::displaySettings() ui->cboIQBalance->clear(); if ( m_iqbals.size() ) { - for ( int i = 0; i < m_iqbals.size(); i++ ) + for ( uint i = 0; i < m_iqbals.size(); i++ ) ui->cboIQBalance->addItem( m_iqbals[i] ); if ( ui->cboIQBalance->count() && oldIndex >= 0 ) @@ -302,7 +302,7 @@ void GNURadioGui::displaySettings() oldIndex = ui->cboBandwidth->currentIndex(); ui->cboBandwidth->clear(); - for ( int i = 0; i < m_bandwidths.size(); i++ ) + for ( uint i = 0; i < m_bandwidths.size(); i++ ) if ( 0.0 == m_bandwidths[i] ) ui->cboBandwidth->addItem( "Auto" ); else @@ -387,7 +387,7 @@ void GNURadioGui::on_sldGain_valueChanged(int value) void GNURadioGui::on_cboSampleRate_currentIndexChanged(int index) { - if ( index < 0 || index >= m_sampRates.size() ) + if ( index < 0 || (uint)index >= m_sampRates.size() ) return; m_settings.m_sampRate = m_sampRates[index]; @@ -414,7 +414,7 @@ void GNURadioGui::on_cboIQBalance_currentIndexChanged(const QString &arg1) void GNURadioGui::on_cboBandwidth_currentIndexChanged(int index) { - if ( index < 0 || index >= m_bandwidths.size() ) + if ( index < 0 || (uint)index >= m_bandwidths.size() ) return; m_settings.m_bandwidth = m_bandwidths[index]; diff --git a/plugins/samplesource/gnuradio/gnuradiogui.h b/plugins/samplesource/gnuradio/gnuradiogui.h index 900ceba80..1954619d4 100644 --- a/plugins/samplesource/gnuradio/gnuradiogui.h +++ b/plugins/samplesource/gnuradio/gnuradiogui.h @@ -55,7 +55,6 @@ public: private: Ui::GNURadioGui* ui; PluginAPI* m_pluginAPI; - SampleSource* m_sampleSource; QList< QPair > m_devs; std::vector< std::pair< QString, std::vector > > m_namedGains; double m_freqMin; @@ -72,8 +71,9 @@ private: QList< QPair< QSlider*, QLabel* > > m_gainControls; - SampleSource::GeneralSettings m_generalSettings; GNURadioInput::Settings m_settings; + SampleSource* m_sampleSource; + SampleSource::GeneralSettings m_generalSettings; QTimer m_updateTimer; void displaySettings(); diff --git a/plugins/samplesource/gnuradio/gnuradioinput.cpp b/plugins/samplesource/gnuradio/gnuradioinput.cpp index f3999e169..87ec35029 100644 --- a/plugins/samplesource/gnuradio/gnuradioinput.cpp +++ b/plugins/samplesource/gnuradio/gnuradioinput.cpp @@ -143,7 +143,7 @@ bool GNURadioInput::startInput(int device) namedGains.clear(); m_settings.m_namedGains.clear(); std::vector< std::string > gain_names = radio->get_gain_names(); - for ( int i = 0; i < gain_names.size(); i++ ) + for ( uint i = 0; i < gain_names.size(); i++ ) { std::string gain_name = gain_names[i]; @@ -172,7 +172,7 @@ bool GNURadioInput::startInput(int device) antennas.clear(); std::vector< std::string > ant = radio->get_antennas(); - for ( int i = 0; i < ant.size(); i++ ) + for ( uint i = 0; i < ant.size(); i++ ) antennas.push_back( QString( ant[i].c_str() ) ); m_dcoffs.clear(); @@ -292,7 +292,7 @@ bool GNURadioInput::applySettings(const GeneralSettings& generalSettings, if((m_settings.m_dcoff != settings.m_dcoff) || force) { m_settings.m_dcoff = settings.m_dcoff; - for ( int i = 0; i < m_dcoffs.size(); i++ ) + for ( uint i = 0; i < m_dcoffs.size(); i++ ) { if ( m_dcoffs[i] != m_settings.m_dcoff ) continue; @@ -305,7 +305,7 @@ bool GNURadioInput::applySettings(const GeneralSettings& generalSettings, if((m_settings.m_iqbal != settings.m_iqbal) || force) { m_settings.m_iqbal = settings.m_iqbal; - for ( int i = 0; i < m_iqbals.size(); i++ ) + for ( uint i = 0; i < m_iqbals.size(); i++ ) { if ( m_iqbals[i] != m_settings.m_iqbal ) continue;