Skip to content

Commit

Permalink
COMP: Fix [[nodiscard]] warnings in PolyLineParametricPath1 example
Browse files Browse the repository at this point in the history
Fixed Mac/Darwin Clang warnings saying:

> warning: ignoring return value of function declared with 'nodiscard' attribute [-Wunused-result]

From https://open.cdash.org/viewBuildError.php?type=1&buildid=8600267
  • Loading branch information
N-Dekker authored and hjmjohnson committed Apr 5, 2023
1 parent 63d4354 commit 6b2d470
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Examples/DataRepresentation/Path/PolyLineParametricPath1.cxx
Expand Up @@ -102,9 +102,15 @@ main(int argc, char * argv[])
point[0] = origin[0] + spacing[0] * size[0];
point[1] = origin[1] + spacing[1] * size[1];

image->TransformPhysicalPointToContinuousIndex(origin, cindex);
using ContinuousIndexValueType = ContinuousIndexType::ValueType;

cindex =
image->TransformPhysicalPointToContinuousIndex<ContinuousIndexValueType>(
origin);
path->AddVertex(cindex);
image->TransformPhysicalPointToContinuousIndex(point, cindex);
cindex =
image->TransformPhysicalPointToContinuousIndex<ContinuousIndexValueType>(
point);
path->AddVertex(cindex);
// Software Guide : EndCodeSnippet

Expand Down

0 comments on commit 6b2d470

Please sign in to comment.