diff options
Diffstat (limited to 'TAO/tao/AnyTypeCode/Union_TypeCode_Static.cpp')
-rw-r--r-- | TAO/tao/AnyTypeCode/Union_TypeCode_Static.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/TAO/tao/AnyTypeCode/Union_TypeCode_Static.cpp b/TAO/tao/AnyTypeCode/Union_TypeCode_Static.cpp index 0ee4b423050..b3bb39e4aac 100644 --- a/TAO/tao/AnyTypeCode/Union_TypeCode_Static.cpp +++ b/TAO/tao/AnyTypeCode/Union_TypeCode_Static.cpp @@ -10,6 +10,7 @@ #include "ace/Value_Ptr.h" #include "ace/CORBA_macros.h" +#include "ace/Truncate.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -35,8 +36,9 @@ TAO::TypeCode::Union<char const *, // Aligning on an octet since the next value after the CDR // encapsulation length will always be the byte order octet/boolean // in this case. - offset = ACE_align_binary (offset + 4, - ACE_CDR::OCTET_ALIGN); + offset = ACE_Utils::truncate_cast<CORBA::ULong> ( + ACE_align_binary (offset + 4, + ACE_CDR::OCTET_ALIGN)); bool const success = (enc << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER)) @@ -44,7 +46,8 @@ TAO::TypeCode::Union<char const *, && (enc << TAO_OutputCDR::from_string (this->base_attributes_.name (), 0)) && marshal (enc, Traits<char const *>::get_typecode (this->discriminant_type_), - offset + enc.total_length ()) + ACE_Utils::truncate_cast<CORBA::ULong> ( + offset + enc.total_length ())) && (enc << this->default_index_) && (enc << this->ncases_); |