]> sigrok.org Git - pulseview.git/commitdiff
Minor whitespace fixes.
authorUwe Hermann <redacted>
Sat, 25 Jul 2015 16:05:11 +0000 (18:05 +0200)
committerUwe Hermann <redacted>
Sat, 25 Jul 2015 16:05:11 +0000 (18:05 +0200)
19 files changed:
main.cpp
pv/data/decode/annotation.cpp
pv/data/decode/decoder.cpp
pv/data/decoderstack.cpp
pv/mainwindow.cpp
pv/popups/channels.cpp
pv/session.cpp
pv/view/analogsignal.cpp
pv/view/cursorpair.cpp
pv/view/decodetrace.cpp
pv/view/header.cpp
pv/view/signal.cpp
pv/view/view.cpp
pv/view/viewwidget.cpp
pv/widgets/decodermenu.cpp
pv/widgets/popup.cpp
pv/widgets/popuptoolbutton.cpp
pv/widgets/wellarray.cpp
signalhandler.cpp

index 61ec03a840243be3dd11f4654d8c9f6fa76b6590..623972395c6c91e61b1d0dfe62590f83ba8a502f 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -159,7 +159,7 @@ int main(int argc, char *argv[])
                        w.show();
 
 #ifdef ENABLE_SIGNALS
-                       if(SignalHandler::prepare_signals()) {
+                       if (SignalHandler::prepare_signals()) {
                                SignalHandler *const handler =
                                        new SignalHandler(&w);
                                QObject::connect(handler,
index 6287edce70f60fccd12ee13313cbeb0b6e7671d7..9a165803fe2381fa7d0d2a40459d1199b26cd1bf 100644 (file)
@@ -43,7 +43,7 @@ Annotation::Annotation(const srd_proto_data *const pdata) :
        format_ = pda->ann_class;
 
        const char *const *annotations = (char**)pda->ann_text;
-       while(*annotations) {
+       while (*annotations) {
                annotations_.push_back(QString::fromUtf8(*annotations));
                annotations++;
        }
index 018051df0fccc0182a92fb9ce6727aa9303863a0..f5fdd0c9a7361f830c6abdd9757be9b5cbe72e7b 100644 (file)
@@ -102,7 +102,7 @@ bool Decoder::have_required_channels() const
 set< shared_ptr<pv::data::Logic> > Decoder::get_data()
 {
        set< shared_ptr<pv::data::Logic> > data;
-       for(auto i = channels_.cbegin(); i != channels_.cend(); i++) {
+       for (auto i = channels_.cbegin(); i != channels_.cend(); i++) {
                shared_ptr<view::LogicSignal> signal((*i).second);
                assert(signal);
                data.insert(signal->logic_data());
@@ -128,14 +128,14 @@ srd_decoder_inst* Decoder::create_decoder_inst(srd_session *session, int unit_si
                session, decoder_->id, opt_hash);
        g_hash_table_destroy(opt_hash);
 
-       if(!decoder_inst)
+       if (!decoder_inst)
                return nullptr;
 
        // Setup the channels
        GHashTable *const channels = g_hash_table_new_full(g_str_hash,
                g_str_equal, g_free, (GDestroyNotify)g_variant_unref);
 
-       for(auto i = channels_.cbegin(); i != channels_.cend(); i++)
+       for (auto i = channels_.cbegin(); i != channels_.cend(); i++)
        {
                shared_ptr<view::LogicSignal> signal((*i).second);
                GVariant *const gvar = g_variant_new_int32(
index 201c87f7fc668596fe49c0b30ffccc4a2b49ec77..354802407fa55487899e622bdc05ff2a176a40ce 100644 (file)
@@ -107,7 +107,7 @@ void DecoderStack::remove(int index)
 
        // Find the decoder in the stack
        auto iter = stack_.begin();
-       for(int i = 0; i < index; i++, iter++)
+       for (int i = 0; i < index; i++, iter++)
                assert(iter != stack_.end());
 
        // Delete the element
@@ -286,7 +286,7 @@ uint64_t DecoderStack::max_sample_count() const
 optional<int64_t> DecoderStack::wait_for_data() const
 {
        unique_lock<mutex> input_lock(input_mutex_);
-       while(!interrupt_ && !frame_complete_ &&
+       while (!interrupt_ && !frame_complete_ &&
                samples_decoded_ >= sample_count_)
                input_cond_.wait(input_lock);
        return boost::make_optional(!interrupt_ &&
@@ -379,7 +379,7 @@ void DecoderStack::decode_proc()
 
        do {
                decode_data(*sample_count, unit_size, session);
-       } while(error_message_.isEmpty() && (sample_count = wait_for_data()));
+       } while (error_message_.isEmpty() && (sample_count = wait_for_data()));
 
        // Destroy the session
        srd_session_destroy(session);
index 6b7fe4f530e94191f50da7f251d75b5f81205de9..e6f1a5e156c5fa36b72194e9cc6394c704a7a4f5 100644 (file)
@@ -750,7 +750,7 @@ void MainWindow::on_actionViewShowCursors_triggered()
        assert(view_);
 
        const bool show = !view_->cursors_shown();
-       if(show)
+       if (show)
                view_->centre_cursors();
 
        view_->show_cursors(show);
index d4ff6c9797cf6262a89b97df74b2dd65c7de05b3..6c122b1c2bbaf16b31c488797e46e72e594c4834 100644 (file)
@@ -200,7 +200,7 @@ QGridLayout* Channels::create_channel_group_grid(
 
                check_box_signal_map_[checkbox] = sig;
 
-               if(++col >= 8)
+               if (++col >= 8)
                        col = 0, row++;
        }
 
index b90c03016d6b42cc924787710c7e547685728dd7..bbfb7d2437b1c3380d955e8ef3ce3301797a2882 100644 (file)
@@ -238,9 +238,9 @@ bool Session::add_decoder(srd_decoder *const dec)
 
                // Make a list of all the channels
                std::vector<const srd_channel*> all_channels;
-               for(const GSList *i = dec->channels; i; i = i->next)
+               for (const GSList *i = dec->channels; i; i = i->next)
                        all_channels.push_back((const srd_channel*)i->data);
-               for(const GSList *i = dec->opt_channels; i; i = i->next)
+               for (const GSList *i = dec->opt_channels; i; i = i->next)
                        all_channels.push_back((const srd_channel*)i->data);
 
                // Auto select the initial channels
@@ -302,7 +302,7 @@ void Session::set_capture_state(capture_state state)
        lock_guard<mutex> lock(sampling_mutex_);
        const bool changed = capture_state_ != state;
        capture_state_ = state;
-       if(changed)
+       if (changed)
                capture_state_changed(state);
 }
 
index fe2979b0be8ac36efe3f520bda5d59a9e0abf9a5..0ac6311116610356b12f0663fa0fc933539f801e 100644 (file)
@@ -181,7 +181,7 @@ void AnalogSignal::paint_envelope(QPainter &p,
        QRectF *const rects = new QRectF[e.length];
        QRectF *rect = rects;
 
-       for(uint64_t sample = 0; sample < e.length-1; sample++) {
+       for (uint64_t sample = 0; sample < e.length-1; sample++) {
                const float x = ((e.scale * sample + e.start) /
                        samples_per_pixel - pixels_offset) + left;
                const AnalogSegment::EnvelopeSample *const s =
@@ -193,9 +193,9 @@ void AnalogSignal::paint_envelope(QPainter &p,
                const float t = y - min(s->min, (s+1)->max) * scale_;
 
                float h = b - t;
-               if(h >= 0.0f && h <= 1.0f)
+               if (h >= 0.0f && h <= 1.0f)
                        h = 1.0f;
-               if(h <= 0.0f && h >= -1.0f)
+               if (h <= 0.0f && h >= -1.0f)
                        h = -1.0f;
 
                *rect++ = QRectF(x, t, 1.0f, h);
index 4f4d39754805ee2cf988f42b8c2b011b24e7454f..46f2455677a962bc86f92bcfd4b9bc7321b03aa0 100644 (file)
@@ -118,7 +118,7 @@ void CursorPair::paint_label(QPainter &p, const QRect &rect, bool hover)
        const int radius = delta_rect.height() / 2;
        const QRectF text_rect(delta_rect.intersected(
                rect).adjusted(radius, 0, -radius, 0));
-       if(text_rect.width() >= text_size_.width())
+       if (text_rect.width() >= text_size_.width())
        {
                const int highlight_radius = delta_rect.height() / 2 - 2;
 
index 8674f40ca405ca2c5833cc708e278015839b2811..36e7a10458a0c9467740f5edf770177199268e2f 100644 (file)
@@ -658,7 +658,7 @@ void DecodeTrace::create_decoder_form(int index,
        group->add_layout(decoder_form);
 
        // Add the mandatory channels
-       for(l = decoder->channels; l; l = l->next) {
+       for (l = decoder->channels; l; l = l->next) {
                const struct srd_channel *const pdch =
                        (struct srd_channel *)l->data;
                QComboBox *const combo = create_channel_selector(parent, dec, pdch);
@@ -673,7 +673,7 @@ void DecodeTrace::create_decoder_form(int index,
        }
 
        // Add the optional channels
-       for(l = decoder->opt_channels; l; l = l->next) {
+       for (l = decoder->opt_channels; l; l = l->next) {
                const struct srd_channel *const pdch =
                        (struct srd_channel *)l->data;
                QComboBox *const combo = create_channel_selector(parent, dec, pdch);
@@ -748,7 +748,7 @@ void DecodeTrace::commit_decoder_channels(shared_ptr<data::decode::Decoder> &dec
 
        for (const ChannelSelector &s : channel_selectors_)
        {
-               if(s.decoder_ != dec)
+               if (s.decoder_ != dec)
                        break;
 
                const LogicSignal *const selection =
@@ -756,7 +756,7 @@ void DecodeTrace::commit_decoder_channels(shared_ptr<data::decode::Decoder> &dec
                                s.combo_->currentIndex()).value<void*>();
 
                for (shared_ptr<Signal> sig : sigs)
-                       if(sig.get() == selection) {
+                       if (sig.get() == selection) {
                                channel_map[s.pdch_] =
                                        dynamic_pointer_cast<LogicSignal>(sig);
                                break;
@@ -825,7 +825,7 @@ void DecodeTrace::on_show_hide_decoder(int index)
 
        // Find the decoder in the stack
        auto iter = stack.cbegin();
-       for(int i = 0; i < index; i++, iter++)
+       for (int i = 0; i < index; i++, iter++)
                assert(iter != stack.end());
 
        shared_ptr<Decoder> dec = *iter;
index 26aae49fada6f9a5a7d2d533ad77b2c8e017baaa..f31a91cc820400fcf707228438fe2f5d2373fca1 100644 (file)
@@ -207,7 +207,7 @@ void Header::on_ungroup()
                                break;
                        }
                }
-       } while(restart);
+       } while (restart);
 }
 
 } // namespace view
index 9f97d5bca7194562f40d4939b77e47f46e19502b..08fa54eea55a40392f5d32f73be5eccb9e02e0ec 100644 (file)
@@ -105,7 +105,7 @@ void Signal::populate_popup_form(QWidget *parent, QFormLayout *form)
        name_widget_->setEditable(true);
        name_widget_->setCompleter(0);
 
-       for(unsigned int i = 0; i < countof(ChannelNames); i++)
+       for (unsigned int i = 0; i < countof(ChannelNames); i++)
                name_widget_->insertItem(i, ChannelNames[i]);
 
        const int index = name_widget_->findText(name_, Qt::MatchExactly);
index d4aa161959ab2bc7829d05dad08b0c0c293b4e75..1aa7b7292da842b660865c821d6a884b929c18c9 100644 (file)
@@ -509,7 +509,7 @@ void View::calculate_tick_spacing()
 
                min_width += SpacingIncrement;
 
-       } while(typical_width > tick_period_ / scale_);
+       } while (typical_width > tick_period_ / scale_);
 }
 
 void View::update_scroll()
index e364d6385f61eb9768b5b0afc9995adda4840bee..600dd621a20b6073b09f45552e86ffd0b3a89ab8 100644 (file)
@@ -79,7 +79,7 @@ bool ViewWidget::accept_drag() const
                        if (r->dragging()) {
                                if (!item_owner)
                                        item_owner = r->owner();
-                               else if(item_owner != r->owner())
+                               else if (item_owner != r->owner())
                                        return false;
                        }
 
index f3c4e06ac63d1d59c4b6cef67f80b4a2eb1561b6..3ea1c841d6530413b71d5ed9d077a65d66ceb2a9 100644 (file)
@@ -33,7 +33,7 @@ DecoderMenu::DecoderMenu(QWidget *parent, bool first_level_decoder) :
 {
        GSList *l = g_slist_sort(g_slist_copy(
                (GSList*)srd_decoder_list()), decoder_name_cmp);
-       for(; l; l = l->next)
+       for (; l; l = l->next)
        {
                const srd_decoder *const d = (srd_decoder*)l->data;
                assert(d);
index 68f79f0f6fbeafe6066bc0a3bc96e4ad11d037d8..de2d1b57010643228bb28c5ba713eb25723c55eb 100644 (file)
@@ -238,7 +238,7 @@ void Popup::reposition_widget()
 
        if (pos_ == Left)
                o.rx() = -width();
-       else if(pos_ == Top)
+       else if (pos_ == Top)
                o.ry() = -height();
 
        o += point_;
@@ -300,7 +300,7 @@ void Popup::mouseReleaseEvent(QMouseEvent *e)
 
        // We need our own out-of-bounds click handler because QWidget counts
        // the drop-shadow region as inside the widget
-       if(!bubble_rect().contains(e->pos()))
+       if (!bubble_rect().contains(e->pos()))
                close();
 }
 
index 5153eee55ad53d547600e70fd7d2b2a04437e6a3..ff335a90e0acecde9d14fd52f0131aede820fcd7 100644 (file)
@@ -45,7 +45,7 @@ void PopupToolButton::set_popup(Popup *popup)
 
 void PopupToolButton::on_clicked(bool)
 {
-       if(!popup_)
+       if (!popup_)
                return;
 
        const QRect r = rect();
index a9418317b072fceae3cf45f25f3656113578cfbf..1f3bf69825ac7434a0a7e4a7b612342b6b9e4dce 100644 (file)
@@ -267,19 +267,19 @@ void WellArray::keyPressEvent(QKeyEvent* e)
 {
     switch(e->key()) {                        // Look at the key code
     case Qt::Key_Left:                                // If 'left arrow'-key,
-        if(curCol > 0)                        // and cr't not in leftmost col
+        if (curCol > 0)                        // and cr't not in leftmost col
             setCurrent(curRow, curCol - 1);        // set cr't to next left column
         break;
     case Qt::Key_Right:                                // Correspondingly...
-        if(curCol < numCols()-1)
+        if (curCol < numCols()-1)
             setCurrent(curRow, curCol + 1);
         break;
     case Qt::Key_Up:
-        if(curRow > 0)
+        if (curRow > 0)
             setCurrent(curRow - 1, curCol);
         break;
     case Qt::Key_Down:
-        if(curRow < numRows()-1)
+        if (curRow < numRows()-1)
             setCurrent(curRow + 1, curCol);
         break;
     case Qt::Key_Space:
index 71f66f559b4b6b5711b83dfafce691e8aa2dc17c..fbbcf225d8995cec5dca768f026d7d0a3434caf4 100644 (file)
@@ -33,7 +33,7 @@ int SignalHandler::sockets_[2];
 
 bool SignalHandler::prepare_signals()
 {
-       if(socketpair(AF_UNIX, SOCK_STREAM, 0, sockets_) != 0)
+       if (socketpair(AF_UNIX, SOCK_STREAM, 0, sockets_) != 0)
                return false;
 
        struct sigaction sig_action;
@@ -42,7 +42,7 @@ bool SignalHandler::prepare_signals()
        sigemptyset(&sig_action.sa_mask);
        sig_action.sa_flags = SA_RESTART;
 
-       if(sigaction(SIGINT, &sig_action, 0) != 0 ||
+       if (sigaction(SIGINT, &sig_action, 0) != 0 ||
                sigaction(SIGTERM, &sig_action, 0) != 0) {
                close(sockets_[0]);
                close(sockets_[1]);
@@ -66,7 +66,7 @@ void SignalHandler::on_socket_notifier_activated()
        socket_notifier_->setEnabled(false);
 
        int sig_number;
-       if(read(sockets_[1], &sig_number, sizeof(int)) != sizeof(int)) {
+       if (read(sockets_[1], &sig_number, sizeof(int)) != sizeof(int)) {
                qDebug() << "Failed to catch signal";
                abort();
        }
@@ -86,7 +86,7 @@ void SignalHandler::on_socket_notifier_activated()
 
 void SignalHandler::handle_signals(int sig_number)
 {
-       if(write(sockets_[0], &sig_number, sizeof(int)) != sizeof(int)) {
+       if (write(sockets_[0], &sig_number, sizeof(int)) != sizeof(int)) {
                // Failed to handle signal
                abort();
        }