From ba64a124f699c1e6d2125c619480c8a40c4683aa Mon Sep 17 00:00:00 2001 From: Martin Corino Date: Mon, 1 Jun 2015 09:30:38 +0200 Subject: 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: --- TAO/tao/AnyTypeCode/Alias_TypeCode.cpp | 9 ++++++--- TAO/tao/AnyTypeCode/Alias_TypeCode_Static.cpp | 9 ++++++--- TAO/tao/AnyTypeCode/Sequence_TypeCode.cpp | 10 +++++++--- TAO/tao/AnyTypeCode/Sequence_TypeCode_Static.cpp | 10 +++++++--- TAO/tao/AnyTypeCode/Struct_TypeCode.cpp | 9 ++++++--- TAO/tao/AnyTypeCode/Struct_TypeCode_Static.cpp | 9 ++++++--- TAO/tao/AnyTypeCode/TypeCode_Case_Base_T.inl | 4 +++- TAO/tao/AnyTypeCode/Union_TypeCode.cpp | 9 ++++++--- TAO/tao/AnyTypeCode/Union_TypeCode_Static.cpp | 9 ++++++--- TAO/tao/AnyTypeCode/Value_TypeCode.cpp | 12 ++++++++---- TAO/tao/AnyTypeCode/Value_TypeCode_Static.cpp | 12 ++++++++---- 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 ( + 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::Aliasattributes_.name (), 0) && marshal (enc, Traits::get_typecode (this->content_type_), - offset + enc.total_length ()) + ACE_Utils::truncate_cast ( + offset + enc.total_length ())) && cdr << static_cast (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 ( + 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::Aliasattributes_.name (), 0) && marshal (enc, Traits::get_typecode (this->content_type_), - offset + enc.total_length ()) + ACE_Utils::truncate_cast ( + offset + enc.total_length ())) && cdr << static_cast (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 @@ -30,14 +32,16 @@ TAO::TypeCode::Sequence::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 ( + ACE_align_binary (offset + 4, + ACE_CDR::OCTET_ALIGN)); return enc << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER) && marshal (enc, Traits::get_typecode (this->content_type_), - offset + enc.total_length ()) + ACE_Utils::truncate_cast ( + offset + enc.total_length ())) && enc << this->length_ && cdr << static_cast (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 ( + ACE_align_binary (offset + 4, + ACE_CDR::OCTET_ALIGN)); return enc << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER) && marshal (enc, Traits::get_typecode ( this->content_type_), - offset + enc.total_length ()) + ACE_Utils::truncate_cast ( + offset + enc.total_length ())) && enc << this->length_ && cdr << static_cast (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 ( + 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::get_string (field.name), 0)) || !marshal (enc, Traits::get_typecode (field.type), - offset + enc.total_length ())) + ACE_Utils::truncate_cast ( + 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 ( + 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::get_string (field.name), 0)) || !marshal (enc, Traits::get_typecode (field.type), - offset + enc.total_length ())) + ACE_Utils::truncate_cast ( + 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::marshal ( Traits::get_string (this->name_), 0)) && TAO::TypeCode::marshal (cdr, Traits::get_typecode (this->type_), - offset + cdr.total_length ()); + ACE_Utils::truncate_cast ( + offset + cdr.total_length ())); } template 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 ( + 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::Unionbase_attributes_.name (), 0)) && marshal (enc, Traits::get_typecode (this->discriminant_type_), - offset + enc.total_length ()) + ACE_Utils::truncate_cast ( + 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 ( + 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::Unionbase_attributes_.name (), 0)) && marshal (enc, Traits::get_typecode (this->discriminant_type_), - offset + enc.total_length ()) + ACE_Utils::truncate_cast ( + 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 ( + 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::Valuetype_modifier_) && marshal (enc, Traits::get_typecode (this->concrete_base_), - offset + enc.total_length ()) + ACE_Utils::truncate_cast ( + offset + enc.total_length ())) && (enc << this->nfields_); if (!success) @@ -70,7 +73,8 @@ TAO::TypeCode::Value::get_string (field.name)) || !marshal (enc, Traits::get_typecode (field.type), - offset + enc.total_length ()) + ACE_Utils::truncate_cast ( + 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 ( + 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::Valuetype_modifier_) && marshal (enc, Traits::get_typecode (this->concrete_base_), - offset + enc.total_length ()) + ACE_Utils::truncate_cast ( + offset + enc.total_length ())) && (enc << this->nfields_); if (!success) @@ -68,7 +71,8 @@ TAO::TypeCode::Value::get_string (field.name)) || !marshal (enc, Traits::get_typecode (field.type), - offset + enc.total_length ()) + ACE_Utils::truncate_cast ( + offset + enc.total_length ())) || !(enc << field.visibility)) return false; } -- cgit v1.2.1