Skip to content

Commit 0d05705

Browse files
N-Dekkerhjmjohnson
authored andcommitted
STYLE: Remove unnecessary parentheses around dereferenced variables
Replaced `([ \(])\(\*(\w+)\)([ \),])` with `$1*$2$3`, using regular expressions.
1 parent 751acdb commit 0d05705

File tree

57 files changed

+123
-123
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+123
-123
lines changed

Modules/Core/Common/include/itkConstNeighborhoodIterator.hxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ ConstNeighborhoodIterator<TImage, TBoundaryCondition>::operator++()
506506
m_Loop[i] = m_BeginIndex[i];
507507
for (Iterator it = Superclass::Begin(); it < _end; ++it)
508508
{
509-
(*it) += m_WrapOffset[i];
509+
*it += m_WrapOffset[i];
510510
}
511511
}
512512
else
@@ -541,7 +541,7 @@ ConstNeighborhoodIterator<TImage, TBoundaryCondition>::operator--()
541541
m_Loop[i] = m_Bound[i] - 1;
542542
for (Iterator it = Superclass::Begin(); it < _end; ++it)
543543
{
544-
(*it) -= m_WrapOffset[i];
544+
*it -= m_WrapOffset[i];
545545
}
546546
}
547547
else
@@ -713,7 +713,7 @@ ConstNeighborhoodIterator<TImage, TBoundaryCondition>::operator+=(const OffsetTy
713713
// Increment pointers.
714714
for (Iterator it = this->Begin(); it < _end; ++it)
715715
{
716-
(*it) += accumulator;
716+
*it += accumulator;
717717
}
718718

719719
// Update loop counter values
@@ -750,7 +750,7 @@ ConstNeighborhoodIterator<TImage, TBoundaryCondition>::operator-=(const OffsetTy
750750
// Increment pointers.
751751
for (Iterator it = this->Begin(); it < _end; ++it)
752752
{
753-
(*it) -= accumulator;
753+
*it -= accumulator;
754754
}
755755

756756
// Update loop counter values

Modules/Core/Common/include/itkNeighborhoodAccessorFunctor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ class ITK_TEMPLATE_EXPORT NeighborhoodAccessorFunctor final
6161

6262
/** Method to dereference a pixel pointer. This is used from the
6363
* ConstNeighborhoodIterator as the equivalent operation to (*it).
64-
* This method should be preferred over the former (*it) notation.
64+
* This method should be preferred over the former *it notation.
6565
* The reason is that dereferencing a pointer to a location of
6666
* VectorImage pixel involves a different operation that simply
6767
* dereferencing the pointer. */
6868
inline PixelType
6969
Get(const InternalPixelType * pixelPointer) const
7070
{
71-
return (*pixelPointer);
71+
return *pixelPointer;
7272
}
7373

7474
/** Method to set the pixel value at a certain pixel pointer */

Modules/Core/Common/include/itkPriorityQueueContainer.hxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ ElementWrapperPointerInterface<TElementWrapperPointer, TElementIdentifier>::is_l
6161
const ElementWrapperPointerType & element1,
6262
const ElementWrapperPointerType & element2) const
6363
{
64-
return (element1->is_less((*element1), (*element2)));
64+
return (element1->is_less(*element1, *element2));
6565
}
6666
// -----------------------------------------------------------------------------
6767

@@ -72,7 +72,7 @@ ElementWrapperPointerInterface<TElementWrapperPointer, TElementIdentifier>::is_g
7272
const ElementWrapperPointerType & element1,
7373
const ElementWrapperPointerType & element2) const
7474
{
75-
return (element1->is_greater((*element1), (*element2)));
75+
return (element1->is_greater(*element1, *element2));
7676
}
7777
// -----------------------------------------------------------------------------
7878

Modules/Core/Common/include/itkVectorImageNeighborhoodAccessorFunctor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class VectorImageNeighborhoodAccessorFunctor
7979

8080
/** Method to dereference a pixel pointer. This is used from the
8181
* ConstNeighborhoodIterator as the equivalent operation to (*it).
82-
* This method should be preferred over the former (*it) notation.
82+
* This method should be preferred over the former *it notation.
8383
* The reason is that dereferencing a pointer to a location of
8484
* VectorImage pixel involves a different operation that simply
8585
* dereferencing the pointer. Here a PixelType (array of InternalPixelType s)

Modules/Core/Common/test/itkMathRoundProfileTest1.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ itkMathRoundProfileTest1(int, char *[])
204204

205205
while (inpItr != inputEnd)
206206
{
207-
if ((*outItr1) != (*outItr2))
207+
if (*outItr1 != *outItr2)
208208
{
209209
std::cout << "Warning*** For input: " << *inpItr << " if-round: " << *outItr1
210210
<< " differs from itk::Math::Round: " << *outItr2 << std::endl;

Modules/Core/GPUCommon/src/itkOpenCLUtil.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ OpenCLGetAvailableDevices(cl_platform_id platform, cl_device_type devType, cl_ui
6161
errid = clGetDeviceIDs(platform, devType, totalNumDevices, totalDevices, nullptr);
6262
OpenCLCheckError(errid, __FILE__, __LINE__, ITK_LOCATION);
6363

64-
(*numAvailableDevices) = 0;
64+
*numAvailableDevices = 0;
6565

6666
// check available devices
6767
for (cl_uint i = 0; i < totalNumDevices; ++i)
@@ -75,7 +75,7 @@ OpenCLGetAvailableDevices(cl_platform_id platform, cl_device_type devType, cl_ui
7575
}
7676
}
7777

78-
availableDevices = (cl_device_id *)malloc((*numAvailableDevices) * sizeof(cl_device_id));
78+
availableDevices = (cl_device_id *)malloc(*numAvailableDevices * sizeof(cl_device_id));
7979

8080
int idx = 0;
8181
for (cl_uint i = 0; i < totalNumDevices; ++i)

Modules/Core/ImageFunction/include/itkGaussianBlurImageFunction.hxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,8 @@ GaussianBlurImageFunction<TInputImage, TOutput>::RecomputeContinuousGaussianKern
332332
}
333333
}
334334

335-
(*it) = m_GaussianFunction->Evaluate(pt);
336-
sum += (*it);
335+
*it = m_GaussianFunction->Evaluate(pt);
336+
sum += *it;
337337
++i;
338338
++it;
339339
}
@@ -342,7 +342,7 @@ GaussianBlurImageFunction<TInputImage, TOutput>::RecomputeContinuousGaussianKern
342342
it = gaussianNeighborhood.Begin();
343343
while (it != gaussianNeighborhood.End())
344344
{
345-
(*it) /= sum;
345+
*it /= sum;
346346
++it;
347347
}
348348
m_ContinuousOperatorArray[direction] = gaussianNeighborhood;

Modules/Core/ImageFunction/include/itkGaussianDerivativeImageFunction.hxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ GaussianDerivativeImageFunction<TInputImage, TOutput>::RecomputeGaussianKernel()
130130
while (it != dogNeighborhood.End())
131131
{
132132
pt[0] = dogNeighborhood.GetOffset(i)[direction] * directionSpacing;
133-
(*it) = m_GaussianDerivativeSpatialFunction->Evaluate(pt);
133+
*it = m_GaussianDerivativeSpatialFunction->Evaluate(pt);
134134
++i;
135135
++it;
136136
}
@@ -167,7 +167,7 @@ GaussianDerivativeImageFunction<TInputImage, TOutput>::EvaluateAtIndex(const Ind
167167

168168
for (const TOutput & kernelValue : operatorNeighborhood.GetBufferReference())
169169
{
170-
result += kernelValue * (*neighborhoodRangeIterator);
170+
result += kernelValue * *neighborhoodRangeIterator;
171171
++neighborhoodRangeIterator;
172172
}
173173
gradient[direction] = result;

Modules/Core/ImageFunction/include/itkMedianImageFunction.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ MedianImageFunction<TInputImage, TCoordinate>::EvaluateAtIndex(const IndexType &
7575
const auto medianIterator = pixels.begin() + (pixels.size() / 2);
7676
std::nth_element(pixels.begin(), medianIterator, pixels.end());
7777

78-
return (*medianIterator);
78+
return *medianIterator;
7979
}
8080
} // namespace itk
8181

Modules/Core/Mesh/include/itkMesh.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ Mesh<TPixelType, VDimension, TMeshTraits>::GetCellBoundaryFeatureNeighbors(int
634634

635635
for (auto usingCell = boundary->UsingCellsBegin(); usingCell != boundary->UsingCellsEnd(); ++usingCell)
636636
{
637-
if ((*usingCell) != cellId)
637+
if (*usingCell != cellId)
638638
{
639639
cellSet->insert(*usingCell);
640640
}

0 commit comments

Comments
 (0)