# HG changeset patch # User Sebastien Jodogne # Date 1716300143 -7200 # Node ID ce2333b5cb008f561b5ec325da729cd668f86661 # Parent 9ed0cb5d6082acb6f9137b49897bcc0e8dba0f16 fix warnings diff -r 9ed0cb5d6082 -r ce2333b5cb00 Sources/StructureSetGeometry.cpp --- a/Sources/StructureSetGeometry.cpp Tue May 21 15:27:40 2024 +0200 +++ b/Sources/StructureSetGeometry.cpp Tue May 21 16:02:23 2024 +0200 @@ -159,8 +159,8 @@ // Find the projection along the normal with the largest support bool first = true; - size_t bestSupport; - double bestProjection; + size_t bestSupport = 0; // Explicit initialization to avoid valgrind warnings on old compilers + double bestProjection = 0.0; // Explicit initialization to make old compilers happy std::list candidates; for (size_t i = 0; i < projections.size(); i++) @@ -211,6 +211,12 @@ candidates.swap(next); } + if (first) + { + // Should never happen + throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); + } + // Compute the range of the projections