mirror of
https://github.com/esphome/esphome.git
synced 2024-11-23 23:48:11 +01:00
fix clang-tidy
This commit is contained in:
parent
cad725b621
commit
865f393c9d
3 changed files with 20 additions and 19 deletions
|
@ -85,7 +85,6 @@ Checks: >-
|
|||
-readability-redundant-string-init,
|
||||
-readability-uppercase-literal-suffix,
|
||||
-readability-use-anyofallof,
|
||||
-readability-named-parameter,
|
||||
-readability-braces-around-statements,
|
||||
-performance-unnecessary-value-param,
|
||||
WarningsAsErrors: '*'
|
||||
|
|
|
@ -82,7 +82,7 @@ template<typename... Ts> class Condition {
|
|||
}
|
||||
|
||||
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)...);
|
||||
}
|
||||
};
|
||||
|
@ -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)...);
|
||||
}
|
||||
void play_next_tuple_(const std::tuple<Ts...> &tuple) {
|
||||
|
@ -223,7 +223,9 @@ template<typename... Ts> class ActionList {
|
|||
}
|
||||
|
||||
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_end_{nullptr};
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace esphome {
|
|||
|
||||
struct nullopt_t { // NOLINT
|
||||
struct init {}; // NOLINT
|
||||
nullopt_t(init) {}
|
||||
nullopt_t(init /*unused*/) {}
|
||||
};
|
||||
|
||||
// extra parenthesis to prevent the most vexing parse:
|
||||
|
@ -42,13 +42,13 @@ template<typename T> class optional { // NOLINT
|
|||
|
||||
optional() {}
|
||||
|
||||
optional(nullopt_t) {}
|
||||
optional(nullopt_t /*unused*/) {}
|
||||
|
||||
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()) {}
|
||||
|
||||
optional &operator=(nullopt_t) {
|
||||
optional &operator=(nullopt_t /*unused*/) {
|
||||
reset();
|
||||
return *this;
|
||||
}
|
||||
|
@ -130,29 +130,29 @@ template<typename T, typename U> inline bool operator>=(optional<T> const &x, op
|
|||
|
||||
// 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
|
||||
|
||||
|
|
Loading…
Reference in a new issue