]> sigrok.org Git - pulseview.git/commitdiff
Replaced BOOST_FOREACH with C++11 range-based for loops
authorJoel Holdsworth <redacted>
Tue, 20 May 2014 21:15:50 +0000 (22:15 +0100)
committerJoel Holdsworth <redacted>
Fri, 23 May 2014 22:24:23 +0000 (23:24 +0100)
18 files changed:
pv/data/analog.cpp
pv/data/analogsnapshot.cpp
pv/data/decoderstack.cpp
pv/data/logic.cpp
pv/data/logicsnapshot.cpp
pv/devicemanager.cpp
pv/dialogs/connect.cpp
pv/mainwindow.cpp
pv/popups/deviceoptions.cpp
pv/popups/probes.cpp
pv/prop/binding/binding.cpp
pv/prop/binding/decoderoptions.cpp
pv/sigsession.cpp
pv/toolbars/samplingbar.cpp
pv/view/decodetrace.cpp
pv/view/header.cpp
pv/view/view.cpp
pv/view/viewport.cpp

index 21ddb5fb766cff41da6a5d4ad63e7e02f0b3bd93..c7430432613c3eadbf373e25b16374f0a1cb980f 100644 (file)
@@ -18,8 +18,6 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-#include <boost/foreach.hpp>
-
 #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;
-       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());
        }
index 4d4f5d67b8866b4d29aa754c595cf15c2cdd235b..ab968cf7362332667e2402b2cf8f59338c1a621c 100644 (file)
@@ -27,8 +27,6 @@
 
 #include <algorithm>
 
-#include <boost/foreach.hpp>
-
 #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);
-       BOOST_FOREACH(Envelope &e, _envelope_levels)
+       for (Envelope &e : _envelope_levels)
                free(e.samples);
 }
 
index f82d3ecc1ef82f32dbfbee4f460d5af588a2fd1c..1cb7d4ff126f7fda54dfac544a24a599e91dd67d 100644 (file)
@@ -20,7 +20,6 @@
 
 #include <libsigrokdecode/libsigrokdecode.h>
 
-#include <boost/foreach.hpp>
 #include <boost/thread/thread.hpp>
 
 #include <stdexcept>
@@ -126,7 +125,7 @@ std::vector<Row> DecoderStack::get_visible_rows() const
 
        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())
@@ -194,7 +193,7 @@ void DecoderStack::begin_decode()
        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");
@@ -202,7 +201,7 @@ void DecoderStack::begin_decode()
                }
 
        // 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();
@@ -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
-       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())))
@@ -336,7 +335,7 @@ void DecoderStack::decode_proc()
        // 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);
 
index 167c79bd3cf2ef49e1e9db77a4f1070b38084aac..9bcfd0a382ac39c020d396007d07a4e1885fbef8 100644 (file)
@@ -18,8 +18,6 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-#include <boost/foreach.hpp>
-
 #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;
-       BOOST_FOREACH(boost::shared_ptr<LogicSnapshot> s, _snapshots) {
+       for (boost::shared_ptr<LogicSnapshot> s : _snapshots) {
                assert(s);
                l = max(l, s->get_sample_count());
        }
index 797a00bc54789f2cd4de2f7067448cf98aec0b96..f896ed178718dd2dc6f840c6567dcba15c4220e2 100644 (file)
@@ -25,8 +25,6 @@
 #include <stdlib.h>
 #include <math.h>
 
-#include <boost/foreach.hpp>
-
 #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);
-       BOOST_FOREACH(MipMapLevel &l, _mip_map)
+       for (MipMapLevel &l : _mip_map)
                free(l.data);
 }
 
index 7a986c5a35e86242aa6e446e5d55eaf69c8cd100..6b07b99111f86482bdaa45f0c883c955bc7fefcb 100644 (file)
@@ -26,8 +26,6 @@
 #include <stdexcept>
 #include <string>
 
-#include <boost/foreach.hpp>
-
 #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
-       BOOST_FOREACH(shared_ptr<device::Device> dev, _devices) {
+       for (shared_ptr<device::Device> dev : _devices) {
                assert(dev);
                dev->release();
        }
@@ -129,7 +127,7 @@ void DeviceManager::scan_all_drivers()
 
 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();
index 1dd8c5077301dbebde604aa64fa9463328df5573..c5535d87fa3b53dcc2662e29f149eb64b8f6b6a0 100644 (file)
@@ -18,8 +18,6 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-#include <boost/foreach.hpp>
-
 #include <libsigrok/libsigrok.h>
 
 #include "connect.h"
@@ -174,7 +172,7 @@ void Connect::scan_pressed()
 
        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();
index ec87ee0568a71a8efd96ff6bf2fcff73810ae2f6..2689060347c19bb186f728fa5b9b16fd66b0fdd9 100644 (file)
@@ -23,7 +23,6 @@
 #endif
 
 #include <boost/bind.hpp>
-#include <boost/foreach.hpp>
 
 #include <algorithm>
 #include <iterator>
index 13055fc0e8cdee6c27e9d99b233064876f52e170..353dfcfedfe941df0ded87663eae7bf28bc2913d 100644 (file)
@@ -20,8 +20,6 @@
 
 #include "deviceoptions.h"
 
-#include <boost/foreach.hpp>
-
 #include <QFormLayout>
 #include <QListWidget>
 
index 8683ab248eb0965ce44289869c9f9160781edef4..ada4d9a09ed64b58af4d0807d655975f5b9116fd 100644 (file)
@@ -20,8 +20,6 @@
 
 #include <map>
 
-#include <boost/foreach.hpp>
-
 #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();
-       BOOST_FOREACH(const shared_ptr<Signal> &sig, sigs)
+       for (const shared_ptr<Signal> &sig : sigs)
                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();
 
-       BOOST_FOREACH(const shared_ptr<pv::view::Signal>& sig, sigs)
+       for (const shared_ptr<pv::view::Signal>& sig : sigs)
        {
                assert(sig);
 
index 3a6c73fb09afbdc162e181d54b7718c62d45be5b..1a5eb5ec097a32994d04e3057db5090bd41aee77 100644 (file)
@@ -18,8 +18,6 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-#include <boost/foreach.hpp>
-
 #include <QFormLayout>
 
 #include <pv/prop/property.h>
@@ -39,7 +37,7 @@ const std::vector< boost::shared_ptr<Property> >& Binding::properties()
 
 void Binding::commit()
 {
-       BOOST_FOREACH(shared_ptr<pv::prop::Property> p, _properties) {
+       for (shared_ptr<pv::prop::Property> p : _properties) {
                assert(p);
                p->commit();
        }
@@ -50,7 +48,7 @@ void Binding::add_properties_to_form(QFormLayout *layout,
 {
        assert(layout);
 
-       BOOST_FOREACH(shared_ptr<pv::prop::Property> p, _properties)
+       for (shared_ptr<pv::prop::Property> p : _properties)
        {
                assert(p);
 
index 6e0630c00dd1d55f853c8614d97589b9566b12b6..930e1f0aee14c77a860ca8242b729218fdc614be 100644 (file)
@@ -23,7 +23,6 @@
 #include "decoderoptions.h"
 
 #include <boost/bind.hpp>
-#include <boost/foreach.hpp>
 #include <boost/none_t.hpp>
 
 #include <pv/data/decoderstack.h>
index 6948ced138a43dcc6e0792b0d5c13f9a0eaf205f..282b7ec5c691959f432fe2627a60b1eddde69754 100644 (file)
@@ -43,8 +43,6 @@
 
 #include <stdexcept>
 
-#include <boost/foreach.hpp>
-
 #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
-               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;
@@ -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;
-       BOOST_FOREACH(const shared_ptr<view::Signal> sig, _signals) {
+       for (const shared_ptr<view::Signal> sig : _signals) {
                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
-               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);
@@ -399,7 +397,7 @@ shared_ptr<view::Signal> SigSession::signal_from_probe(
        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;
@@ -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();
-       BOOST_FOREACH(shared_ptr<data::SignalData> data, data_set) {
+       for (shared_ptr<data::SignalData> data : data_set) {
                assert(data);
                data->set_samplerate(sample_rate);
        }
index 6d419f74dbef319905f31815956fda229d3398ee..367b9b2e6fe4b12ac2d9481af81a7eaa8fc09eef 100644 (file)
@@ -22,8 +22,6 @@
 
 #include <assert.h>
 
-#include <boost/foreach.hpp>
-
 #include <QAction>
 #include <QDebug>
 #include <QHelpEvent>
@@ -114,7 +112,7 @@ void SamplingBar::set_device_list(
        _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();
index f82175107adc998f8cfce5288c9e468b1fd54ab1..e2c211840dd6e24a715198ff9341a9341e4bdff2 100644 (file)
@@ -24,7 +24,6 @@ extern "C" {
 
 #include <extdef.h>
 
-#include <boost/foreach.hpp>
 #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()) {
-                       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,
@@ -429,7 +428,7 @@ void DecodeTrace::draw_range(const pv::data::decode::Annotation &a, QPainter &p,
        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;
@@ -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
-       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())))
@@ -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();
 
-       BOOST_FOREACH(const ProbeSelector &s, _probe_selectors)
+       for (const ProbeSelector &s : _probe_selectors)
        {
                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*>();
 
-               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);
@@ -646,8 +645,7 @@ void DecodeTrace::commit_decoder_probes(shared_ptr<data::decode::Decoder> &dec)
 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();
index a00efb14664534e689464b398040b39d302011ab..7c68f302846b5b4f6d41b020abdef6c15f98df69 100644 (file)
@@ -26,8 +26,6 @@
 
 #include <assert.h>
 
-#include <boost/foreach.hpp>
-
 #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());
-       BOOST_FOREACH(shared_ptr<Trace> t, traces) {
+       for (shared_ptr<Trace> t : traces) {
                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());
 
-       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))
@@ -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());
-       BOOST_FOREACH(const shared_ptr<Trace> t, traces) {
+       for (const shared_ptr<Trace> t : traces) {
                assert(t);
                t->select(false);
        }
@@ -116,7 +114,7 @@ void Header::paintEvent(QPaintEvent*)
        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);
 
@@ -138,7 +136,7 @@ void Header::mousePressEvent(QMouseEvent *event)
                _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()));
@@ -168,7 +166,7 @@ void Header::mousePressEvent(QMouseEvent *event)
        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);
        }
@@ -268,7 +266,7 @@ void Header::keyPressEvent(QKeyEvent *e)
        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;
@@ -279,7 +277,7 @@ void Header::keyPressEvent(QKeyEvent *e)
 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()));
index 3d3b8eb233c74a9cc2498de16e3a7b7522019cfe..0ebfea1e6d532b94c959569aaf5f1e9d03e601d4 100644 (file)
@@ -26,8 +26,6 @@
 #include <limits.h>
 #include <math.h>
 
-#include <boost/foreach.hpp>
-
 #include <QEvent>
 #include <QMouseEvent>
 #include <QScrollBar>
@@ -192,7 +190,7 @@ void View::zoom_one_to_one()
                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());
        }
@@ -248,7 +246,7 @@ list<weak_ptr<SelectableItem> > View::selected_items() const
 
        // 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);
@@ -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;
-       BOOST_FOREACH(const shared_ptr<Signal> sig, sigs)
+       for (const shared_ptr<Signal> sig : sigs)
                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;
-       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();
@@ -340,11 +338,11 @@ void View::normalize_layout()
        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);
-       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);
@@ -499,7 +497,7 @@ void View::signals_changed()
 {
        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;
index 3b06cf9e85e0bc31a5c8f4e7edba38be8aaaa119..cdae779e5dc0dfeec7a39d9fe3ecc2758bb98fed 100644 (file)
@@ -26,8 +26,6 @@
 
 #include <QMouseEvent>
 
-#include <boost/foreach.hpp>
-
 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());
-       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);
        }
@@ -78,16 +76,16 @@ void Viewport::paintEvent(QPaintEvent*)
                _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());
        }
 
-       BOOST_FOREACH(const shared_ptr<Trace> t, traces)
+       for (const shared_ptr<Trace> t : traces)
                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())
@@ -145,7 +143,7 @@ void Viewport::wheelEvent(QWheelEvent *event)
 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()));