From db98a3279ce62d4285cf05674e7ca0c8e0d25dcc Mon Sep 17 00:00:00 2001 From: Alfredo Correa Date: Sun, 22 Dec 2024 23:04:58 -0800 Subject: [PATCH] more tidy and mull --- .clang-tidy | 2 ++ include/boost/multi/detail/layout.hpp | 3 ++- test/element_access.cpp | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 1eb226b34..6da20ec96 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -32,6 +32,7 @@ Checks: '*, -boost-use-ranges, -cppcoreguidelines-avoid-magic-numbers, -cppcoreguidelines-macro-usage, + -cppcoreguidelines-pro-bounds-array-to-pointer-decay, -fuchsia-overloaded-operator, -fuchsia-trailing-return, -llvmlibc-*, @@ -43,6 +44,7 @@ Checks: '*, # -boost-use-ranges // would introduce a dependency on Boost # -clang-diagnostic-deprecated-declarations // some test run deprecated functions on purpose # -cppcoreguidelines-avoid-magic-numbers, // all tests use magic numbers +# -cppcoreguidelines-pro-bounds-array-to-pointer-decay // for Boost Lightweight test BOOST_TEST # -cppcoreguidelines-macro-usage, // BLAS adaptors uses a lot of macros # -fuchsia-overloaded-operator, // this library overloads operators (==, <, +, &) # -llvmlibc-*, // nonsense warnings, for llvm developers diff --git a/include/boost/multi/detail/layout.hpp b/include/boost/multi/detail/layout.hpp index 50aa52142..c0385c5b9 100644 --- a/include/boost/multi/detail/layout.hpp +++ b/include/boost/multi/detail/layout.hpp @@ -847,7 +847,8 @@ struct layout_t constexpr auto scale(size_type num, size_type den) const { assert( (stride_*num) % den == 0 ); - return layout_t{sub_.scale(num, den), stride_*num/den, offset_*num/den, nelems_*num/den}; + assert(offset_ == 0); // TODO(correaa) implement ----------------vvv + return layout_t{sub_.scale(num, den), stride_*num/den, offset_ /* *num/den */, nelems_*num/den}; } }; diff --git a/test/element_access.cpp b/test/element_access.cpp index edc1d1a03..edf3ccc9f 100644 --- a/test/element_access.cpp +++ b/test/element_access.cpp @@ -141,7 +141,7 @@ auto main() -> int { // NOLINT(readability-function-cognitive-complexity,bugpro { auto beg1 = arr({1, 3}, {2, 5}).elements().begin(); auto end1 = arr({1, 3}, {2, 5}).elements().end(); - for(;end1 != beg1; --end1) {} // NOLINT(altera-id-dependent-backward-branch) + for(;end1 != beg1; --end1) {} // NOLINT(altera-id-dependent-backward-branch,altera-unroll-loops) BOOST_TEST( end1 == beg1 ); } }