Skip to content

Commit

Permalink
COMP: removed dead code found by cppcheck
Browse files Browse the repository at this point in the history
Added comments to some code it identified as dead but is in fact there to cause compile errors should mistakes be made elsewhere.
  • Loading branch information
seanm authored and N-Dekker committed Jan 7, 2025
1 parent 668b781 commit b7c6cb4
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Modules/Core/Common/include/itkConceptChecking.h
Original file line number Diff line number Diff line change
Expand Up @@ -702,13 +702,15 @@ struct HasNumericTraits
void
constraints()
{
// This is here to cause compile-time failures, if a provided custom type is missing some methods.
Detail::UniqueType<typename NumericTraits<T>::ValueType>();
Detail::UniqueType<typename NumericTraits<T>::PrintType>();
Detail::UniqueType<typename NumericTraits<T>::AbsType>();
Detail::UniqueType<typename NumericTraits<T>::AccumulateType>();
Detail::UniqueType<typename NumericTraits<T>::RealType>();
Detail::UniqueType<typename NumericTraits<T>::ScalarRealType>();
Detail::UniqueType<typename NumericTraits<T>::FloatType>();

T a{};

// Test these methods that take an instance of T to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ LinearInterpolateImageFunction<TInputImage, TCoordinate>::EvaluateUnoptimized(co

// When RealType is VariableLengthVector, 'value' will be resized properly
// below when it's assigned again.
Concept::Detail::UniqueType<typename NumericTraits<RealType>::ScalarRealType>();

RealType value;
// Initialize variable "value" with overloaded function so that
// in the case of variable length vectors the "value" is initialized
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ struct helper
template <unsigned int VDimension>
struct helper<itk::Index<VDimension>>
{
static constexpr unsigned int Dimension = VDimension;
using PositionType = itk::Index<VDimension>;

template <class TImage, class TIterator>
Expand All @@ -43,7 +42,6 @@ struct helper<itk::Index<VDimension>>
template <typename TCoord, unsigned int VDimension>
struct helper<itk::Point<TCoord, VDimension>>
{
static constexpr unsigned int Dimension = VDimension;
using PositionType = itk::Point<TCoord, VDimension>;

template <class TImage, class TIterator>
Expand Down
2 changes: 0 additions & 2 deletions Modules/Filtering/ImageGrid/test/itkPasteImageFilterGTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ class PasteFixture : public ::testing::Test
template <typename TInputImage, typename TSourceImage = TInputImage>
struct FixtureUtilities
{
static const unsigned int Dimension = TInputImage::ImageDimension;

using PixelType = typename TInputImage::PixelType;
using OutputPixelType = PixelType;
using InputImageType = TInputImage;
Expand Down

0 comments on commit b7c6cb4

Please sign in to comment.