summaryrefslogtreecommitdiff
path: root/TAO/tao/AnyTypeCode/Union_TypeCode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao/AnyTypeCode/Union_TypeCode.cpp')
-rw-r--r--TAO/tao/AnyTypeCode/Union_TypeCode.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/TAO/tao/AnyTypeCode/Union_TypeCode.cpp b/TAO/tao/AnyTypeCode/Union_TypeCode.cpp
index 0b0ec01c176..accfab8d9d9 100644
--- a/TAO/tao/AnyTypeCode/Union_TypeCode.cpp
+++ b/TAO/tao/AnyTypeCode/Union_TypeCode.cpp
@@ -11,6 +11,7 @@
#include "tao/AnyTypeCode/Any.h"
#include "ace/Value_Ptr.h"
+#include "ace/Truncate.h"
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -39,8 +40,9 @@ TAO::TypeCode::Union<StringType,
// 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))
@@ -48,7 +50,8 @@ TAO::TypeCode::Union<StringType,
&& (enc << TAO_OutputCDR::from_string (this->base_attributes_.name (), 0))
&& marshal (enc,
Traits<StringType>::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_);