0024820: CLang compiler warning -Wreturn-stack-address
authoremv <emv@opencascade.com>
Tue, 15 Apr 2014 12:07:02 +0000 (16:07 +0400)
committerabv <abv@opencascade.com>
Mon, 21 Apr 2014 15:58:43 +0000 (19:58 +0400)
The signature of the function BOPDS_DS::CommonBlock(const Handle(BOPDS_PaveBlock)& thePB)
has been changed to return handle, not a reference to handle.

src/BOPDS/BOPDS_DS.cdl
src/BOPDS/BOPDS_DS.cxx

index af39c6d..2cb8087 100644 (file)
@@ -283,7 +283,6 @@ is
     CommonBlock(me; 
                 thePB:PaveBlock from BOPDS)
         returns CommonBlock from BOPDS;     
-    ---C++: return const & 
     ---Purpose: 
     --- Selector  
     --- Returns the common block  
index 3aef433..b949510 100644 (file)
@@ -1101,15 +1101,10 @@ Standard_Boolean BOPDS_DS::IsCommonBlock
 //function : CommonBlock
 //purpose  : 
 //=======================================================================
-const Handle(BOPDS_CommonBlock)& BOPDS_DS::CommonBlock
+Handle(BOPDS_CommonBlock) BOPDS_DS::CommonBlock
     (const Handle(BOPDS_PaveBlock)& thePB) const
 {
-  Handle(BOPDS_CommonBlock) aNullCB;
-  //
-  const Handle(BOPDS_CommonBlock)& aCB = 
-    IsCommonBlock(thePB) ? myMapPBCB.Find(thePB) : aNullCB;
-  //
-  return aCB;
+  return (IsCommonBlock(thePB) ? myMapPBCB.Find(thePB) : NULL);
 }
 
 //=======================================================================