summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Corino <mcorino@remedy.nl>2015-06-01 09:30:38 +0200
committerMartin Corino <mcorino@remedy.nl>2015-06-01 09:30:38 +0200
commitba64a124f699c1e6d2125c619480c8a40c4683aa (patch)
tree19d45f716fb84f44ce13ddaf3a85e53509f2cc2d
parente23c3772c686b0b4af2eb0b7af622c7075b4b4df (diff)
downloadATCD-ba64a124f699c1e6d2125c619480c8a40c4683aa.tar.gz
Fixing MSVC integer conversion warnings.
* TAO/tao/AnyTypeCode/Alias_TypeCode.cpp: * TAO/tao/AnyTypeCode/Alias_TypeCode_Static.cpp: * TAO/tao/AnyTypeCode/Sequence_TypeCode.cpp: * TAO/tao/AnyTypeCode/Sequence_TypeCode_Static.cpp: * TAO/tao/AnyTypeCode/Struct_TypeCode.cpp: * TAO/tao/AnyTypeCode/Struct_TypeCode_Static.cpp: * TAO/tao/AnyTypeCode/TypeCode_Case_Base_T.inl: * TAO/tao/AnyTypeCode/Union_TypeCode.cpp: * TAO/tao/AnyTypeCode/Union_TypeCode_Static.cpp: * TAO/tao/AnyTypeCode/Value_TypeCode.cpp: * TAO/tao/AnyTypeCode/Value_TypeCode_Static.cpp:
-rw-r--r--TAO/tao/AnyTypeCode/Alias_TypeCode.cpp9
-rw-r--r--TAO/tao/AnyTypeCode/Alias_TypeCode_Static.cpp9
-rw-r--r--TAO/tao/AnyTypeCode/Sequence_TypeCode.cpp10
-rw-r--r--TAO/tao/AnyTypeCode/Sequence_TypeCode_Static.cpp10
-rw-r--r--TAO/tao/AnyTypeCode/Struct_TypeCode.cpp9
-rw-r--r--TAO/tao/AnyTypeCode/Struct_TypeCode_Static.cpp9
-rw-r--r--TAO/tao/AnyTypeCode/TypeCode_Case_Base_T.inl4
-rw-r--r--TAO/tao/AnyTypeCode/Union_TypeCode.cpp9
-rw-r--r--TAO/tao/AnyTypeCode/Union_TypeCode_Static.cpp9
-rw-r--r--TAO/tao/AnyTypeCode/Value_TypeCode.cpp12
-rw-r--r--TAO/tao/AnyTypeCode/Value_TypeCode_Static.cpp12
11 files changed, 69 insertions, 33 deletions
diff --git a/TAO/tao/AnyTypeCode/Alias_TypeCode.cpp b/TAO/tao/AnyTypeCode/Alias_TypeCode.cpp
index 985b98a2f5e..a9d0809a0fe 100644
--- a/TAO/tao/AnyTypeCode/Alias_TypeCode.cpp
+++ b/TAO/tao/AnyTypeCode/Alias_TypeCode.cpp
@@ -13,6 +13,7 @@
#include "tao/AnyTypeCode/TypeCode_Traits.h"
#include "ace/Dynamic_Service.h"
+#include "ace/Truncate.h"
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -39,8 +40,9 @@ TAO::TypeCode::Alias<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));
return
enc << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER)
@@ -48,7 +50,8 @@ TAO::TypeCode::Alias<StringType,
&& enc << TAO_OutputCDR::from_string (this->attributes_.name (), 0)
&& marshal (enc,
Traits<StringType>::get_typecode (this->content_type_),
- offset + enc.total_length ())
+ ACE_Utils::truncate_cast<CORBA::ULong> (
+ offset + enc.total_length ()))
&& cdr << static_cast<CORBA::ULong> (enc.total_length ())
&& cdr.write_octet_array_mb (enc.begin ());
}
diff --git a/TAO/tao/AnyTypeCode/Alias_TypeCode_Static.cpp b/TAO/tao/AnyTypeCode/Alias_TypeCode_Static.cpp
index f98a6fa3546..6a89a9dcb7b 100644
--- a/TAO/tao/AnyTypeCode/Alias_TypeCode_Static.cpp
+++ b/TAO/tao/AnyTypeCode/Alias_TypeCode_Static.cpp
@@ -13,6 +13,7 @@
#include "tao/SystemException.h"
#include "ace/Dynamic_Service.h"
+#include "ace/Truncate.h"
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -37,8 +38,9 @@ TAO::TypeCode::Alias<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));
return
enc << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER)
@@ -46,7 +48,8 @@ TAO::TypeCode::Alias<char const *,
&& enc << TAO_OutputCDR::from_string (this->attributes_.name (), 0)
&& marshal (enc,
Traits<char const *>::get_typecode (this->content_type_),
- offset + enc.total_length ())
+ ACE_Utils::truncate_cast<CORBA::ULong> (
+ offset + enc.total_length ()))
&& cdr << static_cast<CORBA::ULong> (enc.total_length ())
&& cdr.write_octet_array_mb (enc.begin ());
}
diff --git a/TAO/tao/AnyTypeCode/Sequence_TypeCode.cpp b/TAO/tao/AnyTypeCode/Sequence_TypeCode.cpp
index ba62129030b..9921f123ee5 100644
--- a/TAO/tao/AnyTypeCode/Sequence_TypeCode.cpp
+++ b/TAO/tao/AnyTypeCode/Sequence_TypeCode.cpp
@@ -9,6 +9,8 @@
# include "tao/AnyTypeCode/Sequence_TypeCode.inl"
#endif /* !__ACE_INLINE__ */
+#include "ace/Truncate.h"
+
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
template <typename TypeCodeType, class RefCountPolicy>
@@ -30,14 +32,16 @@ TAO::TypeCode::Sequence<TypeCodeType, RefCountPolicy>::tao_marshal (
// 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));
return
enc << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER)
&& marshal (enc,
Traits<TypeCodeType>::get_typecode (this->content_type_),
- offset + enc.total_length ())
+ ACE_Utils::truncate_cast<CORBA::ULong> (
+ offset + enc.total_length ()))
&& enc << this->length_
&& cdr << static_cast<CORBA::ULong> (enc.total_length ())
&& cdr.write_octet_array_mb (enc.begin ());
diff --git a/TAO/tao/AnyTypeCode/Sequence_TypeCode_Static.cpp b/TAO/tao/AnyTypeCode/Sequence_TypeCode_Static.cpp
index a1816134fa7..99f8e26c3bf 100644
--- a/TAO/tao/AnyTypeCode/Sequence_TypeCode_Static.cpp
+++ b/TAO/tao/AnyTypeCode/Sequence_TypeCode_Static.cpp
@@ -3,6 +3,8 @@
#include "tao/CDR.h"
#include "tao/AnyTypeCode/TypeCode_Traits.h"
+#include "ace/Truncate.h"
+
#ifndef __ACE_INLINE__
# include "tao/AnyTypeCode/Sequence_TypeCode_Static.inl"
#endif /* !__ACE_INLINE__ */
@@ -28,15 +30,17 @@ TAO::TypeCode::Sequence<CORBA::TypeCode_ptr 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));
return
enc << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER)
&& marshal (enc,
Traits<CORBA::TypeCode_ptr const *>::get_typecode (
this->content_type_),
- offset + enc.total_length ())
+ ACE_Utils::truncate_cast<CORBA::ULong> (
+ offset + enc.total_length ()))
&& enc << this->length_
&& cdr << static_cast<CORBA::ULong> (enc.total_length ())
&& cdr.write_octet_array_mb (enc.begin ());
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;
}
diff --git a/TAO/tao/AnyTypeCode/Struct_TypeCode_Static.cpp b/TAO/tao/AnyTypeCode/Struct_TypeCode_Static.cpp
index 3519d0904b0..06aadae7364 100644
--- a/TAO/tao/AnyTypeCode/Struct_TypeCode_Static.cpp
+++ b/TAO/tao/AnyTypeCode/Struct_TypeCode_Static.cpp
@@ -12,6 +12,7 @@
#endif /* !__ACE_INLINE__ */
#include "ace/Dynamic_Service.h"
+#include "ace/Truncate.h"
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -37,8 +38,9 @@ TAO::TypeCode::Struct<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))
@@ -66,7 +68,8 @@ TAO::TypeCode::Struct<char const *,
Traits<char const *>::get_string (field.name), 0))
|| !marshal (enc,
Traits<char const *>::get_typecode (field.type),
- offset + enc.total_length ()))
+ ACE_Utils::truncate_cast<CORBA::ULong> (
+ offset + enc.total_length ())))
return false;
}
diff --git a/TAO/tao/AnyTypeCode/TypeCode_Case_Base_T.inl b/TAO/tao/AnyTypeCode/TypeCode_Case_Base_T.inl
index 2e7a5b39657..344f917f845 100644
--- a/TAO/tao/AnyTypeCode/TypeCode_Case_Base_T.inl
+++ b/TAO/tao/AnyTypeCode/TypeCode_Case_Base_T.inl
@@ -1,6 +1,7 @@
// -*- C++ -*-
#include "tao/CDR.h"
#include "tao/AnyTypeCode/TypeCode_Traits.h"
+#include "ace/Truncate.h"
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -36,7 +37,8 @@ TAO::TypeCode::Case<StringType, TypeCodeType>::marshal (
Traits<StringType>::get_string (this->name_), 0))
&& TAO::TypeCode::marshal (cdr,
Traits<StringType>::get_typecode (this->type_),
- offset + cdr.total_length ());
+ ACE_Utils::truncate_cast<CORBA::ULong> (
+ offset + cdr.total_length ()));
}
template <typename StringType, typename TypeCodeType>
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_);
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_);
diff --git a/TAO/tao/AnyTypeCode/Value_TypeCode.cpp b/TAO/tao/AnyTypeCode/Value_TypeCode.cpp
index bc909c2e411..a720506dc0b 100644
--- a/TAO/tao/AnyTypeCode/Value_TypeCode.cpp
+++ b/TAO/tao/AnyTypeCode/Value_TypeCode.cpp
@@ -10,6 +10,7 @@
#include "tao/TypeCodeFactory_Adapter.h"
#include "ace/Dynamic_Service.h"
+#include "ace/Truncate.h"
#ifndef __ACE_INLINE__
# include "tao/AnyTypeCode/Value_TypeCode.inl"
@@ -42,8 +43,9 @@ TAO::TypeCode::Value<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))
@@ -52,7 +54,8 @@ TAO::TypeCode::Value<StringType,
&& (enc << this->type_modifier_)
&& marshal (enc,
Traits<StringType>::get_typecode (this->concrete_base_),
- offset + enc.total_length ())
+ ACE_Utils::truncate_cast<CORBA::ULong> (
+ offset + enc.total_length ()))
&& (enc << this->nfields_);
if (!success)
@@ -70,7 +73,8 @@ TAO::TypeCode::Value<StringType,
if (!(enc << Traits<StringType>::get_string (field.name))
|| !marshal (enc,
Traits<StringType>::get_typecode (field.type),
- offset + enc.total_length ())
+ ACE_Utils::truncate_cast<CORBA::ULong> (
+ offset + enc.total_length ()))
|| !(enc << field.visibility))
return false;
}
diff --git a/TAO/tao/AnyTypeCode/Value_TypeCode_Static.cpp b/TAO/tao/AnyTypeCode/Value_TypeCode_Static.cpp
index e038c68f712..6bff91a30bc 100644
--- a/TAO/tao/AnyTypeCode/Value_TypeCode_Static.cpp
+++ b/TAO/tao/AnyTypeCode/Value_TypeCode_Static.cpp
@@ -8,6 +8,7 @@
#include "tao/SystemException.h"
#include "ace/Dynamic_Service.h"
+#include "ace/Truncate.h"
#ifndef __ACE_INLINE__
# include "tao/AnyTypeCode/Value_TypeCode_Static.inl"
@@ -37,8 +38,9 @@ TAO::TypeCode::Value<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))
@@ -47,7 +49,8 @@ TAO::TypeCode::Value<char const *,
&& (enc << this->type_modifier_)
&& marshal (enc,
Traits<char const *>::get_typecode (this->concrete_base_),
- offset + enc.total_length ())
+ ACE_Utils::truncate_cast<CORBA::ULong> (
+ offset + enc.total_length ()))
&& (enc << this->nfields_);
if (!success)
@@ -68,7 +71,8 @@ TAO::TypeCode::Value<char const *,
if (!(enc << Traits<char const *>::get_string (field.name))
|| !marshal (enc,
Traits<char const *>::get_typecode (field.type),
- offset + enc.total_length ())
+ ACE_Utils::truncate_cast<CORBA::ULong> (
+ offset + enc.total_length ()))
|| !(enc << field.visibility))
return false;
}