0028431: Coding, Graphic3d - Eliminate GCC warning -Wstrict-overflow
authorabv <abv@opencascade.com>
Sun, 5 Feb 2017 08:59:29 +0000 (11:59 +0300)
committerapn <apn@opencascade.com>
Thu, 9 Feb 2017 13:16:27 +0000 (16:16 +0300)
Code amended to avoid warning issued by GCC optimizer

src/Graphic3d/Graphic3d_ArrayOfPrimitives.lxx

index 6d6d1eb..44822a6 100644 (file)
@@ -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,