diff --git a/.clang-tidy b/.clang-tidy index 4f16b6456..6a0bbde4b 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -13,7 +13,6 @@ Checks: > readability-*, -bugprone-casting-through-void, -bugprone-easily-swappable-parameters, - -bugprone-implicit-widening-of-multiplication-result, -cppcoreguidelines-avoid-magic-numbers, -cppcoreguidelines-non-private-member-variables-in-classes, -cppcoreguidelines-owning-memory, diff --git a/tasks/all/example/func_tests/main.cpp b/tasks/all/example/func_tests/main.cpp index b506003ab..cc74607f0 100644 --- a/tasks/all/example/func_tests/main.cpp +++ b/tasks/all/example/func_tests/main.cpp @@ -1,5 +1,6 @@ #include +#include #include #include #include @@ -15,7 +16,7 @@ class NesterovATestTaskAll : public ::testing::TestWithParam { std::string abs_path = ppc::util::GetAbsolutePath("all/example/data/pic_all.jpg"); data = stbi_load(abs_path.c_str(), &width, &height, &channels, 0); ASSERT_TRUE(data != nullptr) << "Failed to load image: " << stbi_failure_reason(); - img = std::vector(data, data + (width * height * channels)); + img = std::vector(data, data + (static_cast(width) * height * channels)); stbi_image_free(data); ASSERT_EQ(width, height); @@ -28,10 +29,10 @@ class NesterovATestTaskAll : public ::testing::TestWithParam { TEST_P(NesterovATestTaskAll, MatmulFromPic) { int divider = GetParam(); - const int k_count = (width + height) / divider; + const size_t k_count = (width + height) / divider; std::vector in(k_count * k_count, 0); - for (int i = 0; i < k_count; i++) { + for (size_t i = 0; i < k_count; i++) { in[(i * k_count) + i] = 1; } @@ -45,10 +46,10 @@ TEST_P(NesterovATestTaskAll, MatmulFromPic) { TEST_P(NesterovATestTaskAll, MatMulUtilFromPic) { int divider = GetParam(); - const int k_count = (width + height) / divider; + const size_t k_count = (width + height) / divider; std::vector in(k_count * k_count, 0); - for (int i = 0; i < k_count; i++) { + for (size_t i = 0; i < k_count; i++) { in[(i * k_count) + i] = 1; } std::vector out(k_count * k_count, 0); @@ -59,10 +60,10 @@ TEST_P(NesterovATestTaskAll, MatMulUtilFromPic) { TEST_P(NesterovATestTaskAll, MatMulTBBUtilFromPic) { int divider = GetParam(); - const int k_count = (width + height) / divider; + const size_t k_count = (width + height) / divider; std::vector in(k_count * k_count, 0); - for (int i = 0; i < k_count; i++) { + for (size_t i = 0; i < k_count; i++) { in[(i * k_count) + i] = 1; } std::vector out(k_count * k_count, 0); diff --git a/tasks/all/example/perf_tests/main.cpp b/tasks/all/example/perf_tests/main.cpp index 8c84f284e..226b57fb8 100644 --- a/tasks/all/example/perf_tests/main.cpp +++ b/tasks/all/example/perf_tests/main.cpp @@ -2,6 +2,7 @@ #include #include +#include #include #include @@ -11,12 +12,12 @@ class NesterovAllRunTest : public ::testing::TestWithParam { protected: - static constexpr int kCount = 400; + static constexpr size_t kCount = 400; std::vector input_data; void SetUp() override { input_data.assign(kCount * kCount, 0); - for (int i = 0; i < kCount; ++i) { + for (size_t i = 0; i < kCount; ++i) { input_data[(i * kCount) + i] = 1; } } diff --git a/tasks/mpi/example/perf_tests/main.cpp b/tasks/mpi/example/perf_tests/main.cpp index 336b661bf..ec70c79df 100644 --- a/tasks/mpi/example/perf_tests/main.cpp +++ b/tasks/mpi/example/perf_tests/main.cpp @@ -14,7 +14,7 @@ class NesterovATaskMPITest : public ::testing::TestWithParam { protected: static void RunTest(ppc::core::PerfResults::TypeOfRunning mode) { - constexpr int kCount = 500; + constexpr size_t kCount = 500; // Create data std::vector in(kCount * kCount, 0); diff --git a/tasks/omp/example/perf_tests/main.cpp b/tasks/omp/example/perf_tests/main.cpp index 6097e0c35..7b2db214e 100644 --- a/tasks/omp/example/perf_tests/main.cpp +++ b/tasks/omp/example/perf_tests/main.cpp @@ -13,7 +13,7 @@ class NesterovTaskOMPTest : public ::testing::TestWithParam { protected: static void RunTest(ppc::core::PerfResults::TypeOfRunning mode) { - constexpr int kCount = 300; + constexpr size_t kCount = 300; // Create data std::vector in(kCount * kCount, 0); diff --git a/tasks/seq/example/perf_tests/main.cpp b/tasks/seq/example/perf_tests/main.cpp index 58462f01a..cfc12fc06 100644 --- a/tasks/seq/example/perf_tests/main.cpp +++ b/tasks/seq/example/perf_tests/main.cpp @@ -13,7 +13,7 @@ class NesterovTaskSeqTest : public ::testing::TestWithParam { protected: static void RunTest(ppc::core::PerfResults::TypeOfRunning mode) { - constexpr int kCount = 500; + constexpr size_t kCount = 500; // Create data std::vector in(kCount * kCount, 0); diff --git a/tasks/stl/example/perf_tests/main.cpp b/tasks/stl/example/perf_tests/main.cpp index fd8197c08..176aa8fcf 100644 --- a/tasks/stl/example/perf_tests/main.cpp +++ b/tasks/stl/example/perf_tests/main.cpp @@ -13,7 +13,7 @@ class NesterovTaskSTLTest : public ::testing::TestWithParam { protected: static void RunTest(ppc::core::PerfResults::TypeOfRunning mode) { - constexpr int kCount = 450; + constexpr size_t kCount = 450; // Create data std::vector in(kCount * kCount, 0); diff --git a/tasks/tbb/example/perf_tests/main.cpp b/tasks/tbb/example/perf_tests/main.cpp index cf80fe29d..ea5c00b55 100644 --- a/tasks/tbb/example/perf_tests/main.cpp +++ b/tasks/tbb/example/perf_tests/main.cpp @@ -13,7 +13,7 @@ class NesterovTaskTBBTest : public ::testing::TestWithParam { protected: static void RunTest(ppc::core::PerfResults::TypeOfRunning mode) { - constexpr int kCount = 450; + constexpr size_t kCount = 450; // Create data std::vector in(kCount * kCount, 0);