projects
/
pulseview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f46e495
)
Replaced BOOST_FOREACH with C++11 range-based for loops
author
Joel Holdsworth
<joel@airwebreathe.org.uk>
Tue, 20 May 2014 21:15:50 +0000
(22:15 +0100)
committer
Joel Holdsworth
<joel@airwebreathe.org.uk>
Fri, 23 May 2014 22:24:23 +0000
(23:24 +0100)
18 files changed:
pv/data/analog.cpp
patch
|
blob
|
history
pv/data/analogsnapshot.cpp
patch
|
blob
|
history
pv/data/decoderstack.cpp
patch
|
blob
|
history
pv/data/logic.cpp
patch
|
blob
|
history
pv/data/logicsnapshot.cpp
patch
|
blob
|
history
pv/devicemanager.cpp
patch
|
blob
|
history
pv/dialogs/connect.cpp
patch
|
blob
|
history
pv/mainwindow.cpp
patch
|
blob
|
history
pv/popups/deviceoptions.cpp
patch
|
blob
|
history
pv/popups/probes.cpp
patch
|
blob
|
history
pv/prop/binding/binding.cpp
patch
|
blob
|
history
pv/prop/binding/decoderoptions.cpp
patch
|
blob
|
history
pv/sigsession.cpp
patch
|
blob
|
history
pv/toolbars/samplingbar.cpp
patch
|
blob
|
history
pv/view/decodetrace.cpp
patch
|
blob
|
history
pv/view/header.cpp
patch
|
blob
|
history
pv/view/view.cpp
patch
|
blob
|
history
pv/view/viewport.cpp
patch
|
blob
|
history
diff --git
a/pv/data/analog.cpp
b/pv/data/analog.cpp
index 21ddb5fb766cff41da6a5d4ad63e7e02f0b3bd93..c7430432613c3eadbf373e25b16374f0a1cb980f 100644
(file)
--- a/
pv/data/analog.cpp
+++ b/
pv/data/analog.cpp
@@
-18,8
+18,6
@@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <boost/foreach.hpp>
-
#include "analog.h"
#include "analogsnapshot.h"
#include "analog.h"
#include "analogsnapshot.h"
@@
-53,7
+51,7
@@
void Analog::clear()
uint64_t Analog::get_max_sample_count() const
{
uint64_t l = 0;
uint64_t Analog::get_max_sample_count() const
{
uint64_t l = 0;
-
BOOST_FOREACH(const boost::shared_ptr<AnalogSnapshot> s,
_snapshots) {
+
for (const boost::shared_ptr<AnalogSnapshot> s :
_snapshots) {
assert(s);
l = max(l, s->get_sample_count());
}
assert(s);
l = max(l, s->get_sample_count());
}
diff --git
a/pv/data/analogsnapshot.cpp
b/pv/data/analogsnapshot.cpp
index 4d4f5d67b8866b4d29aa754c595cf15c2cdd235b..ab968cf7362332667e2402b2cf8f59338c1a621c 100644
(file)
--- a/
pv/data/analogsnapshot.cpp
+++ b/
pv/data/analogsnapshot.cpp
@@
-27,8
+27,6
@@
#include <algorithm>
#include <algorithm>
-#include <boost/foreach.hpp>
-
#include "analogsnapshot.h"
using boost::lock_guard;
#include "analogsnapshot.h"
using boost::lock_guard;
@@
-59,7
+57,7
@@
AnalogSnapshot::AnalogSnapshot(const uint64_t expected_num_samples) :
AnalogSnapshot::~AnalogSnapshot()
{
lock_guard<recursive_mutex> lock(_mutex);
AnalogSnapshot::~AnalogSnapshot()
{
lock_guard<recursive_mutex> lock(_mutex);
-
BOOST_FOREACH(Envelope &e,
_envelope_levels)
+
for (Envelope &e :
_envelope_levels)
free(e.samples);
}
free(e.samples);
}
diff --git
a/pv/data/decoderstack.cpp
b/pv/data/decoderstack.cpp
index f82d3ecc1ef82f32dbfbee4f460d5af588a2fd1c..1cb7d4ff126f7fda54dfac544a24a599e91dd67d 100644
(file)
--- a/
pv/data/decoderstack.cpp
+++ b/
pv/data/decoderstack.cpp
@@
-20,7
+20,6
@@
#include <libsigrokdecode/libsigrokdecode.h>
#include <libsigrokdecode/libsigrokdecode.h>
-#include <boost/foreach.hpp>
#include <boost/thread/thread.hpp>
#include <stdexcept>
#include <boost/thread/thread.hpp>
#include <stdexcept>
@@
-126,7
+125,7
@@
std::vector<Row> DecoderStack::get_visible_rows() const
vector<Row> rows;
vector<Row> rows;
-
BOOST_FOREACH (const shared_ptr<decode::Decoder> &dec,
_stack)
+
for (const shared_ptr<decode::Decoder> &dec :
_stack)
{
assert(dec);
if (!dec->shown())
{
assert(dec);
if (!dec->shown())
@@
-194,7
+193,7
@@
void DecoderStack::begin_decode()
clear();
// Check that all decoders have the required channels
clear();
// Check that all decoders have the required channels
-
BOOST_FOREACH(const shared_ptr<decode::Decoder> &dec,
_stack)
+
for (const shared_ptr<decode::Decoder> &dec :
_stack)
if (!dec->have_required_probes()) {
_error_message = tr("One or more required channels "
"have not been specified");
if (!dec->have_required_probes()) {
_error_message = tr("One or more required channels "
"have not been specified");
@@
-202,7
+201,7
@@
void DecoderStack::begin_decode()
}
// Add classes
}
// Add classes
-
BOOST_FOREACH (const shared_ptr<decode::Decoder> &dec,
_stack)
+
for (const shared_ptr<decode::Decoder> &dec :
_stack)
{
assert(dec);
const srd_decoder *const decc = dec->decoder();
{
assert(dec);
const srd_decoder *const decc = dec->decoder();
@@
-235,7
+234,7
@@
void DecoderStack::begin_decode()
// We get the logic data of the first channel in the list.
// This works because we are currently assuming all
// LogicSignals have the same data/snapshot
// We get the logic data of the first channel in the list.
// This works because we are currently assuming all
// LogicSignals have the same data/snapshot
-
BOOST_FOREACH (const shared_ptr<decode::Decoder> &dec,
_stack)
+
for (const shared_ptr<decode::Decoder> &dec :
_stack)
if (dec && !dec->channels().empty() &&
((logic_signal = (*dec->channels().begin()).second)) &&
((data = logic_signal->logic_data())))
if (dec && !dec->channels().empty() &&
((logic_signal = (*dec->channels().begin()).second)) &&
((data = logic_signal->logic_data())))
@@
-336,7
+335,7
@@
void DecoderStack::decode_proc()
// Create the decoders
const unsigned int unit_size = _snapshot->unit_size();
// Create the decoders
const unsigned int unit_size = _snapshot->unit_size();
-
BOOST_FOREACH(const shared_ptr<decode::Decoder> &dec,
_stack)
+
for (const shared_ptr<decode::Decoder> &dec :
_stack)
{
srd_decoder_inst *const di = dec->create_decoder_inst(session, unit_size);
{
srd_decoder_inst *const di = dec->create_decoder_inst(session, unit_size);
diff --git
a/pv/data/logic.cpp
b/pv/data/logic.cpp
index 167c79bd3cf2ef49e1e9db77a4f1070b38084aac..9bcfd0a382ac39c020d396007d07a4e1885fbef8 100644
(file)
--- a/
pv/data/logic.cpp
+++ b/
pv/data/logic.cpp
@@
-18,8
+18,6
@@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <boost/foreach.hpp>
-
#include "logic.h"
#include "logicsnapshot.h"
#include "logic.h"
#include "logicsnapshot.h"
@@
-61,7
+59,7
@@
void Logic::clear()
uint64_t Logic::get_max_sample_count() const
{
uint64_t l = 0;
uint64_t Logic::get_max_sample_count() const
{
uint64_t l = 0;
-
BOOST_FOREACH(boost::shared_ptr<LogicSnapshot> s,
_snapshots) {
+
for (boost::shared_ptr<LogicSnapshot> s :
_snapshots) {
assert(s);
l = max(l, s->get_sample_count());
}
assert(s);
l = max(l, s->get_sample_count());
}
diff --git
a/pv/data/logicsnapshot.cpp
b/pv/data/logicsnapshot.cpp
index 797a00bc54789f2cd4de2f7067448cf98aec0b96..f896ed178718dd2dc6f840c6567dcba15c4220e2 100644
(file)
--- a/
pv/data/logicsnapshot.cpp
+++ b/
pv/data/logicsnapshot.cpp
@@
-25,8
+25,6
@@
#include <stdlib.h>
#include <math.h>
#include <stdlib.h>
#include <math.h>
-#include <boost/foreach.hpp>
-
#include "config.h"
#include "logicsnapshot.h"
#include "config.h"
#include "logicsnapshot.h"
@@
-59,7
+57,7
@@
LogicSnapshot::LogicSnapshot(const sr_datafeed_logic &logic,
LogicSnapshot::~LogicSnapshot()
{
lock_guard<recursive_mutex> lock(_mutex);
LogicSnapshot::~LogicSnapshot()
{
lock_guard<recursive_mutex> lock(_mutex);
-
BOOST_FOREACH(MipMapLevel &l,
_mip_map)
+
for (MipMapLevel &l :
_mip_map)
free(l.data);
}
free(l.data);
}
diff --git
a/pv/devicemanager.cpp
b/pv/devicemanager.cpp
index 7a986c5a35e86242aa6e446e5d55eaf69c8cd100..6b07b99111f86482bdaa45f0c883c955bc7fefcb 100644
(file)
--- a/
pv/devicemanager.cpp
+++ b/
pv/devicemanager.cpp
@@
-26,8
+26,6
@@
#include <stdexcept>
#include <string>
#include <stdexcept>
#include <string>
-#include <boost/foreach.hpp>
-
#include <libsigrok/libsigrok.h>
using boost::shared_ptr;
#include <libsigrok/libsigrok.h>
using boost::shared_ptr;
@@
-108,7
+106,7
@@
void DeviceManager::init_drivers()
void DeviceManager::release_devices()
{
// Release all the used devices
void DeviceManager::release_devices()
{
// Release all the used devices
-
BOOST_FOREACH(shared_ptr<device::Device> dev,
_devices) {
+
for (shared_ptr<device::Device> dev :
_devices) {
assert(dev);
dev->release();
}
assert(dev);
dev->release();
}
@@
-129,7
+127,7
@@
void DeviceManager::scan_all_drivers()
void DeviceManager::release_driver(struct sr_dev_driver *const driver)
{
void DeviceManager::release_driver(struct sr_dev_driver *const driver)
{
-
BOOST_FOREACH(shared_ptr<device::Device> dev,
_devices) {
+
for (shared_ptr<device::Device> dev :
_devices) {
assert(dev);
if(dev->dev_inst()->driver == driver)
dev->release();
assert(dev);
if(dev->dev_inst()->driver == driver)
dev->release();
diff --git
a/pv/dialogs/connect.cpp
b/pv/dialogs/connect.cpp
index 1dd8c5077301dbebde604aa64fa9463328df5573..c5535d87fa3b53dcc2662e29f149eb64b8f6b6a0 100644
(file)
--- a/
pv/dialogs/connect.cpp
+++ b/
pv/dialogs/connect.cpp
@@
-18,8
+18,6
@@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <boost/foreach.hpp>
-
#include <libsigrok/libsigrok.h>
#include "connect.h"
#include <libsigrok/libsigrok.h>
#include "connect.h"
@@
-174,7
+172,7
@@
void Connect::scan_pressed()
g_slist_free_full(drvopts, (GDestroyNotify)free_drvopts);
g_slist_free_full(drvopts, (GDestroyNotify)free_drvopts);
-
BOOST_FOREACH(shared_ptr<device::Device> dev_inst,
devices)
+
for (shared_ptr<device::Device> dev_inst :
devices)
{
assert(dev_inst);
const sr_dev_inst *const sdi = dev_inst->dev_inst();
{
assert(dev_inst);
const sr_dev_inst *const sdi = dev_inst->dev_inst();
diff --git
a/pv/mainwindow.cpp
b/pv/mainwindow.cpp
index ec87ee0568a71a8efd96ff6bf2fcff73810ae2f6..2689060347c19bb186f728fa5b9b16fd66b0fdd9 100644
(file)
--- a/
pv/mainwindow.cpp
+++ b/
pv/mainwindow.cpp
@@
-23,7
+23,6
@@
#endif
#include <boost/bind.hpp>
#endif
#include <boost/bind.hpp>
-#include <boost/foreach.hpp>
#include <algorithm>
#include <iterator>
#include <algorithm>
#include <iterator>
diff --git
a/pv/popups/deviceoptions.cpp
b/pv/popups/deviceoptions.cpp
index 13055fc0e8cdee6c27e9d99b233064876f52e170..353dfcfedfe941df0ded87663eae7bf28bc2913d 100644
(file)
--- a/
pv/popups/deviceoptions.cpp
+++ b/
pv/popups/deviceoptions.cpp
@@
-20,8
+20,6
@@
#include "deviceoptions.h"
#include "deviceoptions.h"
-#include <boost/foreach.hpp>
-
#include <QFormLayout>
#include <QListWidget>
#include <QFormLayout>
#include <QListWidget>
diff --git
a/pv/popups/probes.cpp
b/pv/popups/probes.cpp
index 8683ab248eb0965ce44289869c9f9160781edef4..ada4d9a09ed64b58af4d0807d655975f5b9116fd 100644
(file)
--- a/
pv/popups/probes.cpp
+++ b/
pv/popups/probes.cpp
@@
-20,8
+20,6
@@
#include <map>
#include <map>
-#include <boost/foreach.hpp>
-
#include <QCheckBox>
#include <QFormLayout>
#include <QGridLayout>
#include <QCheckBox>
#include <QFormLayout>
#include <QGridLayout>
@@
-65,7
+63,7
@@
Probes::Probes(SigSession &session, QWidget *parent) :
// Collect a set of signals
map<const sr_channel*, shared_ptr<Signal> > signal_map;
const vector< shared_ptr<Signal> > sigs = _session.get_signals();
// Collect a set of signals
map<const sr_channel*, shared_ptr<Signal> > signal_map;
const vector< shared_ptr<Signal> > sigs = _session.get_signals();
-
BOOST_FOREACH(const shared_ptr<Signal> &sig,
sigs)
+
for (const shared_ptr<Signal> &sig :
sigs)
signal_map[sig->probe()] = sig;
// Populate channel groups
signal_map[sig->probe()] = sig;
// Populate channel groups
@@
-185,7
+183,7
@@
QGridLayout* Probes::create_channel_group_grid(
int row = 0, col = 0;
QGridLayout *const grid = new QGridLayout();
int row = 0, col = 0;
QGridLayout *const grid = new QGridLayout();
-
BOOST_FOREACH(const shared_ptr<pv::view::Signal>& sig,
sigs)
+
for (const shared_ptr<pv::view::Signal>& sig :
sigs)
{
assert(sig);
{
assert(sig);
diff --git
a/pv/prop/binding/binding.cpp
b/pv/prop/binding/binding.cpp
index 3a6c73fb09afbdc162e181d54b7718c62d45be5b..1a5eb5ec097a32994d04e3057db5090bd41aee77 100644
(file)
--- a/
pv/prop/binding/binding.cpp
+++ b/
pv/prop/binding/binding.cpp
@@
-18,8
+18,6
@@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <boost/foreach.hpp>
-
#include <QFormLayout>
#include <pv/prop/property.h>
#include <QFormLayout>
#include <pv/prop/property.h>
@@
-39,7
+37,7
@@
const std::vector< boost::shared_ptr<Property> >& Binding::properties()
void Binding::commit()
{
void Binding::commit()
{
-
BOOST_FOREACH(shared_ptr<pv::prop::Property> p,
_properties) {
+
for (shared_ptr<pv::prop::Property> p :
_properties) {
assert(p);
p->commit();
}
assert(p);
p->commit();
}
@@
-50,7
+48,7
@@
void Binding::add_properties_to_form(QFormLayout *layout,
{
assert(layout);
{
assert(layout);
-
BOOST_FOREACH(shared_ptr<pv::prop::Property> p,
_properties)
+
for (shared_ptr<pv::prop::Property> p :
_properties)
{
assert(p);
{
assert(p);
diff --git
a/pv/prop/binding/decoderoptions.cpp
b/pv/prop/binding/decoderoptions.cpp
index 6e0630c00dd1d55f853c8614d97589b9566b12b6..930e1f0aee14c77a860ca8242b729218fdc614be 100644
(file)
--- a/
pv/prop/binding/decoderoptions.cpp
+++ b/
pv/prop/binding/decoderoptions.cpp
@@
-23,7
+23,6
@@
#include "decoderoptions.h"
#include <boost/bind.hpp>
#include "decoderoptions.h"
#include <boost/bind.hpp>
-#include <boost/foreach.hpp>
#include <boost/none_t.hpp>
#include <pv/data/decoderstack.h>
#include <boost/none_t.hpp>
#include <pv/data/decoderstack.h>
diff --git
a/pv/sigsession.cpp
b/pv/sigsession.cpp
index 6948ced138a43dcc6e0792b0d5c13f9a0eaf205f..282b7ec5c691959f432fe2627a60b1eddde69754 100644
(file)
--- a/
pv/sigsession.cpp
+++ b/
pv/sigsession.cpp
@@
-43,8
+43,6
@@
#include <stdexcept>
#include <stdexcept>
-#include <boost/foreach.hpp>
-
#include <sys/stat.h>
#include <QDebug>
#include <sys/stat.h>
#include <QDebug>
@@
-137,7
+135,7
@@
void SigSession::set_default_device()
default_device = devices.front();
// Try and find the demo device and select that by default
default_device = devices.front();
// Try and find the demo device and select that by default
-
BOOST_FOREACH (shared_ptr<pv::device::Device> dev,
devices)
+
for (shared_ptr<pv::device::Device> dev :
devices)
if (strcmp(dev->dev_inst()->driver->name,
"demo") == 0) {
default_device = dev;
if (strcmp(dev->dev_inst()->driver->name,
"demo") == 0) {
default_device = dev;
@@
-211,7
+209,7
@@
set< shared_ptr<data::SignalData> > SigSession::get_data() const
{
lock_guard<mutex> lock(_signals_mutex);
set< shared_ptr<data::SignalData> > data;
{
lock_guard<mutex> lock(_signals_mutex);
set< shared_ptr<data::SignalData> > data;
-
BOOST_FOREACH(const shared_ptr<view::Signal> sig,
_signals) {
+
for (const shared_ptr<view::Signal> sig :
_signals) {
assert(sig);
data.insert(sig->data());
}
assert(sig);
data.insert(sig->data());
}
@@
-247,8
+245,8
@@
bool SigSession::add_decoder(srd_decoder *const dec)
all_probes.push_back((const srd_channel*)i->data);
// Auto select the initial probes
all_probes.push_back((const srd_channel*)i->data);
// Auto select the initial probes
-
BOOST_FOREACH(const srd_channel *pdch,
all_probes)
-
BOOST_FOREACH(shared_ptr<view::Signal> s,
_signals)
+
for (const srd_channel *pdch :
all_probes)
+
for (shared_ptr<view::Signal> s :
_signals)
{
shared_ptr<view::LogicSignal> l =
dynamic_pointer_cast<view::LogicSignal>(s);
{
shared_ptr<view::LogicSignal> l =
dynamic_pointer_cast<view::LogicSignal>(s);
@@
-399,7
+397,7
@@
shared_ptr<view::Signal> SigSession::signal_from_probe(
const sr_channel *probe) const
{
lock_guard<mutex> lock(_signals_mutex);
const sr_channel *probe) const
{
lock_guard<mutex> lock(_signals_mutex);
-
BOOST_FOREACH(shared_ptr<view::Signal> sig,
_signals) {
+
for (shared_ptr<view::Signal> sig :
_signals) {
assert(sig);
if (sig->probe() == probe)
return sig;
assert(sig);
if (sig->probe() == probe)
return sig;
@@
-428,7
+426,7
@@
void SigSession::read_sample_rate(const sr_dev_inst *const sdi)
// Set the sample rate of all data
const set< shared_ptr<data::SignalData> > data_set = get_data();
// Set the sample rate of all data
const set< shared_ptr<data::SignalData> > data_set = get_data();
-
BOOST_FOREACH(shared_ptr<data::SignalData> data,
data_set) {
+
for (shared_ptr<data::SignalData> data :
data_set) {
assert(data);
data->set_samplerate(sample_rate);
}
assert(data);
data->set_samplerate(sample_rate);
}
diff --git
a/pv/toolbars/samplingbar.cpp
b/pv/toolbars/samplingbar.cpp
index 6d419f74dbef319905f31815956fda229d3398ee..367b9b2e6fe4b12ac2d9481af81a7eaa8fc09eef 100644
(file)
--- a/
pv/toolbars/samplingbar.cpp
+++ b/
pv/toolbars/samplingbar.cpp
@@
-22,8
+22,6
@@
#include <assert.h>
#include <assert.h>
-#include <boost/foreach.hpp>
-
#include <QAction>
#include <QDebug>
#include <QHelpEvent>
#include <QAction>
#include <QDebug>
#include <QHelpEvent>
@@
-114,7
+112,7
@@
void SamplingBar::set_device_list(
_device_selector.clear();
_device_selector_map.clear();
_device_selector.clear();
_device_selector_map.clear();
-
BOOST_FOREACH (shared_ptr<pv::device::DevInst> dev_inst,
devices) {
+
for (shared_ptr<pv::device::DevInst> dev_inst :
devices) {
assert(dev_inst);
const string title = dev_inst->format_device_title();
const sr_dev_inst *sdi = dev_inst->dev_inst();
assert(dev_inst);
const string title = dev_inst->format_device_title();
const sr_dev_inst *sdi = dev_inst->dev_inst();
diff --git
a/pv/view/decodetrace.cpp
b/pv/view/decodetrace.cpp
index f82175107adc998f8cfce5288c9e468b1fd54ab1..e2c211840dd6e24a715198ff9341a9341e4bdff2 100644
(file)
--- a/
pv/view/decodetrace.cpp
+++ b/
pv/view/decodetrace.cpp
@@
-24,7
+24,6
@@
extern "C" {
#include <extdef.h>
#include <extdef.h>
-#include <boost/foreach.hpp>
#include <boost/functional/hash.hpp>
#include <QAction>
#include <boost/functional/hash.hpp>
#include <QAction>
@@
-214,7
+213,7
@@
void DecodeTrace::paint_mid(QPainter &p, int left, int right)
_decoder_stack->get_annotation_subset(annotations, row,
start_sample, end_sample);
if (!annotations.empty()) {
_decoder_stack->get_annotation_subset(annotations, row,
start_sample, end_sample);
if (!annotations.empty()) {
-
BOOST_FOREACH(const Annotation &a,
annotations)
+
for (const Annotation &a :
annotations)
draw_annotation(a, p, get_text_colour(),
annotation_height, left, right,
samples_per_pixel, pixels_offset, y,
draw_annotation(a, p, get_text_colour(),
annotation_height, left, right,
samples_per_pixel, pixels_offset, y,
@@
-429,7
+428,7
@@
void DecodeTrace::draw_range(const pv::data::decode::Annotation &a, QPainter &p,
QString best_annotation;
int best_width = 0;
QString best_annotation;
int best_width = 0;
-
BOOST_FOREACH(const QString &a,
annotations) {
+
for (const QString &a :
annotations) {
const int w = p.boundingRect(QRectF(), 0, a).width();
if (w <= rect.width() && w > best_width)
best_annotation = a, best_width = w;
const int w = p.boundingRect(QRectF(), 0, a).width();
if (w <= rect.width() && w > best_width)
best_annotation = a, best_width = w;
@@
-480,7
+479,7
@@
void DecodeTrace::draw_unresolved_period(QPainter &p, int h, int left,
// We get the logic data of the first probe in the list.
// This works because we are currently assuming all
// LogicSignals have the same data/snapshot
// We get the logic data of the first probe in the list.
// This works because we are currently assuming all
// LogicSignals have the same data/snapshot
-
BOOST_FOREACH (const shared_ptr<Decoder> &dec,
stack)
+
for (const shared_ptr<Decoder> &dec :
stack)
if (dec && !dec->channels().empty() &&
((logic_signal = (*dec->channels().begin()).second)) &&
((data = logic_signal->logic_data())))
if (dec && !dec->channels().empty() &&
((logic_signal = (*dec->channels().begin()).second)) &&
((data = logic_signal->logic_data())))
@@
-623,7
+622,7
@@
void DecodeTrace::commit_decoder_probes(shared_ptr<data::decode::Decoder> &dec)
map<const srd_channel*, shared_ptr<LogicSignal> > probe_map;
const vector< shared_ptr<Signal> > sigs = _session.get_signals();
map<const srd_channel*, shared_ptr<LogicSignal> > probe_map;
const vector< shared_ptr<Signal> > sigs = _session.get_signals();
-
BOOST_FOREACH(const ProbeSelector &s,
_probe_selectors)
+
for (const ProbeSelector &s :
_probe_selectors)
{
if(s._decoder != dec)
break;
{
if(s._decoder != dec)
break;
@@
-632,7
+631,7
@@
void DecodeTrace::commit_decoder_probes(shared_ptr<data::decode::Decoder> &dec)
(LogicSignal*)s._combo->itemData(
s._combo->currentIndex()).value<void*>();
(LogicSignal*)s._combo->itemData(
s._combo->currentIndex()).value<void*>();
-
BOOST_FOREACH(shared_ptr<Signal> sig,
sigs)
+
for (shared_ptr<Signal> sig :
sigs)
if(sig.get() == selection) {
probe_map[s._pdch] =
dynamic_pointer_cast<LogicSignal>(sig);
if(sig.get() == selection) {
probe_map[s._pdch] =
dynamic_pointer_cast<LogicSignal>(sig);
@@
-646,8
+645,7
@@
void DecodeTrace::commit_decoder_probes(shared_ptr<data::decode::Decoder> &dec)
void DecodeTrace::commit_probes()
{
assert(_decoder_stack);
void DecodeTrace::commit_probes()
{
assert(_decoder_stack);
- BOOST_FOREACH(shared_ptr<data::decode::Decoder> dec,
- _decoder_stack->stack())
+ for (shared_ptr<data::decode::Decoder> dec : _decoder_stack->stack())
commit_decoder_probes(dec);
_decoder_stack->begin_decode();
commit_decoder_probes(dec);
_decoder_stack->begin_decode();
diff --git
a/pv/view/header.cpp
b/pv/view/header.cpp
index a00efb14664534e689464b398040b39d302011ab..7c68f302846b5b4f6d41b020abdef6c15f98df69 100644
(file)
--- a/
pv/view/header.cpp
+++ b/
pv/view/header.cpp
@@
-26,8
+26,6
@@
#include <assert.h>
#include <assert.h>
-#include <boost/foreach.hpp>
-
#include <QApplication>
#include <QMenu>
#include <QMouseEvent>
#include <QApplication>
#include <QMenu>
#include <QMouseEvent>
@@
-70,7
+68,7
@@
QSize Header::sizeHint() const
int max_width = 0;
const vector< shared_ptr<Trace> > traces(_view.get_traces());
int max_width = 0;
const vector< shared_ptr<Trace> > traces(_view.get_traces());
-
BOOST_FOREACH(shared_ptr<Trace> t,
traces) {
+
for (shared_ptr<Trace> t :
traces) {
assert(t);
if (t->enabled()) {
assert(t);
if (t->enabled()) {
@@
-86,7
+84,7
@@
shared_ptr<Trace> Header::get_mouse_over_trace(const QPoint &pt)
const int w = width();
const vector< shared_ptr<Trace> > traces(_view.get_traces());
const int w = width();
const vector< shared_ptr<Trace> > traces(_view.get_traces());
-
BOOST_FOREACH(const shared_ptr<Trace> t,
traces)
+
for (const shared_ptr<Trace> t :
traces)
{
assert(t);
if (t->pt_in_label_rect(0, w, pt))
{
assert(t);
if (t->pt_in_label_rect(0, w, pt))
@@
-99,7
+97,7
@@
shared_ptr<Trace> Header::get_mouse_over_trace(const QPoint &pt)
void Header::clear_selection()
{
const vector< shared_ptr<Trace> > traces(_view.get_traces());
void Header::clear_selection()
{
const vector< shared_ptr<Trace> > traces(_view.get_traces());
-
BOOST_FOREACH(const shared_ptr<Trace> t,
traces) {
+
for (const shared_ptr<Trace> t :
traces) {
assert(t);
t->select(false);
}
assert(t);
t->select(false);
}
@@
-116,7
+114,7
@@
void Header::paintEvent(QPaintEvent*)
painter.setRenderHint(QPainter::Antialiasing);
const bool dragging = !_drag_traces.empty();
painter.setRenderHint(QPainter::Antialiasing);
const bool dragging = !_drag_traces.empty();
-
BOOST_FOREACH(const shared_ptr<Trace> t,
traces)
+
for (const shared_ptr<Trace> t :
traces)
{
assert(t);
{
assert(t);
@@
-138,7
+136,7
@@
void Header::mousePressEvent(QMouseEvent *event)
_mouse_down_point = event->pos();
// Save the offsets of any signals which will be dragged
_mouse_down_point = event->pos();
// Save the offsets of any signals which will be dragged
-
BOOST_FOREACH(const shared_ptr<Trace> t,
traces)
+
for (const shared_ptr<Trace> t :
traces)
if (t->selected())
_drag_traces.push_back(
make_pair(t, t->get_v_offset()));
if (t->selected())
_drag_traces.push_back(
make_pair(t, t->get_v_offset()));
@@
-168,7
+166,7
@@
void Header::mousePressEvent(QMouseEvent *event)
if (~QApplication::keyboardModifiers() & Qt::ControlModifier) {
// Unselect all other signals because the Ctrl is not
// pressed
if (~QApplication::keyboardModifiers() & Qt::ControlModifier) {
// Unselect all other signals because the Ctrl is not
// pressed
-
BOOST_FOREACH(const shared_ptr<Trace> t,
traces)
+
for (const shared_ptr<Trace> t :
traces)
if (t != mouse_over_trace)
t->select(false);
}
if (t != mouse_over_trace)
t->select(false);
}
@@
-268,7
+266,7
@@
void Header::keyPressEvent(QKeyEvent *e)
case Qt::Key_Delete:
{
const vector< shared_ptr<Trace> > traces(_view.get_traces());
case Qt::Key_Delete:
{
const vector< shared_ptr<Trace> > traces(_view.get_traces());
-
BOOST_FOREACH(const shared_ptr<Trace> t,
traces)
+
for (const shared_ptr<Trace> t :
traces)
if (t->selected())
t->delete_pressed();
break;
if (t->selected())
t->delete_pressed();
break;
@@
-279,7
+277,7
@@
void Header::keyPressEvent(QKeyEvent *e)
void Header::on_signals_changed()
{
const vector< shared_ptr<Trace> > traces(_view.get_traces());
void Header::on_signals_changed()
{
const vector< shared_ptr<Trace> > traces(_view.get_traces());
-
BOOST_FOREACH(shared_ptr<Trace> t,
traces) {
+
for (shared_ptr<Trace> t :
traces) {
assert(t);
connect(t.get(), SIGNAL(visibility_changed()),
this, SLOT(on_trace_changed()));
assert(t);
connect(t.get(), SIGNAL(visibility_changed()),
this, SLOT(on_trace_changed()));
diff --git
a/pv/view/view.cpp
b/pv/view/view.cpp
index 3d3b8eb233c74a9cc2498de16e3a7b7522019cfe..0ebfea1e6d532b94c959569aaf5f1e9d03e601d4 100644
(file)
--- a/
pv/view/view.cpp
+++ b/
pv/view/view.cpp
@@
-26,8
+26,6
@@
#include <limits.h>
#include <math.h>
#include <limits.h>
#include <math.h>
-#include <boost/foreach.hpp>
-
#include <QEvent>
#include <QMouseEvent>
#include <QScrollBar>
#include <QEvent>
#include <QMouseEvent>
#include <QScrollBar>
@@
-192,7
+190,7
@@
void View::zoom_one_to_one()
return;
double samplerate = 0.0;
return;
double samplerate = 0.0;
-
BOOST_FOREACH(const shared_ptr<SignalData> d,
visible_data) {
+
for (const shared_ptr<SignalData> d :
visible_data) {
assert(d);
samplerate = max(samplerate, d->samplerate());
}
assert(d);
samplerate = max(samplerate, d->samplerate());
}
@@
-248,7
+246,7
@@
list<weak_ptr<SelectableItem> > View::selected_items() const
// List the selected signals
const vector< shared_ptr<Trace> > traces(get_traces());
// List the selected signals
const vector< shared_ptr<Trace> > traces(get_traces());
-
BOOST_FOREACH (shared_ptr<Trace> t,
traces) {
+
for (shared_ptr<Trace> t :
traces) {
assert(t);
if (t->selected())
items.push_back(t);
assert(t);
if (t->selected())
items.push_back(t);
@@
-270,7
+268,7
@@
set< shared_ptr<SignalData> > View::get_visible_data() const
// Make a set of all the visible data objects
set< shared_ptr<SignalData> > visible_data;
// Make a set of all the visible data objects
set< shared_ptr<SignalData> > visible_data;
-
BOOST_FOREACH(const shared_ptr<Signal> sig,
sigs)
+
for (const shared_ptr<Signal> sig :
sigs)
if (sig->enabled())
visible_data.insert(sig->data());
if (sig->enabled())
visible_data.insert(sig->data());
@@
-284,7
+282,7
@@
pair<double, double> View::get_time_extents() const
return make_pair(0.0, 0.0);
double left_time = DBL_MAX, right_time = DBL_MIN;
return make_pair(0.0, 0.0);
double left_time = DBL_MAX, right_time = DBL_MIN;
-
BOOST_FOREACH(const shared_ptr<SignalData> d,
visible_data)
+
for (const shared_ptr<SignalData> d :
visible_data)
{
const double start_time = d->get_start_time();
double samplerate = d->samplerate();
{
const double start_time = d->get_start_time();
double samplerate = d->samplerate();
@@
-340,11
+338,11
@@
void View::normalize_layout()
const vector< shared_ptr<Trace> > traces(get_traces());
int v_min = INT_MAX;
const vector< shared_ptr<Trace> > traces(get_traces());
int v_min = INT_MAX;
-
BOOST_FOREACH(const shared_ptr<Trace> t,
traces)
+
for (const shared_ptr<Trace> t :
traces)
v_min = min(t->get_v_offset(), v_min);
const int delta = -min(v_min, 0);
v_min = min(t->get_v_offset(), v_min);
const int delta = -min(v_min, 0);
-
BOOST_FOREACH(shared_ptr<Trace> t,
traces)
+
for (shared_ptr<Trace> t :
traces)
t->set_v_offset(t->get_v_offset() + delta);
verticalScrollBar()->setSliderPosition(_v_offset + delta);
t->set_v_offset(t->get_v_offset() + delta);
verticalScrollBar()->setSliderPosition(_v_offset + delta);
@@
-499,7
+497,7
@@
void View::signals_changed()
{
int offset = SignalMargin + SignalHeight;
const vector< shared_ptr<Trace> > traces(get_traces());
{
int offset = SignalMargin + SignalHeight;
const vector< shared_ptr<Trace> > traces(get_traces());
-
BOOST_FOREACH(shared_ptr<Trace> t,
traces) {
+
for (shared_ptr<Trace> t :
traces) {
t->set_view(this);
t->set_v_offset(offset);
offset += SignalHeight + 2 * SignalMargin;
t->set_view(this);
t->set_v_offset(offset);
offset += SignalHeight + 2 * SignalMargin;
diff --git
a/pv/view/viewport.cpp
b/pv/view/viewport.cpp
index 3b06cf9e85e0bc31a5c8f4e7edba38be8aaaa119..cdae779e5dc0dfeec7a39d9fe3ecc2758bb98fed 100644
(file)
--- a/
pv/view/viewport.cpp
+++ b/
pv/view/viewport.cpp
@@
-26,8
+26,6
@@
#include <QMouseEvent>
#include <QMouseEvent>
-#include <boost/foreach.hpp>
-
using boost::shared_ptr;
using std::max;
using std::min;
using boost::shared_ptr;
using std::max;
using std::min;
@@
-59,7
+57,7
@@
int Viewport::get_total_height() const
{
int h = 0;
const vector< shared_ptr<Trace> > traces(_view.get_traces());
{
int h = 0;
const vector< shared_ptr<Trace> > traces(_view.get_traces());
-
BOOST_FOREACH(const shared_ptr<Trace> t,
traces) {
+
for (const shared_ptr<Trace> t :
traces) {
assert(t);
h = max(t->get_v_offset() + View::SignalHeight, h);
}
assert(t);
h = max(t->get_v_offset() + View::SignalHeight, h);
}
@@
-78,16
+76,16
@@
void Viewport::paintEvent(QPaintEvent*)
_view.cursors().draw_viewport_background(p, rect());
// Plot the signal
_view.cursors().draw_viewport_background(p, rect());
// Plot the signal
-
BOOST_FOREACH(const shared_ptr<Trace> t,
traces)
+
for (const shared_ptr<Trace> t :
traces)
{
assert(t);
t->paint_back(p, 0, width());
}
{
assert(t);
t->paint_back(p, 0, width());
}
-
BOOST_FOREACH(const shared_ptr<Trace> t,
traces)
+
for (const shared_ptr<Trace> t :
traces)
t->paint_mid(p, 0, width());
t->paint_mid(p, 0, width());
-
BOOST_FOREACH(const shared_ptr<Trace> t,
traces)
+
for (const shared_ptr<Trace> t :
traces)
t->paint_fore(p, 0, width());
if (_view.cursors_shown())
t->paint_fore(p, 0, width());
if (_view.cursors_shown())
@@
-145,7
+143,7
@@
void Viewport::wheelEvent(QWheelEvent *event)
void Viewport::on_signals_changed()
{
const vector< shared_ptr<Trace> > traces(_view.get_traces());
void Viewport::on_signals_changed()
{
const vector< shared_ptr<Trace> > traces(_view.get_traces());
-
BOOST_FOREACH(shared_ptr<Trace> t,
traces) {
+
for (shared_ptr<Trace> t :
traces) {
assert(t);
connect(t.get(), SIGNAL(visibility_changed()),
this, SLOT(update()));
assert(t);
connect(t.get(), SIGNAL(visibility_changed()),
this, SLOT(update()));