Skip to content

Improvement: clang-tidy fixes#2060

Open
dutkalex wants to merge 11 commits intoDLR-AMR:mainfrom
dutkalex:clang-tidy-fixes
Open

Improvement: clang-tidy fixes#2060
dutkalex wants to merge 11 commits intoDLR-AMR:mainfrom
dutkalex:clang-tidy-fixes

Conversation

@dutkalex
Copy link
Contributor

Describe your changes here:
This PR consists of a handful of automated low-hanging fruit clang-tidy simplifications/modernizations.

All these boxes must be checked by the AUTHOR before requesting review:

  • The PR is small enough to be reviewed easily. If not, consider splitting up the changes in multiple PRs.
  • The title starts with one of the following prefixes: Documentation:, Bugfix:, Feature:, Improvement: or Other:.
  • If the PR is related to an issue, make sure to link it.
  • The author made sure that, as a reviewer, he/she would check all boxes below.

All these boxes must be checked by the REVIEWERS before merging the pull request:

As a reviewer please read through all the code lines and make sure that the code is fully understood, bug free, well-documented and well-structured.

General

  • The reviewer executed the new code features at least once and checked the results manually.
  • The code follows the t8code coding guidelines.
  • New source/header files are properly added to the CMake files.
  • The code is well documented. In particular, all function declarations, structs/classes and their members have a proper doxygen documentation. Make sure to add a file documentation for each file!
  • All new algorithms and data structures are sufficiently optimal in terms of memory and runtime (If this should be merged, but there is still potential for optimization, create a new issue).

Tests

  • The code is covered in an existing or new test case using Google Test.
  • The code coverage of the project (reported in the CI) should not decrease. If coverage is decreased, make sure that this is reasonable and acceptable.
  • Valgrind doesn't find any bugs in the new code. This script can be used to check for errors; see also this wiki article.

If the Pull request introduces code that is not covered by the github action (for example coupling with a new library):

  • Should this use case be added to the github action?
  • If not, does the specific use case compile and all tests pass (check manually).

Scripts and Wiki

  • If a new directory with source files is added, it must be covered by the script/find_all_source_files.scp to check the indentation of these files.
  • If this PR introduces a new feature, it must be covered in an example or tutorial and a Wiki article.

License

  • The author added a BSD statement to doc/ (or already has one).

@codecov
Copy link

codecov bot commented Dec 31, 2025

Codecov Report

❌ Patch coverage is 70.45455% with 130 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.05%. Comparing base (4a06e41) to head (93a2b85).

Files with missing lines Patch % Lines
src/t8_forest/t8_forest.cxx 60.46% 34 Missing ⚠️
src/t8_cmesh/t8_cmesh_io/t8_cmesh_triangle.cxx 0.00% 20 Missing ⚠️
src/t8_cmesh/t8_cmesh_examples.cxx 20.00% 12 Missing ⚠️
src/t8_cmesh/t8_cmesh_io/t8_cmesh_save.cxx 0.00% 11 Missing ⚠️
src/t8_cmesh/t8_cmesh.cxx 85.71% 9 Missing ⚠️
src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.cxx 65.00% 7 Missing ⚠️
..._geometry_implementations/t8_geometry_analytic.cxx 50.00% 7 Missing ⚠️
src/t8_vtk/t8_vtk_write_ASCII.cxx 73.07% 7 Missing ⚠️
src/t8_forest/t8_forest_ghost.cxx 86.20% 4 Missing ⚠️
.../t8_cmesh/t8_cmesh_internal/t8_cmesh_partition.cxx 91.89% 3 Missing ⚠️
... and 12 more
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2060   +/-   ##
=======================================
  Coverage   77.05%   77.05%           
=======================================
  Files         112      112           
  Lines       18959    18957    -2     
=======================================
- Hits        14608    14607    -1     
+ Misses       4351     4350    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lenaploetzke lenaploetzke self-requested a review February 4, 2026 09:18
Copy link
Collaborator

@lenaploetzke lenaploetzke left a comment

Choose a reason for hiding this comment

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

Thank you for your nice work! Please also merge main :)

*
*/
typedef struct
using t8_part_ghost_id_and_num_atts = struct
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think only struct t8_part_ghost_id_and_num_atts {...} is even clearer in this case.

* We need it to find neighbor trees.
*/
typedef struct
using t8_msh_file_face_t = struct
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
using t8_msh_file_face_t = struct
struct t8_msh_file_face_t

int orientation = -1;
int found_orientation = 0;
int firstvertex = face1 == 0 ? 1 : 0;
int const firstvertex = face1 == 0 ? 1 : 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
int const firstvertex = face1 == 0 ? 1 : 0;
int const firstvertex = (face1 == 0 ? 1 : 0);

This would improve readability (although not related to your PR).

* This struct stores query data about the elements within the forest.
*/
typedef struct
using t8_forest_child_type_query_t = struct
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
using t8_forest_child_type_query_t = struct
struct t8_forest_child_type_query_t

* The information for a remote process, what data we have to send to them.
*/
typedef struct
using t8_ghost_mpi_send_info_t = struct
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
using t8_ghost_mpi_send_info_t = struct
struct t8_ghost_mpi_send_info_t

* The data structure stored in the global_tree_to_ghost_tree hash table.
*/
typedef struct
using t8_ghost_gtree_hash_t = struct
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
using t8_ghost_gtree_hash_t = struct
struct t8_ghost_gtree_hash_t

* The data structure stored in the process_offsets array.
*/
typedef struct
using t8_ghost_process_hash_t = struct
Copy link
Collaborator

Choose a reason for hiding this comment

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

similar as above and for all below.

* This struct stores the ghost boundary data of a forest.
*/
typedef struct
using t8_forest_ghost_boundary_data_t = struct
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
using t8_forest_ghost_boundary_data_t = struct
struct t8_forest_ghost_boundary_data_t

* we send the information stored in this struct to the other process
*/
typedef struct
using t8_forest_partition_tree_info_t = struct
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
using t8_forest_partition_tree_info_t = struct
struct t8_forest_partition_tree_info_t

const t8_eclass_t tree_class, const int is_ghost, FILE *vtufile,
int *columns, void **data, T8_VTK_KERNEL_MODUS modus);
using t8_forest_vtk_cell_data_kernel
= int (*) (t8_forest_t, const t8_locidx_t, const t8_tree_t, const t8_locidx_t, const t8_element_t *,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we should keep the argument names here to make it easier to define custom callback with correct usage of variables.

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.

2 participants