From 24757a381d1c058ccb760d48e92090caebaeeb99 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Thu, 16 Nov 2023 15:08:58 -0800 Subject: [PATCH] Make `impeller/{archivist|compiler|core|entity}/...` compatible with `.clang-tidy`. --- impeller/archivist/archive.h | 4 ++-- impeller/archivist/archive_database.h | 2 +- impeller/archivist/archive_vector.h | 2 +- impeller/compiler/compiler_backend.h | 2 +- impeller/compiler/logger.h | 2 +- impeller/core/vertex_buffer.h | 2 +- .../entity/contents/filters/inputs/texture_filter_input.h | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/impeller/archivist/archive.h b/impeller/archivist/archive.h index a232bf4c54441..52206afb0f4ac 100644 --- a/impeller/archivist/archive.h +++ b/impeller/archivist/archive.h @@ -21,7 +21,7 @@ class ArchiveDatabase; class Archive { public: - Archive(const std::string& path); + explicit Archive(const std::string& path); ~Archive(); @@ -45,7 +45,7 @@ class Archive { template ::value>> - [[nodiscard]] size_t Read(UnarchiveStep stepper) { + [[nodiscard]] size_t Read(const UnarchiveStep& stepper) { const ArchiveDef& def = T::kArchiveDefinition; return UnarchiveInstances(def, stepper); } diff --git a/impeller/archivist/archive_database.h b/impeller/archivist/archive_database.h index 57696313c7ec8..561b6d6e57b4d 100644 --- a/impeller/archivist/archive_database.h +++ b/impeller/archivist/archive_database.h @@ -22,7 +22,7 @@ struct ArchiveDef; /// class ArchiveDatabase { public: - ArchiveDatabase(const std::string& filename); + explicit ArchiveDatabase(const std::string& filename); ~ArchiveDatabase(); diff --git a/impeller/archivist/archive_vector.h b/impeller/archivist/archive_vector.h index e99e39d362098..9ea9d11884837 100644 --- a/impeller/archivist/archive_vector.h +++ b/impeller/archivist/archive_vector.h @@ -28,7 +28,7 @@ class ArchiveVector : public Archivable { ArchiveVector(); - ArchiveVector(std::vector keys); + explicit ArchiveVector(std::vector keys); ArchiveVector(const ArchiveVector&) = delete; diff --git a/impeller/compiler/compiler_backend.h b/impeller/compiler/compiler_backend.h index e06ec4ccfc461..ea278014398b1 100644 --- a/impeller/compiler/compiler_backend.h +++ b/impeller/compiler/compiler_backend.h @@ -47,7 +47,7 @@ struct CompilerBackend { spirv_cross::Compiler* GetCompiler(); - operator bool() const; + explicit operator bool() const; enum class ExtendedResourceIndex { kPrimary, diff --git a/impeller/compiler/logger.h b/impeller/compiler/logger.h index 0c478b75d0339..a0642ba1f2239 100644 --- a/impeller/compiler/logger.h +++ b/impeller/compiler/logger.h @@ -15,7 +15,7 @@ namespace compiler { class AutoLogger { public: - AutoLogger(std::stringstream& logger) : logger_(logger) {} + explicit AutoLogger(std::stringstream& logger) : logger_(logger) {} ~AutoLogger() { logger_ << std::endl; diff --git a/impeller/core/vertex_buffer.h b/impeller/core/vertex_buffer.h index 1c62fc8b3b859..5ef934f4b82bf 100644 --- a/impeller/core/vertex_buffer.h +++ b/impeller/core/vertex_buffer.h @@ -17,7 +17,7 @@ struct VertexBuffer { size_t vertex_count = 0u; IndexType index_type = IndexType::kUnknown; - constexpr operator bool() const { + constexpr explicit operator bool() const { return static_cast(vertex_buffer) && (index_type == IndexType::kNone || static_cast(index_buffer)); } diff --git a/impeller/entity/contents/filters/inputs/texture_filter_input.h b/impeller/entity/contents/filters/inputs/texture_filter_input.h index dd4443e14ac8a..757f570800d16 100644 --- a/impeller/entity/contents/filters/inputs/texture_filter_input.h +++ b/impeller/entity/contents/filters/inputs/texture_filter_input.h @@ -31,8 +31,8 @@ class TextureFilterInput final : public FilterInput { Matrix GetLocalTransform(const Entity& entity) const override; private: - TextureFilterInput(std::shared_ptr texture, - Matrix local_transform = Matrix()); + explicit TextureFilterInput(std::shared_ptr texture, + Matrix local_transform = Matrix()); std::shared_ptr texture_; Matrix local_transform_;