clang-tidy fixes for f3dwy#3199
Conversation
| ******************************************************************/ | ||
|
|
||
| #define PVODE_BAND_ELEM(A, i, j) ((A->data)[j][i - j + (A->smu)]) | ||
| #define PVODE_BAND_ELEM(A, i, j) (((A)->data)[j][(i) - (j) + ((A)->smu)]) |
There was a problem hiding this comment.
warning: function-like macro 'PVODE_BAND_ELEM' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage]
#define PVODE_BAND_ELEM(A, i, j) (((A)->data)[j][(i) - (j) + ((A)->smu)])
^| ******************************************************************/ | ||
|
|
||
| #define PVODE_BAND_COL(A, j) (((A->data)[j]) + (A->smu)) | ||
| #define PVODE_BAND_COL(A, j) ((((A)->data)[j]) + ((A)->smu)) |
There was a problem hiding this comment.
warning: function-like macro 'PVODE_BAND_COL' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage]
#define PVODE_BAND_COL(A, j) ((((A)->data)[j]) + ((A)->smu))
^| ******************************************************************/ | ||
|
|
||
| #define PVODE_BAND_COL(A, j) (((A->data)[j]) + (A->smu)) | ||
| #define PVODE_BAND_COL(A, j) ((((A)->data)[j]) + ((A)->smu)) |
There was a problem hiding this comment.
warning: function-like macro 'PVODE_BAND_COL' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage]
#define PVODE_BAND_COL(A, j) ((((A)->data)[j]) + ((A)->smu))
^| @@ -150,6 +152,7 @@ public: | |||
|
|
|||
| const int dir; | |||
| virtual ~BoundaryRegionIter = default; | |||
There was a problem hiding this comment.
warning: '~BoundaryRegionIter' cannot be the name of a variable or data member [clang-diagnostic-error]
virtual ~BoundaryRegionIter = default;
^| bool isInit{false}; | ||
| Mat petscWeights; | ||
| Vec rhs, result; | ||
| Mat petscWeights{}; |
There was a problem hiding this comment.
warning: member variable 'petscWeights' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]
Mat petscWeights{};
^| Mat petscWeights; | ||
| Vec rhs, result; | ||
| Mat petscWeights{}; | ||
| Vec rhs{}, result{}; |
There was a problem hiding this comment.
warning: member variable 'result' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]
Vec rhs{}, result{};
^| Mat petscWeights; | ||
| Vec rhs, result; | ||
| Mat petscWeights{}; | ||
| Vec rhs{}, result{}; |
There was a problem hiding this comment.
warning: member variable 'rhs' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]
Vec rhs{}, result{};
^| std::unique_ptr<GlobalField3DAccessInstance> gf; | ||
| const std::unique_ptr<GlobalField3DAccessInstance> gf; | ||
| if constexpr (monotonic) { | ||
| gf = gf3daccess->communicate_asPtr(f); |
There was a problem hiding this comment.
warning: no viable overloaded '=' [clang-diagnostic-error]
gf = gf3daccess->communicate_asPtr(f);
^Additional context
/usr/include/c++/13/bits/unique_ptr.h:413: candidate function not viable: 'this' argument has type 'const std::unique_ptr', but method is not marked const
unique_ptr& operator=(unique_ptr&&) = default;
^/usr/include/c++/13/bits/unique_ptr.h:429: candidate function template not viable: 'this' argument has type 'const std::unique_ptr', but method is not marked const
operator=(unique_ptr<_Up, _Ep>&& __u) noexcept
^/usr/include/c++/13/bits/unique_ptr.h:439: candidate function not viable: 'this' argument has type 'const std::unique_ptr', but method is not marked const
operator=(nullptr_t) noexcept
^/usr/include/c++/13/bits/unique_ptr.h:522: candidate function not viable: 'this' argument has type 'const std::unique_ptr', but method is not marked const
unique_ptr& operator=(const unique_ptr&) = delete;
^| #include <string> | ||
| #include <string_view> | ||
| #include <utility> | ||
|
|
There was a problem hiding this comment.
warning: included header utility is not used directly [misc-include-cleaner]
| output_error.write("ERROR CVODE step failed, flag = {:d}\n", flag); | ||
| if (debug_on_failure) { | ||
| CVodeMemRec* cv_mem = (CVodeMem)cvode_mem; | ||
| const CVodeMemRec* cv_mem = (CVodeMem)cvode_mem; |
There was a problem hiding this comment.
warning: do not use C-style cast to convert between unrelated types [cppcoreguidelines-pro-type-cstyle-cast]
const CVodeMemRec* cv_mem = (CVodeMem)cvode_mem;
^
I did run clang-tidy-diff locally and just committed the changes.