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:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user