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

Compiler and clang-tidy cleanups #433

Merged
merged 3 commits into from
Nov 26, 2024
Merged

Conversation

hjmjohnson
Copy link
Member

A few code improvements are indicated by clang-tidy and compiler warnings.

@github-actions github-actions bot added area:Core Issues affecting the Core module area:Filtering Issues affecting the Filtering module language:C++ Changes to C++ examples labels Nov 25, 2024
@hjmjohnson hjmjohnson force-pushed the sphinx-one-line-initialize branch from 85fa85a to bb0ba2f Compare November 26, 2024 18:29
Copy link
Member

@dzenanz dzenanz left a comment

Choose a reason for hiding this comment

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

Mostly looks good

src/Filtering/ImageGrid/FitSplineIntoPointSet/Code.cxx Outdated Show resolved Hide resolved
p3[0] = 1.0;
p3[1] = 1.0;
p3[2] = 1.0; // third point ( 1, 1, 1 )
const MeshType::PointType p0({ -1.0, -1.0, 0 }); // first point ( -1, -1, 0 )
Copy link
Member

Choose a reason for hiding this comment

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

These comments are far less useful now.

Make the for loop variables match the comparison
variable type.
@hjmjohnson hjmjohnson force-pushed the sphinx-one-line-initialize branch from bb0ba2f to 96ecbf1 Compare November 26, 2024 18:31
Multiple declarations in a single statement reduces readability.

Detect local variable declaration statements and update to have only one
statement per declaration.

Initialize values rather than independant assignments of each
element
@hjmjohnson hjmjohnson force-pushed the sphinx-one-line-initialize branch from 96ecbf1 to b8f4537 Compare November 26, 2024 18:38
@github-actions github-actions bot added the language:Python Changes to Python examples label Nov 26, 2024
@hjmjohnson hjmjohnson merged commit a63e366 into master Nov 26, 2024
6 of 24 checks passed
@dzenanz dzenanz deleted the sphinx-one-line-initialize branch November 26, 2024 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:Core Issues affecting the Core module area:Filtering Issues affecting the Filtering module language:C++ Changes to C++ examples language:Python Changes to Python examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants