]> sigrok.org Git - pulseview.git/commitdiff
Apply some clang-tidy fixes.
authorUwe Hermann <redacted>
Thu, 6 Jul 2017 06:56:39 +0000 (08:56 +0200)
committerUwe Hermann <redacted>
Thu, 6 Jul 2017 10:09:10 +0000 (12:09 +0200)
This patch was generated using clang-tidy:

  clang-tidy -checks="-*,..." -fix

The following set of checks was enabled:

  modernize-use-nullptr,modernize-deprecated-headers,modernize-make-shared,
  modernize-redundant-void-arg,modernize-use-bool-literals,
  modernize-use-emplace,modernize-use-equals-default,
  google-readability-namespace-comments,misc-unused-using-decls

Add NOLINT to have clang-tidy (among other tools) ignore some lines
that are not meant to be changed.

13 files changed:
pv/binding/decoder.cpp
pv/binding/device.cpp
pv/binding/inputoutput.cpp
pv/data/decode/decoder.cpp
pv/data/decode/decoder.hpp
pv/data/decodesignal.hpp
pv/devicemanager.cpp
pv/mainwindow.cpp
pv/views/trace/cursor.cpp
pv/views/trace/decodetrace.cpp
pv/views/trace/decodetrace.hpp
pv/views/trace/view.cpp
pv/views/trace/viewport.cpp

index 28f42a08b38027ca87a9e42a5c6bec84e31c7a09..f51f90774afd0561d130704819528f9fd887a0f1 100644 (file)
@@ -31,7 +31,6 @@
 #include <pv/prop/string.hpp>
 
 using boost::none;
-using std::make_pair;
 using std::map;
 using std::pair;
 using std::shared_ptr;
@@ -97,7 +96,7 @@ shared_ptr<Property> Decoder::bind_enum(
        vector< pair<Glib::VariantBase, QString> > values;
        for (GSList *l = option->values; l; l = l->next) {
                Glib::VariantBase var = Glib::VariantBase((GVariant*)l->data, true);
-               values.push_back(make_pair(var, print_gvariant(var)));
+               values.emplace_back(var, print_gvariant(var));
        }
 
        return shared_ptr<Property>(new Enum(name, desc, values, getter, setter));
index 20082db2f7a949666151fc01e006d7408f7fb3ab..1afc2ce2f32c7f3009aec2296231b019fb15e8b8 100644 (file)
@@ -32,7 +32,6 @@
 using boost::optional;
 
 using std::function;
-using std::make_pair;
 using std::pair;
 using std::set;
 using std::shared_ptr;
@@ -157,7 +156,7 @@ void Device::bind_enum(const QString &name, const QString &desc,
 
                vector< pair<Glib::VariantBase, QString> > values;
                while ((iter.next_value(gvar)))
-                       values.push_back(make_pair(gvar, printer(gvar)));
+                       values.emplace_back(gvar, printer(gvar));
 
                properties_.push_back(shared_ptr<Property>(new Enum(name, desc, values,
                        getter, setter)));
index 9d2299afaf95fd767a5d7142fb71a606e3d97f0f..4aa0c0eabd13aac1a99105340d2a7a28fec49af7 100644 (file)
@@ -35,7 +35,6 @@
 
 using boost::none;
 
-using std::make_pair;
 using std::map;
 using std::pair;
 using std::shared_ptr;
@@ -111,7 +110,7 @@ shared_ptr<Property> InputOutput::bind_enum(
 {
        vector< pair<VariantBase, QString> > enum_vals;
        for (VariantBase var : values)
-               enum_vals.push_back(make_pair(var, print_gvariant(var)));
+               enum_vals.emplace_back(var, print_gvariant(var));
        return shared_ptr<Property>(new Enum(name, desc, enum_vals, getter, setter));
 }
 
index 2a9b980b14ef58039641f22df519cb291b6acdb7..cd3e97d649ec52f0646fa269402b3f5e3d3668c5 100644 (file)
@@ -28,9 +28,7 @@
 #include <pv/data/decodesignal.hpp>
 
 using pv::data::DecodeChannel;
-using std::set;
 using std::map;
-using std::shared_ptr;
 using std::string;
 
 namespace pv {
index 4ec193b1df24dc73d61936e8e5d71bfb278b6316..1ef3a28a9316ad030d9ab193515c6c257e595bd5 100644 (file)
@@ -28,8 +28,6 @@
 #include <glib.h>
 
 using std::map;
-using std::set;
-using std::shared_ptr;
 using std::string;
 using std::vector;
 
index 3d90f7f7de648e861d117fc24e8b1200b44fe952..0e0911521b09973ed2d28fd1ca72efa1f139b0df 100644 (file)
@@ -40,7 +40,6 @@ using std::condition_variable;
 using std::map;
 using std::mutex;
 using std::pair;
-using std::unordered_set;
 using std::vector;
 using std::shared_ptr;
 
index 35efa12786bb524003bbdbe0ff4eecf54d59927e..ccd3716a7509ff342827b9b8eaac30c4f3bcd403 100644 (file)
@@ -48,8 +48,6 @@ using std::string;
 using std::unique_ptr;
 using std::vector;
 
-using Glib::ustring;
-using Glib::Variant;
 using Glib::VariantBase;
 
 using sigrok::ConfigKey;
index 119ce0a791ba22a2aa1d6b1702a387fd6bef9caf..52b625086d4830df551f5a302e61cb1d3db30b5f 100644 (file)
@@ -53,7 +53,6 @@
 using std::bind;
 using std::dynamic_pointer_cast;
 using std::make_shared;
-using std::map;
 using std::placeholders::_1;
 using std::shared_ptr;
 using std::string;
index 4fb4b65d9841deec2594422092997db66a386f01..88c4ebfdca52172c12f609c1eba9c1cb0fee7018 100644 (file)
@@ -34,7 +34,7 @@
 #include <cstdio>
 #include <limits>
 
-using std::abs; // Force usage of std::abs() instead of C's abs().
+using std::abs; // NOLINT. Force usage of std::abs() instead of C's abs().
 using std::shared_ptr;
 
 namespace pv {
index 21d88923ef1c5732f3a0f3ef1394219c2ead7907..b0395eaa05dc685828a6d31d3d69a1383be59361 100644 (file)
@@ -56,14 +56,11 @@ extern "C" {
 using std::all_of;
 using std::make_pair;
 using std::max;
-using std::map;
 using std::min;
 using std::out_of_range;
 using std::pair;
 using std::shared_ptr;
-using std::make_shared;
 using std::tie;
-using std::unordered_set;
 using std::vector;
 
 using pv::data::decode::Annotation;
index 26da3ace35ca01a4f291ff1026a1d29b173ba197..d6a1fbbeb2dd149780fcbcb4832e9930d25bdf2d 100644 (file)
@@ -60,7 +60,7 @@ class Annotation;
 class Decoder;
 class Row;
 }
-}
+}  // namespace data
 
 namespace widgets {
 class DecoderGroupBox;
index 0b5eef74e27a21b2164d980ee8a18f19644bb02d..f8378d98204554305a32ba41516814da7a265012 100644 (file)
@@ -73,7 +73,6 @@ using pv::util::Timestamp;
 using std::back_inserter;
 using std::copy_if;
 using std::count_if;
-using std::dynamic_pointer_cast;
 using std::inserter;
 using std::max;
 using std::make_pair;
index d426a133717596a8c8d396b9f6e4f08e146cef13..8eb32a5e94f03d11254a87e7eae5b14f714c4810 100644 (file)
@@ -37,7 +37,7 @@ using std::abs;
 using std::back_inserter;
 using std::copy;
 using std::dynamic_pointer_cast;
-using std::none_of; // Used in assert()s.
+using std::none_of; // NOLINT. Used in assert()s.
 using std::shared_ptr;
 using std::stable_sort;
 using std::vector;