-
-
Notifications
You must be signed in to change notification settings - Fork 665
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
STYLE: Replace Fill(0.)
and Fill(0u)
with {}
initializer for local variables in tests
#4884
STYLE: Replace Fill(0.)
and Fill(0u)
with {}
initializer for local variables in tests
#4884
Conversation
Replaced `Fill(0.)`, `Fill(0.0)`, `Fill(0.0f)`, and `Fill(0u)` calls with `{}` initializers. Follow-up to pull request InsightSoftwareConsortium#4881 commit 569a8b6 "STYLE: Replace Fill(0) with {} initializer for local variables in tests"
ece8a10
to
fe83d68
Compare
@N-Dekker Not sure if the dynamic analysis defects are a consequence of this PR, but a quick search of the commit that last modified the files points to this commit. Dynamic analysis on 2024-10-18: |
This one specifically reports a test failure of Update: I see now, there is an irregularity in the default-constructor of QuadEdgeMeshPoint that caused those regression failures! Thanks very much, @jhlegarreta ! 🎉 I'll prepare a PR! |
Defaulted the default-constructor of `QuadEdgeMeshPoint`, and added an initializer to its data member m_Edge, to ensure that an instance of this type can be properly initialized by an empty initializer list, `{}`. Aims to fix the dynamic analysis defects reported by Jon Haitz Legarreta Gorroño at InsightSoftwareConsortium#4884 (comment)
Replaced code of the form T var; var.Fill(x); with `auto var = itk::MakeFilled<T>(x);` Following C++ Core Guidelines, Oct 3, 2024, "Always initialize an object", https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-always Using Notepad++, Replace in Files, doing: Find what: ^( [ ]+)([^ ].*)[ ]+(\w+);[\r\n]+\1\3\.Fill\( Replace with: $1auto $3 = itk::MakeFilled<$2>\( Filters: itk*Test*.cxx [v] Match case (*) Regular expression Follow-up to - pull request InsightSoftwareConsortium#4881 - pull request InsightSoftwareConsortium#4884 - pull request InsightSoftwareConsortium#4887
Replaced code of the form T var; var.Fill(x); with `auto var = itk::MakeFilled<T>(x);` Following C++ Core Guidelines, Oct 3, 2024, "Always initialize an object", https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-always Using Notepad++, Replace in Files, doing: Find what: ^( [ ]+)([^ ].*)[ ]+(\w+);[\r\n]+\1\3\.Fill\( Replace with: $1auto $3 = itk::MakeFilled<$2>\( Filters: itk*Test*.cxx [v] Match case (*) Regular expression Follow-up to - pull request InsightSoftwareConsortium#4881 - pull request InsightSoftwareConsortium#4884 - pull request InsightSoftwareConsortium#4887
Replaced code of the form T var; var.Fill(x); with `auto var = itk::MakeFilled<T>(x);` Following C++ Core Guidelines, Oct 3, 2024, "Always initialize an object", https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-always Using Notepad++, Replace in Files, doing: Find what: ^( [ ]+)([^ ].*)[ ]+(\w+);[\r\n]+\1\3\.Fill\( Replace with: $1auto $3 = itk::MakeFilled<$2>\( Filters: itk*Test*.cxx [v] Match case (*) Regular expression Follow-up to - pull request InsightSoftwareConsortium#4881 - pull request InsightSoftwareConsortium#4884 - pull request InsightSoftwareConsortium#4887
Replaced
Fill(0.)
,Fill(0.0)
,Fill(0.0f)
, andFill(0u)
calls with{}
initializers.Fill(0)
with{}
initializer for local variables in tests #4881