From 239a64e7c2a82fc9c1a6ebf518a4614cac0aa705 Mon Sep 17 00:00:00 2001 From: emv Date: Tue, 15 Apr 2014 16:07:02 +0400 Subject: [PATCH] 0024820: CLang compiler warning -Wreturn-stack-address 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 | 1 - src/BOPDS/BOPDS_DS.cxx | 9 ++------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/BOPDS/BOPDS_DS.cdl b/src/BOPDS/BOPDS_DS.cdl index af39c6d1f3..2cb8087a14 100644 --- a/src/BOPDS/BOPDS_DS.cdl +++ b/src/BOPDS/BOPDS_DS.cdl @@ -283,7 +283,6 @@ is CommonBlock(me; thePB:PaveBlock from BOPDS) returns CommonBlock from BOPDS; - ---C++: return const & ---Purpose: --- Selector --- Returns the common block diff --git a/src/BOPDS/BOPDS_DS.cxx b/src/BOPDS/BOPDS_DS.cxx index 3aef4337bf..b9495103ed 100644 --- a/src/BOPDS/BOPDS_DS.cxx +++ b/src/BOPDS/BOPDS_DS.cxx @@ -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); } //=======================================================================