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

Modernize initialization of local SmartPointer variables #4964

Conversation

N-Dekker
Copy link
Contributor

Two style commits:

Using Notepad++, Replace in Files, doing:

    Find what: ^( [ ]+)([^ ][^=\r\n]*::Pointer)([ ]+)(\w+);[\r\n]+\1\4\ =
    Replace with: $1$2$3$4 =
    Filters: itk*.* !+\test
    Directory: D:\src\ITK\Modules
    [v] Match case
    (*) Regular expression

- Follow-up to pull request InsightSoftwareConsortium#4952
commit b4b8e7b
Using Notepad++, Replace in Files, doing:

    Find what: ^( [ ]+)(typename )?([^ ].+)::Pointer[ ]+(\w+[ ]+= \3::New\(\);)
    Find what: ^( [ ]+)(typename )?([^ ].+)::Pointer[ ]+(\w+[ ]+=\r\n\1  \3::New\(\);)
    Replace with: $1auto $4
    Filters: itk*.* !+\test
    Directory: D:\src\ITK\Modules
    [v] Match case
    (*) Regular expression

Manually excluded the initialization of `m_ConvolutionImageFilter` (in
"itkFFTDiscreteGaussianImageFilter.h") as it is not a local variable.

Follow-up to pull request InsightSoftwareConsortium#2826
commit 5ab79bc
"STYLE: Use `auto` for declaration of variables initialized by `New()`"
@github-actions github-actions bot added type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct area:Core Issues affecting the Core module area:Filtering Issues affecting the Filtering module area:IO Issues affecting the IO module area:Registration Issues affecting the Registration module area:Segmentation Issues affecting the Segmentation module area:Numerics Issues affecting the Numerics module labels Nov 20, 2024
@blowekamp
Copy link
Member

Did you include the Examples directory with these changes?

@N-Dekker
Copy link
Contributor Author

Did you include the Examples directory with these changes?

No, I only included files from "ITK/Modules", thanks for reminding me, Bradley! Would be nice for a follow-up!

(I'd rather not include them with this PR, as it is already quite large: over 100 code changes.)

@N-Dekker
Copy link
Contributor Author

N-Dekker commented Nov 20, 2024

/azp run ITK.macOS.Python

@N-Dekker N-Dekker marked this pull request as ready for review November 20, 2024 16:10
@hjmjohnson hjmjohnson merged commit 677b761 into InsightSoftwareConsortium:master Nov 20, 2024
17 checks passed
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Nov 20, 2024
Using Notepad++, Replace in Files, doing:

    Find what: ^( [ ]+)([^ ][^=\r\n]*[Ii]terator[^=\r\n]*)([ ]+)(\w+[Ii]t);[\r\n]+\1\4\ =
    Replace with: $1$2$3$4 =
    Filters: itk*.* !+\test
    Directory: D:\src\ITK\Modules
    [v] Match case
    (*) Regular expression

- Follow-up to pull request InsightSoftwareConsortium#4964
commit 4926511
"STYLE: Replace `Pointer var; var = x` with `Pointer var = x`"
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Nov 20, 2024
Using Notepad++, Replace in Files, doing:

    Find what: ^( [ ]+)([^ ][^=\r\n]*[Ii]terator[^=\r\n]*)([ ]+)(\w+[Ii]t);[\r\n]+\1\4\ =
    Replace with: $1$2$3$4 =
    Filters: itk*.* !+\test
    Directory: D:\src\ITK\Modules
    [v] Match case
    (*) Regular expression

- Follow-up to pull request InsightSoftwareConsortium#4964
commit 4926511
"STYLE: Replace `Pointer var; var = x` with `Pointer var = x`"
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Nov 21, 2024
- Follow-up to pull request InsightSoftwareConsortium#4964
commit 4926511
"STYLE: Replace `Pointer var; var = x` with `Pointer var = x`"

Triggered by a comment by Bradley Lowekamp at
InsightSoftwareConsortium#4964 (comment)
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Nov 21, 2024
- Follow-up to pull request InsightSoftwareConsortium#4964
commit 677b761
"STYLE: Replace T::Pointer with auto when initializing variables by New()"

Triggered by a comment by Bradley Lowekamp at
InsightSoftwareConsortium#4964 (comment)
hjmjohnson pushed a commit that referenced this pull request Nov 21, 2024
- Follow-up to pull request #4964
commit 4926511
"STYLE: Replace `Pointer var; var = x` with `Pointer var = x`"

Triggered by a comment by Bradley Lowekamp at
#4964 (comment)
hjmjohnson pushed a commit that referenced this pull request Nov 21, 2024
- Follow-up to pull request #4964
commit 677b761
"STYLE: Replace T::Pointer with auto when initializing variables by New()"

Triggered by a comment by Bradley Lowekamp at
#4964 (comment)
hjmjohnson pushed a commit that referenced this pull request Nov 21, 2024
Using Notepad++, Replace in Files, doing:

    Find what: ^( [ ]+)([^ ][^=\r\n]*[Ii]terator[^=\r\n]*)([ ]+)(\w+[Ii]t);[\r\n]+\1\4\ =
    Replace with: $1$2$3$4 =
    Filters: itk*.* !+\test
    Directory: D:\src\ITK\Modules
    [v] Match case
    (*) Regular expression

- Follow-up to pull request #4964
commit 4926511
"STYLE: Replace `Pointer var; var = x` with `Pointer var = x`"
N-Dekker added a commit to SuperElastix/elastix that referenced this pull request Nov 22, 2024
N-Dekker added a commit to SuperElastix/elastix that referenced this pull request Nov 23, 2024
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 area:IO Issues affecting the IO module area:Numerics Issues affecting the Numerics module area:Registration Issues affecting the Registration module area:Segmentation Issues affecting the Segmentation module type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants