[Gdcm-hackers] gdcm-git:Grassroots DICOM branch release updated. 94b3dcfba37ddb87f484ba0607d14f6bdd
Cross-platform DICOM implementation
Brought to you by:
malat
|
From: malat <ma...@us...> - 2023-04-04 08:15:22
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Grassroots DICOM".
The branch, release has been updated
via 94b3dcfba37ddb87f484ba0607d14f6bdd4a4dcd (commit)
via ae0212c0e9e14aa42bea2fbb070a0ae65b90829d (commit)
via 998961829bc7cc7a2b63d65199013aa2e8cbefe3 (commit)
via 3677a2c47adf34da9407b377b3c3a31ed7a01697 (commit)
via ff4f396d501282fe36ef5980263899d9c6707136 (commit)
via 62dee5faed54235c1231b1c046e8fb881da7e803 (commit)
via 3d46d81196c8dda008173a9b28d0b96d0c6ac96e (commit)
via 33caa6098607ad2bf7fd05dfdc3336f9471e549a (commit)
via d0c971203e4882f8050f88175c79ce1836c8e2f8 (commit)
via fd09e936f17c5b8ceca4c56c7f11d498a690f973 (commit)
via 7891b4dea4f6578d13c2ab0c8b8b76b448db4b2d (commit)
via 770393e9587dc111a055c2f30e67a74141679ba4 (commit)
via 99418ec167cd09d93e614f4be2dd4516e24ca5c3 (commit)
via fd888d0c9f7c035e3fa71b987fa4370cca64dbc6 (commit)
via 6da731836814b137da1a04953449388b2fff2ce1 (commit)
via aea66f1c83f8b0d189c444bae022ce71ba0c5f70 (commit)
via 4c9a78877053ca9de392b81ba3d0dcdeb710d716 (commit)
via 52155bc676b69b3180b2c90ddc97910092d4812e (commit)
via ed902219b7b828c58efb0fa9b84b8d2aa9feb719 (commit)
via 428e40554bc207b6fba206441638fe70886414c5 (commit)
via 07b20249a31bd8bf4cc22d6d1c31bfc3b2f79200 (commit)
via 4652ff9a78c09c6ede7085f1000ea0c1d6a2a734 (commit)
via 816671f2b15818544c9bd6046366e78a5abac6dd (commit)
via b47c539338697825c7e8c1b8c18fd169f1672180 (commit)
via 7c5f53e8d080acdf9fa6de1a8f1172501a67bf50 (commit)
via b1add81c4a6184314937ef7e90793f2a0a5f22d1 (commit)
via 72cea2246d0fc65002dc1da5844921a817c70769 (commit)
from d897859250c689f4d10b1eaf3e35b7758178b47e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceforge.net/p/gdcm/gdcm/ci/94b3dcfba37ddb87f484ba0607d14f6bdd4a4dcd/
commit 94b3dcfba37ddb87f484ba0607d14f6bdd4a4dcd
Author: Sean McBride <se...@ro...>
Date: Wed Mar 29 16:54:44 2023 -0400
Used clang-tidy to auto-apply readability-redundant-string-init fixes
diff --git a/Source/MediaStorageAndFileFormat/gdcmAnonymizer.cxx b/Source/MediaStorageAndFileFormat/gdcmAnonymizer.cxx
index db12c9ce5..85982095c 100644
--- a/Source/MediaStorageAndFileFormat/gdcmAnonymizer.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmAnonymizer.cxx
@@ -971,7 +971,7 @@ bool Anonymizer::BALCPProtect(DataSet &ds, Tag const & tag, IOD const & iod)
if ( IsVRUI( tag ) )
{
- std::string UIDToAnonymize = "";
+ std::string UIDToAnonymize;
UIDGenerator uid;
if( !copy.IsEmpty() )
@@ -982,7 +982,7 @@ bool Anonymizer::BALCPProtect(DataSet &ds, Tag const & tag, IOD const & iod)
}
}
- std::string anonymizedUID = "";
+ std::string anonymizedUID;
if( !UIDToAnonymize.empty() )
{
if ( dummyMapUIDTags.count( UIDToAnonymize ) == 0 )
diff --git a/Source/MediaStorageAndFileFormat/gdcmSegment.cxx b/Source/MediaStorageAndFileFormat/gdcmSegment.cxx
index 5f1e1ff83..e3f1ed38c 100644
--- a/Source/MediaStorageAndFileFormat/gdcmSegment.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmSegment.cxx
@@ -69,15 +69,12 @@ Segment::ALGOType Segment::GetALGOType(const char * type)
Segment::Segment():
SegmentNumber(0),
- SegmentLabel(""),
- SegmentDescription(""),
AnatomicRegion(),
AnatomicRegionModifiers(),
PropertyCategory(),
PropertyType(),
PropertyTypeModifiers(),
SegmentAlgorithmType(ALGOType_END),
- SegmentAlgorithmName(""),
SurfaceCount(0),
Surfaces()
{
diff --git a/Source/MediaStorageAndFileFormat/gdcmSurface.cxx b/Source/MediaStorageAndFileFormat/gdcmSurface.cxx
index b1b8f1b25..725550c5d 100644
--- a/Source/MediaStorageAndFileFormat/gdcmSurface.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmSurface.cxx
@@ -116,10 +116,8 @@ Surface::VIEWType Surface::GetVIEWType(const char * type)
Surface::Surface():
SurfaceNumber(0),
- SurfaceComments(""),
SurfaceProcessing(false),
SurfaceProcessingRatio(1.),
- SurfaceProcessingDescription(""),
ProcessingAlgorithm(),
RecommendedDisplayGrayscaleValue(0),
RecommendedPresentationOpacity(1),
@@ -127,8 +125,6 @@ Surface::Surface():
FiniteVolume(UNKNOWN),
Manifold(UNKNOWN),
AlgorithmFamily(),
- AlgorithmVersion(""),
- AlgorithmName(""),
NumberOfSurfacePoints(0),
PointCoordinatesData(),
PointPositionAccuracy(nullptr),
https://sourceforge.net/p/gdcm/gdcm/ci/ae0212c0e9e14aa42bea2fbb070a0ae65b90829d/
commit ae0212c0e9e14aa42bea2fbb070a0ae65b90829d
Author: Sean McBride <se...@ro...>
Date: Tue Mar 28 22:41:23 2023 -0400
Slight reformulation of code to pacify clang-tidy bugprone-sizeof-expression warning
warning: suspicious usage of 'sizeof(A*)'; pointer to aggregate [bugprone-sizeof-expression]
diff --git a/Source/MediaStorageAndFileFormat/gdcmFileChangeTransferSyntax.cxx b/Source/MediaStorageAndFileFormat/gdcmFileChangeTransferSyntax.cxx
index e6a7d69a5..01761e627 100644
--- a/Source/MediaStorageAndFileFormat/gdcmFileChangeTransferSyntax.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmFileChangeTransferSyntax.cxx
@@ -287,7 +287,7 @@ void FileChangeTransferSyntax::SetTransferSyntax( TransferSyntax const & ts )
&jpeg2000,
&rle
};
- const int n = sizeof( codecs ) / sizeof( *codecs );
+ const int n = sizeof( codecs ) / sizeof( codecs[0] );
for( int i = 0; i < n; ++i )
{
if( codecs[i]->CanCode( ts ) )
https://sourceforge.net/p/gdcm/gdcm/ci/998961829bc7cc7a2b63d65199013aa2e8cbefe3/
commit 998961829bc7cc7a2b63d65199013aa2e8cbefe3
Author: Sean McBride <se...@ro...>
Date: Tue Mar 28 22:20:05 2023 -0400
Suppress clang-tidy bugprone-suspicious-include warnings with NOLINT
diff --git a/Source/Common/gdcmTesting.cxx b/Source/Common/gdcmTesting.cxx
index f3df5d18c..0460443bc 100644
--- a/Source/Common/gdcmTesting.cxx
+++ b/Source/Common/gdcmTesting.cxx
@@ -27,14 +27,14 @@ namespace gdcm
#error how did that happen ?
#endif
-#include "gdcmDataFileNames.cxx"
-#include "gdcmMD5DataImages.cxx"
-#include "gdcmMD5DataBrokenImages.cxx"
-#include "gdcmMediaStorageDataFiles.cxx"
-#include "gdcmStreamOffsetDataFiles.cxx"
+#include "gdcmDataFileNames.cxx" // NOLINT(bugprone-suspicious-include)
+#include "gdcmMD5DataImages.cxx" // NOLINT(bugprone-suspicious-include)
+#include "gdcmMD5DataBrokenImages.cxx" // NOLINT(bugprone-suspicious-include)
+#include "gdcmMediaStorageDataFiles.cxx" // NOLINT(bugprone-suspicious-include)
+#include "gdcmStreamOffsetDataFiles.cxx" // NOLINT(bugprone-suspicious-include)
// After gdcmStreamOffsetDataFiles:
-#include "gdcmSelectedTagsOffsetDataFiles.cxx"
-#include "gdcmSelectedPrivateGroupOffsetDataFiles.cxx"
+#include "gdcmSelectedTagsOffsetDataFiles.cxx" // NOLINT(bugprone-suspicious-include)
+#include "gdcmSelectedPrivateGroupOffsetDataFiles.cxx" // NOLINT(bugprone-suspicious-include)
bool Testing::ComputeMD5(const char *buffer, size_t buf_len,
char digest_str[33])
https://sourceforge.net/p/gdcm/gdcm/ci/3677a2c47adf34da9407b377b3c3a31ed7a01697/
commit 3677a2c47adf34da9407b377b3c3a31ed7a01697
Author: Sean McBride <se...@ro...>
Date: Tue Mar 28 22:19:34 2023 -0400
Used clang-tidy to manually fix readability-container-size-empty warnings
diff --git a/Source/MediaStorageAndFileFormat/gdcmBitmap.cxx b/Source/MediaStorageAndFileFormat/gdcmBitmap.cxx
index 5408e9b5f..7bdad285f 100644
--- a/Source/MediaStorageAndFileFormat/gdcmBitmap.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmBitmap.cxx
@@ -1052,7 +1052,7 @@ void Bitmap::Print(std::ostream &os) const
if( !IsEmpty() )
{
os << "NumberOfDimensions: " << NumberOfDimensions << "\n";
- assert( Dimensions.size() );
+ assert( !Dimensions.empty() );
os << "Dimensions: (";
std::vector<unsigned int>::const_iterator it = Dimensions.begin();
os << *it;
diff --git a/Source/MediaStorageAndFileFormat/gdcmJPEG2000Codec.cxx b/Source/MediaStorageAndFileFormat/gdcmJPEG2000Codec.cxx
index 86751bcfe..d122b45c0 100644
--- a/Source/MediaStorageAndFileFormat/gdcmJPEG2000Codec.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmJPEG2000Codec.cxx
@@ -591,7 +591,7 @@ bool JPEG2000Codec::Decode(DataElement const &in, DataElement &out)
assert( r == true );
}
std::string str = os.str();
- assert( str.size() );
+ assert( !str.empty() );
out.SetByteValue( &str[0], (uint32_t)str.size() );
return true;
diff --git a/Source/MediaStorageAndFileFormat/gdcmJPEGCodec.cxx b/Source/MediaStorageAndFileFormat/gdcmJPEGCodec.cxx
index 58220ee2c..62143bac6 100644
--- a/Source/MediaStorageAndFileFormat/gdcmJPEGCodec.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmJPEGCodec.cxx
@@ -342,7 +342,7 @@ bool JPEGCodec::Code(DataElement const &in, DataElement &out)
}
std::string str = os.str();
- assert( str.size() );
+ assert( !str.empty() );
Fragment frag;
//frag.SetTag( itemStart );
VL::Type strSize = (VL::Type)str.size();
diff --git a/Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx b/Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx
index 39883e2c0..8ef55d84b 100644
--- a/Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx
@@ -302,7 +302,7 @@ bool JPEGLSCodec::Decode(DataElement const &in, DataElement &out)
assert( r == true );
}
std::string str = os.str();
- assert( str.size() );
+ assert( !str.empty() );
out.SetByteValue( &str[0], (uint32_t)str.size() );
return true;
diff --git a/Source/MediaStorageAndFileFormat/gdcmRLECodec.cxx b/Source/MediaStorageAndFileFormat/gdcmRLECodec.cxx
index 1383e5977..0bc10226a 100644
--- a/Source/MediaStorageAndFileFormat/gdcmRLECodec.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmRLECodec.cxx
@@ -531,7 +531,7 @@ bool RLECodec::Code(DataElement const &in, DataElement &out)
//header.Print( std::cout );
os.write((char*)&header,sizeof(header));
std::string str = os.str() + datastr;
- assert( str.size() );
+ assert( !str.empty() );
Fragment frag;
//frag.SetTag( itemStart );
VL::Type strSize = (VL::Type)str.size();
diff --git a/Source/MediaStorageAndFileFormat/gdcmStringFilter.cxx b/Source/MediaStorageAndFileFormat/gdcmStringFilter.cxx
index 31ea018cb..7f81fda68 100644
--- a/Source/MediaStorageAndFileFormat/gdcmStringFilter.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmStringFilter.cxx
@@ -218,7 +218,7 @@ bool StringFilter::ExecuteQuery(std::string const & query_const,
}
else
{
- assert( subtokens.size() );
+ assert( !subtokens.empty() );
gdcmDebugMacro( "Unhandled token: " << subtokens[0] );
state = -1;
}
diff --git a/Source/MessageExchangeDefinition/gdcmAAssociateACPDU.cxx b/Source/MessageExchangeDefinition/gdcmAAssociateACPDU.cxx
index 4bdbb24f2..261b2fc10 100644
--- a/Source/MessageExchangeDefinition/gdcmAAssociateACPDU.cxx
+++ b/Source/MessageExchangeDefinition/gdcmAAssociateACPDU.cxx
@@ -147,7 +147,7 @@ const std::ostream &AAssociateACPDU::Write(std::ostream &os) const
//os.write( called, 16 );
os.write( (const char*)&Reserved43_74, sizeof(Reserved43_74) );
AppContext.Write( os );
- gdcmAssertAlwaysMacro( PresContextAC.size() );
+ gdcmAssertAlwaysMacro( !PresContextAC.empty() );
std::vector<PresentationContextAC>::const_iterator it = PresContextAC.begin();
for( ; it != PresContextAC.end(); ++it )
{
https://sourceforge.net/p/gdcm/gdcm/ci/ff4f396d501282fe36ef5980263899d9c6707136/
commit ff4f396d501282fe36ef5980263899d9c6707136
Author: Sean McBride <se...@ro...>
Date: Tue Mar 28 22:13:28 2023 -0400
Used clang-tidy to auto-apply readability-const-return-type fixes
diff --git a/Source/MediaStorageAndFileFormat/gdcmSegmentReader.cxx b/Source/MediaStorageAndFileFormat/gdcmSegmentReader.cxx
index bd4e92c42..ee0189b90 100644
--- a/Source/MediaStorageAndFileFormat/gdcmSegmentReader.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmSegmentReader.cxx
@@ -25,7 +25,7 @@ SegmentReader::SegmentReader()
SegmentReader::~SegmentReader()
= default;
-const SegmentReader::SegmentVector SegmentReader::GetSegments() const
+SegmentReader::SegmentVector SegmentReader::GetSegments() const
{
return const_cast<SegmentReader*>(this)->GetSegments();
}
diff --git a/Source/MediaStorageAndFileFormat/gdcmSegmentReader.h b/Source/MediaStorageAndFileFormat/gdcmSegmentReader.h
index 7582e5569..b528fc5fc 100644
--- a/Source/MediaStorageAndFileFormat/gdcmSegmentReader.h
+++ b/Source/MediaStorageAndFileFormat/gdcmSegmentReader.h
@@ -41,7 +41,7 @@ public:
bool Read() override; // Set to protected ?
//** Segment getters/setters **//
- const SegmentVector GetSegments() const;
+ SegmentVector GetSegments() const;
SegmentVector GetSegments();
// unsigned int GetNumberOfSegments();
https://sourceforge.net/p/gdcm/gdcm/ci/62dee5faed54235c1231b1c046e8fb881da7e803/
commit 62dee5faed54235c1231b1c046e8fb881da7e803
Author: Sean McBride <se...@ro...>
Date: Tue Mar 28 21:55:24 2023 -0400
Used clang-tidy to auto-apply modernize-use-equals-default fixes
diff --git a/Source/MediaStorageAndFileFormat/gdcmDPath.cxx b/Source/MediaStorageAndFileFormat/gdcmDPath.cxx
index 23f8955d2..0666a741b 100644
--- a/Source/MediaStorageAndFileFormat/gdcmDPath.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmDPath.cxx
@@ -17,9 +17,9 @@
namespace gdcm {
-DPath::DPath() {}
+DPath::DPath() = default;
-DPath::~DPath() {}
+DPath::~DPath() = default;
// LO mandates that '\\' is never used:
static const char SEPARATOR = '\\';
diff --git a/Source/MessageExchangeDefinition/gdcmBaseQuery.cxx b/Source/MessageExchangeDefinition/gdcmBaseQuery.cxx
index 1063e704c..3cb9ea9ac 100644
--- a/Source/MessageExchangeDefinition/gdcmBaseQuery.cxx
+++ b/Source/MessageExchangeDefinition/gdcmBaseQuery.cxx
@@ -49,14 +49,8 @@ passed to a c-find or c-move query.
namespace gdcm
{
- BaseQuery::BaseQuery()
- {
- //nothing to do, really
- }
- BaseQuery::~BaseQuery()
- {
- //nothing to do, really
- }
+ BaseQuery::BaseQuery() = default;
+ BaseQuery::~BaseQuery() = default;
void BaseQuery::SetSearchParameter(const Tag& inTag, const DictEntry& inDictEntry, const std::string& inValue)
{
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCleaner4.cxx b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCleaner4.cxx
index eaafc73bc..702e9b370 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCleaner4.cxx
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCleaner4.cxx
@@ -54,7 +54,7 @@ static bool IsTagEmpty(const DataSet &ds, const T1 &path, const T2 &pt) {
} // namespace gdcm
struct TestCleaner4Impl {
- virtual ~TestCleaner4Impl() {}
+ virtual ~TestCleaner4Impl() = default;
virtual bool check_before(gdcm::DataSet &ds) = 0;
virtual bool check_after(gdcm::DataSet &ds, bool preservePatientName) = 0;
int run(std::string const &filename, std::string const &outfilename,
https://sourceforge.net/p/gdcm/gdcm/ci/3d46d81196c8dda008173a9b28d0b96d0c6ac96e/
commit 3d46d81196c8dda008173a9b28d0b96d0c6ac96e
Author: Sean McBride <se...@ro...>
Date: Tue Mar 28 21:54:39 2023 -0400
Used clang-tidy to auto-apply modernize-use-bool-literals fixes
diff --git a/Applications/Cxx/gdcmclean.cxx b/Applications/Cxx/gdcmclean.cxx
index 26eb3ee6b..2dc65c50a 100644
--- a/Applications/Cxx/gdcmclean.cxx
+++ b/Applications/Cxx/gdcmclean.cxx
@@ -187,7 +187,7 @@ int main(int argc, char *argv[]) {
gdcm::PrivateTag privatetag;
gdcm::DPath dpath;
- while (1) {
+ while (true) {
// int this_option_optind = optind ? optind : 1;
int option_index = 0;
static struct option long_options[] = {
diff --git a/Examples/Cxx/GetSubSequenceData.cxx b/Examples/Cxx/GetSubSequenceData.cxx
index 2e424c8fc..c512817f7 100644
--- a/Examples/Cxx/GetSubSequenceData.cxx
+++ b/Examples/Cxx/GetSubSequenceData.cxx
@@ -77,7 +77,7 @@ int main(int argc, char *argv[])
DataSet &subds3 = item3.GetNestedDataSet();
const PrivateTag tseq6(0x7fe1,0x26,"GEMS_Ultrasound_MovieGroup_001");
- if( !subds3.FindDataElement( tseq6 ) ) return 1;
+ if( !subds3.FindDataElement( tseq6 ) ) return true;
const DataElement& seq6 = subds3.GetDataElement( tseq6 );
SmartPointer<SequenceOfItems> sqi6 = seq6.GetValueAsSQ();
size_t ni6= sqi6->GetNumberOfItems();
@@ -100,7 +100,7 @@ int main(int argc, char *argv[])
}
const PrivateTag tseq3(0x7fe1,0x36,"GEMS_Ultrasound_MovieGroup_001");
- if( !subds3.FindDataElement( tseq3 ) ) return 1;
+ if( !subds3.FindDataElement( tseq3 ) ) return true;
const DataElement& seq3 = subds3.GetDataElement( tseq3 );
// std::cout << seq3 << std::endl;
@@ -119,14 +119,14 @@ int main(int argc, char *argv[])
Item &item4 = sqi4->GetItem(i4);
DataSet &subds4 = item4.GetNestedDataSet();
- if( !subds4.FindDataElement( tseq8 ) ) return 1;
+ if( !subds4.FindDataElement( tseq8 ) ) return true;
const DataElement& de8 = subds4.GetDataElement( tseq8 );
Element<VR::UL,VM::VM1> ldimz;
ldimz.SetFromDataElement( de8 );
dimz += ldimz.GetValue();
- if( !subds4.FindDataElement( tseq4 ) ) return 1;
+ if( !subds4.FindDataElement( tseq4 ) ) return true;
const DataElement& seq4 = subds4.GetDataElement( tseq4 );
- if( !subds4.FindDataElement( tseq5 ) ) return 1;
+ if( !subds4.FindDataElement( tseq5 ) ) return true;
const DataElement& seq5 = subds4.GetDataElement( tseq5 );
// std::cout << seq4 << std::endl;
https://sourceforge.net/p/gdcm/gdcm/ci/33caa6098607ad2bf7fd05dfdc3336f9471e549a/
commit 33caa6098607ad2bf7fd05dfdc3336f9471e549a
Author: Sean McBride <se...@ro...>
Date: Fri Mar 24 21:47:48 2023 -0400
Used clang-tidy to auto-apply bugprone-macro-parentheses fixes
diff --git a/Source/MediaStorageAndFileFormat/gdcmEquipmentManufacturer.cxx b/Source/MediaStorageAndFileFormat/gdcmEquipmentManufacturer.cxx
index d95dffb7c..c3bd50423 100644
--- a/Source/MediaStorageAndFileFormat/gdcmEquipmentManufacturer.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmEquipmentManufacturer.cxx
@@ -72,7 +72,7 @@ static const char* const toshiba[] = {"TOSHIBA_MEC", "CANON_MEC",
"Toshiba"}; // must include canon
static const char* const uih[] = {"UIH"}; // United Imaging Healthcare
-#define ARRAY_SIZE(X) sizeof(X) / sizeof(*X)
+#define ARRAY_SIZE(X) (sizeof(X) / sizeof(*X))
#define MAPPING(X, Y) \
{ X, ARRAY_SIZE(Y), Y }
https://sourceforge.net/p/gdcm/gdcm/ci/d0c971203e4882f8050f88175c79ce1836c8e2f8/
commit d0c971203e4882f8050f88175c79ce1836c8e2f8
Author: Sean McBride <se...@ro...>
Date: Fri Mar 24 21:40:24 2023 -0400
Used clang-tidy to auto-apply bugprone-suspicious-string-compare fixes
diff --git a/Source/MediaStorageAndFileFormat/gdcmFileStreamer.cxx b/Source/MediaStorageAndFileFormat/gdcmFileStreamer.cxx
index 31339cd1b..03f5f68e8 100644
--- a/Source/MediaStorageAndFileFormat/gdcmFileStreamer.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmFileStreamer.cxx
@@ -788,7 +788,7 @@ bool FileStreamer::InitializeCopy()
Reader reader;
reader.SetFileName( filename );
if( !reader.Read() ) return false;
- if( strcmp( filename, outfilename ) )
+ if( strcmp( filename, outfilename ) != 0 )
{
Writer writer;
writer.SetFileName( outfilename );
@@ -802,7 +802,7 @@ bool FileStreamer::InitializeCopy()
assert( outfilename );
std::ifstream is( filename, std::ios::binary );
if( !is.good() ) return false;
- if( strcmp( filename, outfilename ) )
+ if( strcmp( filename, outfilename ) != 0 )
{
std::ofstream of( outfilename, std::ios::binary );
if( !of.good() ) return false;
diff --git a/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestWriter.cxx b/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestWriter.cxx
index 8224c17ce..19b1b28bc 100644
--- a/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestWriter.cxx
+++ b/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestWriter.cxx
@@ -69,7 +69,7 @@ int TestWrite(const char *subdir, const char* filename, bool recursing, bool ver
char digest[33], outdigest[33];
Testing::ComputeFileMD5(filename, digest);
Testing::ComputeFileMD5(outfilename.c_str(), outdigest);
- if( strcmp(digest, outdigest) )
+ if( strcmp(digest, outdigest) != 0 )
{
if (recursing)
return 1;
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCurve2.cxx b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCurve2.cxx
index 406483004..e07242f0b 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCurve2.cxx
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCurve2.cxx
@@ -148,7 +148,7 @@ static int TestCurve2Read(const char* filename, bool verbose = false)
//assert(0);
res = 1;
}
- else if( strcmp(digest, ref) )
+ else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileChangeTransferSyntax1.cxx b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileChangeTransferSyntax1.cxx
index e7e16b6a6..a838ec037 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileChangeTransferSyntax1.cxx
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileChangeTransferSyntax1.cxx
@@ -165,7 +165,7 @@ static int TestFileChangeTransferSyntax1Func(const char *filename, bool verbose
//assert(0);
res = 1;
}
- else if( strcmp(digest, ref) )
+ else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileChangeTransferSyntax2.cxx b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileChangeTransferSyntax2.cxx
index 204ad8ab2..3d94520fe 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileChangeTransferSyntax2.cxx
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileChangeTransferSyntax2.cxx
@@ -165,7 +165,7 @@ static int TestFileChangeTransferSyntax2Func(const char *filename, bool verbose
//assert(0);
res = 1;
}
- else if( strcmp(digest, ref) )
+ else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileChangeTransferSyntax3.cxx b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileChangeTransferSyntax3.cxx
index ef802067f..fd4cd4aa6 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileChangeTransferSyntax3.cxx
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileChangeTransferSyntax3.cxx
@@ -165,7 +165,7 @@ static int TestFileChangeTransferSyntax3Func(const char *filename, bool verbose
//assert(0);
res = 1;
}
- else if( strcmp(digest, ref) )
+ else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileChangeTransferSyntax4.cxx b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileChangeTransferSyntax4.cxx
index 142863d06..a43d549d6 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileChangeTransferSyntax4.cxx
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileChangeTransferSyntax4.cxx
@@ -165,7 +165,7 @@ static int TestFileChangeTransferSyntax4Func(const char *filename, bool verbose
//assert(0);
res = 1;
}
- else if( strcmp(digest, ref) )
+ else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileDecompressLookupTable.cxx b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileDecompressLookupTable.cxx
index 58b91ca56..9f54328ab 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileDecompressLookupTable.cxx
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileDecompressLookupTable.cxx
@@ -142,7 +142,7 @@ static int TestFileDecompressLookupTableFunc(const char *filename, bool verbose
std::cerr << "Missing LUT-applied MD5 for image from: " << filename << std::endl;
res = 1;
}
- else if( strcmp(digest, ref) )
+ else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileStreamer3.cxx b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileStreamer3.cxx
index cd0ef1e64..7b440c127 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileStreamer3.cxx
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestFileStreamer3.cxx
@@ -126,7 +126,7 @@ int TestFileStream3(const char *filename, bool verbose = false)
std::cerr << "Wrong length: " << bv->GetLength() << std::endl;
return 1;
}
- if( memcmp( bv->GetPointer(), buffer, 2 ) )
+ if( memcmp( bv->GetPointer(), buffer, 2 ) != 0 )
{
std::cerr << "Wrong content" << std::endl;
return 1;
@@ -138,7 +138,7 @@ int TestFileStream3(const char *filename, bool verbose = false)
const ByteValue * bv = de.GetByteValue();
if( !bv ) return 1;
if( bv->GetLength() != 2 ) return 1;
- if( memcmp( bv->GetPointer(), buffer, 2 ) )
+ if( memcmp( bv->GetPointer(), buffer, 2 ) != 0 )
{
std::cerr << "Wrong content" << std::endl;
return 1;
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestIconImageFilter.cxx b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestIconImageFilter.cxx
index ed561f233..c549ac30e 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestIconImageFilter.cxx
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestIconImageFilter.cxx
@@ -108,7 +108,7 @@ int TestIconImageFilterFunc(const char *filename, bool verbose = false)
std::cerr << "Problem with : " << name << " missing md5= " << digest << std::endl;
return 1;
}
- if( strcmp( refmd5, digest) )
+ if( strcmp( refmd5, digest) != 0 )
{
std::cerr << "Problem with : " << name << " " << refmd5 << " vs " << digest << std::endl;
return 1;
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageApplyLookupTable.cxx b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageApplyLookupTable.cxx
index 16853856f..3326bffed 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageApplyLookupTable.cxx
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageApplyLookupTable.cxx
@@ -129,7 +129,7 @@ int TestImageApplyLookupTableFunc(const char *filename, bool verbose = false)
std::cerr << "Missing LUT-applied MD5 for image from: " << filename << std::endl;
res = 1;
}
- else if( strcmp(digest, ref) )
+ else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangePlanarConfiguration.cxx b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangePlanarConfiguration.cxx
index bd1493515..7e21ea11b 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangePlanarConfiguration.cxx
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangePlanarConfiguration.cxx
@@ -141,7 +141,7 @@ int TestImageChangePlanarConfigurationFunc(const char *filename, bool verbose =
//assert(0);
res = 1;
}
- else if( strcmp(digest, ref) )
+ else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax1.cxx b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax1.cxx
index 5807593ce..06a616bc2 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax1.cxx
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax1.cxx
@@ -143,7 +143,7 @@ int TestImageChangeTransferSyntaxJPEG(const char *filename, bool verbose = false
//assert(0);
res = 1;
}
- else if( strcmp(digest, ref) )
+ else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax2.cxx b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax2.cxx
index c445ce71b..b3d19e7f2 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax2.cxx
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax2.cxx
@@ -143,7 +143,7 @@ int TestImageChangeTransferSyntaxJ2K(const char *filename, bool verbose = false)
//assert(0);
res = 1;
}
- else if( strcmp(digest, ref) )
+ else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax3.cxx b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax3.cxx
index 08648106e..f2b37802a 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax3.cxx
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax3.cxx
@@ -150,7 +150,7 @@ int TestImageChangeTransferSyntaxRLE(const char *filename, bool verbose = false)
//assert(0);
res = 1;
}
- else if( strcmp(digest, ref) )
+ else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax4.cxx b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax4.cxx
index 7b73c1d80..66f9e18f9 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax4.cxx
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax4.cxx
@@ -135,7 +135,7 @@ int TestImageChangeTransferSyntaxRAW(const char *filename, bool verbose = false)
//assert(0);
res = 1;
}
- else if( strcmp(digest, ref) )
+ else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax5.cxx b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax5.cxx
index ce12aa18c..2aa4e2f60 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax5.cxx
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax5.cxx
@@ -137,7 +137,7 @@ int TestImageChangeTransferSyntaxJPEGLS(const char *filename, bool verbose = fal
//assert(0);
res = 1;
}
- else if( strcmp(digest, ref) )
+ else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax6.cxx b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax6.cxx
index b224c0c45..ade865582 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax6.cxx
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax6.cxx
@@ -126,7 +126,7 @@ int TestImageChangeTransferSyntaxRAWBE(const char *filename, bool verbose = fals
//assert(0);
res = 1;
}
- else if( strcmp(digest, ref) )
+ else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax7.cxx b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax7.cxx
index 59b7bfdfb..1df643ce0 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax7.cxx
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax7.cxx
@@ -168,7 +168,7 @@ int TestImageChangeTransferSyntaxIM2RAWBE(const char *filename, bool verbose = f
//assert(0);
res = 1;
}
- else if( strcmp(digest, ref) )
+ else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageReader.cxx b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageReader.cxx
index c7adf21a3..489445cd2 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageReader.cxx
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageReader.cxx
@@ -87,7 +87,7 @@ int TestImageRead(const char* filename, bool verbose = false, bool lossydump = f
//assert(0);
res = 1;
}
- else if( strcmp(digest, ref) )
+ else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageRegionReader1.cxx b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageRegionReader1.cxx
index db0b51518..b5fd0288a 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageRegionReader1.cxx
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageRegionReader1.cxx
@@ -100,7 +100,7 @@ static int TestImageRegionRead(const char* filename, bool verbose = false)
std::cout << "Missing md5 " << digest << " for: " << filename << std::endl;
res = 1;
}
- else if( strcmp(digest, ref) )
+ else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageRegionReader2.cxx b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageRegionReader2.cxx
index 010036125..a90f72ed8 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageRegionReader2.cxx
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageRegionReader2.cxx
@@ -105,7 +105,7 @@ static int TestImageRegionRead(const char* filename, bool verbose = false)
std::cout << "Missing md5 " << digest << " for: " << filename << std::endl;
res = 1;
}
- else if( strcmp(digest, ref) )
+ else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageRegionReader3.cxx b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageRegionReader3.cxx
index fcbef7c16..632562e1c 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageRegionReader3.cxx
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageRegionReader3.cxx
@@ -123,7 +123,7 @@ static int TestImageRegionRead(const char* filename, bool verbose = false)
std::cout << "Missing md5 " << digest << " for: " << filename << std::endl;
res = 1;
}
- else if( strcmp(digest, ref) )
+ else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << filename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageWriter.cxx b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageWriter.cxx
index bef6df46d..4f3f5060a 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageWriter.cxx
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageWriter.cxx
@@ -103,7 +103,7 @@ int TestImageWrite(const char *subdir, const char* filename)
//assert(0);
res = 1;
}
- else if( strcmp(digest, ref) )
+ else if( strcmp(digest, ref) != 0 )
{
std::cerr << "Problem reading image from: " << outfilename << std::endl;
std::cerr << "Found " << digest << " instead of " << ref << std::endl;
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestOverlay3.cxx b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestOverlay3.cxx
index 24e3bca87..16a96ffdb 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestOverlay3.cxx
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestOverlay3.cxx
@@ -125,13 +125,13 @@ static int TestReadOverlay(const char* filename, bool verbose = false)
std::cerr << name << std::endl;
++ret;
}
- if( refmd5 && strcmp(digest1, refmd5) )
+ if( refmd5 && strcmp(digest1, refmd5) != 0 )
{
std::cerr << "strcmp/ref: Problem with Overlay: #" << ovidx << std::endl;
std::cerr << "ref: " << refmd5 << " vs " << digest1 << std::endl;
++ret;
}
- if( strcmp(digest1, digest2) )
+ if( strcmp(digest1, digest2) != 0 )
{
std::cerr << "strcmp/1/2: Problem with Overlay: #" << ovidx << std::endl;
std::cerr << "digest1: " << digest1 << " vs " << digest2 << std::endl;
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestPrinter1.cxx b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestPrinter1.cxx
index 22f84d1f7..e12fd4051 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestPrinter1.cxx
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestPrinter1.cxx
@@ -319,7 +319,7 @@ int TestPrint(const char *filename, bool verbose= false)
std::cerr << "Problem with : " << name << " missing md5= " << digest << std::endl;
return 1;
}
- if( strcmp( refmd5, digest) )
+ if( strcmp( refmd5, digest) != 0 )
{
std::cerr << "Problem with : " << name << " " << refmd5 << " vs " << digest << std::endl;
return 1;
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStreamImageReader.cxx b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStreamImageReader.cxx
index bf0652ec5..e303675ad 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStreamImageReader.cxx
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStreamImageReader.cxx
@@ -131,7 +131,7 @@ int TestStreamImageRead(const char* filename, bool verbose = false, bool lossydu
//assert(0);
res = 1;
}
- else if( strcmp(digest, ref) )
+ else if( strcmp(digest, ref) != 0 )
{
// let's be nice for now and only truly fails when file is proper DICOM
https://sourceforge.net/p/gdcm/gdcm/ci/fd09e936f17c5b8ceca4c56c7f11d498a690f973/
commit fd09e936f17c5b8ceca4c56c7f11d498a690f973
Author: Sean McBride <se...@ro...>
Date: Fri Mar 24 19:13:39 2023 -0400
Used clang-tidy to auto-apply performance-faster-string-find fixes
diff --git a/Source/Common/gdcmFilename.cxx b/Source/Common/gdcmFilename.cxx
index 24f903834..80eda8d9e 100644
--- a/Source/Common/gdcmFilename.cxx
+++ b/Source/Common/gdcmFilename.cxx
@@ -28,7 +28,7 @@ const char *Filename::GetPath()
{
std::string fn = ToUnixSlashes();
- std::string::size_type slash_pos = fn.rfind("/");
+ std::string::size_type slash_pos = fn.rfind('/');
if(slash_pos != std::string::npos)
{
Path = fn.substr(0, slash_pos);
@@ -52,7 +52,7 @@ const char *Filename::GetName()
#if defined(_WIN32)
std::string::size_type slash_pos = filename.find_last_of("/\\");
#else
- std::string::size_type slash_pos = filename.find_last_of("/");
+ std::string::size_type slash_pos = filename.find_last_of('/');
#endif
if(slash_pos != std::string::npos)
{
@@ -142,7 +142,7 @@ inline void Realpath(const char *path, std::string & resolved_path)
const char *Filename::GetExtension()
{
std::string name = GetName();
- std::string::size_type dot_pos = name.rfind(".");
+ std::string::size_type dot_pos = name.rfind('.');
if(dot_pos != std::string::npos)
{
return GetName() + dot_pos;
diff --git a/Source/DataStructureAndEncodingDefinition/gdcmTransferSyntax.cxx b/Source/DataStructureAndEncodingDefinition/gdcmTransferSyntax.cxx
index 0c26cfcb2..57a3abceb 100644
--- a/Source/DataStructureAndEncodingDefinition/gdcmTransferSyntax.cxx
+++ b/Source/DataStructureAndEncodingDefinition/gdcmTransferSyntax.cxx
@@ -90,7 +90,7 @@ TransferSyntax::TSType TransferSyntax::GetTSType(const char *cstr)
{
// trim trailing whitespace
std::string str = cstr;
- std::string::size_type notspace = str.find_last_not_of(" ") + 1;
+ std::string::size_type notspace = str.find_last_not_of(' ') + 1;
if( notspace != str.size() )
{
gdcmDebugMacro( "BUGGY HEADER: TS contains " <<
diff --git a/Source/MediaStorageAndFileFormat/gdcmDirectoryHelper.cxx b/Source/MediaStorageAndFileFormat/gdcmDirectoryHelper.cxx
index 2cfb0c6b8..4d1fac972 100644
--- a/Source/MediaStorageAndFileFormat/gdcmDirectoryHelper.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmDirectoryHelper.cxx
@@ -35,7 +35,7 @@ Directory::FilenamesType DirectoryHelper::GetSeriesUIDsBySOPClassUID(const std::
theScanner.GetFilenameFromTagToValue(Tag(0x0020,0x000e), theSeriesValues[i].c_str());
std::string theSOPClassUID = theScanner.GetValue(theFirstFilename.c_str(), Tag(0x0008,0x0016));
//dicom strings sometimes have trailing spaces; make sure to avoid those
- size_t endpos = theSOPClassUID.find_last_not_of(" "); // Find the first character position from reverse af
+ size_t endpos = theSOPClassUID.find_last_not_of(' '); // Find the first character position from reverse af
if( std::string::npos != endpos )
theSOPClassUID = theSOPClassUID.substr( 0, endpos+1 );
if (theSOPClassUID == inSOPClassUID.c_str()){
@@ -88,7 +88,7 @@ Directory::FilenamesType DirectoryHelper::GetFilenamesFromSeriesUIDs(const std::
{
std::string theSeriesUID = theSeriesValues[i];
//dicom strings sometimes have trailing spaces; make sure to avoid those
- size_t endpos = theSeriesUID.find_last_not_of(" "); // Find the first character position from reverse af
+ size_t endpos = theSeriesUID.find_last_not_of(' '); // Find the first character position from reverse af
if( std::string::npos != endpos )
theSeriesUID = theSeriesUID.substr( 0, endpos+1 );
if (inSeriesUID == theSeriesUID)
https://sourceforge.net/p/gdcm/gdcm/ci/7891b4dea4f6578d13c2ab0c8b8b76b448db4b2d/
commit 7891b4dea4f6578d13c2ab0c8b8b76b448db4b2d
Author: Sean McBride <se...@ro...>
Date: Fri Mar 24 18:59:44 2023 -0400
Used clang-tidy to auto-apply readability-container-size-empty fixes
diff --git a/Source/DataStructureAndEncodingDefinition/gdcmDataSet.cxx b/Source/DataStructureAndEncodingDefinition/gdcmDataSet.cxx
index 3024625c1..657ff111e 100644
--- a/Source/DataStructureAndEncodingDefinition/gdcmDataSet.cxx
+++ b/Source/DataStructureAndEncodingDefinition/gdcmDataSet.cxx
@@ -49,7 +49,7 @@ std::string DataSet::GetPrivateCreator(const Tag &t) const
// osirix/AbdominalCT/36382443
owner.erase(owner.size()-1,1);
}
- assert( owner.size() == 0 || owner[owner.size()-1] != ' ' );
+ assert( owner.empty() || owner[owner.size()-1] != ' ' );
return owner;
}
}
@@ -85,7 +85,7 @@ Tag DataSet::ComputeDataElement(const PrivateTag & t) const
std::string tmp(bv->GetPointer(),bv->GetLength());
// trim trailing whitespaces:
tmp.erase(tmp.find_last_not_of(' ') + 1);
- assert( tmp.size() == 0 || tmp[ tmp.size() - 1 ] != ' ' ); // FIXME
+ assert( tmp.empty() || tmp[ tmp.size() - 1 ] != ' ' ); // FIXME
if( System::StrCaseCmp( tmp.c_str(), refowner ) == 0 )
{
// found !
diff --git a/Source/InformationObjectDefinition/gdcmTableReader.cxx b/Source/InformationObjectDefinition/gdcmTableReader.cxx
index e70cf7f7d..869ba1834 100644
--- a/Source/InformationObjectDefinition/gdcmTableReader.cxx
+++ b/Source/InformationObjectDefinition/gdcmTableReader.cxx
@@ -73,7 +73,7 @@ void TableReader::HandleMacroEntryDescription(const char **atts)
assert( ParsingMacroEntryDescription == false );
ParsingMacroEntryDescription = true;
assert( *atts == nullptr );
- assert( Description == "" );
+ assert( Description.empty() );
}
void TableReader::HandleModuleInclude(const char **atts)
@@ -92,7 +92,7 @@ void TableReader::HandleModuleEntryDescription(const char **atts)
assert( ParsingModuleEntryDescription == false );
ParsingModuleEntryDescription = true;
assert( *atts == nullptr );
- assert( Description == "" );
+ assert( Description.empty() );
}
void TableReader::HandleMacroEntry(const char **atts)
diff --git a/Source/MessageExchangeDefinition/gdcmCompositeNetworkFunctions.cxx b/Source/MessageExchangeDefinition/gdcmCompositeNetworkFunctions.cxx
index fdd0808f1..aa339f538 100644
--- a/Source/MessageExchangeDefinition/gdcmCompositeNetworkFunctions.cxx
+++ b/Source/MessageExchangeDefinition/gdcmCompositeNetworkFunctions.cxx
@@ -257,7 +257,7 @@ bool CompositeNetworkFunctions::CFind( const char *remote, uint16_t portno,
gdcmErrorMacro( "Failed to GetResponses." );
return false;
}
- assert( theResponses.size() >= 1 );
+ assert( !theResponses.empty() );
// take the last one:
const DataSet &ds = theResponses[ theResponses.size() - 1 ]; // FIXME
assert ( ds.FindDataElement(Tag(0x0, 0x0900)) );
diff --git a/Source/MessageExchangeDefinition/gdcmNormalizedNetworkFunctions.cxx b/Source/MessageExchangeDefinition/gdcmNormalizedNetworkFunctions.cxx
index d5a0e350b..9b2f3ead1 100644
--- a/Source/MessageExchangeDefinition/gdcmNormalizedNetworkFunctions.cxx
+++ b/Source/MessageExchangeDefinition/gdcmNormalizedNetworkFunctions.cxx
@@ -132,7 +132,7 @@ namespace gdcm
gdcmErrorMacro( "Failed to GetResponses." );
return false;
}
- assert( theResponses.size() >= 1 );
+ assert( !theResponses.empty() );
// take the last one:
const DataSet &ds = theResponses[ theResponses.size() - 1 ]; // FIXME
assert ( ds.FindDataElement(Tag(0x0, 0x0900)) );
@@ -243,7 +243,7 @@ namespace gdcm
gdcmErrorMacro( "Failed to GetResponses." );
return false;
}
- assert( theResponses.size() >= 1 );
+ assert( !theResponses.empty() );
// take the last one:
const DataSet &ds = theResponses[ theResponses.size() - 1 ]; // FIXME
assert ( ds.FindDataElement(Tag(0x0, 0x0900)) );
diff --git a/Source/MessageExchangeDefinition/gdcmServiceClassUser.cxx b/Source/MessageExchangeDefinition/gdcmServiceClassUser.cxx
index daf23ba8d..3ce4e0ea6 100644
--- a/Source/MessageExchangeDefinition/gdcmServiceClassUser.cxx
+++ b/Source/MessageExchangeDefinition/gdcmServiceClassUser.cxx
@@ -326,7 +326,7 @@ bool ServiceClassUser::SendFind(const BaseRootQuery* query, std::vector<DataSet>
std::vector<DataSet> const & theResponses = theCallback.GetResponses();
bool ret = false; // by default an error
- assert( theResponses.size() >= 1 );
+ assert( !theResponses.empty() );
// take the last one:
const DataSet &ds = theResponses[ theResponses.size() - 1 ]; // FIXME
assert ( ds.FindDataElement(Tag(0x0, 0x0900)) );
https://sourceforge.net/p/gdcm/gdcm/ci/770393e9587dc111a055c2f30e67a74141679ba4/
commit 770393e9587dc111a055c2f30e67a74141679ba4
Author: Sean McBride <se...@ro...>
Date: Fri Mar 24 18:56:24 2023 -0400
Used clang-tidy to auto-apply readability-duplicate-include fixes
diff --git a/Source/Common/gdcmSystem.cxx b/Source/Common/gdcmSystem.cxx
index e0733cb26..cbf6ff5fd 100644
--- a/Source/Common/gdcmSystem.cxx
+++ b/Source/Common/gdcmSystem.cxx
@@ -23,7 +23,7 @@
#include <cassert>
#include <cerrno>
#include <climits> // PATH_MAX
-#include <cstdio>
+#include <cstdio> // snprintf
#include <cstdlib>
#include <cstring> // strspn
#include <sys/stat.h>
@@ -36,7 +36,6 @@
#ifdef GDCM_HAVE_WINSOCK_H
#include <winsock.h>
#endif
-#include <cstdio> // snprintf
#if defined(_MSC_VER) && (_MSC_VER < 1900)
#define snprintf _snprintf
#endif
diff --git a/Source/DataStructureAndEncodingDefinition/gdcmWriter.cxx b/Source/DataStructureAndEncodingDefinition/gdcmWriter.cxx
index bf15837ee..515f23ed9 100644
--- a/Source/DataStructureAndEncodingDefinition/gdcmWriter.cxx
+++ b/Source/DataStructureAndEncodingDefinition/gdcmWriter.cxx
@@ -16,13 +16,11 @@
#include "gdcmDataSet.h"
#include "gdcmTrace.h"
-#include "gdcmSwapper.h"
-#include "gdcmDataSet.h"
#include "gdcmExplicitDataElement.h"
#include "gdcmImplicitDataElement.h"
+#include "gdcmSwapper.h"
#include "gdcmValue.h"
-#include "gdcmValue.h"
#include "gdcmItem.h"
#include "gdcmSequenceOfItems.h"
#include "gdcmParseException.h"
diff --git a/Source/MessageExchangeDefinition/gdcmULActionDT.cxx b/Source/MessageExchangeDefinition/gdcmULActionDT.cxx
index 66e922382..a96897672 100644
--- a/Source/MessageExchangeDefinition/gdcmULActionDT.cxx
+++ b/Source/MessageExchangeDefinition/gdcmULActionDT.cxx
@@ -27,7 +27,6 @@ each class have its own file for the sake of brevity of the number of files.
#include "gdcmARTIMTimer.h"
#include "gdcmPDataTFPDU.h"
-#include "gdcmPDataTFPDU.h"
#include "gdcmAttribute.h"
#include "gdcmProgressEvent.h"
#include "gdcmFile.h"
diff --git a/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestReader3.cxx b/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestReader3.cxx
index dd28262b6..893f73f74 100644
--- a/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestReader3.cxx
+++ b/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestReader3.cxx
@@ -25,8 +25,6 @@
#include <unistd.h> /* close */
// open
-#include <sys/types.h>
-#include <sys/stat.h>
#include <fcntl.h>
// mmap
https://sourceforge.net/p/gdcm/gdcm/ci/99418ec167cd09d93e614f4be2dd4516e24ca5c3/
commit 99418ec167cd09d93e614f4be2dd4516e24ca5c3
Author: Sean McBride <se...@ro...>
Date: Fri Mar 24 18:52:45 2023 -0400
Used clang-tidy to auto-apply readability-delete-null-pointer fixes
diff --git a/Source/DataStructureAndEncodingDefinition/gdcmReader.cxx b/Source/DataStructureAndEncodingDefinition/gdcmReader.cxx
index 80eb8c4e9..454b0bf61 100644
--- a/Source/DataStructureAndEncodingDefinition/gdcmReader.cxx
+++ b/Source/DataStructureAndEncodingDefinition/gdcmReader.cxx
@@ -831,7 +831,7 @@ bool Reader::CanRead() const
void Reader::SetFileName(const char *utf8path)
{
- if(Ifstream) delete Ifstream;
+ delete Ifstream;
Ifstream = new std::ifstream();
if (utf8path && *utf8path) {
#ifdef _MSC_VER
diff --git a/Source/MediaStorageAndFileFormat/gdcmSurface.cxx b/Source/MediaStorageAndFileFormat/gdcmSurface.cxx
index df082c472..b1b8f1b25 100644
--- a/Source/MediaStorageAndFileFormat/gdcmSurface.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmSurface.cxx
@@ -150,12 +150,12 @@ Surface::Surface():
Surface::~Surface()
{
- if (PointPositionAccuracy != nullptr) delete PointPositionAccuracy;
- if (PointsBoundingBoxCoordinates != nullptr) delete PointsBoundingBoxCoordinates;
- if (AxisOfRotation != nullptr) delete AxisOfRotation;
- if (CenterOfRotation != nullptr) delete CenterOfRotation;
+ delete PointPositionAccuracy;
+ delete PointsBoundingBoxCoordinates;
+ delete AxisOfRotation;
+ delete CenterOfRotation;
- if (VectorAccuracy != nullptr) delete VectorAccuracy;
+ delete VectorAccuracy;
}
unsigned short Surface::GetRecommendedDisplayGrayscaleValue() const
diff --git a/Source/MessageExchangeDefinition/gdcmServiceClassUser.cxx b/Source/MessageExchangeDefinition/gdcmServiceClassUser.cxx
index 1c0b8b7f7..daf23ba8d 100644
--- a/Source/MessageExchangeDefinition/gdcmServiceClassUser.cxx
+++ b/Source/MessageExchangeDefinition/gdcmServiceClassUser.cxx
@@ -123,10 +123,8 @@ bool ServiceClassUser::InitializeConnection()
}
ULConnection* mConnection = Internals->mConnection;
- if (mConnection)
- {
- delete mConnection;
- }
+ delete mConnection;
+
Internals->mConnection = new ULConnection(connectInfo);
Internals->mConnection->GetTimer().SetTimeout(Internals->timeout);
@@ -404,10 +402,8 @@ bool ServiceClassUser::SendMove(const BaseRootQuery* query, const char *outputdi
// let's start the secondary connection
ULConnection* mSecondaryConnection = Internals->mSecondaryConnection;
- if (mSecondaryConnection)
- {
- delete mSecondaryConnection;
- }
+ delete mSecondaryConnection;
+
Internals->mSecondaryConnection = new ULConnection(connectInfo2);
Internals->mSecondaryConnection->GetTimer().SetTimeout(Internals->timeout);
@@ -439,10 +435,8 @@ bool ServiceClassUser::SendMove(const BaseRootQuery* query, std::vector<DataSet>
// let's start the secondary connection
ULConnection* mSecondaryConnection = Internals->mSecondaryConnection;
- if (mSecondaryConnection)
- {
- delete mSecondaryConnection;
- }
+ delete mSecondaryConnection;
+
Internals->mSecondaryConnection = new ULConnection(connectInfo2);
Internals->mSecondaryConnection->GetTimer().SetTimeout(Internals->timeout);
diff --git a/Source/MessageExchangeDefinition/gdcmULConnectionManager.cxx b/Source/MessageExchangeDefinition/gdcmULConnectionManager.cxx
index 847e41ef4..4393fb358 100644
--- a/Source/MessageExchangeDefinition/gdcmULConnectionManager.cxx
+++ b/Source/MessageExchangeDefinition/gdcmULConnectionManager.cxx
@@ -80,10 +80,7 @@ bool ULConnectionManager::EstablishConnection(const std::string& inAETitle,
return false;
}
- if (mConnection != nullptr)
- {
- delete mConnection;
- }
+ delete mConnection;
mConnection = new ULConnection(connectInfo);
mConnection->GetTimer().SetTimeout(inTimeout);
https://sourceforge.net/p/gdcm/gdcm/ci/fd888d0c9f7c035e3fa71b987fa4370cca64dbc6/
commit fd888d0c9f7c035e3fa71b987fa4370cca64dbc6
Author: Sean McBride <se...@ro...>
Date: Fri Mar 24 18:45:11 2023 -0400
Used clang-tidy to auto-apply modernize-deprecated-headers fixes
Uses C++ header names instead of C header names.
diff --git a/Source/Common/gdcmASN1.cxx b/Source/Common/gdcmASN1.cxx
index ef5ab2573..afab05e02 100644
--- a/Source/Common/gdcmASN1.cxx
+++ b/Source/Common/gdcmASN1.cxx
@@ -14,7 +14,7 @@
#include "gdcmASN1.h"
#include "gdcmSystem.h"
-#include <string.h>
+#include <cstring>
#ifdef GDCM_USE_SYSTEM_OPENSSL
#include <openssl/bio.h>
diff --git a/Source/Common/gdcmBase64.cxx b/Source/Common/gdcmBase64.cxx
index fbe2290ac..8eac3481e 100644
--- a/Source/Common/gdcmBase64.cxx
+++ b/Source/Common/gdcmBase64.cxx
@@ -12,7 +12,7 @@
=========================================================================*/
#include "gdcmBase64.h"
-#include <string.h> // memcpy
+#include <cstring> // memcpy
#include <iostream>
namespace gdcm
diff --git a/Source/Common/gdcmDirectory.cxx b/Source/Common/gdcmDirectory.cxx
index 171dfbecc..cf87700de 100644
--- a/Source/Common/gdcmDirectory.cxx
+++ b/Source/Common/gdcmDirectory.cxx
@@ -14,11 +14,11 @@
#include "gdcmDirectory.h"
#include "gdcmTrace.h"
+#include <cassert>
+#include <cerrno>
+#include <cstring> // strerror
#include <iterator>
-#include <assert.h>
-#include <errno.h>
#include <sys/stat.h> //stat function
-#include <string.h> // strerror
#ifdef _MSC_VER
#include <windows.h>
diff --git a/Source/Common/gdcmFilename.cxx b/Source/Common/gdcmFilename.cxx
index abfc1058d..24f903834 100644
--- a/Source/Common/gdcmFilename.cxx
+++ b/Source/Common/gdcmFilename.cxx
@@ -12,10 +12,10 @@
=========================================================================*/
#include "gdcmFilename.h"
-#include <limits.h>
-#include <stdlib.h> // realpath
-#include <assert.h>
-#include <string.h>
+#include <cassert>
+#include <climits>
+#include <cstdlib> // realpath
+#include <cstring>
namespace gdcm
{
diff --git a/Source/Common/gdcmMD5.cxx b/Source/Common/gdcmMD5.cxx
index 93acd640f..89a966d5e 100644
--- a/Source/Common/gdcmMD5.cxx
+++ b/Source/Common/gdcmMD5.cxx
@@ -19,9 +19,9 @@
#elif defined(GDCM_BUILD_TESTING)
#include "gdcm_md5.h"
#endif
+#include <cstdio>
#include <fstream>
#include <vector>
-#include <stdio.h>
#if defined(_MSC_VER) && (_MSC_VER < 1900)
#define snprintf _snprintf
#endif
diff --git a/Source/Common/gdcmSHA1.cxx b/Source/Common/gdcmSHA1.cxx
index 69acb5b9b..01b8163eb 100644
--- a/Source/Common/gdcmSHA1.cxx
+++ b/Source/Common/gdcmSHA1.cxx
@@ -18,9 +18,9 @@
#include <openssl/sha.h>
#endif
-#include <string.h> // memcmp
-#include <stdlib.h> // malloc
-#include <stdio.h> // snprintf
+#include <cstdio> // snprintf
+#include <cstdlib> // malloc
+#include <cstring> // memcmp
/*
*/
diff --git a/Source/Common/gdcmSwapCode.cxx b/Source/Common/gdcmSwapCode.cxx
index 65ded97cc..4d46f8635 100644
--- a/Source/Common/gdcmSwapCode.cxx
+++ b/Source/Common/gdcmSwapCode.cxx
@@ -12,7 +12,7 @@
=========================================================================*/
#include "gdcmSwapCode.h"
-#include <assert.h>
+#include <cassert>
namespace gdcm
{
diff --git a/Source/Common/gdcmSystem.cxx b/Source/Common/gdcmSystem.cxx
index 55c5a914a..e0733cb26 100644
--- a/Source/Common/gdcmSystem.cxx
+++ b/Source/Common/gdcmSystem.cxx
@@ -20,19 +20,19 @@
#include <iostream>
#include <string>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h> // strspn
-#include <assert.h>
-#include <errno.h>
+#include <cassert>
+#include <cerrno>
+#include <climits> // PATH_MAX
+#include <cstdio>
+#include <cstdlib>
+#include <cstring> // strspn
#include <sys/stat.h>
-#include <limits.h> // PATH_MAX
// gettimeofday
#ifdef GDCM_HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
-#include <time.h>
+#include <ctime>
#ifdef GDCM_HAVE_WINSOCK_H
#include <winsock.h>
#endif
diff --git a/Source/Common/gdcmTerminal.cxx b/Source/Common/gdcmTerminal.cxx
index d31cc00fd..118192d86 100644
--- a/Source/Common/gdcmTerminal.cxx
+++ b/Source/Common/gdcmTerminal.cxx
@@ -13,10 +13,9 @@
=========================================================================*/
#include "gdcmTerminal.h"
-#include <iostream>
-#include <iostream>
+#include <cstdio>
#include <fstream>
-#include <stdio.h>
+#include <iostream>
#if defined(_MSC_VER) && (_MSC_VER < 1900)
#define snprintf _snprintf
#endif
diff --git a/Source/Common/gdcmTesting.cxx b/Source/Common/gdcmTesting.cxx
index 8d48b9579..f3df5d18c 100644
--- a/Source/Common/gdcmTesting.cxx
+++ b/Source/Common/gdcmTesting.cxx
@@ -16,8 +16,8 @@
#include "gdcmSystem.h"
#include "gdcmMD5.h"
-#include <string.h> // strcmp
-#include <stdlib.h> // malloc
+#include <cstdlib> // malloc
+#include <cstring> // strcmp
namespace gdcm
diff --git a/Source/DataDictionary/gdcmGlobal.cxx b/Source/DataDictionary/gdcmGlobal.cxx
index dd2bba5ba..60051a1fe 100644
--- a/Source/DataDictionary/gdcmGlobal.cxx
+++ b/Source/DataDictionary/gdcmGlobal.cxx
@@ -16,8 +16,8 @@
#include "gdcmDefs.h"
#include "gdcmFilename.h"
-#include <limits.h> // PATH_MAX
-#include <string.h> // strcpy
+#include <climits> // PATH_MAX
+#include <cstring> // strcpy
#ifdef _WIN32
#include <windows.h> // MAX_PATH
#endif
diff --git a/Source/DataDictionary/gdcmU...
[truncated message content] |