Fix clang-tidy warnings (from clang-15)

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
Azat Khuzhin 2022-09-10 09:58:49 +02:00
parent 46eafb4732
commit 4e3135383b
8 changed files with 13 additions and 9 deletions

View File

@ -22,6 +22,8 @@ Checks: '*,
-bugprone-implicit-widening-of-multiplication-result, -bugprone-implicit-widening-of-multiplication-result,
-bugprone-narrowing-conversions, -bugprone-narrowing-conversions,
-bugprone-not-null-terminated-result, -bugprone-not-null-terminated-result,
-bugprone-unchecked-optional-access,
-bugprone-assignment-in-if-condition,
-cert-dcl16-c, -cert-dcl16-c,
-cert-err58-cpp, -cert-err58-cpp,
@ -103,6 +105,7 @@ Checks: '*,
-misc-no-recursion, -misc-no-recursion,
-misc-non-private-member-variables-in-classes, -misc-non-private-member-variables-in-classes,
-misc-const-correctness,
-modernize-avoid-c-arrays, -modernize-avoid-c-arrays,
-modernize-concat-nested-namespaces, -modernize-concat-nested-namespaces,
@ -114,6 +117,7 @@ Checks: '*,
-modernize-use-nodiscard, -modernize-use-nodiscard,
-modernize-use-override, -modernize-use-override,
-modernize-use-trailing-return-type, -modernize-use-trailing-return-type,
-modernize-macro-to-enum,
-performance-inefficient-string-concatenation, -performance-inefficient-string-concatenation,
-performance-no-int-to-ptr, -performance-no-int-to-ptr,
@ -135,6 +139,7 @@ Checks: '*,
-readability-suspicious-call-argument, -readability-suspicious-call-argument,
-readability-uppercase-literal-suffix, -readability-uppercase-literal-suffix,
-readability-use-anyofallof, -readability-use-anyofallof,
-readability-simplify-boolean-expr,
-zirkon-*, -zirkon-*,
' '

View File

@ -248,6 +248,7 @@ BackupCoordinationReplicatedTables::getMutations(const String & table_shared_id,
return {}; return {};
std::vector<MutationInfo> res; std::vector<MutationInfo> res;
res.reserve(table_info.mutations.size());
for (const auto & [mutation_id, mutation_entry] : table_info.mutations) for (const auto & [mutation_id, mutation_entry] : table_info.mutations)
res.emplace_back(MutationInfo{mutation_id, mutation_entry}); res.emplace_back(MutationInfo{mutation_id, mutation_entry});
return res; return res;

View File

@ -722,5 +722,3 @@ public:
return res; return res;
} }
}; };
template <typename Key, typename Payload> constexpr size_t ArrayCache<Key, Payload>::min_chunk_size;

View File

@ -14,7 +14,7 @@
namespace std // NOLINT(cert-dcl58-cpp) namespace std // NOLINT(cert-dcl58-cpp)
{ {
using namespace experimental::coroutines_v1; using namespace experimental::coroutines_v1; // NOLINT(cert-dcl58-cpp)
} }
#if __has_warning("-Wdeprecated-experimental-coroutine") #if __has_warning("-Wdeprecated-experimental-coroutine")

View File

@ -233,7 +233,7 @@ void ReadBufferFromFileDescriptor::rewind()
/// Assuming file descriptor supports 'select', check that we have data to read or wait until timeout. /// Assuming file descriptor supports 'select', check that we have data to read or wait until timeout.
bool ReadBufferFromFileDescriptor::poll(size_t timeout_microseconds) bool ReadBufferFromFileDescriptor::poll(size_t timeout_microseconds) const
{ {
fd_set fds; fd_set fds;
FD_ZERO(&fds); FD_ZERO(&fds);

View File

@ -66,7 +66,7 @@ public:
private: private:
/// Assuming file descriptor supports 'select', check that we have data to read or wait until timeout. /// Assuming file descriptor supports 'select', check that we have data to read or wait until timeout.
bool poll(size_t timeout_microseconds); bool poll(size_t timeout_microseconds) const;
}; };

View File

@ -255,7 +255,7 @@ private:
class HDFSSource::URISIterator::Impl class HDFSSource::URISIterator::Impl
{ {
public: public:
explicit Impl(const std::vector<const String> & uris_, ContextPtr context) explicit Impl(const std::vector<String> & uris_, ContextPtr context)
{ {
auto path_and_uri = getPathFromUriAndUriWithoutPath(uris_[0]); auto path_and_uri = getPathFromUriAndUriWithoutPath(uris_[0]);
HDFSBuilderWrapper builder = createHDFSBuilder(path_and_uri.second + "/", context->getGlobalContext()->getConfigRef()); HDFSBuilderWrapper builder = createHDFSBuilder(path_and_uri.second + "/", context->getGlobalContext()->getConfigRef());
@ -293,7 +293,7 @@ String HDFSSource::DisclosedGlobIterator::next()
return pimpl->next(); return pimpl->next();
} }
HDFSSource::URISIterator::URISIterator(const std::vector<const String> & uris_, ContextPtr context) HDFSSource::URISIterator::URISIterator(const std::vector<String> & uris_, ContextPtr context)
: pimpl(std::make_shared<HDFSSource::URISIterator::Impl>(uris_, context)) : pimpl(std::make_shared<HDFSSource::URISIterator::Impl>(uris_, context))
{ {
} }

View File

@ -86,7 +86,7 @@ private:
const String & format_name, const String & format_name,
const ContextPtr & ctx); const ContextPtr & ctx);
std::vector<const String> uris; std::vector<String> uris;
String format_name; String format_name;
String compression_method; String compression_method;
const bool distributed_processing; const bool distributed_processing;
@ -116,7 +116,7 @@ public:
class URISIterator class URISIterator
{ {
public: public:
URISIterator(const std::vector<const String> & uris_, ContextPtr context); URISIterator(const std::vector<String> & uris_, ContextPtr context);
String next(); String next();
private: private:
class Impl; class Impl;