Replaced lengthy iterator types with the auto keyword
[pulseview.git] / pv / view / decodetrace.cpp
index c3bc1dff0a4981170e86b748fe8f45c1a7206b33..f82175107adc998f8cfce5288c9e468b1fd54ab1 100644 (file)
@@ -303,8 +303,7 @@ void DecodeTrace::populate_popup_form(QWidget *parent, QFormLayout *form)
        }
        else
        {
-               list< shared_ptr<Decoder> >::const_iterator iter =
-                       stack.begin();
+               auto iter = stack.cbegin();
                for (int i = 0; i < (int)stack.size(); i++, iter++) {
                        shared_ptr<Decoder> dec(*iter);
                        create_decoder_form(i, dec, parent, form);
@@ -373,7 +372,7 @@ void DecodeTrace::draw_instant(const pv::data::decode::Annotation &a, QPainter &
 {
        const QString text = a.annotations().empty() ?
                QString() : a.annotations().back();
-       const double w = min(p.boundingRect(QRectF(), 0, text).width(),
+       const double w = min((double)p.boundingRect(QRectF(), 0, text).width(),
                0.0) + h;
        const QRectF rect(x - w / 2, y - h / 2, w, h);
 
@@ -592,9 +591,7 @@ QComboBox* DecodeTrace::create_probe_selector(
        const vector< shared_ptr<Signal> > sigs = _session.get_signals();
 
        assert(_decoder_stack);
-       const map<const srd_channel*,
-               shared_ptr<LogicSignal> >::const_iterator probe_iter =
-               dec->channels().find(pdch);
+       const auto probe_iter = dec->channels().find(pdch);
 
        QComboBox *selector = new QComboBox(parent);
 
@@ -705,7 +702,7 @@ void DecodeTrace::on_show_hide_decoder(int index)
        const list< shared_ptr<Decoder> > stack(_decoder_stack->stack());
 
        // Find the decoder in the stack
-       list< shared_ptr<Decoder> >::const_iterator iter = stack.begin();
+       auto iter = stack.cbegin();
        for(int i = 0; i < index; i++, iter++)
                assert(iter != stack.end());