summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarina <marina@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-05-16 03:06:03 +0000
committermarina <marina@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-05-16 03:06:03 +0000
commit2515dad7860cd07fa4fcc16ca4970440bfd814bb (patch)
tree4b504e797ff49d4034013205e12e8d53559d6f4c
parentdd8376f28098f66ace3ec69c979d216e300c57fe (diff)
downloadATCD-2515dad7860cd07fa4fcc16ca4970440bfd814bb.tar.gz
modified 'init' function to use 'status' variable to store the return value to avoid various compilers'
warnings regarding reaching the end of non-void function, problems with ACE_NOTREACHED on vxworks, etc.
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index_T.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index_T.cpp b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index_T.cpp
index 5d8de62c4a8..846f5a191ef 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index_T.cpp
+++ b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index_T.cpp
@@ -128,6 +128,9 @@ TAO_Persistent_Context_Index<ACE_MEM_POOL_2, ACE_LOCK>::open (LPCTSTR file_name,
template <ACE_MEM_POOL_1, class ACE_LOCK> int
TAO_Persistent_Context_Index<ACE_MEM_POOL_2, ACE_LOCK>::init (void)
{
+ // Return value of this function (necessary to keep compilers quiet).
+ int status = 0;
+
if (index_->current_size () == 0)
// CASE 1:there are no Naming Contexts registered. We need to create
// one.
@@ -181,7 +184,9 @@ TAO_Persistent_Context_Index<ACE_MEM_POOL_2, ACE_LOCK>::init (void)
this->bind ("NameService",
c_impl->counter_,
c_impl->context_.map ());
- return 0;
+
+ // Everything went successfully.
+ status = 0;
}
ACE_CATCHANY
{
@@ -190,15 +195,13 @@ TAO_Persistent_Context_Index<ACE_MEM_POOL_2, ACE_LOCK>::init (void)
}
ACE_ENDTRY;
ACE_CHECK_RETURN (-1);
-
- // Below will never be reached, but the compiler is not smart to
- // figure it out. This will keep the warnings away.
- ACE_NOTREACHED (return -1;)
}
else
// CASE 2:Recreate all Naming Contexts.
- return recreate_all ();
+ status = recreate_all ();
+
+ return status;
}
template <ACE_MEM_POOL_1, class ACE_LOCK> int