Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patchkernel: silence some "uninitialized variable" warnings reported by Coverity #329

Merged
merged 3 commits into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/patchkernel/element_reference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ ReferenceElementInfo::ReferenceElementInfo(int _dimension, ElementType _type, in
}

edgeTypeStorage.fill(ElementType::UNDEFINED);
for (int i = 0; i < MAX_ELEM_FACES; ++i) {
for (int i = 0; i < MAX_ELEM_EDGES; ++i) {
edgeConnectStorage[i].fill(-1);
}
}
Expand Down
10 changes: 3 additions & 7 deletions src/patchkernel/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ std::array<std::array<double, 3>, 3> Interface::evalRotationFromCartesian(std::a
// R = | [y_int] |
// | [z_int] |
//
std::array<std::array<double, 3>, 3> R;
std::array<std::array<double, 3>, 3> R = {{{{0., 0., 0.}}, {{0., 0., 0.}}, {{0., 0., 0.}}}};

// x-interface axis
for (int k = 0; k < 3; ++k) {
Expand Down Expand Up @@ -267,7 +267,7 @@ std::array<std::array<double, 3>, 3> Interface::evalRotationInverse(const std::a
*/
std::array<std::array<double, 3>, 3> Interface::evalRotationTranspose(const std::array<std::array<double, 3>, 3> &R)
{
std::array<std::array<double, 3>, 3> R_transposed;
std::array<std::array<double, 3>, 3> R_transposed = {{{{0., 0., 0.}}, {{0., 0., 0.}}, {{0., 0., 0.}}}};
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
R_transposed[j][i] = R[i][j];
Expand Down Expand Up @@ -377,11 +377,7 @@ int Interface::getNeighFace() const
*/
std::array<long, 2> Interface::getOwnerNeigh() const
{
std::array<long, 2> cells;
cells[0] = m_owner;
cells[1] = m_neigh;

return cells;
return {{m_owner, m_neigh}};
}

/*!
Expand Down
2 changes: 0 additions & 2 deletions src/patchkernel/surface_kernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ class SurfaceKernel : public PatchKernel {
bool haveSameOrientation(const Cell &cell_A, int face_A, const Cell &cell_B, int face_B) const;

protected:
int m_spaceDim;

#if BITPIT_ENABLE_MPI==1
SurfaceKernel(MPI_Comm communicator, std::size_t haloSize, bool expert);
SurfaceKernel(int dimension, MPI_Comm communicator, std::size_t haloSize, bool expert);
Expand Down