diff options
Diffstat (limited to 'TAO/tao/AnyTypeCode/Any_Impl_T.cpp')
-rw-r--r-- | TAO/tao/AnyTypeCode/Any_Impl_T.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/TAO/tao/AnyTypeCode/Any_Impl_T.cpp b/TAO/tao/AnyTypeCode/Any_Impl_T.cpp index b42955f5e91..b6ac3bd2724 100644 --- a/TAO/tao/AnyTypeCode/Any_Impl_T.cpp +++ b/TAO/tao/AnyTypeCode/Any_Impl_T.cpp @@ -7,11 +7,9 @@ #include "tao/AnyTypeCode/Any_Unknown_IDL_Type.h" #include "tao/AnyTypeCode/Marshal.h" #include "tao/CDR.h" -#include "tao/Environment.h" -#include "tao/SystemException.h" #include "tao/AnyTypeCode/TypeCode.h" +#include "tao/SystemException.h" -#include "ace/CORBA_macros.h" #include "ace/Auto_Ptr.h" #include "ace/OS_Memory.h" @@ -63,18 +61,18 @@ TAO::Any_Impl_T<T>::extract (const CORBA::Any & any, try { CORBA::TypeCode_ptr any_tc = any._tao_get_typecode (); - CORBA::Boolean _tao_equiv = any_tc->equivalent (tc); + CORBA::Boolean const _tao_equiv = any_tc->equivalent (tc); if (_tao_equiv == 0) { return false; } - TAO::Any_Impl *impl = any.impl (); + TAO::Any_Impl * const impl = any.impl (); - if (!impl->encoded ()) + if (impl && !impl->encoded ()) { - TAO::Any_Impl_T<T> *narrow_impl = + TAO::Any_Impl_T<T> * const narrow_impl = dynamic_cast <TAO::Any_Impl_T<T> *> (impl); if (narrow_impl == 0) @@ -96,9 +94,12 @@ TAO::Any_Impl_T<T>::extract (const CORBA::Any & any, auto_ptr<TAO::Any_Impl_T<T> > replacement_safety (replacement); // We know this will work since the unencoded case is covered above. - TAO::Unknown_IDL_Type *unk = + TAO::Unknown_IDL_Type * const unk = dynamic_cast<TAO::Unknown_IDL_Type *> (impl); + if (!unk) + return false; + // We don't want the rd_ptr of unk to move, in case it is // shared by another Any. This copies the state, not the buffer. TAO_InputCDR for_reading (unk->_tao_get_cdr ()); @@ -117,25 +118,25 @@ TAO::Any_Impl_T<T>::extract (const CORBA::Any & any, // Duplicated by Any_Impl base class constructor. ::CORBA::release (any_tc); } - catch ( ::CORBA::Exception&) + catch (const ::CORBA::Exception&) { } - return 0; + return false; } template<typename T> CORBA::Boolean TAO::Any_Impl_T<T>::to_object (CORBA::Object_ptr &) const { - return 0; + return false; } template<typename T> CORBA::Boolean TAO::Any_Impl_T<T>::to_value (CORBA::ValueBase *&) const { - return 0; + return false; } template<typename T> @@ -143,7 +144,7 @@ template<typename T> CORBA::Boolean TAO::Any_Impl_T<T>::to_abstract_base (CORBA::AbstractBase_ptr &) const { - return 0; + return false; } template<typename T> |