1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0029170: GCC 7.1 warnings -Wstrict-aliasing in Graphic3d_ArrayOfPrimitives.hxx

Methods Graphic3d_ArrayOfPrimitives::SetVertexColor() accepting color as three double rgb values and Graphic3d_Vec4ub object are refactored to avoid using reinterpret_cast between pointers to complex types.

Similar correction is made in ViewerTest_ObjectCommands.cxx (static function VDrawSphere).
This commit is contained in:
abv
2017-09-30 21:35:05 +03:00
committed by bugmaster
parent c85a994a37
commit 6a657c9247
2 changed files with 23 additions and 6 deletions

View File

@@ -2960,7 +2960,7 @@ static int VDrawSphere (Draw_Interpretor& /*di*/, Standard_Integer argc, const c
Handle(TColStd_HArray1OfInteger) aColorArray = new TColStd_HArray1OfInteger (1, aNumberPoints);
for (Standard_Integer aNodeId = 1; aNodeId <= aNumberPoints; ++aNodeId)
{
aColorArray->SetValue (aNodeId, *reinterpret_cast<const Standard_Integer*> (&aColor));
aColorArray->SetValue (aNodeId, *reinterpret_cast<const Standard_Integer*> (aColor.GetData()));
}
aShape->SetColors (aColorArray);