Skip to content

Commit

Permalink
fixes for new warnings GCC started emitting
Browse files Browse the repository at this point in the history
  • Loading branch information
will-saunders-ukaea committed Dec 6, 2024
1 parent 39833fc commit 4732c4b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct BoundaryNormalMapper {
* @returns True if the boundary element is found otherwise false.
*/
inline bool get(const INT global_id, REAL **normal) const {
BoundaryInteractionNormalData2D *node;
BoundaryInteractionNormalData2D *node = nullptr;
bool *exists;
const bool e = root->get_location(global_id, &exists, &node);
*normal = node->d_normal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,15 @@ class DMPlex2DMapper {
const int overlay_cell =
k_overlay_mapper.get_linear_cell_index(cell_tuple);
// Get the number of candidate cells
int num_candidates;
int num_candidates = 0;
k_map_sizes->get(overlay_cell, &num_candidates);
int *candidates;
int *candidates = nullptr;
k_map_candidates->get(overlay_cell, &candidates);
// loop over candidates and test if point in cell
for (int cx = 0; cx < num_candidates; cx++) {
const int candidate = candidates[cx];
// Get the cell data for this candidate cell
Implementation2DLinear::Linear2DData const *cell_data;
Implementation2DLinear::Linear2DData const *cell_data = nullptr;
k_cell_data->get(candidate, &cell_data);
// Test if point in candidate cell
int num_crossings = 0;
Expand Down
2 changes: 1 addition & 1 deletion test/include/test_neso_particles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ inline std::filesystem::path get_test_resource(std::string resource_name) {
#define MAKE_WRAP_METHOD(method_name) \
template <typename... T> auto wrap_##method_name(T... args) { \
return method_name(args...); \
};
}
#endif

/**
Expand Down
2 changes: 1 addition & 1 deletion test/test_petsc_project_evaluate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ TEST(PETSC, dmplex_project_barycentric_coeffs) {
{0.0, 0.0, 0.0, 0.0}};

for (int px = 0; px < num_particles; px++) {
REAL l[4];
REAL l[4] = {0.0, 0.0, 0.0, 0.0};
const REAL x = P->at(px, 0);
const REAL y = P->at(px, 1);
lambda_weights(num_vertices, vertices, x, y, &l[0], &l[1], &l[2], &l[3]);
Expand Down

0 comments on commit 4732c4b

Please sign in to comment.