[Gdcm-hackers] gdcm-git:Grassroots DICOM branch release updated. 4a82c4b6f8d287116633b4a768652d4368
Cross-platform DICOM implementation
Brought to you by:
malat
|
From: malat <ma...@us...> - 2023-05-02 09:21:45
|
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 4a82c4b6f8d287116633b4a768652d4368fd290d (commit)
from 6775070bc837412d3af8cd6466e99db2b5ae7630 (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/4a82c4b6f8d287116633b4a768652d4368fd290d/
commit 4a82c4b6f8d287116633b4a768652d4368fd290d
Author: Sean McBride <se...@ro...>
Date: Tue Apr 4 23:39:15 2023 -0400
Auto-fixed most clang-tidy cert-dcl03-c warnings
Use static_assert where possible.
There was one additional assert that clang-tidy transformed to static_assert, but the result did not compile, so I reverted that one.
diff --git a/Applications/Cxx/gdcmdump.cxx b/Applications/Cxx/gdcmdump.cxx
index 9cc80ac78..7b537816f 100644
--- a/Applications/Cxx/gdcmdump.cxx
+++ b/Applications/Cxx/gdcmdump.cxx
@@ -98,7 +98,7 @@ static void printvalue(std::istream &is, uint32_t type, uint32_t numels, uint32_
is.seekg( pos );
std::cout << "[";
typedef char (string81)[81]; // 80'th byte == 0
- assert( sizeof( string81 ) == 81 );
+ static_assert( sizeof( string81 ) == 81 , "");
switch( type )
{
case TYPE_FLOAT:
@@ -199,7 +199,7 @@ static void ProcessSDSData( std::istream & is )
// haven't been able to figure out what was the begin meant for
is.seekg( 0x20 - 8 );
uint32_t version = 0;
- assert( sizeof(uint32_t) == 4 );
+ static_assert( sizeof(uint32_t) == 4 , "");
is.read( (char*)&version, sizeof(version) );
assert( version == 8 );
uint32_t numel = 0;
@@ -207,7 +207,7 @@ static void ProcessSDSData( std::istream & is )
for( uint32_t el = 0; el < numel; ++el )
{
PDFElement pdfel;
- assert( sizeof(pdfel) == 50 );
+ static_assert( sizeof(pdfel) == 50 , "");
is.read( (char*)&pdfel, 50 );
if( *pdfel.getname() )
{
diff --git a/Source/DataDictionary/gdcmSOPClassUIDToIOD.cxx b/Source/DataDictionary/gdcmSOPClassUIDToIOD.cxx
index 8644a8ab5..8be92209c 100644
--- a/Source/DataDictionary/gdcmSOPClassUIDToIOD.cxx
+++ b/Source/DataDictionary/gdcmSOPClassUIDToIOD.cxx
@@ -135,7 +135,7 @@ namespace gdcm
unsigned int SOPClassUIDToIOD::GetNumberOfSOPClassToIOD()
{
static const unsigned int n = sizeof( SOPClassUIDToIODStrings ) / sizeof( *SOPClassUIDToIODStrings );
- assert( n > 0 );
+ static_assert( n > 0 , "");
return n - 1;
}
diff --git a/Source/DataDictionary/gdcmUIDs.cxx b/Source/DataDictionary/gdcmUIDs.cxx
index c43e24d6a..328bb1d76 100644
--- a/Source/DataDictionary/gdcmUIDs.cxx
+++ b/Source/DataDictionary/gdcmUIDs.cxx
@@ -512,7 +512,7 @@ const char * const * UIDs::GetTransferSyntaxString(unsigned int ts)
if( ts > 0 && ts <= UIDs::GetNumberOfTransferSyntaxStrings() ) return TransferSyntaxStrings[ts];
// else return the {0x0, 0x0} sentinel (begin or end)
assert( *TransferSyntaxStrings[ UIDs::GetNumberOfTransferSyntaxStrings() + 1 ] == nullptr );
- assert( *TransferSyntaxStrings[ 0 ] == nullptr );
+ assert( *TransferSyntaxStrings[ 0 ] == nullptr);
return TransferSyntaxStrings[ UIDs::GetNumberOfTransferSyntaxStrings() + 1 ];
}
diff --git a/Source/DataStructureAndEncodingDefinition/gdcmByteValue.cxx b/Source/DataStructureAndEncodingDefinition/gdcmByteValue.cxx
index 432cdde99..964806393 100644
--- a/Source/DataStructureAndEncodingDefinition/gdcmByteValue.cxx
+++ b/Source/DataStructureAndEncodingDefinition/gdcmByteValue.cxx
@@ -156,7 +156,7 @@ namespace gdcm_ns
else
{
//in the rare case there are more ^ characters
- assert("Name components exceeded");
+ static_assert("Name components exceeded", "");
}
}
else if ( c == '=' )
@@ -201,7 +201,7 @@ namespace gdcm_ns
}
else
{
- assert("Impossible - only 3 names allowed");
+ static_assert("Impossible - only 3 names allowed", "");
}
count2=1;
}
diff --git a/Source/DataStructureAndEncodingDefinition/gdcmMediaStorage.cxx b/Source/DataStructureAndEncodingDefinition/gdcmMediaStorage.cxx
index dc63307cd..c870c47ab 100644
--- a/Source/DataStructureAndEncodingDefinition/gdcmMediaStorage.cxx
+++ b/Source/DataStructureAndEncodingDefinition/gdcmMediaStorage.cxx
@@ -349,21 +349,21 @@ static const MSModalityType MSModalityTypes[] = {
unsigned int MediaStorage::GetNumberOfMSType()
{
const unsigned int n = MS_END;
- assert( n > 0 );
+ static_assert( n > 0 , "");
return n;
}
unsigned int MediaStorage::GetNumberOfMSString()
{
static const unsigned int n = sizeof( MSStrings ) / sizeof( *MSStrings );
- assert( n > 0 );
+ static_assert( n > 0 , "");
return n - 1;
}
unsigned int MediaStorage::GetNumberOfModality()
{
static const unsigned int n = sizeof( MSModalityTypes ) / sizeof( *MSModalityTypes );
- assert( n > 0 );
+ static_assert( n > 0 , "");
return n - 1;
}
diff --git a/Source/DataStructureAndEncodingDefinition/gdcmVR.cxx b/Source/DataStructureAndEncodingDefinition/gdcmVR.cxx
index a08b8402f..4d95080e9 100644
--- a/Source/DataStructureAndEncodingDefinition/gdcmVR.cxx
+++ b/Source/DataStructureAndEncodingDefinition/gdcmVR.cxx
@@ -310,7 +310,7 @@ const char *VR::GetVRStringFromFile(VRType vr)
{
#if 1
static const int N = sizeof(VRValue) / sizeof(VRType);
- assert( N == 35 );
+ static_assert( N == 35 , "");
static VRType *start = VRValue;
static VRType *end = VRValue+N;
const VRType *p =
diff --git a/Source/MediaStorageAndFileFormat/gdcmRLECodec.cxx b/Source/MediaStorageAndFileFormat/gdcmRLECodec.cxx
index 38c77852f..438f237b1 100644
--- a/Source/MediaStorageAndFileFormat/gdcmRLECodec.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmRLECodec.cxx
@@ -54,8 +54,8 @@ public:
{
// read Header (64 bytes)
is.read((char*)(&Header), sizeof(uint32_t)*16);
- assert( sizeof(uint32_t)*16 == 64 );
- assert( sizeof(RLEHeader) == 64 );
+ static_assert( sizeof(uint32_t)*16 == 64 , "");
+ static_assert( sizeof(RLEHeader) == 64 , "");
SwapperNoOp::SwapArray((uint32_t*)&Header,16);
uint32_t numSegments = Header.NumSegments;
if( numSegments >= 1 )
diff --git a/Source/MediaStorageAndFileFormat/gdcmRescaler.cxx b/Source/MediaStorageAndFileFormat/gdcmRescaler.cxx
index a24eaa21c..212b9fe2a 100644
--- a/Source/MediaStorageAndFileFormat/gdcmRescaler.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmRescaler.cxx
@@ -349,11 +349,11 @@ bool Rescaler::InverseRescale(char *out, const char *in8, size_t n)
InverseRescaleFunctionIntoBestFit<int32_t>(out,(const int32_t*)in,n);
break;
case PixelFormat::FLOAT32:
- assert( sizeof(float) == 32 / 8 );
+ static_assert( sizeof(float) == 32 / 8 , "");
InverseRescaleFunctionIntoBestFit<float>(out,(const float*)in,n);
break;
case PixelFormat::FLOAT64:
- assert( sizeof(double) == 64 / 8 );
+ static_assert( sizeof(double) == 64 / 8 , "");
InverseRescaleFunctionIntoBestFit<double>(out,(const double*)in,n);
break;
default:
diff --git a/Source/MediaStorageAndFileFormat/gdcmUUIDGenerator.cxx b/Source/MediaStorageAndFileFormat/gdcmUUIDGenerator.cxx
index eddf0ae6a..11ba83208 100644
--- a/Source/MediaStorageAndFileFormat/gdcmUUIDGenerator.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmUUIDGenerator.cxx
@@ -40,7 +40,7 @@ const char* UUIDGenerator::Generate()
Unique.resize( 36 );
char *uuid_data = &Unique[0];
#if defined(HAVE_UUID_GENERATE)
- assert( sizeof(uuid_t) == 16 );
+ static_assert( sizeof(uuid_t) == 16 , "");
uuid_t g;
uuid_generate(g);
uuid_unparse(g, uuid_data);
diff --git a/Source/MessageExchangeDefinition/gdcmAAssociateACPDU.cxx b/Source/MessageExchangeDefinition/gdcmAAssociateACPDU.cxx
index 261b2fc10..776b9fb55 100644
--- a/Source/MessageExchangeDefinition/gdcmAAssociateACPDU.cxx
+++ b/Source/MessageExchangeDefinition/gdcmAAssociateACPDU.cxx
@@ -219,8 +219,8 @@ void AAssociateACPDU::InitFromRQ( AAssociateRQPDU const & rqpdu )
const std::string reserved = rqpdu.GetReserved43_74();
memcpy( Reserved43_74, reserved.c_str(), sizeof(Reserved43_74) );
- assert( ProtocolVersion == 0x01 );
- assert( Reserved9_10 == 0x0 );
+ static_assert( ProtocolVersion == 0x01 , "");
+ static_assert( Reserved9_10 == 0x0 , "");
assert( memcmp( Reserved11_26, called.c_str(), sizeof( Reserved11_26) ) == 0 );
assert( memcmp( Reserved27_42, calling.c_str(), sizeof(Reserved27_42) ) == 0 );
assert( memcmp( Reserved43_74, reserved.c_str(), sizeof(Reserved43_74) ) == 0 );
diff --git a/Source/MessageExchangeDefinition/gdcmServiceClassApplicationInformation.cxx b/Source/MessageExchangeDefinition/gdcmServiceClassApplicationInformation.cxx
index 48844bd8e..50a3634ca 100644
--- a/Source/MessageExchangeDefinition/gdcmServiceClassApplicationInformation.cxx
+++ b/Source/MessageExchangeDefinition/gdcmServiceClassApplicationInformation.cxx
@@ -48,7 +48,7 @@ const std::ostream &ServiceClassApplicationInformation::Write(std::ostream &os)
size_t ServiceClassApplicationInformation::Size() const
{
- assert( sizeof(InternalArray) == 6 );
+ static_assert( sizeof(InternalArray) == 6 , "");
return 6;
}
diff --git a/Testing/Source/Common/Cxx/TestUnpacker12Bits.cxx b/Testing/Source/Common/Cxx/TestUnpacker12Bits.cxx
index 57f117a0c..9dd299292 100644
--- a/Testing/Source/Common/Cxx/TestUnpacker12Bits.cxx
+++ b/Testing/Source/Common/Cxx/TestUnpacker12Bits.cxx
@@ -77,7 +77,7 @@ int TestUnpacker12Bits(int, char *[])
unsigned short * output_s = (unsigned short*)output;
const unsigned short outputvalues[] = { 0x301, 0x452, 0x967, 0xab8 };
const size_t outputlen = sizeof(outputvalues) / sizeof(*outputvalues);
- assert( outlen / 2 == outputlen );
+ static_assert( outlen / 2 == outputlen , "");
for(size_t i = 0; i < outputlen; ++i)
{
if( outputvalues[i] != output_s[i] )
diff --git a/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestItem.cxx b/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestItem.cxx
index 750152725..d7f03f3ed 100644
--- a/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestItem.cxx
+++ b/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestItem.cxx
@@ -25,7 +25,7 @@ void CreateDataElement(gdcm::ExplicitDataElement &de, int offset)
gdcm::VR vr = gdcm::VR::UN;
const char str[] = "GDCM";
uint32_t len = (uint32_t)strlen(str);
- assert( sizeof(uint32_t) == 4 );
+ static_assert( sizeof(uint32_t) == 4 , "");
gdcm::ByteValue val(str, len);
tag.Write<gdcm::SwapperNoOp>(ss);
vr.Write(ss);
diff --git a/Utilities/gdcmopenjpeg/src/lib/openjp2/dwt.c b/Utilities/gdcmopenjpeg/src/lib/openjp2/dwt.c
index 5b98d2b38..3c4b003b4 100644
--- a/Utilities/gdcmopenjpeg/src/lib/openjp2/dwt.c
+++ b/Utilities/gdcmopenjpeg/src/lib/openjp2/dwt.c
@@ -659,8 +659,8 @@ static void opj_idwt53_v_cas0_mcols_SSE2_OR_AVX2(
assert(PARALLEL_COLS_53 == 16);
assert(VREG_INT_COUNT == 8);
#else
- assert(PARALLEL_COLS_53 == 8);
- assert(VREG_INT_COUNT == 4);
+ static_assert(PARALLEL_COLS_53 == 8, "");
+ static_assert(VREG_INT_COUNT == 4, "");
#endif
/* Note: loads of input even/odd values must be done in a unaligned */
@@ -761,8 +761,8 @@ static void opj_idwt53_v_cas1_mcols_SSE2_OR_AVX2(
assert(PARALLEL_COLS_53 == 16);
assert(VREG_INT_COUNT == 8);
#else
- assert(PARALLEL_COLS_53 == 8);
- assert(VREG_INT_COUNT == 4);
+ static_assert(PARALLEL_COLS_53 == 8, "");
+ static_assert(VREG_INT_COUNT == 4, "");
#endif
/* Note: loads of input even/odd values must be done in a unaligned */
-----------------------------------------------------------------------
Summary of changes:
Applications/Cxx/gdcmdump.cxx | 6 +++---
Source/DataDictionary/gdcmSOPClassUIDToIOD.cxx | 2 +-
Source/DataDictionary/gdcmUIDs.cxx | 2 +-
Source/DataStructureAndEncodingDefinition/gdcmByteValue.cxx | 4 ++--
Source/DataStructureAndEncodingDefinition/gdcmMediaStorage.cxx | 6 +++---
Source/DataStructureAndEncodingDefinition/gdcmVR.cxx | 2 +-
Source/MediaStorageAndFileFormat/gdcmRLECodec.cxx | 4 ++--
Source/MediaStorageAndFileFormat/gdcmRescaler.cxx | 4 ++--
Source/MediaStorageAndFileFormat/gdcmUUIDGenerator.cxx | 2 +-
Source/MessageExchangeDefinition/gdcmAAssociateACPDU.cxx | 4 ++--
.../gdcmServiceClassApplicationInformation.cxx | 2 +-
Testing/Source/Common/Cxx/TestUnpacker12Bits.cxx | 2 +-
.../Source/DataStructureAndEncodingDefinition/Cxx/TestItem.cxx | 2 +-
Utilities/gdcmopenjpeg/src/lib/openjp2/dwt.c | 8 ++++----
14 files changed, 25 insertions(+), 25 deletions(-)
hooks/post-receive
--
Grassroots DICOM
|