Skip to content

Commit

Permalink
Merge topic 'NO_module_cppcheck'
Browse files Browse the repository at this point in the history
a379365 COMP: Fix all valid cppcheck warnings in ITK (last patch)
  • Loading branch information
Kent Williams authored and kwrobot committed Mar 28, 2013
2 parents f3ffe9f + a379365 commit b63dc9b
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 25 deletions.
12 changes: 7 additions & 5 deletions Examples/DataRepresentation/Image/ImageAdaptor3.cxx
Expand Up @@ -60,7 +60,8 @@
//
// Software Guide : EndLatex


namespace itk
{
// Software Guide : BeginCodeSnippet
class VectorPixelAccessor
{
Expand All @@ -70,9 +71,10 @@ class VectorPixelAccessor

VectorPixelAccessor() : m_Index(0) {}

void operator=( const VectorPixelAccessor & vpa )
VectorPixelAccessor & operator=( const VectorPixelAccessor & vpa )
{
m_Index = vpa.m_Index;
return *this;
}
ExternalType Get( const InternalType & input ) const
{
Expand All @@ -87,7 +89,7 @@ class VectorPixelAccessor
unsigned int m_Index;
};
// Software Guide : EndCodeSnippet

}

// Software Guide : BeginLatex
//
Expand Down Expand Up @@ -150,7 +152,7 @@ int main( int argc, char *argv[] )

// Software Guide : BeginCodeSnippet
typedef itk::ImageAdaptor< VectorImageType,
VectorPixelAccessor > ImageAdaptorType;
itk::VectorPixelAccessor > ImageAdaptorType;

ImageAdaptorType::Pointer adaptor = ImageAdaptorType::New();
// Software Guide : EndCodeSnippet
Expand All @@ -167,7 +169,7 @@ int main( int argc, char *argv[] )


// Software Guide : BeginCodeSnippet
VectorPixelAccessor accessor;
itk::VectorPixelAccessor accessor;
accessor.SetIndex( atoi( argv[3] ) );
adaptor->SetPixelAccessor( accessor );
// Software Guide : EndCodeSnippet
Expand Down
14 changes: 9 additions & 5 deletions Examples/DataRepresentation/Image/ImageAdaptor4.cxx
Expand Up @@ -56,7 +56,8 @@
//
// Software Guide : EndLatex


namespace itk
{
// Software Guide : BeginCodeSnippet
class ThresholdingPixelAccessor
{
Expand All @@ -75,14 +76,17 @@ class ThresholdingPixelAccessor
m_Threshold = threshold;
}

void operator=( const ThresholdingPixelAccessor & vpa )
ThresholdingPixelAccessor & operator=( const ThresholdingPixelAccessor & vpa )
{
m_Threshold = vpa.m_Threshold;
return *this;
}

private:
InternalType m_Threshold;
};
}

// Software Guide : EndCodeSnippet


Expand Down Expand Up @@ -123,7 +127,7 @@ int main( int argc, char *argv[] )


// Software Guide : BeginCodeSnippet
typedef ThresholdingPixelAccessor::InternalType PixelType;
typedef itk::ThresholdingPixelAccessor::InternalType PixelType;
const unsigned int Dimension = 2;
typedef itk::Image< PixelType, Dimension > ImageType;
// Software Guide : EndCodeSnippet
Expand All @@ -140,7 +144,7 @@ int main( int argc, char *argv[] )

// Software Guide : BeginCodeSnippet
typedef itk::ImageAdaptor< ImageType,
ThresholdingPixelAccessor > ImageAdaptorType;
itk::ThresholdingPixelAccessor > ImageAdaptorType;

ImageAdaptorType::Pointer adaptor = ImageAdaptorType::New();
// Software Guide : EndCodeSnippet
Expand All @@ -156,7 +160,7 @@ int main( int argc, char *argv[] )


// Software Guide : BeginCodeSnippet
ThresholdingPixelAccessor accessor;
itk::ThresholdingPixelAccessor accessor;
accessor.SetThreshold( atoi( argv[3] ) );
adaptor->SetPixelAccessor( accessor );
// Software Guide : EndCodeSnippet
Expand Down
2 changes: 1 addition & 1 deletion Examples/Filtering/CompositeFilterExample.cxx
Expand Up @@ -283,7 +283,7 @@ int main( int argc, char* argv[] )
{
writer->Update();
}
catch ( itk::ExceptionObject e )
catch ( itk::ExceptionObject & e )
{
std::cerr << "Error: " << e << std::endl;
}
Expand Down
2 changes: 1 addition & 1 deletion Examples/Filtering/DanielssonDistanceMapImageFilter.cxx
Expand Up @@ -255,7 +255,7 @@ int main( int argc, char * argv[] )
{
offsetWriter->Update();
}
catch( itk::ExceptionObject exp )
catch( itk::ExceptionObject & exp )
{
std::cerr << "Exception caught !" << std::endl;
std::cerr << exp << std::endl;
Expand Down
2 changes: 0 additions & 2 deletions Examples/Filtering/OtsuMultipleThresholdImageFilter.cxx
Expand Up @@ -167,8 +167,6 @@ int main( int argc, char * argv[] )
InputPixelType lowerThreshold = 0;
InputPixelType upperThreshold;

std::string format = argv[2];

char outputFilename[1000];
outputFile = outputFileBase + "%03d.";
outputFile += argv[3]; // filename extension
Expand Down
6 changes: 3 additions & 3 deletions Examples/Filtering/SignedDanielssonDistanceMapImageFilter.cxx
Expand Up @@ -133,7 +133,7 @@ int main( int argc, char * argv[] )
{
writer->Update();
}
catch( itk::ExceptionObject exp )
catch( itk::ExceptionObject & exp )
{
std::cerr << "Exception caught !" << std::endl;
std::cerr << exp << std::endl;
Expand All @@ -156,7 +156,7 @@ int main( int argc, char * argv[] )
{
voronoiWriter->Update();
}
catch( itk::ExceptionObject exp )
catch( itk::ExceptionObject & exp )
{
std::cerr << "Exception caught !" << std::endl;
std::cerr << exp << std::endl;
Expand All @@ -182,7 +182,7 @@ int main( int argc, char * argv[] )
{
offsetWriter->Update();
}
catch( itk::ExceptionObject exp )
catch( itk::ExceptionObject & exp )
{
std::cerr << "Exception caught !" << std::endl;
std::cerr << exp << std::endl;
Expand Down
2 changes: 1 addition & 1 deletion Examples/Registration/DeformableRegistration10.cxx
Expand Up @@ -208,7 +208,7 @@ int main( int argc, char *argv[] )
{
fieldWriter->Update();
}
catch ( itk::ExceptionObject e )
catch ( itk::ExceptionObject & e )
{
e.Print( std::cerr );
}
Expand Down
2 changes: 1 addition & 1 deletion Examples/Registration/DeformableRegistration9.cxx
Expand Up @@ -201,7 +201,7 @@ int main( int argc, char *argv[] )
{
fieldWriter->Update();
}
catch ( itk::ExceptionObject e )
catch ( itk::ExceptionObject & e )
{
e.Print( std::cerr );
}
Expand Down
6 changes: 3 additions & 3 deletions Examples/Registration/MultiResImageRegistration1.cxx
Expand Up @@ -398,8 +398,8 @@ int main( int argc, char *argv[] )
FixedImageReaderType::Pointer fixedImageReader = FixedImageReaderType::New();
MovingImageReaderType::Pointer movingImageReader = MovingImageReaderType::New();

fixedImageReader->SetFileName( argv[1] );
movingImageReader->SetFileName( argv[2] );
fixedImageReader->SetFileName( fixedImageFile );
movingImageReader->SetFileName( movingImageFile );


// Software Guide : BeginLatex
Expand Down Expand Up @@ -644,7 +644,7 @@ int main( int argc, char *argv[] )
CastFilterType::Pointer caster = CastFilterType::New();


writer->SetFileName( argv[3] );
writer->SetFileName( outImagefile );


caster->SetInput( resample->GetOutput() );
Expand Down
2 changes: 1 addition & 1 deletion Examples/SpatialObjects/DTITubeSpatialObject.cxx
Expand Up @@ -91,7 +91,7 @@ int main( int , char *[] )
v[k] = k;
}
p.SetTensorMatrix(v);
delete v;
delete [] v;
p.SetColor(1,0,0,1);
list.push_back(p);
}
Expand Down
2 changes: 1 addition & 1 deletion Wrapping/Generators/Python/PyUtils/itkPyCommand.h
Expand Up @@ -71,7 +71,7 @@ class PyCommand : public Command
~PyCommand();
void PyExecute();
PyCommand(const Self&); // Not implemented.
void operator=(const Self&); // Not implemented.
PyCommand & operator=(const Self&); // Not implemented.

private:
PyObject *m_Object;
Expand Down
2 changes: 1 addition & 1 deletion Wrapping/Generators/Tcl/itkTclCommand.h
Expand Up @@ -61,7 +61,7 @@ class TclCommand : public Command
TclCommand();
~TclCommand() {}
TclCommand(const Self&); // Not implemented.
void operator=(const Self&); // Not implemented.
TclCommand & operator=(const Self&); // Not implemented.

void TclExecute() const;

Expand Down

0 comments on commit b63dc9b

Please sign in to comment.