Apply some clang-tidy fixes.

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.
This commit is contained in:
Uwe Hermann 2017-07-06 08:56:39 +02:00
parent 762ab7a4b2
commit 20f59e957e
13 changed files with 6 additions and 21 deletions

View 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));

View 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)));

View 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));
}

View 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 {

View File

@ -28,8 +28,6 @@
#include <glib.h>
using std::map;
using std::set;
using std::shared_ptr;
using std::string;
using std::vector;

View 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;

View 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;

View 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;

View 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 {

View 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;

View File

@ -60,7 +60,7 @@ class Annotation;
class Decoder;
class Row;
}
}
} // namespace data
namespace widgets {
class DecoderGroupBox;

View 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;

View 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;