Skip to content

Commit

Permalink
STYLE: Remove unintended extra space from destructors and operators
Browse files Browse the repository at this point in the history
It appears that clang-format (version 8.0.1) has in some cases
introduced an unintended space character between the class name and the
`::`, in the definition of a destructor or overloaded `operator`. This
typically seems to have happened when there originally was a line break
between the class name and the colon characters.

Follow-up to:
"STYLE: Remove space between class and member names in C++ source files"
pull request InsightSoftwareConsortium#2096
commit 734d6f8

Related to "Bug 44189 - clang-format does not remove space between
non-macro identifier and ::", reported by Pablo Martin-Gomez, 2019-12-01
https://bugs.llvm.org/show_bug.cgi?id=44189
  • Loading branch information
N-Dekker authored and dzenanz committed Mar 11, 2021
1 parent 1c25350 commit 1e99f17
Show file tree
Hide file tree
Showing 76 changed files with 90 additions and 90 deletions.
2 changes: 1 addition & 1 deletion Modules/Core/Common/src/itkFileOutputWindow.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ FileOutputWindow::FileOutputWindow()
m_FileName = "";
}

FileOutputWindow ::~FileOutputWindow()
FileOutputWindow::~FileOutputWindow()
{
delete m_Stream;
m_Stream = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/src/itkHexahedronCellTopology.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ const int HexahedronCellTopology ::m_Faces[6][4] = { { 0, 4, 7, 3 }, { 1, 2, 6,

HexahedronCellTopology::HexahedronCellTopology() = default;

HexahedronCellTopology ::~HexahedronCellTopology() = default;
HexahedronCellTopology::~HexahedronCellTopology() = default;
} // end namespace itk
8 changes: 4 additions & 4 deletions Modules/Core/Common/src/itkImageIORegion.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
namespace itk
{

ImageIORegion ::~ImageIORegion() = default;
ImageIORegion::~ImageIORegion() = default;

ImageIORegion::ImageIORegion(unsigned int dimension)
: m_ImageDimension{ dimension }
Expand All @@ -32,7 +32,7 @@ ImageIORegion::ImageIORegion(unsigned int dimension)


ImageIORegion &
ImageIORegion ::operator=(const Self & region)
ImageIORegion::operator=(const Self & region)
{
if ((region.m_Index.size() == m_Index.size()) && (region.m_Size.size() == m_Size.size()))
{
Expand Down Expand Up @@ -229,14 +229,14 @@ ImageIORegion::GetNumberOfPixels() const
}

bool
ImageIORegion ::operator==(const Self & region) const
ImageIORegion::operator==(const Self & region) const
{
return (m_Index == region.m_Index) && (m_Size == region.m_Size) && (m_ImageDimension == region.m_ImageDimension);
}

/** Compare two regions. */
bool
ImageIORegion ::operator!=(const Self & region) const
ImageIORegion::operator!=(const Self & region) const
{
return !(*this == region);
}
Expand Down
10 changes: 5 additions & 5 deletions Modules/Core/Common/src/itkLightObject.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -88,25 +88,25 @@ LightObject::Delete()
*/
#ifdef _WIN32
void *
LightObject ::operator new(size_t n)
LightObject::operator new(size_t n)
{
return new char[n];
}

void *
LightObject ::operator new[](size_t n)
LightObject::operator new[](size_t n)
{
return new char[n];
}

void
LightObject ::operator delete(void * m)
LightObject::operator delete(void * m)
{
delete[](char *) m;
}

void
LightObject ::operator delete[](void * m, size_t)
LightObject::operator delete[](void * m, size_t)
{
delete[](char *) m;
}
Expand Down Expand Up @@ -172,7 +172,7 @@ LightObject::SetReferenceCount(int ref)
}
}

LightObject ::~LightObject()
LightObject::~LightObject()
{
/**
* warn user if reference counting is on and the object is being referenced
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 @@ -32,7 +32,7 @@ LightProcessObject::LightProcessObject()
* Destructor for the LightProcessObject class. We've got to
* UnRegister() the use of any input classes.
*/
LightProcessObject ::~LightProcessObject() = default;
LightProcessObject::~LightProcessObject() = default;

/**
* Update the progress of the process object. If a ProgressMethod exists,
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/src/itkMemoryProbe.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ MemoryProbe::MemoryProbe()
: ResourceProbe<MemoryProbe::MemoryLoadType, double>("Memory", "kB")
{}

MemoryProbe ::~MemoryProbe() = default;
MemoryProbe::~MemoryProbe() = default;

MemoryProbe::MemoryLoadType
MemoryProbe::GetInstantValue() const
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ MersenneTwisterRandomVariateGenerator::MersenneTwisterRandomVariateGenerator()
SetSeed(121212);
}

MersenneTwisterRandomVariateGenerator ::~MersenneTwisterRandomVariateGenerator() = default;
MersenneTwisterRandomVariateGenerator::~MersenneTwisterRandomVariateGenerator() = default;

MersenneTwisterRandomVariateGenerator::IntegerType
MersenneTwisterRandomVariateGenerator ::hash(time_t t, clock_t c)
Expand Down
8 changes: 4 additions & 4 deletions Modules/Core/Common/src/itkMetaDataDictionary.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ MetaDataDictionary::MetaDataDictionary()
: m_Dictionary(std::make_shared<MetaDataDictionaryMapType>())
{}

MetaDataDictionary ::~MetaDataDictionary() = default;
MetaDataDictionary::~MetaDataDictionary() = default;

// NOTE: Desired behavior is to perform shallow copy, so m_Dictionary is shared
// as is thee default behavior for copy constructors.
MetaDataDictionary::MetaDataDictionary(const MetaDataDictionary &) = default;

MetaDataDictionary &
MetaDataDictionary ::operator=(const MetaDataDictionary & old)
MetaDataDictionary::operator=(const MetaDataDictionary & old)
{
if (this != &old)
{
Expand All @@ -51,13 +51,13 @@ MetaDataDictionary::Print(std::ostream & os) const
}
}

MetaDataObjectBase::Pointer & MetaDataDictionary ::operator[](const std::string & key)
MetaDataObjectBase::Pointer & MetaDataDictionary::operator[](const std::string & key)
{
MakeUnique();
return (*m_Dictionary)[key];
}

const MetaDataObjectBase * MetaDataDictionary ::operator[](const std::string & key) const
const MetaDataObjectBase * MetaDataDictionary::operator[](const std::string & key) const
{
auto iter = m_Dictionary->find(key);
if (iter == m_Dictionary->end())
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/src/itkMetaDataObjectBase.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace itk
MetaDataObjectBase::MetaDataObjectBase() = default;


MetaDataObjectBase ::~MetaDataObjectBase() = default;
MetaDataObjectBase::~MetaDataObjectBase() = default;


const char *
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/src/itkObject.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ Object::Object()
this->Modified();
}

Object ::~Object()
Object::~Object()
{
itkDebugMacro(<< "Destructing!");
delete m_SubjectImplementation;
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/src/itkObjectFactoryBase.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ ObjectFactoryBase::ObjectFactoryBase()
/**
* Unload the library and free the path string
*/
ObjectFactoryBase ::~ObjectFactoryBase()
ObjectFactoryBase::~ObjectFactoryBase()
{
m_OverrideMap->erase(m_OverrideMap->begin(), m_OverrideMap->end());
delete m_OverrideMap;
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 @@ -45,7 +45,7 @@ OutputWindow::OutputWindow()
m_PromptUser = false;
}

OutputWindow ::~OutputWindow() = default;
OutputWindow::~OutputWindow() = default;

void
OutputWindowDisplayText(const char * message)
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 @@ -101,7 +101,7 @@ DataObject::Pointer ProcessObject::MakeOutput(DataObjectPointerArraySizeType)
}


ProcessObject ::~ProcessObject()
ProcessObject::~ProcessObject()
{
/*
* Destructor for the ProcessObject class. We've got to
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/src/itkProgressAccumulator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ProgressAccumulator::ProgressAccumulator()
m_CallbackCommand->SetCallbackFunction(this, &Self::ReportProgress);
}

ProgressAccumulator ::~ProgressAccumulator()
ProgressAccumulator::~ProgressAccumulator()
{
UnregisterAllFilters();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ const int QuadraticTriangleCellTopology ::m_Edges[3][3] = { { 0, 4, 1 }, { 1, 5,

QuadraticTriangleCellTopology::QuadraticTriangleCellTopology() = default;

QuadraticTriangleCellTopology ::~QuadraticTriangleCellTopology() = default;
QuadraticTriangleCellTopology::~QuadraticTriangleCellTopology() = default;
} // end namespace itk
2 changes: 1 addition & 1 deletion Modules/Core/Common/src/itkQuadrilateralCellTopology.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ const int QuadrilateralCellTopology ::m_Edges[4][2] = { { 0, 1 }, { 1, 2 }, { 2,

QuadrilateralCellTopology::QuadrilateralCellTopology() = default;

QuadrilateralCellTopology ::~QuadrilateralCellTopology() = default;
QuadrilateralCellTopology::~QuadrilateralCellTopology() = default;
} // end namespace itk
4 changes: 2 additions & 2 deletions Modules/Core/Common/src/itkSimpleFilterWatcher.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ SimpleFilterWatcher::SimpleFilterWatcher(const SimpleFilterWatcher & watch)
}

SimpleFilterWatcher &
SimpleFilterWatcher ::operator=(const SimpleFilterWatcher & watch)
SimpleFilterWatcher::operator=(const SimpleFilterWatcher & watch)
{
this->DeepCopy(watch);
return *this;
Expand Down Expand Up @@ -147,7 +147,7 @@ SimpleFilterWatcher::RemoveObservers()
}
}

SimpleFilterWatcher ::~SimpleFilterWatcher()
SimpleFilterWatcher::~SimpleFilterWatcher()
{
if (m_Process)
{
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/src/itkSmapsFileParser.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ SmapsData_2_6::GetStackUsage()

VMMapData_10_2 ::VMMapData_10_2() = default;

VMMapData_10_2 ::~VMMapData_10_2() = default;
VMMapData_10_2::~VMMapData_10_2() = default;

std::istream &
operator>>(std::istream & stream, VMMapData_10_2 & data)
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/src/itkTetrahedronCellTopology.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ const int TetrahedronCellTopology ::m_Edges[6][2] = { { 0, 1 }, { 1, 2 }, { 2, 0

TetrahedronCellTopology::TetrahedronCellTopology() = default;

TetrahedronCellTopology ::~TetrahedronCellTopology() = default;
TetrahedronCellTopology::~TetrahedronCellTopology() = default;
} // end namespace itk
2 changes: 1 addition & 1 deletion Modules/Core/Common/src/itkThreadLogger.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ThreadLogger::ThreadLogger()
m_Thread = std::thread(&ThreadLogger::ThreadFunction, this);
}

ThreadLogger ::~ThreadLogger()
ThreadLogger::~ThreadLogger()
{
if (m_Thread.joinable())
{
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/src/itkThreadPool.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ ThreadPool::GetNumberOfCurrentlyIdleThreads() const
return int(m_Threads.size()) - int(m_WorkQueue.size()); // lousy approximation
}

ThreadPool ::~ThreadPool()
ThreadPool::~ThreadPool()
{
{
std::unique_lock<std::mutex> mutexHolder(m_PimplGlobals->m_Mutex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace itk

ThreadedIndexedContainerPartitioner::ThreadedIndexedContainerPartitioner() = default;

ThreadedIndexedContainerPartitioner ::~ThreadedIndexedContainerPartitioner() = default;
ThreadedIndexedContainerPartitioner::~ThreadedIndexedContainerPartitioner() = default;

ThreadIdType
ThreadedIndexedContainerPartitioner::PartitionDomain(const ThreadIdType threadId,
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/src/itkTimeProbe.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ TimeProbe::TimeProbe()
m_RealTimeClock = RealTimeClock::New();
}

TimeProbe ::~TimeProbe() = default;
TimeProbe::~TimeProbe() = default;

TimeProbe::TimeStampType
TimeProbe::GetInstantValue() const
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/src/itkTimeProbesCollectorBase.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ namespace itk
{
TimeProbesCollectorBase::TimeProbesCollectorBase() = default;

TimeProbesCollectorBase ::~TimeProbesCollectorBase() = default;
TimeProbesCollectorBase::~TimeProbesCollectorBase() = default;
} // end namespace itk
2 changes: 1 addition & 1 deletion Modules/Core/Common/src/itkTriangleCellTopology.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ const int TriangleCellTopology ::m_Edges[3][2] = { { 0, 1 }, { 1, 2 }, { 2, 0 }

TriangleCellTopology::TriangleCellTopology() = default;

TriangleCellTopology ::~TriangleCellTopology() = default;
TriangleCellTopology::~TriangleCellTopology() = default;
} // end namespace itk
2 changes: 1 addition & 1 deletion Modules/Core/Common/src/itkWin32OutputWindow.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace itk
/** */
HWND Win32OutputWindow::m_OutputWindow = nullptr;

Win32OutputWindow ::~Win32OutputWindow()
Win32OutputWindow::~Win32OutputWindow()
{
if (Win32OutputWindow::m_OutputWindow)
{
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/src/itkXMLFileOutputWindow.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace itk
*/
XMLFileOutputWindow ::XMLFileOutputWindow() = default;

XMLFileOutputWindow ::~XMLFileOutputWindow() = default;
XMLFileOutputWindow::~XMLFileOutputWindow() = default;

void
XMLFileOutputWindow::PrintSelf(std::ostream & os, Indent indent) const
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Mesh/src/itkMeshRegion.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ MeshRegion::MeshRegion()
/**
* Destructor for the MeshRegion class.
*/
MeshRegion ::~MeshRegion() = default;
MeshRegion::~MeshRegion() = default;
} // end namespace itk
2 changes: 1 addition & 1 deletion Modules/Core/Mesh/src/itkSimplexMeshGeometry.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ SimplexMeshGeometry::SimplexMeshGeometry()
closestAttractorIndex = 0;
}

SimplexMeshGeometry ::~SimplexMeshGeometry()
SimplexMeshGeometry::~SimplexMeshGeometry()
{
delete this->neighborSet;
this->neighborSet = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/QuadEdgeMesh/src/itkQuadEdge.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ QuadEdge::QuadEdge()
}

// ---------------------------------------------------------------------
QuadEdge ::~QuadEdge()
QuadEdge::~QuadEdge()
{
this->m_Onext = nullptr;
this->m_Rot = nullptr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ SpatialObjectProperty::SetTagStringDictionary(const std::map<std::string, std::s
}

SpatialObjectProperty::Self &
SpatialObjectProperty ::operator=(const SpatialObjectProperty & rhs)
SpatialObjectProperty::operator=(const SpatialObjectProperty & rhs)
{
if (this != &rhs)
{
Expand Down
4 changes: 2 additions & 2 deletions Modules/Filtering/FFT/src/itkFFTWGlobalConfiguration.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct FFTWGlobalConfigurationGlobals

WisdomFilenameGeneratorBase::WisdomFilenameGeneratorBase() = default;

WisdomFilenameGeneratorBase ::~WisdomFilenameGeneratorBase() = default;
WisdomFilenameGeneratorBase::~WisdomFilenameGeneratorBase() = default;

ManualWisdomFilenameGenerator::ManualWisdomFilenameGenerator(std::string wfn)
: m_WisdomFilename(std::move(wfn))
Expand Down Expand Up @@ -489,7 +489,7 @@ FFTWGlobalConfiguration ::FFTWGlobalConfiguration()
}
}

FFTWGlobalConfiguration ::~FFTWGlobalConfiguration()
FFTWGlobalConfiguration::~FFTWGlobalConfiguration()
{
if (this->m_WriteWisdomCache && this->m_NewWisdomAvailable)
{
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 @@ -316,7 +316,7 @@ DCMTKSequence::GetElementTM(const unsigned short group,
return EXIT_SUCCESS;
}

DCMTKFileReader ::~DCMTKFileReader()
DCMTKFileReader::~DCMTKFileReader()
{
delete m_DFile;
}
Expand Down
2 changes: 1 addition & 1 deletion Modules/IO/DCMTK/src/itkDCMTKSeriesFileNames.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ DCMTKSeriesFileNames ::DCMTKSeriesFileNames()
m_LoadPrivateTags = false;
}

DCMTKSeriesFileNames ::~DCMTKSeriesFileNames() = default;
DCMTKSeriesFileNames::~DCMTKSeriesFileNames() = default;

void
DCMTKSeriesFileNames::SetInputDirectory(const char * name)
Expand Down
2 changes: 1 addition & 1 deletion Modules/IO/ImageBase/test/itkFileFreeImageIO.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace itk

FileFreeImageIO ::FileFreeImageIO() {}

FileFreeImageIO ::~FileFreeImageIO() {}
FileFreeImageIO::~FileFreeImageIO() {}

bool
FileFreeImageIO ::CanReadFile(const char * filename)
Expand Down
Loading

0 comments on commit 1e99f17

Please sign in to comment.