Skip to content

Commit c844c4b

Browse files
committed
Prepare for clang20
1 parent 6239996 commit c844c4b

File tree

16 files changed

+34
-23
lines changed

16 files changed

+34
-23
lines changed

base/base/find_symbols.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ inline const char * find_first_symbols_sse42(const char * const begin, const cha
274274
const char * pos = begin;
275275

276276
#if defined(__SSE4_2__)
277-
constexpr int mode = _SIDD_UBYTE_OPS | _SIDD_CMP_EQUAL_ANY | _SIDD_LEAST_SIGNIFICANT;
277+
constexpr int mode = _SIDD_UBYTE_OPS | _SIDD_CMP_EQUAL_ANY | _SIDD_LEAST_SIGNIFICANT; // NOLINT(misc-redundant-expression)
278278

279279
__m128i set = _mm_setr_epi8(c01, c02, c03, c04, c05, c06, c07, c08, c09, c10, c11, c12, c13, c14, c15, c16);
280280

src/Columns/ColumnAggregateFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ void ColumnAggregateFunction::doInsertRangeFrom(const IColumn & from, size_t sta
300300

301301
size_t old_size = data.size();
302302
data.resize(old_size + length);
303-
memcpy(data.data() + old_size, &from_concrete.data[start], length * sizeof(data[0]));
303+
memcpy(data.data() + old_size, &from_concrete.data[start], length * sizeof(data[0])); // NOLINT(bugprone-bitwise-pointer-cast)
304304
}
305305
}
306306

src/Coordination/tests/gtest_coordination_storage.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -879,11 +879,11 @@ TYPED_TEST(CoordinationTest, TestUncommittedStateBasicCrud)
879879
storage.preprocessRequest(create_request, 0, 0, 1);
880880
storage.preprocessRequest(create_request, 0, 0, 2);
881881

882-
ASSERT_FALSE(get_committed_data());
882+
ASSERT_EQ(get_committed_data(), std::nullopt);
883883

884884
const auto after_create_get = preprocess_get(3);
885885

886-
ASSERT_FALSE(get_committed_data());
886+
ASSERT_EQ(get_committed_data(), std::nullopt);
887887

888888
const auto set_request = std::make_shared<ZooKeeperSetRequest>();
889889
set_request->path = path;
@@ -892,7 +892,7 @@ TYPED_TEST(CoordinationTest, TestUncommittedStateBasicCrud)
892892

893893
const auto after_set_get = preprocess_get(5);
894894

895-
ASSERT_FALSE(get_committed_data());
895+
ASSERT_EQ(get_committed_data(), std::nullopt);
896896

897897
const auto remove_request = std::make_shared<ZooKeeperRemoveRequest>();
898898
remove_request->path = path;
@@ -901,7 +901,7 @@ TYPED_TEST(CoordinationTest, TestUncommittedStateBasicCrud)
901901

902902
const auto after_remove_get = preprocess_get(8);
903903

904-
ASSERT_FALSE(get_committed_data());
904+
ASSERT_EQ(get_committed_data(), std::nullopt);
905905

906906
{
907907
const auto responses = storage.processRequest(create_request, 0, 1);
@@ -957,7 +957,7 @@ TYPED_TEST(CoordinationTest, TestUncommittedStateBasicCrud)
957957
ASSERT_EQ(get_response.error, Error::ZNONODE);
958958
}
959959

960-
ASSERT_FALSE(get_committed_data());
960+
ASSERT_EQ(get_committed_data(), std::nullopt);
961961
}
962962

963963
#endif

src/Daemon/SentryWriter.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@ void SentryWriter::resetInstance() {}
262262

263263
SentryWriter::SentryWriter(Poco::Util::LayeredConfiguration &) {}
264264
SentryWriter::~SentryWriter() = default;
265-
void SentryWriter::sendError(Type, int, const std::string &, const FramePointers &, size_t, size_t) {}
266265
void SentryWriter::onSignal(int, const std::string &, const FramePointers &, size_t, size_t) {}
267266
void SentryWriter::onException(int, const std::string &, const FramePointers &, size_t, size_t) {}
268267

src/Daemon/SentryWriter.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#pragma once
22

3+
#include "config.h"
4+
35
#include <string>
46
#include <Common/StackTrace.h>
57

@@ -49,13 +51,14 @@ class SentryWriter
4951
~SentryWriter();
5052

5153
private:
54+
explicit SentryWriter(Poco::Util::LayeredConfiguration & config);
55+
56+
#if USE_SENTRY
5257
static std::unique_ptr<SentryWriter> instance;
5358
bool initialized = false;
5459
bool anonymize = false;
5560
std::string server_data_path;
5661

57-
explicit SentryWriter(Poco::Util::LayeredConfiguration & config);
58-
5962
enum Type
6063
{
6164
SIGNAL,
@@ -71,4 +74,5 @@ class SentryWriter
7174
const FramePointers & frame_pointers,
7275
size_t offset,
7376
size_t size);
77+
#endif
7478
};

src/Functions/padString.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ namespace
6161
{
6262
if (num_chars <= step)
6363
{
64-
writeSlice(StringSource::Slice{std::bit_cast<const UInt8 *>(pad_string.data()), numCharsToNumBytes(num_chars)}, res_sink);
64+
writeSlice(StringSource::Slice{reinterpret_cast<const UInt8 *>(pad_string.data()), numCharsToNumBytes(num_chars)}, res_sink);
6565
break;
6666
}
67-
writeSlice(StringSource::Slice{std::bit_cast<const UInt8 *>(pad_string.data()), numCharsToNumBytes(step)}, res_sink);
67+
writeSlice(StringSource::Slice{reinterpret_cast<const UInt8 *>(pad_string.data()), numCharsToNumBytes(step)}, res_sink);
6868
num_chars -= step;
6969
}
7070
}

src/IO/AzureBlobStorage/copyAzureBlobStorageFile.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ namespace
6161
, schedule(schedule_)
6262
, log(log_)
6363
, max_single_part_upload_size(settings_->max_single_part_upload_size)
64+
, normal_part_size(0)
6465
{
6566
}
6667

src/IO/S3/copyS3File.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ namespace
8484
, schedule(schedule_)
8585
, blob_storage_log(blob_storage_log_)
8686
, log(log_)
87+
, num_parts(0)
88+
, normal_part_size(0)
8789
{
8890
}
8991

src/Interpreters/tests/gtest_filecache.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ TEST_F(FileCacheTest, LRUPolicy)
381381
const size_t file_size = INT_MAX; // the value doesn't really matter because boundary_alignment == 1.
382382

383383

384-
const auto user = FileCache::getCommonUser();
384+
const auto & user = FileCache::getCommonUser();
385385
{
386386
std::cerr << "Step 1\n";
387387
auto cache = DB::FileCache("1", settings);
@@ -839,7 +839,7 @@ TEST_F(FileCacheTest, writeBuffer)
839839

840840
FileCache cache("6", settings);
841841
cache.initialize();
842-
const auto user = FileCache::getCommonUser();
842+
const auto & user = FileCache::getCommonUser();
843843

844844
auto write_to_cache = [&, this](const String & key, const Strings & data, bool flush, ReadBufferPtr * out_read_buffer = nullptr)
845845
{
@@ -973,7 +973,7 @@ try
973973
DB::FileCache file_cache("7", settings);
974974
file_cache.initialize();
975975

976-
const auto user = FileCache::getCommonUser();
976+
const auto & user = FileCache::getCommonUser();
977977
auto tmp_data_scope = std::make_shared<TemporaryDataOnDiskScope>(&file_cache, TemporaryDataOnDiskSettings{});
978978

979979
auto some_data_holder = file_cache.getOrSet(FileCacheKey::fromPath("some_data"), 0, 5_KiB, 5_KiB, CreateFileSegmentSettings{}, 0, user);
@@ -1129,7 +1129,7 @@ TEST_F(FileCacheTest, CachedReadBuffer)
11291129
cache->initialize();
11301130

11311131
auto key = DB::FileCacheKey::fromPath(file_path);
1132-
const auto user = FileCache::getCommonUser();
1132+
const auto & user = FileCache::getCommonUser();
11331133

11341134
{
11351135
auto cached_buffer = std::make_shared<CachedOnDiskReadBufferFromFile>(
@@ -1241,7 +1241,7 @@ TEST_F(FileCacheTest, SLRUPolicy)
12411241

12421242
const size_t file_size = -1; // the value doesn't really matter because boundary_alignment == 1.
12431243
size_t file_cache_name = 0;
1244-
const auto user = FileCache::getCommonUser();
1244+
const auto & user = FileCache::getCommonUser();
12451245

12461246
{
12471247
auto cache = DB::FileCache(std::to_string(++file_cache_name), settings);
@@ -1431,7 +1431,7 @@ TEST_F(FileCacheTest, FileCacheGetOrSet)
14311431
settings[FileCacheSetting::max_file_segment_size] = 25;
14321432
settings[FileCacheSetting::load_metadata_asynchronously] = false;
14331433

1434-
const auto user = FileCache::getCommonUser();
1434+
const auto & user = FileCache::getCommonUser();
14351435
const auto key = DB::FileCacheKey::fromPath("key1");
14361436

14371437
auto cache = DB::FileCache("1", settings);

src/Processors/Formats/Impl/AvroRowInputFormat.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,12 @@ class AvroDeserializer
8686

8787
explicit Action(SkipFn skip_fn_)
8888
: type(Skip)
89+
, target_column_idx(0)
8990
, skip_fn(skip_fn_) {}
9091

9192
Action(const std::vector<size_t> & nested_column_indexes_, const std::vector<DeserializeFn> & nested_deserializers_)
9293
: type(Nested)
94+
, target_column_idx(0)
9395
, nested_column_indexes(nested_column_indexes_)
9496
, nested_deserializers(nested_deserializers_) {}
9597

@@ -130,6 +132,7 @@ class AvroDeserializer
130132
private:
131133
Action(Type type_, std::vector<Action> actions_)
132134
: type(type_)
135+
, target_column_idx(0)
133136
, actions(actions_) {}
134137

135138
void deserializeNested(MutableColumns & columns, avro::Decoder & decoder, RowReadExtension & ext) const;

0 commit comments

Comments
 (0)