Skip to content

Commit

Permalink
[cpp] Fix more clang-tidy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiashienzsch committed Sep 24, 2024
1 parent d3c717d commit 01d5e61
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Checks: >
clang-diagnostics-*,
concurrency-*,
-concurrency-mt-unsafe,
cppcoreguidelines-*,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
Expand All @@ -41,12 +40,10 @@ Checks: >
readability-*,
readability-identifier-naming,
-readability-function-cognitive-complexity,
-readability-identifier-length,
-*-avoid-c-arrays,
-*-magic-numbers,
-*-no-malloc,
-*-vararg,
WarningsAsErrors: "*"
Expand All @@ -56,6 +53,10 @@ CheckOptions:
value: 4
- key: cppcoreguidelines-avoid-do-while.IgnoreMacros
value: true
- key: readability-function-cognitive-complexity.DescribeBasicIncrements
value: false
- key: readability-function-cognitive-complexity.Threshold
value: 132
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.PrivateMemberPrefix
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/pffdtd/engine_sycl_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ auto run(Simulation3D<Real> const& sim) -> void {
auto gh1 = sycl::accessor{gh1_buf, cgh, sycl::read_write};
auto vh1 = sycl::accessor{vh1_buf, cgh, sycl::read_write};
cgh.parallel_for<ApplyBoundaryLoss<Real>>(Nbl, [=](sycl::id<1> id) {
auto nb = id[0];
auto nb = static_cast<int64_t>(id[0]);
Real _1 = 1.0;
Real _2 = 2.0;
int32_t const k = mat_bnl[nb];
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/pffdtd/utility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ template<typename T>
auto* const ptr = new T[count];
auto const bytes = static_cast<size_t>(count) * sizeof(T);
std::memset(static_cast<void*>(ptr), 0, bytes);
return reinterpret_cast<T*>(ptr);
return ptr;
}

template<typename T>
Expand Down

0 comments on commit 01d5e61

Please sign in to comment.