Skip to content

Commit

Permalink
STYLE: Order static inline consistently
Browse files Browse the repository at this point in the history
Prefer 'static inline' ordering to 'inline static'
for toolkit consistency.

Both static inline and inline static are allowed and they mean the same
thing. static inline is preferred.

"storage class specifiers" like static are prefered to come first in a
declaration.
  • Loading branch information
hjmjohnson committed Dec 3, 2024
1 parent af9d1d2 commit 997b69b
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions Modules/Core/Common/include/itkBSplineDerivativeKernelFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ class ITK_TEMPLATE_EXPORT BSplineDerivativeKernelFunction : public KernelFunctio
{};

/** Evaluate the function: zeroth order spline. */
inline static TRealValueType
static inline TRealValueType
Evaluate(const Dispatch<0> &, const TRealValueType & itkNotUsed(u))
{
return TRealValueType{ 0.0 };
}

/** Evaluate the function: first order spline */
inline static TRealValueType
static inline TRealValueType
Evaluate(const Dispatch<1> &, const TRealValueType & u)
{
if (Math::ExactlyEquals(u, TRealValueType{ -1.0 }))
Expand Down Expand Up @@ -132,7 +132,7 @@ class ITK_TEMPLATE_EXPORT BSplineDerivativeKernelFunction : public KernelFunctio
}

/** Evaluate the function: second order spline. */
inline static TRealValueType
static inline TRealValueType
Evaluate(const Dispatch<2> &, const TRealValueType & u)
{
if ((u > TRealValueType{ -0.5 }) && (u < TRealValueType{ 0.5 }))
Expand All @@ -154,7 +154,7 @@ class ITK_TEMPLATE_EXPORT BSplineDerivativeKernelFunction : public KernelFunctio
}

/** Evaluate the function: third order spline. */
inline static TRealValueType
static inline TRealValueType
Evaluate(const Dispatch<3> &, const TRealValueType & u)
{
if ((u >= TRealValueType{ 0.0 }) && (u < TRealValueType{ 1.0 }))
Expand All @@ -180,7 +180,7 @@ class ITK_TEMPLATE_EXPORT BSplineDerivativeKernelFunction : public KernelFunctio
}

/** Evaluate the function: unimplemented spline order */
inline static TRealValueType
static inline TRealValueType
Evaluate(const DispatchBase &, const TRealValueType &)
{
itkGenericExceptionMacro("Evaluate not implemented for spline order " << SplineOrder);
Expand Down
10 changes: 5 additions & 5 deletions Modules/Core/Common/include/itkBSplineKernelFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class ITK_TEMPLATE_EXPORT BSplineKernelFunction : public KernelFunctionBase<TRea
{};

/** Zeroth order spline. */
inline static TRealValueType
static inline TRealValueType
Evaluate(const Dispatch<0> &, const TRealValueType & u)
{
const TRealValueType absValue = itk::Math::abs(u);
Expand All @@ -114,7 +114,7 @@ class ITK_TEMPLATE_EXPORT BSplineKernelFunction : public KernelFunctionBase<TRea
}

/** First order spline */
inline static TRealValueType
static inline TRealValueType
Evaluate(const Dispatch<1> &, const TRealValueType & u)
{
const TRealValueType absValue = itk::Math::abs(u);
Expand All @@ -129,7 +129,7 @@ class ITK_TEMPLATE_EXPORT BSplineKernelFunction : public KernelFunctionBase<TRea
}

/** Second order spline. */
inline static TRealValueType
static inline TRealValueType
Evaluate(const Dispatch<2> &, const TRealValueType & u)
{
const TRealValueType absValue = itk::Math::abs(u);
Expand All @@ -152,7 +152,7 @@ class ITK_TEMPLATE_EXPORT BSplineKernelFunction : public KernelFunctionBase<TRea
}

/** Third order spline. */
inline static TRealValueType
static inline TRealValueType
Evaluate(const Dispatch<3> &, const TRealValueType & u)
{
const TRealValueType absValue = itk::Math::abs(u);
Expand All @@ -176,7 +176,7 @@ class ITK_TEMPLATE_EXPORT BSplineKernelFunction : public KernelFunctionBase<TRea
}

/** Unimplemented spline order */
inline static TRealValueType
static inline TRealValueType
Evaluate(const DispatchBase &, const TRealValueType &)
{
itkGenericExceptionMacro("Evaluate not implemented for spline order " << SplineOrder);
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkImageHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class ImageHelper
using IndexValueType = typename ImageType::IndexValueType;

/** ComputeIndex with recursive templates */
inline static void
static inline void
ComputeIndex(const IndexType & bufferedRegionIndex,
OffsetValueType offset,
[[maybe_unused]] const OffsetValueType offsetTable[],
Expand Down Expand Up @@ -88,7 +88,7 @@ class ImageHelper

// ComputeOffset
//
inline static void
static inline void
ComputeOffset(const IndexType & bufferedRegionIndex,
const IndexType & index,
[[maybe_unused]] const OffsetValueType offsetTable[],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class ITK_TEMPLATE_EXPORT NoiseBaseImageFilter : public InPlaceImageFilter<TInpu
void
PrintSelf(std::ostream & os, Indent indent) const override;

inline static uint32_t
static inline uint32_t
Hash(uint32_t a, uint32_t b)
{
// Knuth's Multiplicative Method for hashing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ class ITK_TEMPLATE_EXPORT ImageToImageMetric : public SingleValuedCostFunction

~FixedImageSamplePoint() = default;

inline friend std::ostream &
friend inline std::ostream &
operator<<(std::ostream & os, const FixedImageSamplePoint & val)
{
os << "point: " << static_cast<typename NumericTraits<FixedImagePointType>::PrintType>(val.point) << std::endl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class ImageVoxel
m_Value = val;
}

inline friend std::ostream &
friend inline std::ostream &
operator<<(std::ostream & os, const ImageVoxel & val)
{
os << "Vpos: " << val.m_Vpos << std::endl;
Expand Down

0 comments on commit 997b69b

Please sign in to comment.