summaryrefslogtreecommitdiff
path: root/TAO/tao/AnyTypeCode/Struct_TypeCode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao/AnyTypeCode/Struct_TypeCode.cpp')
-rw-r--r--TAO/tao/AnyTypeCode/Struct_TypeCode.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/TAO/tao/AnyTypeCode/Struct_TypeCode.cpp b/TAO/tao/AnyTypeCode/Struct_TypeCode.cpp
index 0e1bbf380e0..a258a8c5229 100644
--- a/TAO/tao/AnyTypeCode/Struct_TypeCode.cpp
+++ b/TAO/tao/AnyTypeCode/Struct_TypeCode.cpp
@@ -15,6 +15,7 @@
#endif /* !__ACE_INLINE__ */
#include "ace/Dynamic_Service.h"
+#include "ace/Truncate.h"
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -42,8 +43,9 @@ TAO::TypeCode::Struct<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))
@@ -67,7 +69,8 @@ TAO::TypeCode::Struct<StringType,
Traits<StringType>::get_string (field.name), 0))
|| !marshal (enc,
Traits<StringType>::get_typecode (field.type),
- offset + enc.total_length ()))
+ ACE_Utils::truncate_cast<CORBA::ULong> (
+ offset + enc.total_length ())))
return false;
}