Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Make clang tidy be clang compiler #119

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Modules/Core/TestKernel/src/itkTestDriverInclude.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ int ProcessArguments(int *ac, ArgumentStringType *av, ProcessedOutputType * proc
usage();
return 1;
}
regressionTestParameters.compareList.push_back( ComparePairType((*av)[i + 1], (*av)[i + 2]) );
regressionTestParameters.compareList.emplace_back((*av)[i + 1], (*av)[i + 2] );
(*av) += 3;
*ac -= 3;
}
Expand Down Expand Up @@ -214,7 +214,7 @@ int ProcessArguments(int *ac, ArgumentStringType *av, ProcessedOutputType * proc
}


hashTestList.push_back( HashPairType( filename, hashVector ) );
hashTestList.emplace_back( filename, hashVector );

}
else if ( !skip && strcmp((*av)[i], "--") == 0 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ int itkJoinSeriesImageFilterStreamingTest(int argc, char* argv[] )
extractor->InPlaceOn();
extractor->ReleaseDataFlagOn();

savedPointers.push_back( extractor );
savedPointers.emplace_back(extractor );

joinSeries->PushBackInput( extractor->GetOutput() );

Expand Down
2 changes: 1 addition & 1 deletion Modules/Filtering/ImageGrid/test/itkCyclicReferences.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ int itkCyclicReferences(int, char* [] )
//test unregister from vector of data objects
{
std::vector<itk::DataObject::Pointer> v;
v.push_back(if2);
v.emplace_back(if2);
}
}//image

Expand Down
16 changes: 8 additions & 8 deletions Modules/IO/CSV/test/itkCSVArray2DFileReaderTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,10 @@ int itkCSVArray2DFileReaderTest (int argc, char *argv[])
test_row_names = dfo->GetRowHeaders();

std::vector<std::string> row_names;
row_names.push_back( "Jan" );
row_names.push_back( "Feb" );
row_names.push_back( "Mar,April" );
row_names.push_back( "May" );
row_names.emplace_back("Jan" );
row_names.emplace_back("Feb" );
row_names.emplace_back("Mar,April" );
row_names.emplace_back("May" );

if ( !testStringVector(row_names, test_row_names) )
{
Expand All @@ -223,10 +223,10 @@ int itkCSVArray2DFileReaderTest (int argc, char *argv[])
test_col_names = dfo->GetColumnHeaders();

std::vector<std::string> col_names;
col_names.push_back( "Africa" );
col_names.push_back( "Asia" );
col_names.push_back( "Aus" );
col_names.push_back( "US,Can" );
col_names.emplace_back("Africa" );
col_names.emplace_back("Asia" );
col_names.emplace_back("Aus" );
col_names.emplace_back("US,Can" );

if ( !testStringVector(col_names, test_col_names) )
{
Expand Down
20 changes: 10 additions & 10 deletions Modules/IO/CSV/test/itkCSVArray2DFileReaderWriterTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,16 @@ int itkCSVFileReaderWriterTest_Func(int argc, char *argv[], bool headers)
{
std::vector<std::string> ColumnHeaders;
std::vector<std::string> RowHeaders;
ColumnHeaders.push_back( "itkArray2DObject" );
ColumnHeaders.push_back( "Col1" );
ColumnHeaders.push_back( "Col2" );
ColumnHeaders.push_back( "Col3" );
ColumnHeaders.push_back( "Col4" );
ColumnHeaders.push_back( "Col5" );
ColumnHeaders.push_back( "Col6" );
RowHeaders.push_back( "Row1" );
RowHeaders.push_back( "Row2" );
RowHeaders.push_back( "Row3" );
ColumnHeaders.emplace_back("itkArray2DObject" );
ColumnHeaders.emplace_back("Col1" );
ColumnHeaders.emplace_back("Col2" );
ColumnHeaders.emplace_back("Col3" );
ColumnHeaders.emplace_back("Col4" );
ColumnHeaders.emplace_back("Col5" );
ColumnHeaders.emplace_back("Col6" );
RowHeaders.emplace_back("Row1" );
RowHeaders.emplace_back("Row2" );
RowHeaders.emplace_back("Row3" );
writer->SetRowHeaders( RowHeaders );
writer->SetColumnHeaders( ColumnHeaders );
}
Expand Down
14 changes: 7 additions & 7 deletions Modules/IO/CSV/test/itkCSVNumericObjectFileWriterTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,13 @@ int itkCSVNumericObjectFileWriterTest( int argc, char *argv[] )

std::vector<std::string> ColumnHeaders;
std::vector<std::string> RowHeaders;
ColumnHeaders.push_back( "itkMatrixObject" );
ColumnHeaders.push_back( "Col1" );
ColumnHeaders.push_back( "Col2" );
ColumnHeaders.push_back( "Col3" );
RowHeaders.push_back( "Row1" );
RowHeaders.push_back( "Row2" );
RowHeaders.push_back( "Row3" );
ColumnHeaders.emplace_back("itkMatrixObject" );
ColumnHeaders.emplace_back("Col1" );
ColumnHeaders.emplace_back("Col2" );
ColumnHeaders.emplace_back("Col3" );
RowHeaders.emplace_back("Row1" );
RowHeaders.emplace_back("Row2" );
RowHeaders.emplace_back("Row3" );

using fixedMatrixWriterType = itk::CSVNumericObjectFileWriter
<double, NRows,NCols>;
Expand Down
2 changes: 1 addition & 1 deletion Modules/IO/ImageBase/src/itkImageIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ImageIOFactory::CreateImageIO(const char *path, FileModeType mode)
auto * io = dynamic_cast< ImageIOBase * >( allobject.GetPointer() );
if ( io )
{
possibleImageIO.push_back(io);
possibleImageIO.emplace_back(io);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion Modules/IO/MeshBase/src/itkMeshIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ ::CreateMeshIO(const char *path, FileModeType mode)

if ( io )
{
possibleMeshIO.push_back(io);
possibleMeshIO.emplace_back(io);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,84 +128,84 @@ int itkScalarImageToCooccurrenceListSampleFilterTest( int , char *[] )

val[0] = 2;
val[1] = 3;
baselineVectorList.push_back( val );
baselineVectorList.emplace_back(val );

val[0] = 3;
val[1] = 4;
baselineVectorList.push_back( val );
baselineVectorList.emplace_back(val );

val[0] = 4;
val[1] = 5;
baselineVectorList.push_back( val );
baselineVectorList.emplace_back(val );

val[0] = 3;
val[1] = 4;
baselineVectorList.push_back( val );
baselineVectorList.emplace_back(val );


val[0] = 4;
val[1] = 5;
baselineVectorList.push_back( val );
baselineVectorList.emplace_back(val );

val[0] = 5;
val[1] = 6;
baselineVectorList.push_back( val );
baselineVectorList.emplace_back(val );

val[0] = 4;
val[1] = 5;
baselineVectorList.push_back( val );
baselineVectorList.emplace_back(val );

val[0] = 5;
val[1] = 6;
baselineVectorList.push_back( val );
baselineVectorList.emplace_back(val );

val[0] = 6;
val[1] = 7;
baselineVectorList.push_back( val );
baselineVectorList.emplace_back(val );

val[0] = 0;
val[1] = 1;
baselineVectorList.push_back( val );
baselineVectorList.emplace_back(val );

val[0] = 1;
val[1] = 2;
baselineVectorList.push_back( val );
baselineVectorList.emplace_back(val );

val[0] = 2;
val[1] = 3;
baselineVectorList.push_back( val );
baselineVectorList.emplace_back(val );

val[0] = 3;
val[1] = 4;
baselineVectorList.push_back( val );
baselineVectorList.emplace_back(val );

val[0] = 4;
val[1] = 5;
baselineVectorList.push_back( val );
baselineVectorList.emplace_back(val );

val[0] = 1;
val[1] = 2;
baselineVectorList.push_back( val );
baselineVectorList.emplace_back(val );

val[0] = 2;
val[1] = 3;
baselineVectorList.push_back( val );
baselineVectorList.emplace_back(val );

val[0] = 3;
val[1] = 4;
baselineVectorList.push_back( val );
baselineVectorList.emplace_back(val );

val[0] = 5;
val[1] = 6;
baselineVectorList.push_back( val );
baselineVectorList.emplace_back(val );

val[0] = 6;
val[1] = 7;
baselineVectorList.push_back( val );
baselineVectorList.emplace_back(val );

val[0] = 7;
val[1] = 8;
baselineVectorList.push_back( val );
baselineVectorList.emplace_back(val );

std::vector< MeasurementVectorType >::const_iterator it;

Expand Down
70 changes: 26 additions & 44 deletions Modules/Video/Core/test/itkTemporalProcessObjectTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ class DummyTemporalProcessObject : public TemporalProcessObject
void TemporalStreamingGenerateData() override
{
// Create a START entry in the stack trace
m_CallStack.push_back(CallRecord(m_IdNumber,
CallRecord::START_CALL, CallRecord::STREAMING_GENERATE_DATA) );
m_CallStack.emplace_back(m_IdNumber,
CallRecord::START_CALL, CallRecord::STREAMING_GENERATE_DATA );

// Report
SizeValueType outputStart = this->GetOutput()->GetRequestedTemporalRegion().GetFrameStart();
Expand Down Expand Up @@ -286,8 +286,8 @@ class DummyTemporalProcessObject : public TemporalProcessObject
//this->GetOutput()->SetBufferedTemporalRegion(this->GetOutput()->GetRequestedTemporalRegion());

// Create an END entry in the stack trace
m_CallStack.push_back(CallRecord(m_IdNumber,
CallRecord::END_CALL, CallRecord::STREAMING_GENERATE_DATA) );
m_CallStack.emplace_back(m_IdNumber,
CallRecord::END_CALL, CallRecord::STREAMING_GENERATE_DATA );

}

Expand Down Expand Up @@ -384,15 +384,15 @@ class DummyTemporalProcessObject : public TemporalProcessObject
void GenerateData() override
{
// Create a START entry in the stack trace
m_CallStack.push_back(CallRecord(m_IdNumber,
CallRecord::START_CALL, CallRecord::GENERATE_DATA) );
m_CallStack.emplace_back(m_IdNumber,
CallRecord::START_CALL, CallRecord::GENERATE_DATA );

std::cout << "*(ID = " << m_IdNumber << ") - GenerateData" << std::endl;
Superclass::GenerateData();

// Create an END entry in the stack trace
m_CallStack.push_back(CallRecord(m_IdNumber,
CallRecord::END_CALL, CallRecord::GENERATE_DATA) );
m_CallStack.emplace_back(m_IdNumber,
CallRecord::END_CALL, CallRecord::GENERATE_DATA );

}

Expand Down Expand Up @@ -620,68 +620,52 @@ int itkTemporalProcessObjectTest( int ,
std::vector<RecordType> correctCallStack;

// GenDat - START - obj 3
correctCallStack.push_back(
RecordType(3, RecordType::START_CALL, RecordType::GENERATE_DATA) );
correctCallStack.emplace_back(3, RecordType::START_CALL, RecordType::GENERATE_DATA );

// GenDat - START - obj 2
correctCallStack.push_back(
RecordType(2, RecordType::START_CALL, RecordType::GENERATE_DATA) );
correctCallStack.emplace_back(2, RecordType::START_CALL, RecordType::GENERATE_DATA );

// GenDat - START - obj 1
correctCallStack.push_back(
RecordType(1, RecordType::START_CALL, RecordType::GENERATE_DATA) );
correctCallStack.emplace_back(1, RecordType::START_CALL, RecordType::GENERATE_DATA );

// TempStreamGenDat - START - obj 1
correctCallStack.push_back(
RecordType(1, RecordType::START_CALL, RecordType::STREAMING_GENERATE_DATA) );
correctCallStack.emplace_back(1, RecordType::START_CALL, RecordType::STREAMING_GENERATE_DATA );

// TempStreamGenDat - END - obj 1
correctCallStack.push_back(
RecordType(1, RecordType::END_CALL, RecordType::STREAMING_GENERATE_DATA) );
correctCallStack.emplace_back(1, RecordType::END_CALL, RecordType::STREAMING_GENERATE_DATA );

// TempStreamGenDat - START - obj 1
correctCallStack.push_back(
RecordType(1, RecordType::START_CALL, RecordType::STREAMING_GENERATE_DATA) );
correctCallStack.emplace_back(1, RecordType::START_CALL, RecordType::STREAMING_GENERATE_DATA );

// TempStreamGenDat - END - obj 1
correctCallStack.push_back(
RecordType(1, RecordType::END_CALL, RecordType::STREAMING_GENERATE_DATA) );
correctCallStack.emplace_back(1, RecordType::END_CALL, RecordType::STREAMING_GENERATE_DATA );

// TempStreamGenDat - START - obj 1
correctCallStack.push_back(
RecordType(1, RecordType::START_CALL, RecordType::STREAMING_GENERATE_DATA) );
correctCallStack.emplace_back(1, RecordType::START_CALL, RecordType::STREAMING_GENERATE_DATA );

// TempStreamGenDat - END - obj 1
correctCallStack.push_back(
RecordType(1, RecordType::END_CALL, RecordType::STREAMING_GENERATE_DATA) );
correctCallStack.emplace_back(1, RecordType::END_CALL, RecordType::STREAMING_GENERATE_DATA );

// GenDat - END - obj 1
correctCallStack.push_back(
RecordType(1, RecordType::END_CALL, RecordType::GENERATE_DATA) );
correctCallStack.emplace_back(1, RecordType::END_CALL, RecordType::GENERATE_DATA );

// TempStreamGenDat - START - obj 2
correctCallStack.push_back(
RecordType(2, RecordType::START_CALL, RecordType::STREAMING_GENERATE_DATA) );
correctCallStack.emplace_back(2, RecordType::START_CALL, RecordType::STREAMING_GENERATE_DATA );

// TempStreamGenDat - END - obj 2
correctCallStack.push_back(
RecordType(2, RecordType::END_CALL, RecordType::STREAMING_GENERATE_DATA) );
correctCallStack.emplace_back(2, RecordType::END_CALL, RecordType::STREAMING_GENERATE_DATA );

// GenDat - END - obj 2
correctCallStack.push_back(
RecordType(2, RecordType::END_CALL, RecordType::GENERATE_DATA) );
correctCallStack.emplace_back(2, RecordType::END_CALL, RecordType::GENERATE_DATA );

// TempStreamGenDat - START - obj 3
correctCallStack.push_back(
RecordType(3, RecordType::START_CALL, RecordType::STREAMING_GENERATE_DATA) );
correctCallStack.emplace_back(3, RecordType::START_CALL, RecordType::STREAMING_GENERATE_DATA );

// TempStreamGenDat - END - obj 3
correctCallStack.push_back(
RecordType(3, RecordType::END_CALL, RecordType::STREAMING_GENERATE_DATA) );
correctCallStack.emplace_back(3, RecordType::END_CALL, RecordType::STREAMING_GENERATE_DATA );

// GenDat - END - obj 3
correctCallStack.push_back(
RecordType(3, RecordType::END_CALL, RecordType::GENERATE_DATA) );
correctCallStack.emplace_back(3, RecordType::END_CALL, RecordType::GENERATE_DATA );

// Check that correct number of calls made
if (itk::TemporalProcessObjectTest::m_CallStack.size() != correctCallStack.size() )
Expand Down Expand Up @@ -759,12 +743,10 @@ int itkTemporalProcessObjectTest( int ,
correctCallStack.clear();

// GenDat - START - obj 3
correctCallStack.push_back(
RecordType(3, RecordType::START_CALL, RecordType::GENERATE_DATA) );
correctCallStack.emplace_back(3, RecordType::START_CALL, RecordType::GENERATE_DATA );

// GenDat - END - obj 3
correctCallStack.push_back(
RecordType(3, RecordType::END_CALL, RecordType::GENERATE_DATA) );
correctCallStack.emplace_back(3, RecordType::END_CALL, RecordType::GENERATE_DATA );

// Check that correct number of calls made
if (itk::TemporalProcessObjectTest::m_CallStack.size() != correctCallStack.size() )
Expand Down
2 changes: 1 addition & 1 deletion Modules/Video/IO/src/itkVideoIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ VideoIOBase::Pointer VideoIOFactory::CreateVideoIO( IOModeType mode, const char*
auto * io = dynamic_cast< VideoIOBase* >( allobject.GetPointer() );
if (io)
{
possibleVideoIO.push_back(io);
possibleVideoIO.emplace_back(io);
}
else
{
Expand Down
Loading