From: Uwe Hermann Date: Sat, 9 Mar 2013 10:41:41 +0000 (+0100) Subject: Whitespace fixes. X-Git-Tag: pulseview-0.1.0~93 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=793f8096c486d0fba871227d9772a510f7496c08;p=pulseview.git Whitespace fixes. --- diff --git a/pv/dialogs/connect.cpp b/pv/dialogs/connect.cpp index 51de735e..cb83b3d7 100644 --- a/pv/dialogs/connect.cpp +++ b/pv/dialogs/connect.cpp @@ -95,12 +95,12 @@ void Connect::populate_drivers() if ((sr_config_list(drivers[i], SR_CONF_DEVICE_OPTIONS, (const void **)&hwopts, NULL) == SR_OK) && hwopts) for (int j = 0; hwopts[j]; j++) - if(hwopts[j] == SR_CONF_SAMPLERATE) { + if (hwopts[j] == SR_CONF_SAMPLERATE) { supported_device = true; break; } - if(supported_device) + if (supported_device) _drivers.addItem(QString("%1 (%2)").arg( drivers[i]->longname).arg(drivers[i]->name), qVariantFromValue((void*)drivers[i])); @@ -126,7 +126,7 @@ void Connect::scan_pressed() _device_list.clear(); const int index = _drivers.currentIndex(); - if(index == -1) + if (index == -1) return; sr_dev_driver *const driver = (sr_dev_driver*)_drivers.itemData( diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 03562b8f..da018587 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -226,7 +226,7 @@ void MainWindow::on_actionOpen_triggered() void MainWindow::on_actionConnect_triggered() { dialogs::Connect dlg(this); - if(!dlg.exec()) + if (!dlg.exec()) return; struct sr_dev_inst *const sdi = dlg.get_selected_device(); diff --git a/pv/prop/binding/deviceoptions.cpp b/pv/prop/binding/deviceoptions.cpp index 9db50dd0..b0feb717 100644 --- a/pv/prop/binding/deviceoptions.cpp +++ b/pv/prop/binding/deviceoptions.cpp @@ -195,7 +195,7 @@ const void* DeviceOptions::enum_getter( const struct sr_dev_inst *sdi, int key) { const void *data = NULL; - if(sr_config_get(sdi->driver, key, &data, sdi) != SR_OK) { + if (sr_config_get(sdi->driver, key, &data, sdi) != SR_OK) { qDebug() << "WARNING: Failed to get value of config id" << key; return NULL; @@ -207,7 +207,7 @@ double DeviceOptions::samplerate_value_getter( const struct sr_dev_inst *sdi) { uint64_t *samplerate = NULL; - if(sr_config_get(sdi->driver, SR_CONF_SAMPLERATE, + if (sr_config_get(sdi->driver, SR_CONF_SAMPLERATE, (const void**)&samplerate, sdi) != SR_OK) { qDebug() << "WARNING: Failed to get value of sample rate"; @@ -220,7 +220,7 @@ void DeviceOptions::samplerate_value_setter( struct sr_dev_inst *sdi, double value) { uint64_t samplerate = value; - if(sr_config_set(sdi, SR_CONF_SAMPLERATE, + if (sr_config_set(sdi, SR_CONF_SAMPLERATE, &samplerate) != SR_OK) qDebug() << "WARNING: Failed to set value of sample rate"; @@ -239,7 +239,7 @@ const void* DeviceOptions::samplerate_list_getter( return NULL; } - if(sr_config_get(sdi->driver, SR_CONF_SAMPLERATE, + if (sr_config_get(sdi->driver, SR_CONF_SAMPLERATE, (const void**)&samplerate, sdi) != SR_OK || !samplerate) { qDebug() << @@ -248,7 +248,7 @@ const void* DeviceOptions::samplerate_list_getter( } for (const uint64_t *rate = samplerates->list; *rate; rate++) - if(*rate == *samplerate) + if (*rate == *samplerate) return (const void*)rate; return NULL; diff --git a/pv/prop/double.cpp b/pv/prop/double.cpp index d7c79ca7..c1e776e1 100644 --- a/pv/prop/double.cpp +++ b/pv/prop/double.cpp @@ -50,15 +50,15 @@ Double::Double(QString name, QWidget* Double::get_widget(QWidget *parent) { - if(_spin_box) + if (_spin_box) return _spin_box; _spin_box = new QDoubleSpinBox(parent); _spin_box->setDecimals(_decimals); _spin_box->setSuffix(_suffix); - if(_range) + if (_range) _spin_box->setRange(_range->first, _range->second); - if(_step) + if (_step) _spin_box->setSingleStep(*_step); _spin_box->setValue(_getter ? _getter() : 0.0); @@ -70,7 +70,7 @@ void Double::commit() { assert(_setter); - if(!_spin_box) + if (!_spin_box) return; _setter(_spin_box->value()); diff --git a/pv/prop/enum.cpp b/pv/prop/enum.cpp index ce33c5a8..54fe5fed 100644 --- a/pv/prop/enum.cpp +++ b/pv/prop/enum.cpp @@ -48,15 +48,15 @@ QWidget* Enum::get_widget(QWidget *parent) return _selector; const void *value = NULL; - if(_getter) + if (_getter) value = _getter(); _selector = new QComboBox(parent); - for(unsigned int i = 0; i < _values.size(); i++) { + for (unsigned int i = 0; i < _values.size(); i++) { const pair &v = _values[i]; _selector->addItem(v.second, qVariantFromValue((void*)v.first)); - if(v.first == value) + if (v.first == value) _selector->setCurrentIndex(i); } diff --git a/pv/samplingbar.cpp b/pv/samplingbar.cpp index 04070033..24fcc40a 100644 --- a/pv/samplingbar.cpp +++ b/pv/samplingbar.cpp @@ -145,8 +145,8 @@ struct sr_dev_inst* SamplingBar::get_selected_device() const void SamplingBar::set_selected_device(struct sr_dev_inst *const sdi) { - for(int i = 0; i < _device_selector.count(); i++) - if(sdi == _device_selector.itemData(i).value()) { + for (int i = 0; i < _device_selector.count(); i++) + if (sdi == _device_selector.itemData(i).value()) { _device_selector.setCurrentIndex(i); return; } @@ -213,7 +213,7 @@ void SamplingBar::update_sample_rate_selector_value() assert(sdi); uint64_t *samplerate = NULL; - if(sr_config_get(sdi->driver, SR_CONF_SAMPLERATE, + if (sr_config_get(sdi->driver, SR_CONF_SAMPLERATE, (const void**)&samplerate, sdi) != SR_OK) { qDebug() << "WARNING: Failed to get value of sample rate"; @@ -227,8 +227,8 @@ void SamplingBar::update_sample_rate_selector_value() _sample_rate_value.setValue(*samplerate); else if (_sample_rate_list_action->isVisible()) { - for(int i = 0; i < _sample_rate_list.count(); i++) - if(*samplerate == _sample_rate_list.itemData( + for (int i = 0; i < _sample_rate_list.count(); i++) + if (*samplerate == _sample_rate_list.itemData( i).value()) _sample_rate_list.setCurrentIndex(i); }