Skip to content

clang-tidy fixes for f3dwy#3199

Merged
dschwoerer merged 4 commits into
f3dwyfrom
f3dwy-clang-tidy
Nov 10, 2025
Merged

clang-tidy fixes for f3dwy#3199
dschwoerer merged 4 commits into
f3dwyfrom
f3dwy-clang-tidy

Conversation

@dschwoerer
Copy link
Copy Markdown
Contributor

I did run clang-tidy-diff locally and just committed the changes.

Comment thread src/invert/laplace/impls/petsc/petsc_laplace.cxx Outdated
Comment thread src/invert/laplace/impls/petsc/petsc_laplace.cxx Outdated
Comment thread src/mesh/boundary_standard.cxx Outdated
Comment thread src/mesh/coordinates.cxx Outdated
Comment thread src/mesh/coordinates.cxx Outdated
Comment thread src/mesh/impls/bout/boutmesh.cxx Outdated
Comment thread src/mesh/interpolation/hermite_spline_xz.cxx Outdated
Comment thread src/mesh/parallel/fci.cxx Outdated
Comment thread src/solver/impls/pvode/pvode.cxx Outdated
Comment thread tests/MMS/spatial/fci/fci_mms.cxx Outdated
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

******************************************************************/

#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)])
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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))
        ^

Comment thread include/bout/boundary_iterator.hxx Outdated
@@ -150,6 +152,7 @@ public:

const int dir;
virtual ~BoundaryRegionIter = default;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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{};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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{};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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{};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
                  ^

Comment thread src/mesh/parallel/fci.cxx
#include <string>
#include <string_view>
#include <utility>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header utility is not used directly [misc-include-cleaner]

Suggested change

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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: do not use C-style cast to convert between unrelated types [cppcoreguidelines-pro-type-cstyle-cast]

      const CVodeMemRec* cv_mem = (CVodeMem)cvode_mem;
                                  ^

@dschwoerer dschwoerer merged commit c58bf64 into f3dwy Nov 10, 2025
13 checks passed
@dschwoerer dschwoerer deleted the f3dwy-clang-tidy branch November 10, 2025 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant