projects
/
pulseview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
db1aabc
)
Random simplifications, cosmetics/whitespace/consistency fixes.
author
Uwe Hermann
<uwe@hermann-uwe.de>
Sat, 18 Mar 2017 23:20:26 +0000
(
00:20
+0100)
committer
Uwe Hermann
<uwe@hermann-uwe.de>
Thu, 23 Mar 2017 18:42:18 +0000
(19:42 +0100)
45 files changed:
main.cpp
patch
|
blob
|
history
pv/binding/decoder.cpp
patch
|
blob
|
history
pv/data/analogsegment.cpp
patch
|
blob
|
history
pv/data/decode/decoder.hpp
patch
|
blob
|
history
pv/data/decoderstack.cpp
patch
|
blob
|
history
pv/data/decoderstack.hpp
patch
|
blob
|
history
pv/data/logic.cpp
patch
|
blob
|
history
pv/data/logicsegment.cpp
patch
|
blob
|
history
pv/data/logicsegment.hpp
patch
|
blob
|
history
pv/data/segment.cpp
patch
|
blob
|
history
pv/data/signalbase.cpp
patch
|
blob
|
history
pv/dialogs/inputoutputoptions.hpp
patch
|
blob
|
history
pv/dialogs/settings.cpp
patch
|
blob
|
history
pv/dialogs/storeprogress.hpp
patch
|
blob
|
history
pv/mainwindow.cpp
patch
|
blob
|
history
pv/popups/channels.cpp
patch
|
blob
|
history
pv/prop/int.cpp
patch
|
blob
|
history
pv/session.cpp
patch
|
blob
|
history
pv/session.hpp
patch
|
blob
|
history
pv/storesession.cpp
patch
|
blob
|
history
pv/toolbars/mainbar.cpp
patch
|
blob
|
history
pv/util.cpp
patch
|
blob
|
history
pv/util.hpp
patch
|
blob
|
history
pv/view/analogsignal.cpp
patch
|
blob
|
history
pv/view/decodetrace.cpp
patch
|
blob
|
history
pv/view/decodetrace.hpp
patch
|
blob
|
history
pv/view/header.cpp
patch
|
blob
|
history
pv/view/logicsignal.cpp
patch
|
blob
|
history
pv/view/logicsignal.hpp
patch
|
blob
|
history
pv/view/ruler.hpp
patch
|
blob
|
history
pv/view/trace.cpp
patch
|
blob
|
history
pv/view/tracetreeitem.cpp
patch
|
blob
|
history
pv/view/tracetreeitemowner.hpp
patch
|
blob
|
history
pv/view/view.cpp
patch
|
blob
|
history
pv/view/view.hpp
patch
|
blob
|
history
pv/view/viewport.cpp
patch
|
blob
|
history
pv/views/trace/standardbar.hpp
patch
|
blob
|
history
pv/views/viewbase.hpp
patch
|
blob
|
history
pv/widgets/decodergroupbox.cpp
patch
|
blob
|
history
pv/widgets/decodermenu.cpp
patch
|
blob
|
history
pv/widgets/decodermenu.hpp
patch
|
blob
|
history
pv/widgets/popup.cpp
patch
|
blob
|
history
pv/widgets/sweeptimingwidget.cpp
patch
|
blob
|
history
pv/widgets/wellarray.cpp
patch
|
blob
|
history
signalhandler.cpp
patch
|
blob
|
history
diff --git
a/main.cpp
b/main.cpp
index 2119b81e50d778daf1ca3e2b6ba4fc09bd8b3f97..690a559c29e9a8952b74e2a840475b227650d5b3 100644
(file)
--- a/
main.cpp
+++ b/
main.cpp
@@
-136,10
+136,11
@@
int main(int argc, char *argv[])
if (argc - optind > 1) {
fprintf(stderr, "Only one file can be opened.\n");
return 1;
if (argc - optind > 1) {
fprintf(stderr, "Only one file can be opened.\n");
return 1;
- } else if (argc - optind == 1) {
- open_file = argv[argc - 1];
}
}
+ if (argc - optind == 1)
+ open_file = argv[argc - 1];
+
// Initialise libsigrok
context = sigrok::Context::create();
#ifdef ANDROID
// Initialise libsigrok
context = sigrok::Context::create();
#ifdef ANDROID
diff --git
a/pv/binding/decoder.cpp
b/pv/binding/decoder.cpp
index c5d014879f51d9580ab249328e387356fe6e4a09..b968ab7995e31227780169b65d4bb2a95b1397ff 100644
(file)
--- a/
pv/binding/decoder.cpp
+++ b/
pv/binding/decoder.cpp
@@
-128,10
+128,7
@@
Glib::VariantBase Decoder::getter(const char *id)
}
}
}
}
- if (val)
- return Glib::VariantBase(val, true);
- else
- return Glib::VariantBase();
+ return (val) ? Glib::VariantBase(val, true) : Glib::VariantBase();
}
void Decoder::setter(const char *id, Glib::VariantBase value)
}
void Decoder::setter(const char *id, Glib::VariantBase value)
diff --git
a/pv/data/analogsegment.cpp
b/pv/data/analogsegment.cpp
index 6719340c5e9e06eb58698de193c3dfd7927d238c..45db047e179e3477de9ef5a09f91455e27f613e1 100644
(file)
--- a/
pv/data/analogsegment.cpp
+++ b/
pv/data/analogsegment.cpp
@@
-43,8
+43,7
@@
namespace data {
const int AnalogSegment::EnvelopeScalePower = 4;
const int AnalogSegment::EnvelopeScaleFactor = 1 << EnvelopeScalePower;
const int AnalogSegment::EnvelopeScalePower = 4;
const int AnalogSegment::EnvelopeScaleFactor = 1 << EnvelopeScalePower;
-const float AnalogSegment::LogEnvelopeScaleFactor =
- logf(EnvelopeScaleFactor);
+const float AnalogSegment::LogEnvelopeScaleFactor = logf(EnvelopeScaleFactor);
const uint64_t AnalogSegment::EnvelopeDataUnit = 64*1024; // bytes
AnalogSegment::AnalogSegment(Analog& owner, uint64_t samplerate) :
const uint64_t AnalogSegment::EnvelopeDataUnit = 64*1024; // bytes
AnalogSegment::AnalogSegment(Analog& owner, uint64_t samplerate) :
@@
-73,7
+72,7
@@
void AnalogSegment::append_interleaved_samples(const float *data,
uint64_t prev_sample_count = sample_count_;
uint64_t prev_sample_count = sample_count_;
- for (uint32_t i
=
0; i < sample_count; i++) {
+ for (uint32_t i
=
0; i < sample_count; i++) {
append_single_sample((void*)data);
data += stride;
}
append_single_sample((void*)data);
data += stride;
}
@@
-174,8
+173,10
@@
void AnalogSegment::append_payload_to_envelope_levels()
it = begin_raw_sample_iteration(0);
for (uint64_t i = 0; i < sample_count_; i++) {
const float sample = *((float*)it->value);
it = begin_raw_sample_iteration(0);
for (uint64_t i = 0; i < sample_count_; i++) {
const float sample = *((float*)it->value);
- if (sample < min_value_) min_value_ = sample;
- if (sample > max_value_) max_value_ = sample;
+ if (sample < min_value_)
+ min_value_ = sample;
+ if (sample > max_value_)
+ max_value_ = sample;
continue_raw_sample_iteration(it, 1);
}
end_raw_sample_iteration(it);
continue_raw_sample_iteration(it, 1);
}
end_raw_sample_iteration(it);
@@
-191,7
+192,7
@@
void AnalogSegment::append_payload_to_envelope_levels()
// Iterate through the samples to populate the first level mipmap
uint64_t start_sample = prev_length * EnvelopeScaleFactor;
// Iterate through the samples to populate the first level mipmap
uint64_t start_sample = prev_length * EnvelopeScaleFactor;
- uint64_t end_sample
= e0.length * EnvelopeScaleFactor;
+ uint64_t end_sample = e0.length * EnvelopeScaleFactor;
it = begin_raw_sample_iteration(start_sample);
for (uint64_t i = start_sample; i < end_sample; i += EnvelopeScaleFactor) {
it = begin_raw_sample_iteration(start_sample);
for (uint64_t i = start_sample; i < end_sample; i += EnvelopeScaleFactor) {
@@
-202,8
+203,10
@@
void AnalogSegment::append_payload_to_envelope_levels()
*max_element(samples, samples + EnvelopeScaleFactor),
};
*max_element(samples, samples + EnvelopeScaleFactor),
};
- if (sub_sample.min < min_value_) min_value_ = sub_sample.min;
- if (sub_sample.max > max_value_) max_value_ = sub_sample.max;
+ if (sub_sample.min < min_value_)
+ min_value_ = sub_sample.min;
+ if (sub_sample.max > max_value_)
+ max_value_ = sub_sample.max;
continue_raw_sample_iteration(it, EnvelopeScaleFactor);
*dest_ptr++ = sub_sample;
continue_raw_sample_iteration(it, EnvelopeScaleFactor);
*dest_ptr++ = sub_sample;
@@
-213,7
+216,7
@@
void AnalogSegment::append_payload_to_envelope_levels()
// Compute higher level mipmaps
for (unsigned int level = 1; level < ScaleStepCount; level++) {
Envelope &e = envelope_levels_[level];
// Compute higher level mipmaps
for (unsigned int level = 1; level < ScaleStepCount; level++) {
Envelope &e = envelope_levels_[level];
- const Envelope &el = envelope_levels_[level
-
1];
+ const Envelope &el = envelope_levels_[level
-
1];
// Expand the data buffer to fit the new samples
prev_length = e.length;
// Expand the data buffer to fit the new samples
prev_length = e.length;
diff --git
a/pv/data/decode/decoder.hpp
b/pv/data/decode/decoder.hpp
index 1b323f0b74dc0b7b8de2d1b87605b6f0d39ca851..1b655662bcb707dfe5fd83dbc847164e81bc04a2 100644
(file)
--- a/
pv/data/decode/decoder.hpp
+++ b/
pv/data/decode/decoder.hpp
@@
-68,8
+68,7
@@
public:
bool have_required_channels() const;
bool have_required_channels() const;
- srd_decoder_inst* create_decoder_inst(
- srd_session *session) const;
+ srd_decoder_inst* create_decoder_inst(srd_session *session) const;
set< shared_ptr<pv::data::Logic> > get_data();
set< shared_ptr<pv::data::Logic> > get_data();
diff --git
a/pv/data/decoderstack.cpp
b/pv/data/decoderstack.cpp
index d3e1f4acd25de681fd147253ddc8d423ce5cd2bc..8fc3242392bd2642f36a2e093010d8a8c146df38 100644
(file)
--- a/
pv/data/decoderstack.cpp
+++ b/
pv/data/decoderstack.cpp
@@
-416,7
+416,7
@@
void DecoderStack::annotation_callback(srd_proto_data *pdata, void *decoder)
row_iter = d->rows_.find((*r).second);
else {
// Failing that, use the decoder as a key
row_iter = d->rows_.find((*r).second);
else {
// Failing that, use the decoder as a key
- row_iter = d->rows_.find(Row(decc));
+ row_iter = d->rows_.find(Row(decc));
}
assert(row_iter != d->rows_.end());
}
assert(row_iter != d->rows_.end());
diff --git
a/pv/data/decoderstack.hpp
b/pv/data/decoderstack.hpp
index 8a9e0e45c9116cee863b8e245044de78923016bf..5216006ef4b5567a543fe36b4afa46721ea535de 100644
(file)
--- a/
pv/data/decoderstack.hpp
+++ b/
pv/data/decoderstack.hpp
@@
-127,8
+127,7
@@
private:
void decode_proc();
void decode_proc();
- static void annotation_callback(srd_proto_data *pdata,
- void *decoder);
+ static void annotation_callback(srd_proto_data *pdata, void *decoder);
private Q_SLOTS:
void on_new_frame();
private Q_SLOTS:
void on_new_frame();
diff --git
a/pv/data/logic.cpp
b/pv/data/logic.cpp
index 399c81349c3087ceea417a0e75a610f436e49c59..ac47c29d6ac12d004f44c23ccc80b6678e44e78b 100644
(file)
--- a/
pv/data/logic.cpp
+++ b/
pv/data/logic.cpp
@@
-42,8
+42,7
@@
unsigned int Logic::num_channels() const
return num_channels_;
}
return num_channels_;
}
-void Logic::push_segment(
- shared_ptr<LogicSegment> &segment)
+void Logic::push_segment(shared_ptr<LogicSegment> &segment)
{
segments_.push_front(segment);
}
{
segments_.push_front(segment);
}
@@
-55,8
+54,7
@@
const deque< shared_ptr<LogicSegment> >& Logic::logic_segments() const
vector< shared_ptr<Segment> > Logic::segments() const
{
vector< shared_ptr<Segment> > Logic::segments() const
{
- return vector< shared_ptr<Segment> >(
- segments_.begin(), segments_.end());
+ return vector< shared_ptr<Segment> >(segments_.begin(), segments_.end());
}
void Logic::clear()
}
void Logic::clear()
diff --git
a/pv/data/logicsegment.cpp
b/pv/data/logicsegment.cpp
index db2ce0548fcbedcd4023e7532bc4e999bf3b35a7..cbaf54a47c132a3d192e530e59e5ee1f6efda586 100644
(file)
--- a/
pv/data/logicsegment.cpp
+++ b/
pv/data/logicsegment.cpp
@@
-44,7
+44,7
@@
namespace data {
const int LogicSegment::MipMapScalePower = 4;
const int LogicSegment::MipMapScaleFactor = 1 << MipMapScalePower;
const float LogicSegment::LogMipMapScaleFactor = logf(MipMapScaleFactor);
const int LogicSegment::MipMapScalePower = 4;
const int LogicSegment::MipMapScaleFactor = 1 << MipMapScalePower;
const float LogicSegment::LogMipMapScaleFactor = logf(MipMapScaleFactor);
-const uint64_t LogicSegment::MipMapDataUnit = 64
*
1024; // bytes
+const uint64_t LogicSegment::MipMapDataUnit = 64
*
1024; // bytes
LogicSegment::LogicSegment(pv::data::Logic& owner, unsigned int unit_size,
uint64_t samplerate) :
LogicSegment::LogicSegment(pv::data::Logic& owner, unsigned int unit_size,
uint64_t samplerate) :
@@
-177,7
+177,7
@@
const uint8_t* LogicSegment::get_samples(int64_t start_sample,
lock_guard<recursive_mutex> lock(mutex_);
lock_guard<recursive_mutex> lock(mutex_);
- return get_raw_samples(start_sample, (end_sample
-
start_sample));
+ return get_raw_samples(start_sample, (end_sample
-
start_sample));
}
SegmentLogicDataIterator* LogicSegment::begin_sample_iteration(uint64_t start)
}
SegmentLogicDataIterator* LogicSegment::begin_sample_iteration(uint64_t start)
@@
-257,7
+257,7
@@
void LogicSegment::append_payload_to_mipmap()
// Compute higher level mipmaps
for (unsigned int level = 1; level < ScaleStepCount; level++) {
MipMapLevel &m = mip_map_[level];
// Compute higher level mipmaps
for (unsigned int level = 1; level < ScaleStepCount; level++) {
MipMapLevel &m = mip_map_[level];
- const MipMapLevel &ml = mip_map_[level
-
1];
+ const MipMapLevel &ml = mip_map_[level
-
1];
// Expand the data buffer to fit the new samples
prev_length = m.length;
// Expand the data buffer to fit the new samples
prev_length = m.length;
diff --git
a/pv/data/logicsegment.hpp
b/pv/data/logicsegment.hpp
index bc9c77d0f4c7b6923287967f3b189648c0c65459..3c012a45c3257bcf4c20be27256b3a243ba0cf2b 100644
(file)
--- a/
pv/data/logicsegment.hpp
+++ b/
pv/data/logicsegment.hpp
@@
-93,7
+93,7
@@
public:
private:
uint64_t unpack_sample(const uint8_t *ptr) const;
void pack_sample(uint8_t *ptr, uint64_t value);
private:
uint64_t unpack_sample(const uint8_t *ptr) const;
void pack_sample(uint8_t *ptr, uint64_t value);
-
+
void reallocate_mipmap_level(MipMapLevel &m);
void append_payload_to_mipmap();
void reallocate_mipmap_level(MipMapLevel &m);
void append_payload_to_mipmap();
diff --git
a/pv/data/segment.cpp
b/pv/data/segment.cpp
index ceaf0a056ef84a2c8f473f1d664559b4e583ce1e..88015c3639860597accf8bf23eb21ed98d499e53 100644
(file)
--- a/
pv/data/segment.cpp
+++ b/
pv/data/segment.cpp
@@
-117,8
+117,7
@@
void Segment::append_single_sample(void *data)
// There will always be space for at least one sample in
// the current chunk, so we do not need to test for space
// There will always be space for at least one sample in
// the current chunk, so we do not need to test for space
- memcpy(current_chunk_ + (used_samples_ * unit_size_),
- data, unit_size_);
+ memcpy(current_chunk_ + (used_samples_ * unit_size_), data, unit_size_);
used_samples_++;
unused_samples_--;
used_samples_++;
unused_samples_--;
@@
-222,14
+221,12
@@
void Segment::continue_raw_sample_iteration(SegmentRawDataIterator* it, uint64_t
{
lock_guard<recursive_mutex> lock(mutex_);
{
lock_guard<recursive_mutex> lock(mutex_);
+ // Fail gracefully if we are asked to deliver data we don't have
if (it->sample_index > sample_count_)
if (it->sample_index > sample_count_)
- {
- // Fail gracefully if we are asked to deliver data we don't have
return;
return;
- } else {
- it->sample_index += increase;
- it->chunk_offs += (increase * unit_size_);
- }
+
+ it->sample_index += increase;
+ it->chunk_offs += (increase * unit_size_);
if (it->chunk_offs > (chunk_size_ - 1)) {
it->chunk_num++;
if (it->chunk_offs > (chunk_size_ - 1)) {
it->chunk_num++;
@@
-252,6
+249,5
@@
void Segment::end_raw_sample_iteration(SegmentRawDataIterator* it)
}
}
}
}
-
} // namespace data
} // namespace pv
} // namespace data
} // namespace pv
diff --git
a/pv/data/signalbase.cpp
b/pv/data/signalbase.cpp
index 949c8237572de2f09dfb0c9dbd162ba51bf1e735..ff66100718d38cdb7d8e30f8e5814f9d0cb0e089 100644
(file)
--- a/
pv/data/signalbase.cpp
+++ b/
pv/data/signalbase.cpp
@@
-37,7
+37,7
@@
using std::tie;
namespace pv {
namespace data {
namespace pv {
namespace data {
-const int SignalBase::ColourBGAlpha = 8
*256/
100;
+const int SignalBase::ColourBGAlpha = 8
* 256 /
100;
SignalBase::SignalBase(shared_ptr<sigrok::Channel> channel, ChannelType channel_type) :
channel_(channel),
SignalBase::SignalBase(shared_ptr<sigrok::Channel> channel, ChannelType channel_type) :
channel_(channel),
@@
-398,6
+398,5
@@
void SignalBase::on_capture_state_changed(int state)
}
}
}
}
-
} // namespace data
} // namespace pv
} // namespace data
} // namespace pv
diff --git
a/pv/dialogs/inputoutputoptions.hpp
b/pv/dialogs/inputoutputoptions.hpp
index 5d5ab55a1a967af98494534c949814b49efd6782..be6d33080f699a245355ebc92ee7b493aade746d 100644
(file)
--- a/
pv/dialogs/inputoutputoptions.hpp
+++ b/
pv/dialogs/inputoutputoptions.hpp
@@
-47,7
+47,7
@@
public:
* @param title the title of the dialog.
* @param options the map of options to use as a template.
* @param parent the parent widget of the dialog.
* @param title the title of the dialog.
* @param options the map of options to use as a template.
* @param parent the parent widget of the dialog.
- */
+ */
InputOutputOptions(const QString &title,
const map<string, shared_ptr<sigrok::Option>> &options,
QWidget *parent);
InputOutputOptions(const QString &title,
const map<string, shared_ptr<sigrok::Option>> &options,
QWidget *parent);
diff --git
a/pv/dialogs/settings.cpp
b/pv/dialogs/settings.cpp
index b8150b7bfaa4dadd187eec8eb7b233c660e2f2ad..b8f9bf9fa5910ec906f4b4a84e1487a5cb3374a0 100644
(file)
--- a/
pv/dialogs/settings.cpp
+++ b/
pv/dialogs/settings.cpp
@@
-57,7
+57,7
@@
Settings::Settings(DeviceManager &device_manager, QWidget *parent) :
page_list->setViewMode(QListView::IconMode);
page_list->setIconSize(QSize(icon_size, icon_size));
page_list->setMovement(QListView::Static);
page_list->setViewMode(QListView::IconMode);
page_list->setIconSize(QSize(icon_size, icon_size));
page_list->setMovement(QListView::Static);
- page_list->setMaximumWidth(icon_size +
icon_size/2
);
+ page_list->setMaximumWidth(icon_size +
(icon_size / 2)
);
page_list->setSpacing(12);
pages = new QStackedWidget;
page_list->setSpacing(12);
pages = new QStackedWidget;
@@
-168,15
+168,13
@@
QWidget *Settings::get_about_page(QWidget *parent) const
/* Library info */
s.append("<tr><td colspan=\"2\"><b>" +
/* Library info */
s.append("<tr><td colspan=\"2\"><b>" +
- tr("Used libraries:") +
- "</b></td></tr>");
+ tr("Used libraries:") + "</b></td></tr>");
s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
.arg(QString("Qt"), qVersion()));
/* Set up the supported field */
s.append("<tr><td colspan=\"2\"><b>" +
s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
.arg(QString("Qt"), qVersion()));
/* Set up the supported field */
s.append("<tr><td colspan=\"2\"><b>" +
- tr("Supported hardware drivers:") +
- "</b></td></tr>");
+ tr("Supported hardware drivers:") + "</b></td></tr>");
for (auto entry : context->drivers()) {
s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
.arg(QString::fromUtf8(entry.first.c_str()),
for (auto entry : context->drivers()) {
s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
.arg(QString::fromUtf8(entry.first.c_str()),
@@
-184,8
+182,7
@@
QWidget *Settings::get_about_page(QWidget *parent) const
}
s.append("<tr><td colspan=\"2\"><b>" +
}
s.append("<tr><td colspan=\"2\"><b>" +
- tr("Supported input formats:") +
- "</b></td></tr>");
+ tr("Supported input formats:") + "</b></td></tr>");
for (auto entry : context->input_formats()) {
s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
.arg(QString::fromUtf8(entry.first.c_str()),
for (auto entry : context->input_formats()) {
s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
.arg(QString::fromUtf8(entry.first.c_str()),
@@
-193,8
+190,7
@@
QWidget *Settings::get_about_page(QWidget *parent) const
}
s.append("<tr><td colspan=\"2\"><b>" +
}
s.append("<tr><td colspan=\"2\"><b>" +
- tr("Supported output formats:") +
- "</b></td></tr>");
+ tr("Supported output formats:") + "</b></td></tr>");
for (auto entry : context->output_formats()) {
s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
.arg(QString::fromUtf8(entry.first.c_str()),
for (auto entry : context->output_formats()) {
s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
.arg(QString::fromUtf8(entry.first.c_str()),
@@
-203,8
+199,7
@@
QWidget *Settings::get_about_page(QWidget *parent) const
#ifdef ENABLE_DECODE
s.append("<tr><td colspan=\"2\"><b>" +
#ifdef ENABLE_DECODE
s.append("<tr><td colspan=\"2\"><b>" +
- tr("Supported protocol decoders:") +
- "</b></td></tr>");
+ tr("Supported protocol decoders:") + "</b></td></tr>");
for (const GSList *l = srd_decoder_list(); l; l = l->next) {
dec = (struct srd_decoder *)l->data;
s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
for (const GSList *l = srd_decoder_list(); l; l = l->next) {
dec = (struct srd_decoder *)l->data;
s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
diff --git
a/pv/dialogs/storeprogress.hpp
b/pv/dialogs/storeprogress.hpp
index 48e1239dd033ba648a8caaa2f2280668f7e5cf56..b57ad25e501c18307587fe0ce96567b827693543 100644
(file)
--- a/
pv/dialogs/storeprogress.hpp
+++ b/
pv/dialogs/storeprogress.hpp
@@
-47,8
+47,7
@@
public:
const shared_ptr<sigrok::OutputFormat> output_format,
const map<string, Glib::VariantBase> &options,
const pair<uint64_t, uint64_t> sample_range,
const shared_ptr<sigrok::OutputFormat> output_format,
const map<string, Glib::VariantBase> &options,
const pair<uint64_t, uint64_t> sample_range,
- const Session &session,
- QWidget *parent = nullptr);
+ const Session &session, QWidget *parent = nullptr);
virtual ~StoreProgress();
virtual ~StoreProgress();
diff --git
a/pv/mainwindow.cpp
b/pv/mainwindow.cpp
index dd8be229e97acc9b29065124d6431b103c145b84..7e48e5a9f96a21f7c64cd9fe5a6d049d826ad70f 100644
(file)
--- a/
pv/mainwindow.cpp
+++ b/
pv/mainwindow.cpp
@@
-134,10
+134,10
@@
shared_ptr<views::ViewBase> MainWindow::get_active_view() const
QDockWidget *dock = nullptr;
while (w) {
QDockWidget *dock = nullptr;
while (w) {
- dock = qobject_cast<QDockWidget*>(w);
- if (dock)
- break;
- w = w->parent();
+
dock = qobject_cast<QDockWidget*>(w);
+
if (dock)
+
break;
+
w = w->parent();
}
// Get the view contained in the dock widget
}
// Get the view contained in the dock widget
diff --git
a/pv/popups/channels.cpp
b/pv/popups/channels.cpp
index 0251a9d17a0d6604a666afc02c40b4f80c58c5be..4a5e396c2e08e685d81205caa642608d3be73a13 100644
(file)
--- a/
pv/popups/channels.cpp
+++ b/
pv/popups/channels.cpp
@@
-168,13
+168,11
@@
void Channels::populate_group(shared_ptr<ChannelGroup> group,
QString("<h3>%1</h3>").arg(group->name().c_str())));
// Create the channel group grid
QString("<h3>%1</h3>").arg(group->name().c_str())));
// Create the channel group grid
- QGridLayout *const channel_grid =
- create_channel_group_grid(sigs);
+ QGridLayout *const channel_grid = create_channel_group_grid(sigs);
layout_.addRow(channel_grid);
// Create the channel group options
layout_.addRow(channel_grid);
// Create the channel group options
- if (binding)
- {
+ if (binding) {
binding->add_properties_to_form(&layout_, true);
group_bindings_.push_back(binding);
}
binding->add_properties_to_form(&layout_, true);
group_bindings_.push_back(binding);
}
diff --git
a/pv/prop/int.cpp
b/pv/prop/int.cpp
index d791bd96b05d0846b40d52dc476fdddec135420d..ce77b9592d3f66778ab6247b88b20cca32b9ca74 100644
(file)
--- a/
pv/prop/int.cpp
+++ b/
pv/prop/int.cpp
@@
-140,8
+140,7
@@
void Int::commit()
new_value = g_variant_new_int64(spin_box_->value());
else if (g_variant_type_equal(type, G_VARIANT_TYPE_UINT64))
new_value = g_variant_new_uint64(spin_box_->value());
new_value = g_variant_new_int64(spin_box_->value());
else if (g_variant_type_equal(type, G_VARIANT_TYPE_UINT64))
new_value = g_variant_new_uint64(spin_box_->value());
- else
- {
+ else {
// Unexpected value type.
assert(false);
}
// Unexpected value type.
assert(false);
}
diff --git
a/pv/session.cpp
b/pv/session.cpp
index f65b05a1588cad8ea001d31fdcdd3df7e6e94eca..d00ff97a0bbe78ae7a9e55a82e2913b36c602807 100644
(file)
--- a/
pv/session.cpp
+++ b/
pv/session.cpp
@@
-1035,7
+1035,7
@@
void Session::feed_in_analog(shared_ptr<Analog> analog)
void Session::data_feed_in(shared_ptr<sigrok::Device> device,
shared_ptr<Packet> packet)
{
void Session::data_feed_in(shared_ptr<sigrok::Device> device,
shared_ptr<Packet> packet)
{
- static bool frame_began
=
false;
+ static bool frame_began
=
false;
(void)device;
(void)device;
diff --git
a/pv/session.hpp
b/pv/session.hpp
index 7229c7e337f3ec71efa1041d9799b3c3e4fe2c42..faf1396da6bd79f793b56b7bbbca5a715bf2e38f 100644
(file)
--- a/
pv/session.hpp
+++ b/
pv/session.hpp
@@
-169,8
+169,7
@@
public:
bool has_view(shared_ptr<views::ViewBase> view);
bool has_view(shared_ptr<views::ViewBase> view);
- const unordered_set< shared_ptr<data::SignalBase> >
- signalbases() const;
+ const unordered_set< shared_ptr<data::SignalBase> > signalbases() const;
#ifdef ENABLE_DECODE
bool add_decoder(srd_decoder *const dec);
#ifdef ENABLE_DECODE
bool add_decoder(srd_decoder *const dec);
diff --git
a/pv/storesession.cpp
b/pv/storesession.cpp
index 8916cb8cd154e078837cef5174813e8e4bd38d1c..8b638de8246da898b8212ee4d1c841781524e990 100644
(file)
--- a/
pv/storesession.cpp
+++ b/
pv/storesession.cpp
@@
-226,7
+226,7
@@
void StoreSession::store_proc(vector< shared_ptr<data::SignalBase> > achannel_li
// Qt needs the progress values to fit inside an int. If they would
// not, scale the current and max values down until they do.
while ((sample_count_ >> progress_scale) > INT_MAX)
// Qt needs the progress values to fit inside an int. If they would
// not, scale the current and max values down until they do.
while ((sample_count_ >> progress_scale) > INT_MAX)
- progress_scale
++;
+ progress_scale++;
unit_count_ = sample_count_ >> progress_scale;
unit_count_ = sample_count_ >> progress_scale;
diff --git
a/pv/toolbars/mainbar.cpp
b/pv/toolbars/mainbar.cpp
index f3bbcee1b90490af234be2db0bc9e1bac2759173..838fefcaaa101f5612f6d57ee1170a0f6d5b5f2d 100644
(file)
--- a/
pv/toolbars/mainbar.cpp
+++ b/
pv/toolbars/mainbar.cpp
@@
-420,8
+420,7
@@
void MainBar::update_sample_count_selector()
min_sample_count = min(max(min_sample_count, MinSampleCount),
max_sample_count);
min_sample_count = min(max(min_sample_count, MinSampleCount),
max_sample_count);
- sample_count_.show_125_list(
- min_sample_count, max_sample_count);
+ sample_count_.show_125_list(min_sample_count, max_sample_count);
if (sr_dev->config_check(ConfigKey::LIMIT_SAMPLES, Capability::GET)) {
auto gvar = sr_dev->config_get(ConfigKey::LIMIT_SAMPLES);
if (sr_dev->config_check(ConfigKey::LIMIT_SAMPLES, Capability::GET)) {
auto gvar = sr_dev->config_get(ConfigKey::LIMIT_SAMPLES);
@@
-581,8
+580,7
@@
void MainBar::add_decoder(srd_decoder *decoder)
#endif
}
#endif
}
-void MainBar::export_file(shared_ptr<OutputFormat> format,
- bool selection_only)
+void MainBar::export_file(shared_ptr<OutputFormat> format, bool selection_only)
{
using pv::dialogs::StoreProgress;
{
using pv::dialogs::StoreProgress;
@@
-741,7
+739,7
@@
void MainBar::on_sample_rate_changed()
void MainBar::on_config_changed()
{
commit_sample_count();
void MainBar::on_config_changed()
{
commit_sample_count();
- commit_sample_rate();
+ commit_sample_rate();
}
void MainBar::on_actionNewView_triggered()
}
void MainBar::on_actionNewView_triggered()
diff --git
a/pv/util.cpp
b/pv/util.cpp
index c5f9c832ef44be87034826df96fa7d79f42e9e03..7d711f197013e65dcccca8172e14b9b29239bca6 100644
(file)
--- a/
pv/util.cpp
+++ b/
pv/util.cpp
@@
-110,12
+110,8
@@
static QTextStream& operator<<(QTextStream& stream, const Timestamp& t)
return stream << QString::fromStdString(str);
}
return stream << QString::fromStdString(str);
}
-QString format_time_si(
- const Timestamp& v,
- SIPrefix prefix,
- unsigned int precision,
- QString unit,
- bool sign)
+QString format_time_si(const Timestamp& v, SIPrefix prefix,
+ unsigned int precision, QString unit, bool sign)
{
if (prefix == SIPrefix::unspecified) {
// No prefix given, calculate it
{
if (prefix == SIPrefix::unspecified) {
// No prefix given, calculate it
@@
-142,22
+138,14
@@
QString format_time_si(
QTextStream ts(&s);
if (sign && !v.is_zero())
ts << forcesign;
QTextStream ts(&s);
if (sign && !v.is_zero())
ts << forcesign;
- ts
- << qSetRealNumberPrecision(precision)
- << (v * multiplier)
- << ' '
- << prefix
- << unit;
+ ts << qSetRealNumberPrecision(precision) << (v * multiplier) << ' '
+ << prefix << unit;
return s;
}
return s;
}
-QString format_time_si_adjusted(
- const Timestamp& t,
- SIPrefix prefix,
- unsigned precision,
- QString unit,
- bool sign)
+QString format_time_si_adjusted(const Timestamp& t, SIPrefix prefix,
+ unsigned precision, QString unit, bool sign)
{
// The precision is always given without taking the prefix into account
// so we need to deduct the number of decimals the prefix might imply
{
// The precision is always given without taking the prefix into account
// so we need to deduct the number of decimals the prefix might imply
@@
-170,7
+158,6
@@
QString format_time_si_adjusted(
return format_time_si(t, prefix, relative_prec, unit, sign);
}
return format_time_si(t, prefix, relative_prec, unit, sign);
}
-
// Helper for 'format_time_minutes()'.
static QString pad_number(unsigned int number, int length)
{
// Helper for 'format_time_minutes()'.
static QString pad_number(unsigned int number, int length)
{
diff --git
a/pv/util.hpp
b/pv/util.hpp
index 1c78b89f1831b802f16531a90bed7a489905d92f..bc71624bf3109fc2cb498778e943ac7acb3480f0 100644
(file)
--- a/
pv/util.hpp
+++ b/
pv/util.hpp
@@
-74,12
+74,9
@@
typedef boost::multiprecision::number<
*
* @return The formatted value.
*/
*
* @return The formatted value.
*/
-QString format_time_si(
- const Timestamp& v,
- SIPrefix prefix = SIPrefix::unspecified,
- unsigned precision = 0,
- QString unit = "s",
- bool sign = true);
+QString format_time_si(const Timestamp& v,
+ SIPrefix prefix = SIPrefix::unspecified, unsigned precision = 0,
+ QString unit = "s", bool sign = true);
/**
* Wrapper around 'format_time_si()' that interprets the given 'precision'
/**
* Wrapper around 'format_time_si()' that interprets the given 'precision'
@@
-96,12
+93,8
@@
QString format_time_si(
*
* @return The formatted value.
*/
*
* @return The formatted value.
*/
-QString format_time_si_adjusted(
- const Timestamp& t,
- SIPrefix prefix,
- unsigned precision = 0,
- QString unit = "s",
- bool sign = true);
+QString format_time_si_adjusted(const Timestamp& t, SIPrefix prefix,
+ unsigned precision = 0, QString unit = "s", bool sign = true);
/**
* Formats the given timestamp using "[+-]DD:HH:MM:SS.mmm uuu nnn ppp..." format.
/**
* Formats the given timestamp using "[+-]DD:HH:MM:SS.mmm uuu nnn ppp..." format.
@@
-116,9
+109,7
@@
QString format_time_si_adjusted(
*
* @return The formatted value.
*/
*
* @return The formatted value.
*/
-QString format_time_minutes(
- const Timestamp& t,
- signed precision = 0,
+QString format_time_minutes(const Timestamp& t, signed precision = 0,
bool sign = true);
} // namespace util
bool sign = true);
} // namespace util
diff --git
a/pv/view/analogsignal.cpp
b/pv/view/analogsignal.cpp
index 8f79f919eaad3f7e67618378cb6405af9b4f193c..af979c0c2d8a6500358538138e2e89cc9adeccf6 100644
(file)
--- a/
pv/view/analogsignal.cpp
+++ b/
pv/view/analogsignal.cpp
@@
-68,8
+68,8
@@
const QColor AnalogSignal::SignalColours[4] = {
QColor(0x4E, 0x9A, 0x06) // Green
};
QColor(0x4E, 0x9A, 0x06) // Green
};
-const QColor AnalogSignal::GridMajorColor = QColor(0, 0, 0, 40
*256/
100);
-const QColor AnalogSignal::GridMinorColor = QColor(0, 0, 0, 20
*256/
100);
+const QColor AnalogSignal::GridMajorColor = QColor(0, 0, 0, 40
* 256 /
100);
+const QColor AnalogSignal::GridMinorColor = QColor(0, 0, 0, 20
* 256 /
100);
const QColor AnalogSignal::SamplingPointColour(0x77, 0x77, 0x77);
const QColor AnalogSignal::SamplingPointColour(0x77, 0x77, 0x77);
@@
-157,16
+157,14
@@
int AnalogSignal::scale_handle_offset() const
{
const int h = (pos_vdivs_ + neg_vdivs_) * div_height_;
{
const int h = (pos_vdivs_ + neg_vdivs_) * div_height_;
- return ((scale_index_drag_offset_ - scale_index_) *
- h / 4) - h / 2;
+ return ((scale_index_drag_offset_ - scale_index_) * h / 4) - h / 2;
}
void AnalogSignal::scale_handle_dragged(int offset)
{
const int h = (pos_vdivs_ + neg_vdivs_) * div_height_;
}
void AnalogSignal::scale_handle_dragged(int offset)
{
const int h = (pos_vdivs_ + neg_vdivs_) * div_height_;
- scale_index_ = scale_index_drag_offset_ -
- (offset + h / 2) / (h / 4);
+ scale_index_ = scale_index_drag_offset_ - (offset + h / 2) / (h / 4);
update_scale();
}
update_scale();
}
@@
-371,7
+369,7
@@
void AnalogSignal::paint_envelope(QPainter &p,
QRectF *const rects = new QRectF[e.length];
QRectF *rect = rects;
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 =
const float x = ((e.scale * sample + e.start) /
samples_per_pixel - pixels_offset) + left;
const AnalogSegment::EnvelopeSample *const s =
@@
-379,8
+377,8
@@
void AnalogSignal::paint_envelope(QPainter &p,
// We overlap this sample with the next so that vertical
// gaps do not appear during steep rising or falling edges
// We overlap this sample with the next so that vertical
// gaps do not appear during steep rising or falling edges
- const float b = y - max(s->max, (s
+
1)->min) * scale_;
- const float t = y - min(s->min, (s
+
1)->max) * scale_;
+ const float b = y - max(s->max, (s
+
1)->min) * scale_;
+ const float t = y - min(s->min, (s
+
1)->max) * scale_;
float h = b - t;
if (h >= 0.0f && h <= 1.0f)
float h = b - t;
if (h >= 0.0f && h <= 1.0f)
diff --git
a/pv/view/decodetrace.cpp
b/pv/view/decodetrace.cpp
index 670d6ef1dcb3b5b8b66c79516c93b2be8d322815..55b5f5754ab52edcf179978e4babd6ac185dd83e 100644
(file)
--- a/
pv/view/decodetrace.cpp
+++ b/
pv/view/decodetrace.cpp
@@
-52,7
+52,6
@@
extern "C" {
#include <pv/widgets/decodergroupbox.hpp>
#include <pv/widgets/decodermenu.hpp>
#include <pv/widgets/decodergroupbox.hpp>
#include <pv/widgets/decodermenu.hpp>
-
using std::all_of;
using std::list;
using std::make_pair;
using std::all_of;
using std::list;
using std::make_pair;
@@
-438,8
+437,7
@@
void DecodeTrace::draw_annotation(const pv::data::decode::Annotation &a,
const double start = a.start_sample() / samples_per_pixel -
pixels_offset;
const double start = a.start_sample() / samples_per_pixel -
pixels_offset;
- const double end = a.end_sample() / samples_per_pixel -
- pixels_offset;
+ const double end = a.end_sample() / samples_per_pixel - pixels_offset;
const size_t colour = (base_colour + a.format()) % countof(Colours);
p.setPen(OutlineColours[colour]);
const size_t colour = (base_colour + a.format()) % countof(Colours);
p.setPen(OutlineColours[colour]);
@@
-451,8
+449,7
@@
void DecodeTrace::draw_annotation(const pv::data::decode::Annotation &a,
if (a.start_sample() == a.end_sample())
draw_instant(a, p, h, start, y);
else
if (a.start_sample() == a.end_sample())
draw_instant(a, p, h, start, y);
else
- draw_range(a, p, h, start, end, y, pp,
- row_title_width);
+ draw_range(a, p, h, start, end, y, pp, row_title_width);
}
void DecodeTrace::draw_annotation_block(
}
void DecodeTrace::draw_annotation_block(
@@
-490,7
+487,7
@@
void DecodeTrace::draw_annotation_block(
p.setBrush(QBrush((single_format ? Colours[colour] : Qt::gray),
Qt::Dense4Pattern));
p.drawRoundedRect(
p.setBrush(QBrush((single_format ? Colours[colour] : Qt::gray),
Qt::Dense4Pattern));
p.drawRoundedRect(
- QRectF(start, top, end - start, bottom - top), h
/4, h/
4);
+ QRectF(start, top, end - start, bottom - top), h
/ 4, h /
4);
}
void DecodeTrace::draw_instant(const pv::data::decode::Annotation &a, QPainter &p,
}
void DecodeTrace::draw_instant(const pv::data::decode::Annotation &a, QPainter &p,
@@
-619,8
+616,7
@@
void DecodeTrace::draw_unresolved_period(QPainter &p, int h, int left,
if (!data || data->logic_segments().empty())
return;
if (!data || data->logic_segments().empty())
return;
- const shared_ptr<LogicSegment> segment =
- data->logic_segments().front();
+ const shared_ptr<LogicSegment> segment = data->logic_segments().front();
assert(segment);
const int64_t sample_count = (int64_t)segment->get_sample_count();
if (sample_count == 0)
assert(segment);
const int64_t sample_count = (int64_t)segment->get_sample_count();
if (sample_count == 0)
@@
-639,7
+635,7
@@
void DecodeTrace::draw_unresolved_period(QPainter &p, int h, int left,
samples_per_pixel - pixels_offset, left - 1.0);
const double end = min(sample_count / samples_per_pixel -
pixels_offset, right + 1.0);
samples_per_pixel - pixels_offset, left - 1.0);
const double end = min(sample_count / samples_per_pixel -
pixels_offset, right + 1.0);
- const QRectF no_decode_rect(start, y -
h/2
+ 0.5, end - start, h);
+ const QRectF no_decode_rect(start, y -
(h / 2)
+ 0.5, end - start, h);
p.setPen(QPen(Qt::NoPen));
p.setBrush(Qt::white);
p.setPen(QPen(Qt::NoPen));
p.setBrush(Qt::white);
@@
-963,7
+959,7
@@
void DecodeTrace::on_delete_decoder(int index)
decoder_stack->remove(index);
// Update the popup
decoder_stack->remove(index);
// Update the popup
- create_popup_form();
+ create_popup_form();
decoder_stack->begin_decode();
}
decoder_stack->begin_decode();
}
diff --git
a/pv/view/decodetrace.hpp
b/pv/view/decodetrace.hpp
index 3103a3c02ce4910556a68c1d28c96b976d797b47..9f5755244bd61cc738a5930734f41a15b22b168d 100644
(file)
--- a/
pv/view/decodetrace.hpp
+++ b/
pv/view/decodetrace.hpp
@@
-182,8
+182,7
@@
private:
const shared_ptr<pv::data::decode::Decoder> &dec,
const srd_channel *const pdch);
const shared_ptr<pv::data::decode::Decoder> &dec,
const srd_channel *const pdch);
- void commit_decoder_channels(
- shared_ptr<data::decode::Decoder> &dec);
+ void commit_decoder_channels(shared_ptr<data::decode::Decoder> &dec);
void commit_channels();
void commit_channels();
diff --git
a/pv/view/header.cpp
b/pv/view/header.cpp
index 28f8130d16d562a586e8d18765518d98cc840f4c..0e9445ea239e7a9879e1b88f24e1610b6a09b591 100644
(file)
--- a/
pv/view/header.cpp
+++ b/
pv/view/header.cpp
@@
-103,8
+103,7
@@
void Header::paintEvent(QPaintEvent*)
// would be clipped away.
const QRect rect(0, 0, width() - BaselineOffset, height());
// would be clipped away.
const QRect rect(0, 0, width() - BaselineOffset, height());
- vector< shared_ptr<RowItem> > items(
- view_.list_by_type<RowItem>());
+ vector< shared_ptr<RowItem> > items(view_.list_by_type<RowItem>());
stable_sort(items.begin(), items.end(),
[](const shared_ptr<RowItem> &a, const shared_ptr<RowItem> &b) {
stable_sort(items.begin(), items.end(),
[](const shared_ptr<RowItem> &a, const shared_ptr<RowItem> &b) {
diff --git
a/pv/view/logicsignal.cpp
b/pv/view/logicsignal.cpp
index 2f4ac22cf50083a789d662c94fdc3ef0e4da2f45..9c8f6b319cf7fbd1699b0810dea5ba17fe3bc753 100644
(file)
--- a/
pv/view/logicsignal.cpp
+++ b/
pv/view/logicsignal.cpp
@@
-176,8
+176,7
@@
void LogicSignal::paint_mid(QPainter &p, const ViewItemPaintParams &pp)
if (segments.empty())
return;
if (segments.empty())
return;
- const shared_ptr<pv::data::LogicSegment> &segment =
- segments.front();
+ const shared_ptr<pv::data::LogicSegment> &segment = segments.front();
double samplerate = segment->samplerate();
double samplerate = segment->samplerate();
diff --git
a/pv/view/logicsignal.hpp
b/pv/view/logicsignal.hpp
index 274fd6cd23437d95d8d0f0ce6ee470e4ea80a6bd..273120230d0b25f02af6b95d366f8ac633b31ed0 100644
(file)
--- a/
pv/view/logicsignal.hpp
+++ b/
pv/view/logicsignal.hpp
@@
-118,8
+118,7
@@
private:
void init_trigger_actions(QWidget *parent);
const vector<int32_t> get_trigger_types() const;
void init_trigger_actions(QWidget *parent);
const vector<int32_t> get_trigger_types() const;
- QAction* action_from_trigger_type(
- const sigrok::TriggerMatchType *type);
+ QAction* action_from_trigger_type(const sigrok::TriggerMatchType *type);
const sigrok::TriggerMatchType* trigger_type_from_action(
QAction *action);
void populate_popup_form(QWidget *parent, QFormLayout *form);
const sigrok::TriggerMatchType* trigger_type_from_action(
QAction *action);
void populate_popup_form(QWidget *parent, QFormLayout *form);
diff --git
a/pv/view/ruler.hpp
b/pv/view/ruler.hpp
index 192de791fcb79ad86c9a37eb09b3f48128eeec89..1efd8737c9c938fb568bdf0948a8b9f5c0bc62d8 100644
(file)
--- a/
pv/view/ruler.hpp
+++ b/
pv/view/ruler.hpp
@@
-55,7
+55,6
@@
class Ruler : public MarginWidget
friend struct RulerTest::tick_position_test_2;
private:
friend struct RulerTest::tick_position_test_2;
private:
-
/// Height of the ruler in multipes of the text height
static const float RulerHeight;
/// Height of the ruler in multipes of the text height
static const float RulerHeight;
diff --git
a/pv/view/trace.cpp
b/pv/view/trace.cpp
index 0d4a4536171aacd99082465740deabe66f957793..985c295059a5da42c1390323de9396296712bfea 100644
(file)
--- a/
pv/view/trace.cpp
+++ b/
pv/view/trace.cpp
@@
-42,11
+42,11
@@
namespace pv {
namespace views {
namespace TraceView {
namespace views {
namespace TraceView {
-const QPen Trace::AxisPen(QColor(0, 0, 0, 30
*256/
100));
+const QPen Trace::AxisPen(QColor(0, 0, 0, 30
* 256 /
100));
const int Trace::LabelHitPadding = 2;
const int Trace::LabelHitPadding = 2;
-const QColor Trace::BrightGrayBGColour = QColor(0, 0, 0, 10
*255/
100);
-const QColor Trace::DarkGrayBGColour = QColor(0, 0, 0, 15
*255/
100);
+const QColor Trace::BrightGrayBGColour = QColor(0, 0, 0, 10
* 255 /
100);
+const QColor Trace::DarkGrayBGColour = QColor(0, 0, 0, 15
* 255 /
100);
Trace::Trace(shared_ptr<data::SignalBase> channel) :
base_(channel),
Trace::Trace(shared_ptr<data::SignalBase> channel) :
base_(channel),
@@
-138,8
+138,7
@@
pv::widgets::Popup* Trace::create_popup(QWidget *parent)
create_popup_form();
create_popup_form();
- connect(popup_, SIGNAL(closed()),
- this, SLOT(on_popup_closed()));
+ connect(popup_, SIGNAL(closed()), this, SLOT(on_popup_closed()));
return popup_;
}
return popup_;
}
diff --git
a/pv/view/tracetreeitem.cpp
b/pv/view/tracetreeitem.cpp
index 1cc3dd6d95e1a5d20acf62d385254bf791edfc75..97c31dc43d462057c95f2979730ef2e7291a3dee 100644
(file)
--- a/
pv/view/tracetreeitem.cpp
+++ b/
pv/view/tracetreeitem.cpp
@@
-140,7
+140,7
@@
QPoint TraceTreeItem::point(const QRect &rect) const
void TraceTreeItem::set_bgcolour_state(bool state)
{
void TraceTreeItem::set_bgcolour_state(bool state)
{
- bgcolour_state_ = state;
+ bgcolour_state_ = state;
}
} // namespace TraceView
}
} // namespace TraceView
diff --git
a/pv/view/tracetreeitemowner.hpp
b/pv/view/tracetreeitemowner.hpp
index 92aae37f5590b12a5080083c2f3dbba73815106a..58a656d084d0259fa73c29c1d2d46b49dfa05191 100644
(file)
--- a/
pv/view/tracetreeitemowner.hpp
+++ b/
pv/view/tracetreeitemowner.hpp
@@
-75,8
+75,7
@@
public:
/**
* Returns a list of row items owned by this object.
*/
/**
* Returns a list of row items owned by this object.
*/
- vector< shared_ptr<TraceTreeItem> >
- trace_tree_child_items() const;
+ vector< shared_ptr<TraceTreeItem> > trace_tree_child_items() const;
/**
* Clears the list of child items.
/**
* Clears the list of child items.
diff --git
a/pv/view/view.cpp
b/pv/view/view.cpp
index 9e2aeaa87af8c4319447e564009cd4332915aca8..dc545babf4d0147f87d6519498c6ea314339dfe1 100644
(file)
--- a/
pv/view/view.cpp
+++ b/
pv/view/view.cpp
@@
-65,7
+65,6
@@
#include "decodetrace.hpp"
#endif
#include "decodetrace.hpp"
#endif
-
using pv::data::SignalData;
using pv::data::Segment;
using pv::util::TimeUnit;
using pv::data::SignalData;
using pv::data::Segment;
using pv::util::TimeUnit;
@@
-444,7
+443,7
@@
void View::zoom(double steps)
void View::zoom(double steps, int offset)
{
void View::zoom(double steps, int offset)
{
- set_zoom(scale_ * pow(3.0
/
2.0, -steps), offset);
+ set_zoom(scale_ * pow(3.0
/
2.0, -steps), offset);
}
void View::zoom_fit(bool gui_state)
}
void View::zoom_fit(bool gui_state)
@@
-533,8
+532,7
@@
pair<Timestamp, Timestamp> View::get_time_extents() const
boost::optional<Timestamp> left_time, right_time;
const set< shared_ptr<SignalData> > visible_data = get_visible_data();
for (const shared_ptr<SignalData> d : visible_data) {
boost::optional<Timestamp> left_time, right_time;
const set< shared_ptr<SignalData> > visible_data = get_visible_data();
for (const shared_ptr<SignalData> d : visible_data) {
- const vector< shared_ptr<Segment> > segments =
- d->segments();
+ const vector< shared_ptr<Segment> > segments = d->segments();
for (const shared_ptr<Segment> &s : segments) {
double samplerate = s->samplerate();
samplerate = (samplerate <= 0.0) ? 1.0 : samplerate;
for (const shared_ptr<Segment> &s : segments) {
double samplerate = s->samplerate();
samplerate = (samplerate <= 0.0) ? 1.0 : samplerate;
diff --git
a/pv/view/view.hpp
b/pv/view/view.hpp
index aebc25401bb85d34cad008e28c99fa0104c8dce3..ee62d11369b373ddd60d5b26820944ed7012f0b2 100644
(file)
--- a/
pv/view/view.hpp
+++ b/
pv/view/view.hpp
@@
-67,7
+67,8
@@
class Trace;
class Viewport;
class TriggerMarker;
class Viewport;
class TriggerMarker;
-class CustomAbstractScrollArea : public QAbstractScrollArea {
+class CustomAbstractScrollArea : public QAbstractScrollArea
+{
Q_OBJECT
public:
Q_OBJECT
public:
@@
-76,7
+77,8
@@
public:
bool viewportEvent(QEvent *event);
};
bool viewportEvent(QEvent *event);
};
-class View : public ViewBase, public TraceTreeItemOwner {
+class View : public ViewBase, public TraceTreeItemOwner
+{
Q_OBJECT
private:
Q_OBJECT
private:
diff --git
a/pv/view/viewport.cpp
b/pv/view/viewport.cpp
index d3f25aa6ba2bb82e07aa0afd1a389f6a13f9c6f9..4b5fe245e0c11a9c6af77fdd038201d4427e997e 100644
(file)
--- a/
pv/view/viewport.cpp
+++ b/
pv/view/viewport.cpp
@@
-59,8
+59,7
@@
shared_ptr<ViewItem> Viewport::get_mouse_over_item(const QPoint &pt)
const ViewItemPaintParams pp(rect(), view_.scale(), view_.offset());
const vector< shared_ptr<ViewItem> > items(this->items());
for (auto i = items.rbegin(); i != items.rend(); i++)
const ViewItemPaintParams pp(rect(), view_.scale(), view_.offset());
const vector< shared_ptr<ViewItem> > items(this->items());
for (auto i = items.rbegin(); i != items.rend(); i++)
- if ((*i)->enabled() &&
- (*i)->hit_box_rect(pp).contains(pt))
+ if ((*i)->enabled() && (*i)->hit_box_rect(pp).contains(pt))
return *i;
return nullptr;
}
return *i;
return nullptr;
}
diff --git
a/pv/views/trace/standardbar.hpp
b/pv/views/trace/standardbar.hpp
index c00c218d82f3eb2a484cb029129c8da9bf6ff8c0..7a76a639289aebf70c4a15a8b8bdb49485a52c11 100644
(file)
--- a/
pv/views/trace/standardbar.hpp
+++ b/
pv/views/trace/standardbar.hpp
@@
-48,7
+48,7
@@
class StandardBar : public QToolBar
public:
StandardBar(Session &session, QWidget *parent,
public:
StandardBar(Session &session, QWidget *parent,
- TraceView::View *view, bool add_default_widgets
=
true);
+ TraceView::View *view, bool add_default_widgets
=
true);
Session &session() const;
Session &session() const;
diff --git
a/pv/views/viewbase.hpp
b/pv/views/viewbase.hpp
index 95f3ff758ca52555d67de6f5b28955f48afddd8f..45aae7f1021f7797e0dc11cf5e53484a81d80f7e 100644
(file)
--- a/
pv/views/viewbase.hpp
+++ b/
pv/views/viewbase.hpp
@@
-49,11
+49,12
@@
enum ViewType {
ViewTypeTabularDecode
};
ViewTypeTabularDecode
};
-class ViewBase : public QWidget {
+class ViewBase : public QWidget
+{
Q_OBJECT
public:
Q_OBJECT
public:
- explicit ViewBase(Session &session, bool is_main_view
=
false, QWidget *parent = nullptr);
+ explicit ViewBase(Session &session, bool is_main_view
=
false, QWidget *parent = nullptr);
Session& session();
const Session& session() const;
Session& session();
const Session& session() const;
diff --git
a/pv/widgets/decodergroupbox.cpp
b/pv/widgets/decodergroupbox.cpp
index 623ebddef6d4992102d50571c47c35be451df921..f5b9f2533378e938f0a918510229e4da204f5526 100644
(file)
--- a/
pv/widgets/decodergroupbox.cpp
+++ b/
pv/widgets/decodergroupbox.cpp
@@
-37,8
+37,7
@@
DecoderGroupBox::DecoderGroupBox(QString title, QWidget *parent, bool isDeletabl
layout_->setContentsMargins(0, 0, 0, 0);
setLayout(layout_);
layout_->setContentsMargins(0, 0, 0, 0);
setLayout(layout_);
- layout_->addWidget(new QLabel(QString("<h3>%1</h3>").arg(title)),
- 0, 0);
+ layout_->addWidget(new QLabel(QString("<h3>%1</h3>").arg(title)), 0, 0);
layout_->setColumnStretch(0, 1);
QHBoxLayout *const toolbar = new QHBoxLayout;
layout_->setColumnStretch(0, 1);
QHBoxLayout *const toolbar = new QHBoxLayout;
diff --git
a/pv/widgets/decodermenu.cpp
b/pv/widgets/decodermenu.cpp
index e3a953338a43d930350c67b3e4cbd3ce50c7cdd9..994aad1b4e5669f244edb9e4ba2c690c2cfa55be 100644
(file)
--- a/
pv/widgets/decodermenu.cpp
+++ b/
pv/widgets/decodermenu.cpp
@@
-65,7
+65,7
@@
void DecoderMenu::on_action(QObject *action)
(srd_decoder*)((QAction*)action)->data().value<void*>();
assert(dec);
(srd_decoder*)((QAction*)action)->data().value<void*>();
assert(dec);
- decoder_selected(dec);
+ decoder_selected(dec);
}
} // widgets
}
} // widgets
diff --git
a/pv/widgets/decodermenu.hpp
b/pv/widgets/decodermenu.hpp
index 3a7dde4bff6cd7256532609e2eea292dfe3dc1d3..cec4b574e3c7a0ca9674980e7552beefbcdaefb5 100644
(file)
--- a/
pv/widgets/decodermenu.hpp
+++ b/
pv/widgets/decodermenu.hpp
@@
-38,7
+38,6
@@
public:
private:
static int decoder_name_cmp(const void *a, const void *b);
private:
static int decoder_name_cmp(const void *a, const void *b);
-
private Q_SLOTS:
void on_action(QObject *action);
private Q_SLOTS:
void on_action(QObject *action);
diff --git
a/pv/widgets/popup.cpp
b/pv/widgets/popup.cpp
index f60e643a794e3b0f5493ca1802c046afe2b8dea9..6d211c9887e2d3c4d20b794d97ec91ec53bd0da6 100644
(file)
--- a/
pv/widgets/popup.cpp
+++ b/
pv/widgets/popup.cpp
@@
-119,7
+119,7
@@
bool Popup::space_for_arrow() const
case Bottom:
if (point_.y() > y())
return false;
case Bottom:
if (point_.y() > y())
return false;
- return true;
+ return true;
case Left:
if (point_.x() < (x() + width()))
case Left:
if (point_.x() < (x() + width()))
@@
-168,7
+168,7
@@
QPolygon Popup::arrow_polygon() const
case Left:
poly << QPoint(p.x() - l, p.y() + l);
break;
case Left:
poly << QPoint(p.x() - l, p.y() + l);
break;
-
+
case Top:
poly << QPoint(p.x() + l, p.y() - l);
break;
case Top:
poly << QPoint(p.x() + l, p.y() - l);
break;
diff --git
a/pv/widgets/sweeptimingwidget.cpp
b/pv/widgets/sweeptimingwidget.cpp
index 6e24d94839429ec961e19c99dbe65d1e9047930b..d768620248003b14662a82d3f4dbde0ae5ba04a2 100644
(file)
--- a/
pv/widgets/sweeptimingwidget.cpp
+++ b/
pv/widgets/sweeptimingwidget.cpp
@@
-87,8
+87,7
@@
void SweepTimingWidget::show_list(const uint64_t *vals, size_t count)
list_.clear();
for (size_t i = 0; i < count; i++) {
char *const s = sr_si_string_u64(vals[i], suffix_);
list_.clear();
for (size_t i = 0; i < count; i++) {
char *const s = sr_si_string_u64(vals[i], suffix_);
- list_.addItem(QString::fromUtf8(s),
- qVariantFromValue(vals[i]));
+ list_.addItem(QString::fromUtf8(s), qVariantFromValue(vals[i]));
g_free(s);
}
g_free(s);
}
@@
-138,20
+137,17
@@
void SweepTimingWidget::show_125_list(uint64_t min, uint64_t max)
uint64_t SweepTimingWidget::value() const
{
uint64_t SweepTimingWidget::value() const
{
- switch(value_type_) {
+ switch
(value_type_) {
case None:
return 0;
case None:
return 0;
-
case MinMaxStep:
return (uint64_t)value_.value();
case MinMaxStep:
return (uint64_t)value_.value();
-
case List:
{
const int index = list_.currentIndex();
return (index >= 0) ? list_.itemData(
index).value<uint64_t>() : 0;
}
case List:
{
const int index = list_.currentIndex();
return (index >= 0) ? list_.itemData(
index).value<uint64_t>() : 0;
}
-
default:
// Unexpected value type
assert(false);
default:
// Unexpected value type
assert(false);
diff --git
a/pv/widgets/wellarray.cpp
b/pv/widgets/wellarray.cpp
index 3ae6eec6305b1eb696bb55affcf070a71d5790dc..7617552731f0280b4544c68b7f9832171af57dcf 100644
(file)
--- a/
pv/widgets/wellarray.cpp
+++ b/
pv/widgets/wellarray.cpp
@@
-265,7
+265,7
@@
void WellArray::focusOutEvent(QFocusEvent*)
*/
void WellArray::keyPressEvent(QKeyEvent* event)
{
*/
void WellArray::keyPressEvent(QKeyEvent* event)
{
- switch(event->key()) { // Look at the key code
+ switch
(event->key()) { // Look at the key code
case Qt::Key_Left: // If 'left arrow'-key,
if (curCol > 0) // and cr't not in leftmost col
setCurrent(curRow, curCol - 1); // set cr't to next left column
case Qt::Key_Left: // If 'left arrow'-key,
if (curCol > 0) // and cr't not in leftmost col
setCurrent(curRow, curCol - 1); // set cr't to next left column
diff --git
a/signalhandler.cpp
b/signalhandler.cpp
index f262d6639fe6dc6582de6f7251c4cad58cc69e6b..14706261b7d483bc0a031be43f82104549b6f5ca 100644
(file)
--- a/
signalhandler.cpp
+++ b/
signalhandler.cpp
@@
-71,8
+71,7
@@
void SignalHandler::on_socket_notifier_activated()
abort();
}
abort();
}
- switch(sig_number)
- {
+ switch (sig_number) {
case SIGINT:
Q_EMIT int_received();
break;
case SIGINT:
Q_EMIT int_received();
break;