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:
#include <pv/prop/string.hpp>
using boost::none;
#include <pv/prop/string.hpp>
using boost::none;
using std::map;
using std::pair;
using std::shared_ptr;
using std::map;
using std::pair;
using std::shared_ptr;
vector< pair<Glib::VariantBase, QString> > values;
for (GSList *l = option->values; l; l = l->next) {
Glib::VariantBase var = Glib::VariantBase((GVariant*)l->data, true);
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));
}
return shared_ptr<Property>(new Enum(name, desc, values, getter, setter));
using boost::optional;
using std::function;
using boost::optional;
using std::function;
using std::pair;
using std::set;
using std::shared_ptr;
using std::pair;
using std::set;
using std::shared_ptr;
vector< pair<Glib::VariantBase, QString> > values;
while ((iter.next_value(gvar)))
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)));
properties_.push_back(shared_ptr<Property>(new Enum(name, desc, values,
getter, setter)));
using std::map;
using std::pair;
using std::shared_ptr;
using std::map;
using std::pair;
using std::shared_ptr;
{
vector< pair<VariantBase, QString> > enum_vals;
for (VariantBase var : values)
{
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));
}
return shared_ptr<Property>(new Enum(name, desc, enum_vals, getter, setter));
}
#include <pv/data/decodesignal.hpp>
using pv::data::DecodeChannel;
#include <pv/data/decodesignal.hpp>
using pv::data::DecodeChannel;
using std::string;
namespace pv {
using std::string;
namespace pv {
#include <glib.h>
using std::map;
#include <glib.h>
using std::map;
-using std::set;
-using std::shared_ptr;
using std::string;
using std::vector;
using std::string;
using std::vector;
using std::map;
using std::mutex;
using std::pair;
using std::map;
using std::mutex;
using std::pair;
-using std::unordered_set;
using std::vector;
using std::shared_ptr;
using std::vector;
using std::shared_ptr;
using std::unique_ptr;
using std::vector;
using std::unique_ptr;
using std::vector;
-using Glib::ustring;
-using Glib::Variant;
using Glib::VariantBase;
using sigrok::ConfigKey;
using Glib::VariantBase;
using sigrok::ConfigKey;
using std::bind;
using std::dynamic_pointer_cast;
using std::make_shared;
using std::bind;
using std::dynamic_pointer_cast;
using std::make_shared;
using std::placeholders::_1;
using std::shared_ptr;
using std::string;
using std::placeholders::_1;
using std::shared_ptr;
using std::string;
#include <cstdio>
#include <limits>
#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 {
using std::shared_ptr;
namespace pv {
using std::all_of;
using std::make_pair;
using std::max;
using std::all_of;
using std::make_pair;
using std::max;
using std::min;
using std::out_of_range;
using std::pair;
using std::shared_ptr;
using std::min;
using std::out_of_range;
using std::pair;
using std::shared_ptr;
-using std::unordered_set;
using std::vector;
using pv::data::decode::Annotation;
using std::vector;
using pv::data::decode::Annotation;
class Decoder;
class Row;
}
class Decoder;
class Row;
}
namespace widgets {
class DecoderGroupBox;
namespace widgets {
class DecoderGroupBox;
using std::back_inserter;
using std::copy_if;
using std::count_if;
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;
using std::inserter;
using std::max;
using std::make_pair;
using std::back_inserter;
using std::copy;
using std::dynamic_pointer_cast;
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;
using std::shared_ptr;
using std::stable_sort;
using std::vector;