Skip to content

Commit

Permalink
STYLE: Replace integer literals which are cast to bool.
Browse files Browse the repository at this point in the history
Finds and replaces integer literals which are cast to bool.

SRCDIR=/Users/johnsonhj/Dashboard/src/ITK #My local SRC
BLDDIR=/Users/johnsonhj/Dashboard/src/ITK-clang/ #My local BLD

cd /Users/johnsonhj/Dashboard/src/ITK-clang/
run-clang-tidy.py -checks=-*,modernize-use-bool-literals  -header-filter=.* -fix
  • Loading branch information
hjmjohnson committed Nov 6, 2018
1 parent 9c09f5a commit d12b531
Show file tree
Hide file tree
Showing 75 changed files with 133 additions and 133 deletions.
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkVertexCell.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ VertexCell< TCellInterface >
{
pcoord[0] = -10.0;
}
return 0;
return false;
}
}
} // end namespace itk
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/src/itkDataObject.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ void
DataObject
::DataHasBeenGenerated()
{
this->m_DataReleased = 0;
this->m_DataReleased = false;
this->Modified();
this->m_UpdateMTime.Modified();
}
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/src/itkLightProcessObject.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ ::UpdateOutputData()
* GenerateData this object - we have not aborted yet, and our progress
* before we start to execute is 0.0.
*/
m_AbortGenerateData = 0;
m_AbortGenerateData = false;
m_Progress = 0.0f;

this->GenerateData();
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/src/itkObjectFactoryBase.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ ::GetEnableFlag(const char *className, const char *subclassName)
return ( *i ).second.m_EnabledFlag;
}
}
return 0;
return false;
}

/**
Expand All @@ -923,7 +923,7 @@ ::Disable(const char *className)

for ( auto i = start; i != end; ++i )
{
( *i ).second.m_EnabledFlag = 0;
( *i ).second.m_EnabledFlag = false;
}
}

Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/src/itkOutputWindow.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ OutputWindow::Pointer OutputWindow:: m_Instance = nullptr;
OutputWindow
::OutputWindow()
{
m_PromptUser = 0;
m_PromptUser = false;
}

OutputWindow
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/src/itkProcessObject.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1383,7 +1383,7 @@ ::PropagateResetPipeline()
// Reset this object.
//
// Clear the updating flag.
m_Updating = 0;
m_Updating = false;

//
// Loop through the inputs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ int itkFloodFilledSpatialFunctionTest(int, char* [])

for(it.GoToBegin(); !it.IsAtEnd(); ++it)
{
it.Set(0);
it.Set(false);
}

// Create and initialize a spatial function
Expand Down Expand Up @@ -130,7 +130,7 @@ int itkFloodFilledSpatialFunctionTest(int, char* [])
// Iterate through the entire image and set interior pixels to 1
for( sfi.GoToBegin(); !( sfi.IsAtEnd() ); ++sfi)
{
sfi.Set(1);
sfi.Set(true);
}

} // end loop over iterator strategies
Expand Down
8 changes: 4 additions & 4 deletions Modules/Core/Transform/test/itkAffineTransformTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ int itkAffineTransformTest(int, char *[])
}

/* Compose with an isotropic scaling */
aff2->Scale(.3, 1);
aff2->Scale(.3, true);
std::cout << "Result of isotropic scaling:" << std::endl;
aff2->Print( std::cout );

Expand Down Expand Up @@ -301,7 +301,7 @@ int itkAffineTransformTest(int, char *[])
}

/* Compose with a general N-D rotation */
aff2->Rotate(0, 1, 0.57, 1);
aff2->Rotate(0, 1, 0.57, true);
std::cout << "Result of general rotation:" << std::endl;
aff2->Print( std::cout );

Expand All @@ -321,7 +321,7 @@ int itkAffineTransformTest(int, char *[])
}

/* Compose with a 2-D rotation */
aff2->Rotate(0, 1, -0.57, 1);
aff2->Rotate(0, 1, -0.57, true);
std::cout << "Result of 2-D rotation:" << std::endl;
aff2->Print( std::cout );

Expand Down Expand Up @@ -501,7 +501,7 @@ int itkAffineTransformTest(int, char *[])
axis[0] = .707;
axis[1] = .707;
axis[2] = .707;
aff3->Rotate3D(axis, 1.0, 1);
aff3->Rotate3D(axis, 1.0, true);
std::cout << "Create and rotate a 3D transform:" << std::endl;
aff3->Print( std::cout );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ int itkCenteredAffineTransformTest(int, char *[])
aff2->Print( std::cout );

/* Compose with an isotropic scaling */
aff2->Scale(.3, 1);
aff2->Scale(.3, true);
std::cout << "Result of isotropic scaling:" << std::endl;
aff2->Print( std::cout );

Expand All @@ -141,12 +141,12 @@ int itkCenteredAffineTransformTest(int, char *[])
aff2->Print( std::cout );

/* Compose with a general N-D rotation */
aff2->Rotate(0, 1, 0.57, 1);
aff2->Rotate(0, 1, 0.57, true);
std::cout << "Result of general rotation:" << std::endl;
aff2->Print( std::cout );

/* Compose with a 2-D rotation */
aff2->Rotate(0, 1, -0.57, 1);
aff2->Rotate(0, 1, -0.57, true);
std::cout << "Result of 2-D rotation:" << std::endl;
aff2->Print( std::cout );

Expand Down Expand Up @@ -214,7 +214,7 @@ int itkCenteredAffineTransformTest(int, char *[])
axis[0] = .707;
axis[1] = .707;
axis[2] = .707;
aff3->Rotate3D(axis, 1.0, 1);
aff3->Rotate3D(axis, 1.0, true);
std::cout << "Create and rotate a 3D transform:" << std::endl;
aff3->Print( std::cout );

Expand Down
6 changes: 3 additions & 3 deletions Modules/IO/BMP/src/itkBMPImageIO.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace itk
/** Constructor */
BMPImageIO::BMPImageIO() :
m_BitMapOffset( 0 ),
m_FileLowerLeft( 0 ),
m_FileLowerLeft( false ),
m_Depth( 8 ),
m_NumberOfColors( 0 ),
m_ColorPaletteSize( 0 ),
Expand Down Expand Up @@ -463,11 +463,11 @@ void BMPImageIO::ReadImageInformation()
if ( ysize < 0 )
{
ysize = -ysize;
m_FileLowerLeft = 0;
m_FileLowerLeft = false;
}
else
{
m_FileLowerLeft = 1;
m_FileLowerLeft = true;
}

this->SetNumberOfDimensions(2);
Expand Down
2 changes: 1 addition & 1 deletion Modules/IO/BMP/src/itkBMPImageIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ BMPImageIOFactory::BMPImageIOFactory()
this->RegisterOverride( "itkImageIOBase",
"itkBMPImageIO",
"BMP Image IO",
1,
true,
CreateObjectFunction< BMPImageIO >::New() );
}

Expand Down
2 changes: 1 addition & 1 deletion Modules/IO/BioRad/src/itkBioRadImageIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ BioRadImageIOFactory::BioRadImageIOFactory()
this->RegisterOverride( "itkImageIOBase",
"itkBioRadImageIO",
"BioRad Image IO",
1,
true,
CreateObjectFunction< BioRadImageIO >::New() );
}

Expand Down
2 changes: 1 addition & 1 deletion Modules/IO/Bruker/src/itkBruker2dseqImageIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Bruker2dseqImageIOFactory::Bruker2dseqImageIOFactory()
this->RegisterOverride( "itkImageIOBase",
"itkBruker2dseqImageIO",
"Bruker2dseq Image IO",
1,
true,
CreateObjectFunction< Bruker2dseqImageIO >::New() );
}

Expand Down
2 changes: 1 addition & 1 deletion Modules/IO/DCMTK/src/itkDCMTKFileReader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ ::GetElementUI(const unsigned short group,
<< "," << entry);
}
OFString ofString;
if(uiItem->getOFStringArray(ofString,0) != EC_Normal)
if(uiItem->getOFStringArray(ofString,false) != EC_Normal)
{
DCMTKExceptionOrErrorReturn(<< "Can't get UID Value at tag "
<< std::hex << group << " " << std::hex
Expand Down
2 changes: 1 addition & 1 deletion Modules/IO/DCMTK/src/itkDCMTKImageIO.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ DCMTKImageIO::DCMTKImageIO()
m_UseJPEGCodec = false;
m_UseJPLSCodec = false;
m_UseRLECodec = false;
m_DicomImageSetByUser = 0;
m_DicomImageSetByUser = false;


const char *readExtensions[] =
Expand Down
2 changes: 1 addition & 1 deletion Modules/IO/DCMTK/src/itkDCMTKImageIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ DCMTKImageIOFactory::DCMTKImageIOFactory()
this->RegisterOverride( "itkImageIOBase",
"itkDCMTKImageIO",
"DICOM Image IO",
1,
true,
CreateObjectFunction< DCMTKImageIO >::New() );
}

Expand Down
2 changes: 1 addition & 1 deletion Modules/IO/GDCM/src/itkGDCMImageIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ GDCMImageIOFactory::GDCMImageIOFactory()
this->RegisterOverride( "itkImageIOBase",
"itkGDCMImageIO",
"GDCM Image IO",
1,
true,
CreateObjectFunction< GDCMImageIO >::New() );
}

Expand Down
2 changes: 1 addition & 1 deletion Modules/IO/GE/src/itkGE4ImageIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ GE4ImageIOFactory::GE4ImageIOFactory()
this->RegisterOverride( "itkImageIOBase",
"itkGE4ImageIO",
"GE4 Image IO",
1,
true,
CreateObjectFunction< GE4ImageIO >::New() );
}

Expand Down
2 changes: 1 addition & 1 deletion Modules/IO/GE/src/itkGE5ImageIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ GE5ImageIOFactory::GE5ImageIOFactory()
this->RegisterOverride( "itkImageIOBase",
"itkGE5ImageIO",
"GE5 Image IO",
1,
true,
CreateObjectFunction< GE5ImageIO >::New() );
}

Expand Down
2 changes: 1 addition & 1 deletion Modules/IO/GE/src/itkGEAdwImageIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ GEAdwImageIOFactory::GEAdwImageIOFactory()
this->RegisterOverride( "itkImageIOBase",
"itkGEAdwImageIO",
"GEAdw Image IO",
1,
true,
CreateObjectFunction< GEAdwImageIO >::New() );
}

Expand Down
2 changes: 1 addition & 1 deletion Modules/IO/GIPL/src/itkGiplImageIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ GiplImageIOFactory::GiplImageIOFactory()
this->RegisterOverride( "itkImageIOBase",
"itkGiplImageIO",
"Gipl Image IO",
1,
true,
CreateObjectFunction< GiplImageIO >::New() );
}

Expand Down
2 changes: 1 addition & 1 deletion Modules/IO/HDF5/src/itkHDF5ImageIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ HDF5ImageIOFactory::HDF5ImageIOFactory()
this->RegisterOverride( "itkImageIOBase",
"itkHDF5ImageIO",
"HDF5 Image IO",
1,
true,
CreateObjectFunction< HDF5ImageIO >::New() );
}

Expand Down
2 changes: 1 addition & 1 deletion Modules/IO/ImageBase/include/itkImageFileReader.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ ImageFileReader< TOutputImage, ConvertPixelTraits >
} \
}

if(0) {}
if(false) {}
ITK_CONVERT_BUFFER_IF_BLOCK(ImageIOBase::UCHAR,unsigned char)
ITK_CONVERT_BUFFER_IF_BLOCK(ImageIOBase::CHAR,char)
ITK_CONVERT_BUFFER_IF_BLOCK(ImageIOBase::USHORT,unsigned short)
Expand Down
2 changes: 1 addition & 1 deletion Modules/IO/ImageBase/test/itkFileFreeImageIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ FileFreeImageIOFactory::FileFreeImageIOFactory()
this->RegisterOverride("itkImageIOBase",
"itkFileFreeImageIO",
"ImageIO that creates an in-memory file from a text description",
1,
true,
CreateObjectFunction<FileFreeImageIO>::New());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,14 @@ int itkImageFileWriterStreamingPastingCompressingTest1(int argc, char* argv[])

i = 0;

int retValue = ActualTest(argv[1], argv[2], argv[3], 0, 0, 0, expectException[i++]);
retValue = (retValue == EXIT_FAILURE) ? EXIT_FAILURE : ActualTest(argv[1], argv[2], argv[3], 0, 0, 1, expectException[i++]);
retValue = (retValue == EXIT_FAILURE) ? EXIT_FAILURE : ActualTest(argv[1], argv[2], argv[3], 0, 1, 0, expectException[i++]);
retValue = (retValue == EXIT_FAILURE) ? EXIT_FAILURE : ActualTest(argv[1], argv[2], argv[3], 0, 1, 1, expectException[i++]);
retValue = (retValue == EXIT_FAILURE) ? EXIT_FAILURE : ActualTest(argv[1], argv[2], argv[3], 1, 0, 0, expectException[i++]);
retValue = (retValue == EXIT_FAILURE) ? EXIT_FAILURE : ActualTest(argv[1], argv[2], argv[3], 1, 0, 1, expectException[i++]);
retValue = (retValue == EXIT_FAILURE) ? EXIT_FAILURE : ActualTest(argv[1], argv[2], argv[3], 1, 1, 0, expectException[i++]);
retValue = (retValue == EXIT_FAILURE) ? EXIT_FAILURE : ActualTest(argv[1], argv[2], argv[3], 1, 1, 1, expectException[i++]);
int retValue = ActualTest(argv[1], argv[2], argv[3], false, false, false, expectException[i++]);
retValue = (retValue == EXIT_FAILURE) ? EXIT_FAILURE : ActualTest(argv[1], argv[2], argv[3], false, false, true, expectException[i++]);
retValue = (retValue == EXIT_FAILURE) ? EXIT_FAILURE : ActualTest(argv[1], argv[2], argv[3], false, true, false, expectException[i++]);
retValue = (retValue == EXIT_FAILURE) ? EXIT_FAILURE : ActualTest(argv[1], argv[2], argv[3], false, true, true, expectException[i++]);
retValue = (retValue == EXIT_FAILURE) ? EXIT_FAILURE : ActualTest(argv[1], argv[2], argv[3], true, false, false, expectException[i++]);
retValue = (retValue == EXIT_FAILURE) ? EXIT_FAILURE : ActualTest(argv[1], argv[2], argv[3], true, false, true, expectException[i++]);
retValue = (retValue == EXIT_FAILURE) ? EXIT_FAILURE : ActualTest(argv[1], argv[2], argv[3], true, true, false, expectException[i++]);
retValue = (retValue == EXIT_FAILURE) ? EXIT_FAILURE : ActualTest(argv[1], argv[2], argv[3], true, true, true, expectException[i++]);


return retValue;
Expand Down
2 changes: 1 addition & 1 deletion Modules/IO/JPEG/src/itkJPEGImageIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ JPEGImageIOFactory::JPEGImageIOFactory()
this->RegisterOverride( "itkImageIOBase",
"itkJPEGImageIO",
"JPEG Image IO",
1,
true,
CreateObjectFunction< JPEGImageIO >::New() );
}

Expand Down
2 changes: 1 addition & 1 deletion Modules/IO/JPEG2000/src/itkJPEG2000ImageIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ JPEG2000ImageIOFactory::JPEG2000ImageIOFactory()
this->RegisterOverride( "itkImageIOBase",
"itkJPEG2000ImageIO",
"JPEG2000 Image IO",
1,
true,
CreateObjectFunction< JPEG2000ImageIO >::New() );
}

Expand Down
2 changes: 1 addition & 1 deletion Modules/IO/LSM/src/itkLSMImageIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ LSMImageIOFactory::LSMImageIOFactory()
this->RegisterOverride( "itkImageIOBase",
"itkLSMImageIO",
"LSM Image IO",
1,
true,
CreateObjectFunction< LSMImageIO >::New() );
}

Expand Down
2 changes: 1 addition & 1 deletion Modules/IO/MINC/src/itkMINCImageIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ MINCImageIOFactory::MINCImageIOFactory()
this->RegisterOverride( "itkImageIOBase",
"itkMINCImageIO",
"MINC Image IO",
1,
true,
CreateObjectFunction< MINCImageIO >::New() );
}

Expand Down
2 changes: 1 addition & 1 deletion Modules/IO/MRC/src/itkMRCImageIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ MRCImageIOFactory::MRCImageIOFactory()
this->RegisterOverride( "itkImageIOBase",
"itkMRCImageIO",
"MRC Image IO",
1,
true,
CreateObjectFunction< MRCImageIO >::New() );
}

Expand Down
2 changes: 1 addition & 1 deletion Modules/IO/Mesh/src/itkFreeSurferAsciiMeshIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ::FreeSurferAsciiMeshIOFactory()
this->RegisterOverride( "itkMeshIOBase",
"itkFreeSurferAsciiMeshIO",
"Freesurfer Mesh IO",
1,
true,
CreateObjectFunction< FreeSurferAsciiMeshIO >::New() );
}

Expand Down
2 changes: 1 addition & 1 deletion Modules/IO/Mesh/src/itkFreeSurferBinaryMeshIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ::FreeSurferBinaryMeshIOFactory()
this->RegisterOverride( "itkMeshIOBase",
"itkFreeSurferBinaryMeshIO",
"Freesurfer Binary Mesh IO",
1,
true,
CreateObjectFunction< FreeSurferBinaryMeshIO >::New() );
}

Expand Down
2 changes: 1 addition & 1 deletion Modules/IO/Mesh/src/itkGiftiMeshIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ::GiftiMeshIOFactory()
this->RegisterOverride( "itkMeshIOBase",
"itkGiftiMeshIO",
"Gifti Mesh IO",
1,
true,
CreateObjectFunction< GiftiMeshIO >::New() );
}

Expand Down
Loading

0 comments on commit d12b531

Please sign in to comment.