Skip to content

Commit

Permalink
Merge pull request #1414 from dutkalex/cleanup
Browse files Browse the repository at this point in the history
Fix various warnings
  • Loading branch information
lukasdreyer authored Feb 28, 2025
2 parents 97adaf7 + c0dfcdf commit f4562f2
Show file tree
Hide file tree
Showing 81 changed files with 741 additions and 532 deletions.
4 changes: 2 additions & 2 deletions benchmarks/t8_time_forest_partition.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ t8_anchor_element (t8_forest_t forest, t8_locidx_t which_tree,
* c_min, c_max. We refine the cells in the band c_min*E, c_max*E */
static int
t8_band_adapt (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t which_tree, t8_eclass_t tree_class,
t8_locidx_t lelement_id, const t8_scheme *scheme, const int is_family, const int num_elements,
t8_element_t *elements[])
[[maybe_unused]] t8_locidx_t lelement_id, const t8_scheme *scheme, const int is_family,
[[maybe_unused]] const int num_elements, t8_element_t *elements[])
{
int level, base_level, max_level;
t8_3D_vec elem_midpoint;
Expand Down
48 changes: 31 additions & 17 deletions benchmarks/t8_time_fractal.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@
*
*/
static int
t8_adapt_menger_quad (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t which_tree, t8_eclass_t tree_class,
t8_locidx_t lelement_id, const t8_scheme *scheme, const int is_family, const int num_elements,
t8_adapt_menger_quad (t8_forest_t forest, [[maybe_unused]] t8_forest_t forest_from,
[[maybe_unused]] t8_locidx_t which_tree, t8_eclass_t tree_class,
[[maybe_unused]] t8_locidx_t lelement_id, const t8_scheme *scheme,
[[maybe_unused]] const int is_family, [[maybe_unused]] const int num_elements,
t8_element_t *elements[])
{
const int *adapt_data = (const int *) t8_forest_get_user_data (forest);
Expand Down Expand Up @@ -77,8 +79,10 @@ t8_adapt_menger_quad (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t w
* of the mesh or leave it untouched. Refine the remaining elements.
*/
static int
t8_adapt_sierpinski_tri (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t which_tree, t8_eclass_t tree_class,
t8_locidx_t lelement_id, const t8_scheme *scheme, const int is_family, const int num_elements,
t8_adapt_sierpinski_tri (t8_forest_t forest, [[maybe_unused]] t8_forest_t forest_from,
[[maybe_unused]] t8_locidx_t which_tree, t8_eclass_t tree_class,
[[maybe_unused]] t8_locidx_t lelement_id, const t8_scheme *scheme,
[[maybe_unused]] const int is_family, [[maybe_unused]] const int num_elements,
t8_element_t *elements[])
{
const int *adapt_data = (const int *) t8_forest_get_user_data (forest);
Expand All @@ -102,8 +106,10 @@ t8_adapt_sierpinski_tri (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_
* of the mesh or leave them untouched. Refine the remaining elements.
*/
static int
t8_adapt_menger_hex (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t which_tree, t8_eclass_t tree_class,
t8_locidx_t lelement_id, const t8_scheme *scheme, const int is_family, const int num_elements,
t8_adapt_menger_hex (t8_forest_t forest, [[maybe_unused]] t8_forest_t forest_from,
[[maybe_unused]] t8_locidx_t which_tree, t8_eclass_t tree_class,
[[maybe_unused]] t8_locidx_t lelement_id, const t8_scheme *scheme,
[[maybe_unused]] const int is_family, [[maybe_unused]] const int num_elements,
t8_element_t *elements[])
{
const int *adapt_data = (const int *) t8_forest_get_user_data (forest);
Expand Down Expand Up @@ -151,8 +157,10 @@ t8_adapt_menger_hex (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t wh
* of the mesh or leave it untouched. Refine the remaining elements.
*/
static int
t8_adapt_sierpinski_tet (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t which_tree, t8_eclass_t tree_class,
t8_locidx_t lelement_id, const t8_scheme *scheme, const int is_family, const int num_elements,
t8_adapt_sierpinski_tet (t8_forest_t forest, [[maybe_unused]] t8_forest_t forest_from,
[[maybe_unused]] t8_locidx_t which_tree, t8_eclass_t tree_class,
[[maybe_unused]] t8_locidx_t lelement_id, const t8_scheme *scheme,
[[maybe_unused]] const int is_family, [[maybe_unused]] const int num_elements,
t8_element_t *elements[])
{
const int *adapt_data = (const int *) t8_forest_get_user_data (forest);
Expand All @@ -176,9 +184,11 @@ t8_adapt_sierpinski_tet (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_
* of the mesh or leave it untouched. Refine the remaining elements.
*/
static int
t8_adapt_sierpinski_prism (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t which_tree, t8_eclass_t tree_class,
t8_locidx_t lelement_id, const t8_scheme *scheme, const int is_family,
const int num_elements, t8_element_t *elements[])
t8_adapt_sierpinski_prism (t8_forest_t forest, [[maybe_unused]] t8_forest_t forest_from,
[[maybe_unused]] t8_locidx_t which_tree, t8_eclass_t tree_class,
[[maybe_unused]] t8_locidx_t lelement_id, const t8_scheme *scheme,
[[maybe_unused]] const int is_family, [[maybe_unused]] const int num_elements,
t8_element_t *elements[])
{
const int *adapt_data = (const int *) t8_forest_get_user_data (forest);
const int level_max = adapt_data[0];
Expand All @@ -201,9 +211,11 @@ t8_adapt_sierpinski_prism (t8_forest_t forest, t8_forest_t forest_from, t8_locid
* of the mesh or leave it untouched. Refine the remaining elements.
*/
static int
t8_adapt_sierpinski_pyramid (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t which_tree,
t8_eclass_t tree_class, t8_locidx_t lelement_id, const t8_scheme *scheme,
const int is_family, const int num_elements, t8_element_t *elements[])
t8_adapt_sierpinski_pyramid (t8_forest_t forest, [[maybe_unused]] t8_forest_t forest_from,
[[maybe_unused]] t8_locidx_t which_tree, t8_eclass_t tree_class,
[[maybe_unused]] t8_locidx_t lelement_id, const t8_scheme *scheme,
[[maybe_unused]] const int is_family, [[maybe_unused]] const int num_elements,
t8_element_t *elements[])
{
const int *adapt_data = (const int *) t8_forest_get_user_data (forest);
const int level_max = adapt_data[0];
Expand All @@ -223,9 +235,11 @@ t8_adapt_sierpinski_pyramid (t8_forest_t forest, t8_forest_t forest_from, t8_loc

/* Coarse every family in the mesh. */
static int
t8_adapt_coarse (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t which_tree, t8_eclass_t tree_class,
t8_locidx_t lelement_id, const t8_scheme *scheme, const int is_family, const int num_elements,
t8_element_t *elements[])
t8_adapt_coarse ([[maybe_unused]] t8_forest_t forest, [[maybe_unused]] t8_forest_t forest_from,
[[maybe_unused]] t8_locidx_t which_tree, [[maybe_unused]] t8_eclass_t tree_class,
[[maybe_unused]] t8_locidx_t lelement_id, [[maybe_unused]] const t8_scheme *scheme,
const int is_family, [[maybe_unused]] const int num_elements,
[[maybe_unused]] t8_element_t *elements[])
{
if (is_family) {
return -1;
Expand Down
18 changes: 11 additions & 7 deletions benchmarks/t8_time_prism_adapt.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@
#include <t8_cmesh/t8_cmesh_examples.h>

static int
t8_basic_adapt_refine_type (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t which_tree, t8_eclass_t tree_class,
t8_locidx_t lelement_id, const t8_scheme *scheme, const int is_family,
const int num_elements, t8_element_t *elements[])
t8_basic_adapt_refine_type (t8_forest_t forest, [[maybe_unused]] t8_forest_t forest_from,
[[maybe_unused]] t8_locidx_t which_tree, t8_eclass_t tree_class,
[[maybe_unused]] t8_locidx_t lelement_id, const t8_scheme *scheme,
[[maybe_unused]] const int is_family, [[maybe_unused]] const int num_elements,
t8_element_t *elements[])
{
int level;
int type;
Expand All @@ -58,9 +60,11 @@ t8_basic_adapt_refine_type (t8_forest_t forest, t8_forest_t forest_from, t8_loci
}

static int
t8_basic_adapt_refine_tet (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t which_tree, t8_eclass_t tree_class,
t8_locidx_t lelement_id, const t8_scheme *scheme, const int is_family,
const int num_elements, t8_element_t *elements[])
t8_basic_adapt_refine_tet (t8_forest_t forest, [[maybe_unused]] t8_forest_t forest_from,
[[maybe_unused]] t8_locidx_t which_tree, t8_eclass_t tree_class,
[[maybe_unused]] t8_locidx_t lelement_id, const t8_scheme *scheme,
[[maybe_unused]] const int is_family, [[maybe_unused]] const int num_elements,
t8_element_t *elements[])
{
int level;
int type;
Expand All @@ -81,7 +85,7 @@ t8_basic_adapt_refine_tet (t8_forest_t forest, t8_forest_t forest_from, t8_locid
}

static void
t8_time_refine (int start_level, int end_level, int create_forest, int cube, int adapt, int do_balance,
t8_time_refine (int start_level, int end_level, [[maybe_unused]] int create_forest, int cube, int adapt, int do_balance,
t8_eclass_t eclass)
{
t8_forest_t forest, forest_adapt, forest_partition;
Expand Down
5 changes: 3 additions & 2 deletions example/IO/cmesh/gmsh/t8_load_and_refine_square_w_hole.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ t8_midpoint (t8_forest_t forest, t8_locidx_t which_tree, t8_element_t *element,
}

static int
t8_load_refine_adapt (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t which_tree, t8_eclass_t tree_class,
t8_locidx_t lelement_id, const t8_scheme *scheme, const int is_family, const int num_elements,
t8_load_refine_adapt ([[maybe_unused]] t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t which_tree,
t8_eclass_t tree_class, [[maybe_unused]] t8_locidx_t lelement_id, const t8_scheme *scheme,
[[maybe_unused]] const int is_family, [[maybe_unused]] const int num_elements,
t8_element_t *elements[])
{
double elem_midpoint[3];
Expand Down
13 changes: 8 additions & 5 deletions example/IO/forest/netcdf/t8_write_forest_netcdf.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ struct t8_example_netcdf_adapt_data
*/
int
t8_example_netcdf_adapt_fn (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t which_tree,
const t8_eclass_t tree_class, t8_locidx_t lelement_id, const t8_scheme *scheme,
const int is_family, const int num_elements, t8_element_t *elements[])
[[maybe_unused]] const t8_eclass_t tree_class, [[maybe_unused]] t8_locidx_t lelement_id,
[[maybe_unused]] const t8_scheme *scheme, const int is_family,
[[maybe_unused]] const int num_elements, t8_element_t *elements[])
{
t8_3D_point element_centroid;
double distance;
Expand Down Expand Up @@ -138,9 +139,11 @@ t8_example_netcdf_adapt (t8_forest_t forest)
* \note It is assumed that each user-variable in \a ext_vars holds one value for each element in the mesh/forest. If no additional variables should be written in the netCDF file, set \a num_additional_vars equal to zero and pass a NULL-pointer as \a ext_vars.
*/
static void
t8_example_time_netcdf_writing_operation (t8_forest_t forest, sc_MPI_Comm comm, int netcdf_var_storage_mode,
int netcdf_var_mpi_access, const char *title, int num_additional_vars,
t8_netcdf_variable_t *ext_vars[])
t8_example_time_netcdf_writing_operation ([[maybe_unused]] t8_forest_t forest, [[maybe_unused]] sc_MPI_Comm comm,
[[maybe_unused]] int netcdf_var_storage_mode,
[[maybe_unused]] int netcdf_var_mpi_access,
[[maybe_unused]] const char *title, [[maybe_unused]] int num_additional_vars,
[[maybe_unused]] t8_netcdf_variable_t *ext_vars[])
{
#if T8_WITH_NETCDF_PAR
double start_time, end_time, duration, global;
Expand Down
4 changes: 2 additions & 2 deletions example/advect/t8_advection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ t8_advect_element_set_phi_adapt (const t8_advect_problem_t *problem, t8_locidx_t
* and coarsen if it is larger than a given threshold. */
static int
t8_advect_adapt (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t ltree_id, const t8_eclass_t tree_class,
t8_locidx_t lelement_id, const t8_scheme *scheme, const int is_family, const int num_elements,
t8_element_t *elements[])
t8_locidx_t lelement_id, const t8_scheme *scheme, const int is_family,
[[maybe_unused]] const int num_elements, t8_element_t *elements[])
{
t8_advect_problem_t *problem;
t8_advect_element_data_t *elem_data;
Expand Down
4 changes: 2 additions & 2 deletions example/cmesh/t8_cmesh_partition.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <t8_schemes/t8_default/t8_default.hxx>

static void
t8_random_partition (int level)
t8_random_partition ([[maybe_unused]] int level)
{
t8_cmesh_t cmesh, cmesh_part, cmesh_part2;
char file[BUFSIZ];
Expand Down Expand Up @@ -88,7 +88,7 @@ t8_random_partition (int level)
* will also be partitioned. Otherwise replicated.
*/
static void
t8_partition (int level, int partition_from)
t8_partition (int level, [[maybe_unused]] int partition_from)
{
t8_cmesh_t cmesh, cmesh_part, cmesh_part2;
char file[BUFSIZ];
Expand Down
10 changes: 6 additions & 4 deletions example/common/t8_example_common.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@
*/
int
t8_common_adapt_balance (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t which_tree,
const t8_eclass_t tree_class, t8_locidx_t lelement_id, const t8_scheme *scheme,
const int is_family, const int num_elements, t8_element_t *elements[])
const t8_eclass_t tree_class, [[maybe_unused]] t8_locidx_t lelement_id,
const t8_scheme *scheme, [[maybe_unused]] const int is_family,
[[maybe_unused]] const int num_elements, t8_element_t *elements[])
{
int level;
int maxlevel, child_id;
Expand Down Expand Up @@ -118,8 +119,9 @@ t8_common_within_levelset (t8_forest_t forest, const t8_locidx_t ltreeid, const
/* TODO: Currently the band_width control is not working yet. */
int
t8_common_adapt_level_set (t8_forest_t forest, t8_forest_t forest_from, t8_locidx_t which_tree,
const t8_eclass_t tree_class, t8_locidx_t lelement_id, const t8_scheme *scheme,
const int is_family, const int num_elements, t8_element_t *elements[])
const t8_eclass_t tree_class, [[maybe_unused]] t8_locidx_t lelement_id,
const t8_scheme *scheme, const int is_family, [[maybe_unused]] const int num_elements,
t8_element_t *elements[])
{
t8_example_level_set_struct_t *data;
int within_band;
Expand Down
Loading

0 comments on commit f4562f2

Please sign in to comment.