From 75c3c8d8b6995e2643811ce045514165f77a6e72 Mon Sep 17 00:00:00 2001 From: Debian Science Maintainers Date: Fri, 6 May 2011 14:52:41 +0100 Subject: [PATCH] ftbfs-g++4.6 Fix build failures with g++ 4.6 (closes: #624943) Error message is: ../../../../ros/src/Visual3d/Visual3d_TransientManager.cxx: In static member function 'static Standard_Boolean Visual3d_TransientManager::BeginDraw(const Handle_Visual3d_View&, Standard_Boolean, Standard_Boolean)': ../../../../ros/src/Visual3d/Visual3d_TransientManager.cxx:123:70: error: taking address of temporary [-fpermissive] ../../../../ros/src/Visual3d/Visual3d_TransientManager.cxx:127:68: error: taking address of temporary [-fpermissive] ../../../../ros/src/Visual3d/Visual3d_TransientManager.cxx: In static member function 'static void Visual3d_TransientManager::ClearDraw(const Handle_Visual3d_View&, Standard_Boolean)': ../../../../ros/src/Visual3d/Visual3d_TransientManager.cxx:192:77: error: taking address of temporary [-fpermissive] ../../../../ros/src/Visual3d/Visual3d_TransientManager.cxx:194:75: error: taking address of temporary [-fpermissive] ../../../../ros/src/Visual3d/Visual3d_TransientManager.cxx: In static member function 'static Standard_Boolean Visual3d_TransientManager::BeginAddDraw(const Handle_Visual3d_View&)': ../../../../ros/src/Visual3d/Visual3d_TransientManager.cxx:232:79: error: taking address of temporary [-fpermissive] ../../../../ros/src/Visual3d/Visual3d_TransientManager.cxx:234:77: error: taking address of temporary [-fpermissive] Submitted upstream: http://www.opencascade.org/org/forum/thread_20572/ Gbp-Pq: Topic submitted Gbp-Pq: Name ftbfs-g++4.6.patch --- .../Visual3d/Visual3d_TransientManager.cxx | 32 +++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/ros/src/Visual3d/Visual3d_TransientManager.cxx b/ros/src/Visual3d/Visual3d_TransientManager.cxx index 194b37e64..3d56ed096 100644 --- a/ros/src/Visual3d/Visual3d_TransientManager.cxx +++ b/ros/src/Visual3d/Visual3d_TransientManager.cxx @@ -120,11 +120,11 @@ Aspect_CLayer2d UnderCLayer; if (! UnderLayer.IsNull ()){ UnderCLayer = UnderLayer->CLayer (); - theCView.ptrUnderLayer = (CALL_DEF_LAYER *) &(UnderLayer->CLayer ()); + theCView.ptrUnderLayer = (CALL_DEF_LAYER *) &UnderCLayer; } if (! OverLayer.IsNull ()){ OverCLayer = OverLayer->CLayer (); - theCView.ptrOverLayer = (CALL_DEF_LAYER *) &(OverLayer->CLayer ()); + theCView.ptrOverLayer = (CALL_DEF_LAYER *) &OverCLayer; } // Begin rendering @@ -188,10 +188,16 @@ void Visual3d_TransientManager::ClearDraw (const Handle(Visual3d_View)& AView, // Begin rendering theCView = *(CALL_DEF_VIEW *)AView->CView (); - if (!AView->UnderLayer().IsNull()) - theCView.ptrUnderLayer = (CALL_DEF_LAYER *)&(AView->UnderLayer()->CLayer()); - if (!AView->OverLayer().IsNull()) - theCView.ptrOverLayer = (CALL_DEF_LAYER *)&(AView->OverLayer()->CLayer()); +Aspect_CLayer2d OverCLayer; +Aspect_CLayer2d UnderCLayer; + if (!AView->UnderLayer().IsNull()) { + UnderCLayer = AView->UnderLayer()->CLayer (); + theCView.ptrUnderLayer = (CALL_DEF_LAYER *)&UnderCLayer; + } + if (!AView->OverLayer().IsNull()) { + OverCLayer = AView->OverLayer()->CLayer(); + theCView.ptrOverLayer = (CALL_DEF_LAYER *)&OverCLayer; + } Handle(Aspect_GraphicDriver) agd = AView->GraphicDriver (); @@ -228,10 +234,16 @@ Standard_Boolean Visual3d_TransientManager::BeginAddDraw (const Handle(Visual3d_ // Begin rendering theCView = *(CALL_DEF_VIEW *)AView->CView (); - if (!AView->UnderLayer().IsNull()) - theCView.ptrUnderLayer = (CALL_DEF_LAYER *) &(AView->UnderLayer()->CLayer ()); - if (!AView->OverLayer().IsNull()) - theCView.ptrOverLayer = (CALL_DEF_LAYER *) &(AView->OverLayer()->CLayer ()); +Aspect_CLayer2d OverCLayer; +Aspect_CLayer2d UnderCLayer; + if (!AView->UnderLayer().IsNull()) { + UnderCLayer = AView->UnderLayer()->CLayer (); + theCView.ptrUnderLayer = (CALL_DEF_LAYER *)&UnderCLayer; + } + if (!AView->OverLayer().IsNull()) { + OverCLayer = AView->OverLayer()->CLayer(); + theCView.ptrOverLayer = (CALL_DEF_LAYER *)&OverCLayer; + } Handle(Aspect_GraphicDriver) agd = AView->GraphicDriver (); -- 2.30.2