Skip to content

Commit ad64a79

Browse files
N-Dekkerhjmjohnson
authored andcommitted
STYLE: Do not do return; directly after throwing an exception
Any return statement directly after a `throw` (possibly from a call to `itkExceptionMacro` or `itkGenericExceptionMacro`) is unreachable, by definition.
1 parent ad86850 commit ad64a79

File tree

37 files changed

+0
-66
lines changed

37 files changed

+0
-66
lines changed

Modules/Bridge/VTK/include/itkVTKImageImport.hxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ VTKImageImport<TOutputImage>::PropagateRequestedRegion(DataObject * outputPtr)
125125
if (!output)
126126
{
127127
itkExceptionMacro(<< "Downcast from DataObject to my Image type failed.");
128-
return;
129128
}
130129
Superclass::PropagateRequestedRegion(output);
131130
if (m_PropagateUpdateExtentCallback)

Modules/Core/Common/include/itkByteSwapper.hxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ ByteSwapper<T>::SwapRangeFromSystemToBigEndian(T * p, BufferSizeType num)
129129
return;
130130
default:
131131
itkGenericExceptionMacro(<< "Cannot swap number of bytes requested");
132-
return;
133132
}
134133
}
135134

Modules/Core/Common/include/itkImageDuplicator.hxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ ImageDuplicator<TInputImage>::Update()
4040
if (!m_InputImage)
4141
{
4242
itkExceptionMacro(<< "Input image has not been connected");
43-
return;
4443
}
4544

4645
// Update only if the input image has been modified

Modules/Core/Common/include/itkResourceProbesCollectorBase.hxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ ResourceProbesCollectorBase<TProbe>::Stop(const char * id)
4444
if (pos == this->m_Probes.end())
4545
{
4646
itkGenericExceptionMacro(<< "The probe \"" << id << "\" does not exist. It can not be stopped.");
47-
return;
4847
}
4948
pos->second.Stop();
5049
}

Modules/Core/Common/include/itkSmapsFileParser.hxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ VMMapFileParser<TVMMapDataType>::ReadFile(const std::string & mapFileLocation)
149149
if (inputFile.is_open() == false)
150150
{
151151
itkGenericExceptionMacro(<< "The VMap file " << mapFileLocation << " could not be open");
152-
return;
153152
}
154153
// load the file
155154
inputFile >> this->m_MapData;

Modules/Core/Common/include/itkStreamingImageFilter.hxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ StreamingImageFilter<TInputImage, TOutputImage>::UpdateOutputData(DataObject * i
120120
{
121121
itkExceptionMacro(<< "At least " << this->GetNumberOfRequiredInputs() << " inputs are required but only " << ninputs
122122
<< " are specified.");
123-
return;
124123
}
125124

126125
/**

Modules/Core/Common/src/itkPlatformMultiThreaderPosix.cxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ PlatformMultiThreader::MultipleMethodExecute()
6060
if (m_MultipleMethod[thread_loop] == (ThreadFunctionType) nullptr)
6161
{
6262
itkExceptionMacro(<< "No multiple method set for: " << thread_loop);
63-
return;
6463
}
6564
}
6665

Modules/Core/Common/src/itkPlatformMultiThreaderSingle.cxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ PlatformMultiThreader::MultipleMethodExecute()
4949
if (m_MultipleMethod[thread_loop] == (ThreadFunctionType)0)
5050
{
5151
itkExceptionMacro(<< "No multiple method set for: " << thread_loop);
52-
return;
5352
}
5453
}
5554

Modules/Core/Common/src/itkPlatformMultiThreaderWindows.cxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ PlatformMultiThreader::MultipleMethodExecute()
5454
if (m_MultipleMethod[threadCount] == nullptr)
5555
{
5656
itkExceptionMacro(<< "No multiple method set for: " << threadCount);
57-
return;
5857
}
5958
}
6059
// Using _beginthreadex on a PC

Modules/Core/ImageFunction/include/itkRayCastInterpolateImageFunction.hxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1197,7 +1197,6 @@ RayCastHelper<TInputImage, TCoordRep>::InitialiseVoxelPointers()
11971197
err.SetDescription("The ray traversal direction is unset "
11981198
"- InitialiseVoxelPointers().");
11991199
throw err;
1200-
return;
12011200
}
12021201
}
12031202
}

0 commit comments

Comments
 (0)