From f87817bc03764490bd634e0a217ac9a3fa9529e2 Mon Sep 17 00:00:00 2001 From: abv Date: Sun, 5 Feb 2017 11:59:29 +0300 Subject: [PATCH] 0028431: Coding, Graphic3d - Eliminate GCC warning -Wstrict-overflow Code amended to avoid warning issued by GCC optimizer --- src/Graphic3d/Graphic3d_ArrayOfPrimitives.lxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Graphic3d/Graphic3d_ArrayOfPrimitives.lxx b/src/Graphic3d/Graphic3d_ArrayOfPrimitives.lxx index 6d6d1ebc8b..44822a68f8 100644 --- a/src/Graphic3d/Graphic3d_ArrayOfPrimitives.lxx +++ b/src/Graphic3d/Graphic3d_ArrayOfPrimitives.lxx @@ -152,7 +152,10 @@ inline void Graphic3d_ArrayOfPrimitives::SetVertice (const Standard_Integer th aVec.y() = theY; aVec.z() = theZ; - myAttribs->NbElements = Max (theIndex, myAttribs->NbElements); + if (myAttribs->NbElements < theIndex) + { + myAttribs->NbElements = theIndex; + } } inline void Graphic3d_ArrayOfPrimitives::SetVertexColor (const Standard_Integer theIndex, -- 2.39.5