From: abv Date: Sun, 5 Feb 2017 08:59:29 +0000 (+0300) Subject: 0028431: Coding, Graphic3d - Eliminate GCC warning -Wstrict-overflow X-Git-Tag: V7_2_0_beta~252 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=f87817bc03764490bd634e0a217ac9a3fa9529e2;p=occt.git 0028431: Coding, Graphic3d - Eliminate GCC warning -Wstrict-overflow Code amended to avoid warning issued by GCC optimizer --- 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,