Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix clang_tidy #3295

Merged
merged 4 commits into from
Oct 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dbms/src/Common/RadixSort.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
*/
struct RadixSortMallocAllocator
{
void * allocate(size_t size)
static void * allocate(size_t size)
{
return malloc(size);
}

void deallocate(void * ptr, size_t /*size*/)
static void deallocate(void * ptr, size_t /*size*/)
{
return free(ptr);
}
Expand Down
4 changes: 2 additions & 2 deletions dbms/src/Common/RecycledAllocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace DB
class RecycledAllocator : public boost::noncopyable
{
public:
RecycledAllocator(const size_t initial_size = 65536, const size_t growth_factor = 2)
explicit RecycledAllocator(const size_t initial_size = 65536, const size_t growth_factor = 2)
: arena(initial_size, growth_factor)
{}

Expand All @@ -25,4 +25,4 @@ class RecycledAllocator : public boost::noncopyable
ArenaWithFreeLists arena;
};

} // namespace DB
} // namespace DB
4 changes: 2 additions & 2 deletions dbms/src/Common/RedactHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void Redact::setRedactLog(bool v)
Redact::REDACT_LOG.store(v, std::memory_order_relaxed);
}

std::string Redact::handleToDebugString(const DB::HandleID handle)
std::string Redact::handleToDebugString(DB::HandleID handle)
{
if (Redact::REDACT_LOG.load(std::memory_order_relaxed))
return "?";
Expand All @@ -30,7 +30,7 @@ std::string Redact::keyToHexString(const char * key, size_t size)
char * pos = buf.data();
for (size_t i = 0; i < size; ++i)
{
writeHexByteUppercase((UInt8)(key[i]), pos);
writeHexByteUppercase(static_cast<UInt8>(key[i]), pos);
pos += 2;
}
return buf;
Expand Down
4 changes: 2 additions & 2 deletions dbms/src/Common/RedactHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Redact
public:
static void setRedactLog(bool v);

static std::string handleToDebugString(const DB::HandleID handle);
static std::string handleToDebugString(DB::HandleID handle);
static std::string keyToDebugString(const char * key, size_t size);

static std::string keyToHexString(const char * key, size_t size);
Expand All @@ -25,7 +25,7 @@ class Redact
friend class DB::FieldVisitorToDebugString;

protected:
Redact() {}
Redact() = default;

private:
// Log user data to log only when this flag is set to false.
Expand Down
2 changes: 1 addition & 1 deletion dbms/src/Common/SharedLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void * SharedLibrary::getImpl(const std::string & name, bool no_throw)
{
dlerror();

auto res = dlsym(handle, name.c_str());
auto * res = dlsym(handle, name.c_str());

if (char * error = dlerror())
{
Expand Down
2 changes: 1 addition & 1 deletion dbms/src/Common/SimpleIncrement.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct SimpleIncrement
{
std::atomic<UInt64> value;

SimpleIncrement(UInt64 start = 0)
explicit SimpleIncrement(UInt64 start = 0)
: value(start)
{}

Expand Down