fix clang-tidy

This commit is contained in:
Tomasz Duda 2024-08-13 23:52:09 +02:00
parent cad725b621
commit 865f393c9d
3 changed files with 20 additions and 19 deletions

View file

@ -85,7 +85,6 @@ Checks: >-
-readability-redundant-string-init, -readability-redundant-string-init,
-readability-uppercase-literal-suffix, -readability-uppercase-literal-suffix,
-readability-use-anyofallof, -readability-use-anyofallof,
-readability-named-parameter,
-readability-braces-around-statements, -readability-braces-around-statements,
-performance-unnecessary-value-param, -performance-unnecessary-value-param,
WarningsAsErrors: '*' WarningsAsErrors: '*'

View file

@ -82,7 +82,7 @@ template<typename... Ts> class Condition {
} }
protected: protected:
template<int... S> bool check_tuple_(const std::tuple<Ts...> &tuple, seq<S...>) { template<int... S> bool check_tuple_(const std::tuple<Ts...> &tuple, seq<S...> /*unused*/) {
return this->check(std::get<S>(tuple)...); return this->check(std::get<S>(tuple)...);
} }
}; };
@ -156,7 +156,7 @@ template<typename... Ts> class Action {
} }
} }
} }
template<int... S> void play_next_tuple_(const std::tuple<Ts...> &tuple, seq<S...>) { template<int... S> void play_next_tuple_(const std::tuple<Ts...> &tuple, seq<S...> /*unused*/) {
this->play_next_(std::get<S>(tuple)...); this->play_next_(std::get<S>(tuple)...);
} }
void play_next_tuple_(const std::tuple<Ts...> &tuple) { void play_next_tuple_(const std::tuple<Ts...> &tuple) {
@ -223,7 +223,9 @@ template<typename... Ts> class ActionList {
} }
protected: protected:
template<int... S> void play_tuple_(const std::tuple<Ts...> &tuple, seq<S...>) { this->play(std::get<S>(tuple)...); } template<int... S> void play_tuple_(const std::tuple<Ts...> &tuple, seq<S...> /*unused*/) {
this->play(std::get<S>(tuple)...);
}
Action<Ts...> *actions_begin_{nullptr}; Action<Ts...> *actions_begin_{nullptr};
Action<Ts...> *actions_end_{nullptr}; Action<Ts...> *actions_end_{nullptr};

View file

@ -24,7 +24,7 @@ namespace esphome {
struct nullopt_t { // NOLINT struct nullopt_t { // NOLINT
struct init {}; // NOLINT struct init {}; // NOLINT
nullopt_t(init) {} nullopt_t(init /*unused*/) {}
}; };
// extra parenthesis to prevent the most vexing parse: // extra parenthesis to prevent the most vexing parse:
@ -42,13 +42,13 @@ template<typename T> class optional { // NOLINT
optional() {} optional() {}
optional(nullopt_t) {} optional(nullopt_t /*unused*/) {}
optional(T const &arg) : has_value_(true), value_(arg) {} // NOLINT optional(T const &arg) : has_value_(true), value_(arg) {} // NOLINT
template<class U> optional(optional<U> const &other) : has_value_(other.has_value()), value_(other.value()) {} template<class U> optional(optional<U> const &other) : has_value_(other.has_value()), value_(other.value()) {}
optional &operator=(nullopt_t) { optional &operator=(nullopt_t /*unused*/) {
reset(); reset();
return *this; return *this;
} }
@ -130,29 +130,29 @@ template<typename T, typename U> inline bool operator>=(optional<T> const &x, op
// Comparison with nullopt // Comparison with nullopt
template<typename T> inline bool operator==(optional<T> const &x, nullopt_t) { return (!x); } template<typename T> inline bool operator==(optional<T> const &x, nullopt_t /*unused*/) { return (!x); }
template<typename T> inline bool operator==(nullopt_t, optional<T> const &x) { return (!x); } template<typename T> inline bool operator==(nullopt_t /*unused*/, optional<T> const &x) { return (!x); }
template<typename T> inline bool operator!=(optional<T> const &x, nullopt_t) { return bool(x); } template<typename T> inline bool operator!=(optional<T> const &x, nullopt_t /*unused*/) { return bool(x); }
template<typename T> inline bool operator!=(nullopt_t, optional<T> const &x) { return bool(x); } template<typename T> inline bool operator!=(nullopt_t /*unused*/, optional<T> const &x) { return bool(x); }
template<typename T> inline bool operator<(optional<T> const &, nullopt_t) { return false; } template<typename T> inline bool operator<(optional<T> const & /*unused*/, nullopt_t /*unused*/) { return false; }
template<typename T> inline bool operator<(nullopt_t, optional<T> const &x) { return bool(x); } template<typename T> inline bool operator<(nullopt_t /*unused*/, optional<T> const &x) { return bool(x); }
template<typename T> inline bool operator<=(optional<T> const &x, nullopt_t) { return (!x); } template<typename T> inline bool operator<=(optional<T> const &x, nullopt_t /*unused*/) { return (!x); }
template<typename T> inline bool operator<=(nullopt_t, optional<T> const &) { return true; } template<typename T> inline bool operator<=(nullopt_t /*unused*/, optional<T> const & /*unused*/) { return true; }
template<typename T> inline bool operator>(optional<T> const &x, nullopt_t) { return bool(x); } template<typename T> inline bool operator>(optional<T> const &x, nullopt_t /*unused*/) { return bool(x); }
template<typename T> inline bool operator>(nullopt_t, optional<T> const &) { return false; } template<typename T> inline bool operator>(nullopt_t /*unused*/, optional<T> const & /*unused*/) { return false; }
template<typename T> inline bool operator>=(optional<T> const &, nullopt_t) { return true; } template<typename T> inline bool operator>=(optional<T> const & /*unused*/, nullopt_t /*unused*/) { return true; }
template<typename T> inline bool operator>=(nullopt_t, optional<T> const &x) { return (!x); } template<typename T> inline bool operator>=(nullopt_t /*unused*/, optional<T> const &x) { return (!x); }
// Comparison with T // Comparison with T