0022330: Compilation errors from 'clang' on OS X
authorVSV and APL <>
Thu, 18 Aug 2011 07:36:01 +0000 (07:36 +0000)
committerbugmaster <bugmaster@opencascade.com>
Mon, 5 Mar 2012 15:29:43 +0000 (19:29 +0400)
src/Visual3d/Visual3d_TransientManager.cxx

index 194b37e..deabf50 100755 (executable)
@@ -78,6 +78,9 @@ return theCView;
 }
 #define theCView _theCView()
 
+static Aspect_CLayer2d UnderCLayer;
+static Aspect_CLayer2d OverCLayer;
+
 //
 //-Constructors
 //
@@ -113,18 +116,16 @@ Standard_Boolean Visual3d_TransientManager::BeginDraw (const Handle(Visual3d_Vie
 
 Handle(Visual3d_Layer) OverLayer = AView->OverLayer ();
 Handle(Visual3d_Layer) UnderLayer = AView->UnderLayer ();
-Aspect_CLayer2d OverCLayer;
-Aspect_CLayer2d UnderCLayer;
-       OverCLayer.ptrLayer = UnderCLayer.ptrLayer = NULL;
+  OverCLayer.ptrLayer = UnderCLayer.ptrLayer = NULL;
        theCView        = *(CALL_DEF_VIEW *)AView->CView ();
 
        if (! UnderLayer.IsNull ()){
-               UnderCLayer = UnderLayer->CLayer ();
-               theCView.ptrUnderLayer = (CALL_DEF_LAYER *) &(UnderLayer->CLayer ());
+               UnderCLayer = UnderLayer->CLayer();
+               theCView.ptrUnderLayer = (CALL_DEF_LAYER *) &UnderCLayer;
        }
        if (! OverLayer.IsNull ()){
-               OverCLayer = OverLayer->CLayer ();
-               theCView.ptrOverLayer = (CALL_DEF_LAYER *) &(OverLayer->CLayer ());
+               OverCLayer = OverLayer->CLayer();
+               theCView.ptrOverLayer = (CALL_DEF_LAYER *) &OverCLayer;
        }
 
        // Begin rendering
@@ -188,11 +189,14 @@ 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());
-
+  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 ();
 
        theGraphicDriver = *(Handle(Graphic3d_GraphicDriver) *) &agd;
@@ -228,11 +232,14 @@ 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 ());
-
+  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 ();
 
        theGraphicDriver = *(Handle(Graphic3d_GraphicDriver) *) &agd;