0024252: GCC warnings on breakage of strict-aliasing rules

Fixed type casts in NCollection maps
Avoid invalid type cast in handling of LDOM text object
Use correct pointer type in callback function of Graphic3d_CGraduatedTrihedron class
Format of printf() simplified in IntPatch_Point.cxx
This commit is contained in:
abv
2014-01-15 06:40:18 +04:00
committed by bugmaster
parent 504a896866
commit fd03ee4b3b
10 changed files with 49 additions and 113 deletions

View File

@@ -3021,22 +3021,20 @@ void Visual3d_View::TriedronEcho (const Aspect_TypeOfTriedronEcho AType ) {
}
Standard_Boolean checkFloat(const Standard_Real value)
static Standard_Boolean checkFloat(const Standard_Real value)
{
return value > -FLT_MAX && value < FLT_MAX;
}
void SetMinMaxValuesCallback(void* Visual3dView)
static void SetMinMaxValuesCallback(Visual3d_View* theView)
{
Standard_Real xmin, ymin, zmin, xmax, ymax, zmax;
Handle(Visual3d_View) view = (Handle(Visual3d_View)&) Visual3dView;
view->MinMaxValues(xmin, ymin, zmin, xmax, ymax, zmax);
theView->MinMaxValues(xmin, ymin, zmin, xmax, ymax, zmax);
if (checkFloat(xmin) && checkFloat(ymin) && checkFloat(zmin) &&
checkFloat(xmax) && checkFloat(ymax) && checkFloat(zmax))
{
Handle(Graphic3d_GraphicDriver) driver = Handle(Graphic3d_GraphicDriver)::DownCast(view->GraphicDriver());
Handle(Graphic3d_GraphicDriver) driver = Handle(Graphic3d_GraphicDriver)::DownCast(theView->GraphicDriver());
driver->GraduatedTrihedronMinMaxValues((Standard_ShortReal)xmin, (Standard_ShortReal)ymin, (Standard_ShortReal)zmin,
(Standard_ShortReal)xmax, (Standard_ShortReal)ymax, (Standard_ShortReal)zmax);
}