# HG changeset patch # User Sebastien Jodogne # Date 1783418531 -7200 # Node ID c11bace73f8c1e3bb48493e7957af936ffa5c2c8 # Parent 7c518a774b7602b86a033f06ec95d430047a6212 fix for older compilers diff -r 7c518a774b76 -r c11bace73f8c OrthancFramework/Sources/DicomParsing/DicomWebJsonVisitor.cpp --- a/OrthancFramework/Sources/DicomParsing/DicomWebJsonVisitor.cpp Tue Jul 07 11:46:39 2026 +0200 +++ b/OrthancFramework/Sources/DicomParsing/DicomWebJsonVisitor.cpp Tue Jul 07 12:02:11 2026 +0200 @@ -409,7 +409,8 @@ #endif - template static void ApplyBinaryModeToOtherTypes(Json::Value& node, DicomWebJsonVisitor::BinaryMode mode, @@ -430,15 +431,17 @@ if (!values.empty()) { std::string raw; - raw.resize(values.size() * sizeof(TargetType)); + raw.resize(values.size() * sizeof(MemoryType)); if (!raw.empty()) { - TargetType *p = reinterpret_cast(&raw[0]); + assert(Toolbox::DetectEndianness() == Endianness_Little); // TODO - Add support for big endian + + MemoryType *p = reinterpret_cast(&raw[0]); for (size_t i = 0; i < values.size(); i++, p++) { - *p = static_cast(values[i]); + *p = static_cast(values[i]); } } @@ -459,7 +462,7 @@ for (size_t i = 0; i < values.size(); i++) { - a.append(values[i]); + a.append(static_cast(values[i])); } } @@ -624,15 +627,15 @@ switch (vr) { case ValueRepresentation_OtherWord: - ApplyBinaryModeToOtherTypes(node, mode, bulkDataUri, values); + ApplyBinaryModeToOtherTypes(node, mode, bulkDataUri, values); break; case ValueRepresentation_OtherLong: - ApplyBinaryModeToOtherTypes(node, mode, bulkDataUri, values); + ApplyBinaryModeToOtherTypes(node, mode, bulkDataUri, values); break; case ValueRepresentation_OtherVeryLong: - ApplyBinaryModeToOtherTypes(node, mode, bulkDataUri, values); + ApplyBinaryModeToOtherTypes(node, mode, bulkDataUri, values); break; default: @@ -700,11 +703,11 @@ switch (vr) { case ValueRepresentation_OtherDouble: - ApplyBinaryModeToOtherTypes(node, mode, bulkDataUri, values); + ApplyBinaryModeToOtherTypes(node, mode, bulkDataUri, values); break; case ValueRepresentation_OtherFloat: - ApplyBinaryModeToOtherTypes(node, mode, bulkDataUri, values); + ApplyBinaryModeToOtherTypes(node, mode, bulkDataUri, values); break; default: diff -r 7c518a774b76 -r c11bace73f8c OrthancFramework/UnitTestsSources/FromDcmtkTests.cpp --- a/OrthancFramework/UnitTestsSources/FromDcmtkTests.cpp Tue Jul 07 11:46:39 2026 +0200 +++ b/OrthancFramework/UnitTestsSources/FromDcmtkTests.cpp Tue Jul 07 12:02:11 2026 +0200 @@ -2051,7 +2051,7 @@ dicom.ReplacePlainString(DicomTag(0x0040, 0x0031), "UT"); #if DCMTK_VERSION_NUMBER >= 365 - dicom.ReplacePlainString(DicomTag(0x7056, 0x1000), "-17"); // OV + dicom.ReplacePlainString(DicomTag(0x7056, 0x1000), "17"); // OV dicom.ReplacePlainString(DicomTag(0x7056, 0x1001), "-18"); // SV dicom.ReplacePlainString(DicomTag(0x7056, 0x1002), "19"); // UV #endif @@ -2183,7 +2183,7 @@ #if DCMTK_VERSION_NUMBER >= 365 ASSERT_EQ("OV", visitor.GetResult() ["70561000"]["vr"].asString()); - ASSERT_EQ(-17, visitor.GetResult() ["70561000"]["Value"][0].asInt()); + ASSERT_EQ(17, visitor.GetResult() ["70561000"]["Value"][0].asInt()); ASSERT_EQ("SV", visitor.GetResult() ["70561001"]["vr"].asString()); ASSERT_EQ(-18, visitor.GetResult() ["70561001"]["Value"][0].asInt()); ASSERT_EQ("UV", visitor.GetResult() ["70561002"]["vr"].asString()); @@ -2254,7 +2254,7 @@ #endif #if DCMTK_VERSION_NUMBER >= 365 - ASSERT_TRUE(m.LookupStringValue(s, DicomTag(0x7056, 0x1000), true)); ASSERT_EQ("-17", s); // OV + ASSERT_TRUE(m.LookupStringValue(s, DicomTag(0x7056, 0x1000), true)); ASSERT_EQ("17", s); // OV ASSERT_TRUE(m.LookupStringValue(s, DicomTag(0x7056, 0x1001), true)); ASSERT_EQ("-18", s); // SV ASSERT_TRUE(m.LookupStringValue(s, DicomTag(0x7056, 0x1002), true)); ASSERT_EQ("19", s); // UV #endif