summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormcorino <mcorino@remedy.nl>2015-06-02 17:22:10 +0200
committermcorino <mcorino@remedy.nl>2015-06-02 17:22:10 +0200
commit0c6a0f9be27c1b76021664d545fc37d1294d0cc2 (patch)
treeb9f9104e1a15d38a7adea2d6da591b8b32ba9fb1
parentf6999de8de25305011db12c60f7c7268c1a3b717 (diff)
parent404853f41d696d1b0cd421a594d1f69825c95f1f (diff)
downloadATCD-0c6a0f9be27c1b76021664d545fc37d1294d0cc2.tar.gz
Merge pull request #88 from mcorino/master
Fix MSVC14 compile warnings
-rw-r--r--ACE/ace/config-win32-msvc.h4
-rw-r--r--TAO/TAO_IDL/ast/ast_structure.cpp4
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp8
-rw-r--r--TAO/TAO_IDL/driver/drv_preproc.cpp7
-rw-r--r--TAO/TAO_IDL/fe/idl.ll2
-rw-r--r--TAO/TAO_IDL/fe/idl.yy.cpp26
-rw-r--r--TAO/orbsvcs/orbsvcs/IOR_Multicast.cpp6
-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
-rw-r--r--TAO/tao/CDR.cpp6
-rw-r--r--TAO/tao/CORBALOC_Parser.cpp3
-rw-r--r--TAO/tao/CORBA_String.cpp8
-rw-r--r--TAO/tao/DynamicAny/DynValue_i.cpp9
-rw-r--r--TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.cpp5
-rw-r--r--TAO/tao/DynamicInterface/Request.cpp4
-rw-r--r--TAO/tao/Dynamic_TP/DTP_Task.cpp6
-rw-r--r--TAO/tao/Dynamic_TP/DTP_Thread_Pool.cpp4
-rw-r--r--TAO/tao/HTTP_Client.cpp3
-rw-r--r--TAO/tao/IIOP_Profile.cpp7
-rw-r--r--TAO/tao/IORInterceptor/IORInterceptor_Adapter_Impl.cpp2
-rw-r--r--TAO/tao/Invocation_Adapter.cpp3
-rw-r--r--TAO/tao/MCAST_Parser.cpp5
-rw-r--r--TAO/tao/Monitor/Monitor_Impl.cpp2
-rw-r--r--TAO/tao/On_Demand_Fragmentation_Strategy.cpp10
-rw-r--r--TAO/tao/PortableServer/POAManager.inl4
-rw-r--r--TAO/tao/PortableServer/Servant_Base.cpp6
-rw-r--r--TAO/tao/RTCORBA/Thread_Pool.cpp4
-rw-r--r--TAO/tao/Storable_FlatFileStream.cpp4
-rw-r--r--TAO/tao/Strategies/DIOP_Profile.cpp7
-rw-r--r--TAO/tao/Strategies/DIOP_Transport.cpp2
-rw-r--r--TAO/tao/Strategies/SHMIOP_Profile.cpp6
-rw-r--r--TAO/tao/Transport.cpp5
-rw-r--r--TAO/tao/TransportCurrent/Current_Impl.cpp2
-rw-r--r--TAO/tao/TypeCodeFactory/TypeCodeFactory_i.cpp4
-rw-r--r--TAO/tao/Valuetype/ValueBase.cpp7
46 files changed, 179 insertions, 112 deletions
diff --git a/ACE/ace/config-win32-msvc.h b/ACE/ace/config-win32-msvc.h
index dfa1f85da0c..7b4c7e6b9ee 100644
--- a/ACE/ace/config-win32-msvc.h
+++ b/ACE/ace/config-win32-msvc.h
@@ -99,7 +99,9 @@
#define ACE_LACKS_NETDB_H
#define ACE_LACKS_NET_IF_H
#define ACE_LACKS_NETINET_IN_H
-#define ACE_LACKS_STDINT_H
+#if !defined (ACE_WIN32_VC14)
+# define ACE_LACKS_STDINT_H
+#endif
#define ACE_LACKS_STROPTS_H
#define ACE_LACKS_SYS_IOCTL_H
#define ACE_LACKS_SYS_IPC_H
diff --git a/TAO/TAO_IDL/ast/ast_structure.cpp b/TAO/TAO_IDL/ast/ast_structure.cpp
index 3659ee654f0..3e7fc1f83a5 100644
--- a/TAO/TAO_IDL/ast/ast_structure.cpp
+++ b/TAO/TAO_IDL/ast/ast_structure.cpp
@@ -78,6 +78,8 @@ trademarks or registered trademarks of Sun Microsystems, Inc.
#include "utl_err.h"
#include "utl_indenter.h"
+#include "ace/Truncate.h"
+
AST_Structure::AST_Structure (UTL_ScopedName *n,
bool local,
bool abstract)
@@ -211,7 +213,7 @@ AST_Structure::member_count (void)
ACE_CDR::ULong
AST_Structure::nfields (void) const
{
- return this->fields_.size ();
+ return ACE_Utils::truncate_cast<ACE_CDR::ULong> (this->fields_.size ());
}
int
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp
index 868bb06e8f0..359af9aab39 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp
@@ -187,7 +187,7 @@ be_visitor_operation_ami_cs::visit_operation (be_operation *node)
/// Some compilers can't resolve the stream operator overload.
const char *op_name = opname.c_str ();
- ACE_CDR::ULong len = opname.length ();
+ ACE_CString::size_type len = opname.length ();
*os << be_nl_2
<< "TAO::Asynch_Invocation_Adapter _tao_call (" << be_idt << be_idt_nl
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp
index 0da70f55a0f..479ee59a5a6 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp
@@ -274,7 +274,7 @@ be_visitor_operation::gen_stub_operation_body (
/// Some compilers can't resolve the stream operator overload.
const char *lname = opname.c_str ();
- ACE_CDR::ULong len = opname.length ();
+ ACE_CString::size_type len = opname.length ();
*os << lname << "\"," << be_nl
<< len << "," << be_nl;
diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp
index c76598ca55f..d17c4be7e1b 100644
--- a/TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp
@@ -176,9 +176,9 @@ int
TAO::be_visitor_struct_typecode::gen_member_typecodes (AST_Structure * node)
{
AST_Field ** member_ptr = 0;
- size_t const count = node->nfields ();
+ ACE_CDR::ULong const count = node->nfields ();
- for (size_t i = 0; i < count; ++i)
+ for (ACE_CDR::ULong i = 0; i < count; ++i)
{
node->field (member_ptr, i);
@@ -218,10 +218,10 @@ int
TAO::be_visitor_struct_typecode::visit_members (AST_Structure * node)
{
AST_Field ** member_ptr = 0;
- size_t const count = node->nfields ();
+ ACE_CDR::ULong const count = node->nfields ();
TAO_OutStream & os = *this->ctx_->stream ();
- for (size_t i = 0; i < count; ++i)
+ for (ACE_CDR::ULong i = 0; i < count; ++i)
{
node->field (member_ptr, i);
diff --git a/TAO/TAO_IDL/driver/drv_preproc.cpp b/TAO/TAO_IDL/driver/drv_preproc.cpp
index 1e0168f788e..6a8a0b3f8b6 100644
--- a/TAO/TAO_IDL/driver/drv_preproc.cpp
+++ b/TAO/TAO_IDL/driver/drv_preproc.cpp
@@ -78,6 +78,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc.
#include "ace/UUID.h"
#include "ace/Dirent.h"
#include "ace/OS_NS_sys_stat.h"
+#include "ace/Truncate.h"
// FUZZ: disable check_for_streams_include
#include "ace/streams.h"
@@ -171,7 +172,7 @@ DRV_cpp_calc_total_argsize(void)
unsigned long ix = 0;
while (DRV_arglist[ix] != 0)
{
- size += ACE_OS::strlen (DRV_arglist[ix]) + 1;
+ size += ACE_Utils::truncate_cast<unsigned long> (ACE_OS::strlen (DRV_arglist[ix]) + 1);
++ix;
}
return size;
@@ -182,7 +183,7 @@ static bool
DRV_get_line (FILE *file)
{
char *line = ACE_OS::fgets (drv_line,
- drv_line_size,
+ ACE_Utils::truncate_cast<int> (drv_line_size),
file);
if (!line || (!*line && feof (file)))
{
@@ -226,7 +227,7 @@ DRV_get_line (FILE *file)
}
line = ACE_OS::fgets (drv_line + len,
- drv_line_size - len,
+ ACE_Utils::truncate_cast<int> (drv_line_size - len),
file);
} while (line && *line);
diff --git a/TAO/TAO_IDL/fe/idl.ll b/TAO/TAO_IDL/fe/idl.ll
index 25c5431f04e..817051334be 100644
--- a/TAO/TAO_IDL/fe/idl.ll
+++ b/TAO/TAO_IDL/fe/idl.ll
@@ -1267,7 +1267,7 @@ idl_get_pragma_string (char *pragma)
return 0;
}
- int len = end - start;
+ int len = static_cast<int> (end - start);
char *retval = 0;
ACE_NEW_RETURN (retval,
diff --git a/TAO/TAO_IDL/fe/idl.yy.cpp b/TAO/TAO_IDL/fe/idl.yy.cpp
index ce4b582911e..fdb80056a23 100644
--- a/TAO/TAO_IDL/fe/idl.yy.cpp
+++ b/TAO/TAO_IDL/fe/idl.yy.cpp
@@ -379,7 +379,7 @@ static void yy_fatal_error (yyconst char msg[] );
*/
#define YY_DO_BEFORE_ACTION \
(yytext_ptr) = yy_bp; \
- tao_yyleng = (size_t) (yy_cp - yy_bp); \
+ tao_yyleng = (int) (yy_cp - yy_bp); \
(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
if ( tao_yyleng >= YYLMAX ) \
@@ -1179,7 +1179,7 @@ static int input (void );
buf[n++] = (char) c; \
if ( c == EOF && ferror( tao_yyin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
- result = n; \
+ result = static_cast<int> (n); \
} \
else \
{ \
@@ -2245,8 +2245,8 @@ static int yy_get_next_buffer (void)
else
{
- int num_to_read =
- YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+ int num_to_read = (int)
+ (YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1);
while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */
@@ -2259,7 +2259,7 @@ static int yy_get_next_buffer (void)
if ( b->yy_is_our_buffer )
{
- int new_size = b->yy_buf_size * 2;
+ int new_size = (int)(b->yy_buf_size * 2);
if ( new_size <= 0 )
b->yy_buf_size += b->yy_buf_size / 8;
@@ -2280,8 +2280,8 @@ static int yy_get_next_buffer (void)
(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
- num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
- number_to_move - 1;
+ num_to_read = (int)(YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+ number_to_move - 1);
}
@@ -2413,7 +2413,7 @@ static int yy_get_next_buffer (void)
yy_cp += (int) (dest - source);
yy_bp += (int) (dest - source);
YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
+ (yy_n_chars) = static_cast<int> (YY_CURRENT_BUFFER_LVALUE->yy_buf_size);
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
YY_FATAL_ERROR( "flex scanner push-back overflow" );
@@ -2450,7 +2450,7 @@ static int yy_get_next_buffer (void)
else
{ /* need more input */
- int offset = (yy_c_buf_p) - (yytext_ptr);
+ int offset = static_cast<int> ((yy_c_buf_p) - (yytext_ptr));
++(yy_c_buf_p);
switch ( yy_get_next_buffer( ) )
@@ -2751,7 +2751,7 @@ static void tao_yyensure_buffer_stack (void)
/* Increase the buffer to prepare for a possible push. */
int grow_size = 8 /* arbitrary grow size */;
- num_to_alloc = (yy_buffer_stack_max) + grow_size;
+ num_to_alloc = static_cast<int> (yy_buffer_stack_max) + grow_size;
(yy_buffer_stack) = (struct yy_buffer_state**)tao_yyrealloc
((yy_buffer_stack),
num_to_alloc * sizeof(struct yy_buffer_state*)
@@ -2789,7 +2789,7 @@ YY_BUFFER_STATE tao_yy_scan_buffer (char * base, yy_size_t size )
b->yy_buf_pos = b->yy_ch_buf = base;
b->yy_is_our_buffer = 0;
b->yy_input_file = 0;
- b->yy_n_chars = b->yy_buf_size;
+ b->yy_n_chars = static_cast<int> (b->yy_buf_size);
b->yy_is_interactive = 0;
b->yy_at_bol = 1;
b->yy_fill_buffer = 0;
@@ -2811,7 +2811,7 @@ YY_BUFFER_STATE tao_yy_scan_buffer (char * base, yy_size_t size )
YY_BUFFER_STATE tao_yy_scan_string (yyconst char * yystr )
{
- return tao_yy_scan_bytes(yystr,strlen(yystr) );
+ return tao_yy_scan_bytes(yystr, static_cast<int> (strlen(yystr)) );
}
/** Setup the input buffer state to scan the given bytes. The next call to tao_yylex() will
@@ -3915,7 +3915,7 @@ idl_get_pragma_string (char *pragma)
return 0;
}
- int len = end - start;
+ int len = static_cast<int> (end - start);
char *retval = 0;
ACE_NEW_RETURN (retval,
diff --git a/TAO/orbsvcs/orbsvcs/IOR_Multicast.cpp b/TAO/orbsvcs/orbsvcs/IOR_Multicast.cpp
index 4e62181384b..8d99f155162 100644
--- a/TAO/orbsvcs/orbsvcs/IOR_Multicast.cpp
+++ b/TAO/orbsvcs/orbsvcs/IOR_Multicast.cpp
@@ -65,7 +65,7 @@ TAO_IOR_Multicast::init (const char *ior,
if (tmpnic != 0)
{
// i.e. a nic name has been specified
- length_addr = tmpnic - mcast_addr + 1;
+ length_addr = static_cast<CORBA::ULong> (tmpnic - mcast_addr + 1);
actual_mcast_addr = CORBA::string_alloc (length_addr);
ACE_OS::strncpy (actual_mcast_addr.inout (),
@@ -277,8 +277,8 @@ TAO_IOR_Multicast::handle_input (ACE_HANDLE)
// length as the first element, and ior itself as the second.)
// Length of ior to be sent.
- CORBA::Short data_len =
- static_cast<CORBA::Short> (ACE_HTONS (this->ior_.length () + 1));
+ CORBA::UShort data_len =
+ ACE_HTONS (static_cast<CORBA::UShort> (this->ior_.length () + 1));
// Vector to be sent.
const int cnt = 2;
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;
}
diff --git a/TAO/tao/CDR.cpp b/TAO/tao/CDR.cpp
index 0f040b90f62..53c4318b9c1 100644
--- a/TAO/tao/CDR.cpp
+++ b/TAO/tao/CDR.cpp
@@ -4,6 +4,8 @@
#include "tao/SystemException.h"
#include "tao/GIOP_Fragmentation_Strategy.h"
+#include "ace/Truncate.h"
+
#if !defined (__ACE_INLINE__)
# include "tao/CDR.inl"
#endif /* ! __ACE_INLINE__ */
@@ -256,12 +258,12 @@ TAO_OutputCDR::offset (char* pos)
{
if (pos >= cur_mb->rd_ptr () && pos <= cur_mb->wr_ptr ())
{
- offset += (cur_mb->wr_ptr () - pos);
+ offset += ACE_Utils::truncate_cast<int> (cur_mb->wr_ptr () - pos);
found = true;
}
else if (found)
{
- offset += cur_mb->length ();
+ offset += ACE_Utils::truncate_cast<int> (cur_mb->length ());
}
if (wr_ptr == cur_mb->wr_ptr ())
diff --git a/TAO/tao/CORBALOC_Parser.cpp b/TAO/tao/CORBALOC_Parser.cpp
index 932c0426273..63cd20f81ae 100644
--- a/TAO/tao/CORBALOC_Parser.cpp
+++ b/TAO/tao/CORBALOC_Parser.cpp
@@ -14,6 +14,7 @@
#include "ace/Vector_T.h"
#include "ace/INET_Addr.h"
#include "ace/OS_NS_string.h"
+#include "ace/Truncate.h"
#include "ace/os_include/os_netdb.h"
@@ -201,7 +202,7 @@ TAO_CORBALOC_Parser::parse_string (const char * ior, CORBA::ORB_ptr orb)
// now take the collection of endpoints along with the decoded key and
// mix them together to get the mprofile.
- TAO_MProfile mprofile (endpoints.size());
+ TAO_MProfile mprofile (ACE_Utils::truncate_cast<CORBA::ULong> (endpoints.size()));
for (size_t i = 0; i < endpoints.size(); i++)
{
diff --git a/TAO/tao/CORBA_String.cpp b/TAO/tao/CORBA_String.cpp
index 7e173e3480a..aaa20da44ec 100644
--- a/TAO/tao/CORBA_String.cpp
+++ b/TAO/tao/CORBA_String.cpp
@@ -31,7 +31,7 @@ istream &
operator>> (istream &is, CORBA::String_var &sv)
{
is.seekg (0, ios::end);
- sv = CORBA::string_alloc (is.tellg ());
+ sv = CORBA::string_alloc (static_cast<CORBA::ULong> (is.tellg ()));
is.seekg (0, ios::beg);
is >> sv.inout ();
return is;
@@ -48,7 +48,7 @@ istream &
operator>> (istream &is, CORBA::String_out &so)
{
is.seekg (0, ios::end);
- so = CORBA::string_alloc (is.tellg ());
+ so = CORBA::string_alloc (static_cast<CORBA::ULong> (is.tellg ()));
is.seekg (0, ios::beg);
is >> so.ptr ();
return is;
@@ -77,7 +77,7 @@ operator>> (istream &is, CORBA::WString_var &wsv)
{
is.seekg (0, ios::end);
// @@ is.tellg()/sizeof(CORBA::WChar) instead?
- CORBA::ULong const len = is.tellg ();
+ CORBA::ULong const len = static_cast<CORBA::ULong> (is.tellg ());
wsv = CORBA::wstring_alloc (len);
is.seekg (0, ios::beg);
@@ -116,7 +116,7 @@ operator>> (istream &is, CORBA::WString_out &wso)
{
is.seekg (0, ios::end);
// @@ is.tellg()/sizeof(CORBA::WChar) instead?
- const CORBA::ULong len = is.tellg ();
+ const CORBA::ULong len = static_cast<CORBA::ULong> (is.tellg ());
wso = CORBA::wstring_alloc (len);
is.seekg (0, ios::beg);
diff --git a/TAO/tao/DynamicAny/DynValue_i.cpp b/TAO/tao/DynamicAny/DynValue_i.cpp
index 6892ea759dc..7a58d303fb3 100644
--- a/TAO/tao/DynamicAny/DynValue_i.cpp
+++ b/TAO/tao/DynamicAny/DynValue_i.cpp
@@ -10,6 +10,8 @@
#include "tao/CDR.h"
#include "tao/Valuetype/ValueBase.h"
+#include "ace/Truncate.h"
+
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
TAO_DynValue_i::TAO_DynValue_i (CORBA::Boolean allow_truncation)
@@ -156,7 +158,7 @@ TAO_DynValue_i::get_correct_base_type (
// and so on until we reach the member we have asked for.
CORBA::ULong
- currentBase = base_types.size ();
+ currentBase = ACE_Utils::truncate_cast<CORBA::ULong> (base_types.size ());
if (!currentBase)
{
TAOLIB_DEBUG ((LM_DEBUG,
@@ -717,7 +719,8 @@ TAO_DynValue_i::to_outputCDR (TAO_OutputCDR &out_cdr)
TAO_OBV_GIOP_Flags::Value_tag_base |
TAO_OBV_GIOP_Flags::Type_info_single;
- const CORBA::ULong num_ids = this->da_base_types_.size ();
+ const CORBA::ULong num_ids =
+ ACE_Utils::truncate_cast<CORBA::ULong> (this->da_base_types_.size ());
CORBA::ULong trunc_ids;
for (trunc_ids= 0u; trunc_ids < num_ids - 1u; ++trunc_ids)
{
@@ -1106,7 +1109,7 @@ TAO_DynValue_i::from_inputCDR (TAO_InputCDR &strm)
// marks for each seporate base-type's state we pass).
CORBA::Boolean need_first = true;
CORBA::ULong
- currentBase= this->da_base_types_.size (),
+ currentBase = ACE_Utils::truncate_cast<CORBA::ULong> (this->da_base_types_.size ()),
currentBaseMember = 0u;
for (CORBA::ULong currentMember= 0u;
currentMember < num_fields;
diff --git a/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.cpp b/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.cpp
index ebdabe25ceb..830f379f67c 100644
--- a/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.cpp
+++ b/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.cpp
@@ -12,6 +12,8 @@
#include "tao/Pluggable_Messaging_Utils.h"
#include "tao/AnyTypeCode/Any_Impl.h"
+#include "ace/Truncate.h"
+
#if !defined (__ACE_INLINE__)
# include "AMH_DSI_Response_Handler.inl"
#endif /* ! __ACE_INLINE__ */
@@ -403,7 +405,8 @@ TAO_AMH_DSI_Response_Handler::gateway_exception_reply (
// We know nothing about this exception, so we marshal it as a block
// of bytes. The outgoing stream's byte order has already been matched
// to the original source of the reply.
- this->_tao_out.write_char_array (encap.buffer (), encap.length ());
+ this->_tao_out.write_char_array (encap.buffer (),
+ ACE_Utils::truncate_cast<ACE_CDR::ULong> (encap.length ()));
// This will prevent the marshaling of any parameters into this reply.
// this->sent_gateway_exception_ = 1;
this->_tao_rh_send_reply ();
diff --git a/TAO/tao/DynamicInterface/Request.cpp b/TAO/tao/DynamicInterface/Request.cpp
index 1b6f8fff951..261f1e08bd7 100644
--- a/TAO/tao/DynamicInterface/Request.cpp
+++ b/TAO/tao/DynamicInterface/Request.cpp
@@ -219,9 +219,9 @@ CORBA::Request::send_deferred (void)
TAO::DII_Deferred_Invocation_Adapter _tao_call (
this->target_,
_tao_arg_list,
- number_args,
+ static_cast<int> (number_args),
this->opname_,
- static_cast<CORBA::ULong> (ACE_OS::strlen (this->opname_)),
+ ACE_OS::strlen (this->opname_),
0,
this->orb_->orb_core (),
this);
diff --git a/TAO/tao/Dynamic_TP/DTP_Task.cpp b/TAO/tao/Dynamic_TP/DTP_Task.cpp
index 1d5a6d03f1f..30adce9c2e2 100644
--- a/TAO/tao/Dynamic_TP/DTP_Task.cpp
+++ b/TAO/tao/Dynamic_TP/DTP_Task.cpp
@@ -136,7 +136,7 @@ TAO_DTP_Task::open (void* /* args */)
return 0;
}
- size_t num = this->init_pool_threads_;
+ int num = static_cast<int> (this->init_pool_threads_);
if (TAO_debug_level > 4)
{
@@ -225,7 +225,7 @@ TAO_DTP_Task::open (void* /* args */)
num));
}
- this->active_count_ = num;
+ this->active_count_ = static_cast<size_t> (num);
this->opened_ = true;
this->accepting_requests_ = true;
@@ -307,7 +307,7 @@ bool
TAO_DTP_Task::need_active (void)
{
ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->aw_lock_, false);
- return ((this->busy_threads_ == this->active_count_) &&
+ return ((this->busy_threads_ == static_cast<unsigned long> (this->active_count_)) &&
((this->max_pool_threads_ < 1) ||
(this->active_count_ < this->max_pool_threads_)));
}
diff --git a/TAO/tao/Dynamic_TP/DTP_Thread_Pool.cpp b/TAO/tao/Dynamic_TP/DTP_Thread_Pool.cpp
index d9dfb449d96..5861424f7bc 100644
--- a/TAO/tao/Dynamic_TP/DTP_Thread_Pool.cpp
+++ b/TAO/tao/Dynamic_TP/DTP_Thread_Pool.cpp
@@ -184,7 +184,7 @@ TAO_DTP_Thread_Pool::current_threads (void) const
this->lock_,
0);
- return this->threads_.thr_count ();
+ return static_cast<CORBA::ULong> (this->threads_.thr_count ());
}
void
@@ -336,7 +336,7 @@ TAO_DTP_Thread_Pool::create_threads_i (size_t count)
-1);
result =
this->threads_.activate (flags,
- count,
+ static_cast<int> (count),
force_active,
default_grp_id,
default_priority,
diff --git a/TAO/tao/HTTP_Client.cpp b/TAO/tao/HTTP_Client.cpp
index bdf6b371d52..64f7f792068 100644
--- a/TAO/tao/HTTP_Client.cpp
+++ b/TAO/tao/HTTP_Client.cpp
@@ -4,6 +4,7 @@
#include "tao/HTTP_Handler.h"
#include "ace/OS_NS_string.h"
+#include "ace/Truncate.h"
#include "tao/debug.h"
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -40,7 +41,7 @@ TAO_HTTP_Client::read (ACE_Message_Block *mb)
TAOLIB_ERROR_RETURN ((LM_ERROR, "TAO (%P|%t) - HTTP_Client::read, Connector error\n"), -1);
}
- return HTTP_reader.byte_count ();
+ return ACE_Utils::truncate_cast<int> (HTTP_reader.byte_count ());
}
diff --git a/TAO/tao/IIOP_Profile.cpp b/TAO/tao/IIOP_Profile.cpp
index c4f0505a693..fee07e0b832 100644
--- a/TAO/tao/IIOP_Profile.cpp
+++ b/TAO/tao/IIOP_Profile.cpp
@@ -10,6 +10,7 @@
#include "tao/SystemException.h"
#include "ace/OS_NS_string.h"
#include "ace/OS_NS_stdio.h"
+#include "ace/Truncate.h"
#include "ace/os_include/os_netdb.h"
static const char the_prefix[] = "iiop";
@@ -210,7 +211,7 @@ TAO_IIOP_Profile::parse_string_i (const char *ior)
else if (cp_pos != 0)
{
// A port number or port name was specified.
- CORBA::ULong length_port = okd - cp_pos - 1;
+ CORBA::ULong length_port = ACE_Utils::truncate_cast<CORBA::ULong> (okd - cp_pos - 1);
CORBA::String_var tmp = CORBA::string_alloc (length_port);
if (tmp.in() != 0)
@@ -245,10 +246,10 @@ TAO_IIOP_Profile::parse_string_i (const char *ior)
this->endpoint_.port_ = ia.get_port_number ();
}
}
- length_host = cp_pos - ior;
+ length_host = ACE_Utils::truncate_cast<CORBA::ULong> (cp_pos - ior);
}
else
- length_host = okd - ior;
+ length_host = ACE_Utils::truncate_cast<CORBA::ULong> (okd - ior);
#if defined (ACE_HAS_IPV6)
if (ipv6_in_host)
diff --git a/TAO/tao/IORInterceptor/IORInterceptor_Adapter_Impl.cpp b/TAO/tao/IORInterceptor/IORInterceptor_Adapter_Impl.cpp
index 29a1cf83dc8..a56217e32dd 100644
--- a/TAO/tao/IORInterceptor/IORInterceptor_Adapter_Impl.cpp
+++ b/TAO/tao/IORInterceptor/IORInterceptor_Adapter_Impl.cpp
@@ -160,7 +160,7 @@ TAO_IORInterceptor_Adapter_Impl::adapter_state_changed (
CORBA::add_ref (member);
- seq_obj_ref_template[counter] = member;
+ seq_obj_ref_template[static_cast<CORBA::ULong> (counter)] = member;
}
for (size_t i = 0; i < interceptor_count; ++i)
diff --git a/TAO/tao/Invocation_Adapter.cpp b/TAO/tao/Invocation_Adapter.cpp
index aaafac232f0..c7c2d955971 100644
--- a/TAO/tao/Invocation_Adapter.cpp
+++ b/TAO/tao/Invocation_Adapter.cpp
@@ -15,6 +15,7 @@
#include "tao/Collocation_Resolver.h"
#include "tao/Invocation_Retry_State.h"
#include "ace/Service_Config.h"
+#include "ace/Truncate.h"
#if !defined (__ACE_INLINE__)
# include "tao/Invocation_Adapter.inl"
@@ -36,7 +37,7 @@ namespace TAO
TAO_Stub *stub = this->get_stub ();
TAO_Operation_Details op_details (this->operation_,
- this->op_len_,
+ ACE_Utils::truncate_cast<CORBA::ULong> (this->op_len_),
this->args_,
this->number_args_,
this->has_in_args_,
diff --git a/TAO/tao/MCAST_Parser.cpp b/TAO/tao/MCAST_Parser.cpp
index 052e31e2cc5..5eda8d95184 100644
--- a/TAO/tao/MCAST_Parser.cpp
+++ b/TAO/tao/MCAST_Parser.cpp
@@ -11,6 +11,7 @@
#include "ace/SOCK_Dgram.h"
#include "ace/OS_NS_strings.h"
#include "ace/OS_NS_string.h"
+#include "ace/Truncate.h"
#if !defined(__ACE_INLINE__)
#include "tao/MCAST_Parser.inl"
@@ -200,7 +201,9 @@ TAO_MCAST_Parser::multicast_query (char* & buf,
// Length of service name we will send.
CORBA::Short data_len =
- (CORBA::Short) ACE_HTONS (ACE_OS::strlen (service_name) + 1);
+ (CORBA::Short) ACE_HTONS (
+ ACE_Utils::truncate_cast<ACE_UINT16> (
+ ACE_OS::strlen (service_name) + 1));
// Vector we will send. It contains: 1) length of service
// name string, 2)port on which we are listening for
diff --git a/TAO/tao/Monitor/Monitor_Impl.cpp b/TAO/tao/Monitor/Monitor_Impl.cpp
index 1014770e978..e47bfe6bbcb 100644
--- a/TAO/tao/Monitor/Monitor_Impl.cpp
+++ b/TAO/tao/Monitor/Monitor_Impl.cpp
@@ -44,7 +44,7 @@ Monitor_Impl::get_statistic_names (const char * filter)
::Monitor::NameList *namelist = 0;
ACE_NEW_THROW_EX (namelist,
- ::Monitor::NameList (mc_names.size ()),
+ ::Monitor::NameList (static_cast<CORBA::ULong> (mc_names.size ())),
CORBA::NO_MEMORY ());
CORBA::ULong index = 0;
diff --git a/TAO/tao/On_Demand_Fragmentation_Strategy.cpp b/TAO/tao/On_Demand_Fragmentation_Strategy.cpp
index 2c78bf33cb6..e9b790dd6fa 100644
--- a/TAO/tao/On_Demand_Fragmentation_Strategy.cpp
+++ b/TAO/tao/On_Demand_Fragmentation_Strategy.cpp
@@ -6,6 +6,8 @@
#include "tao/GIOP_Message_Base.h"
#include "tao/debug.h"
+#include "ace/Truncate.h"
+
TAO_On_Demand_Fragmentation_Strategy::TAO_On_Demand_Fragmentation_Strategy (
TAO_Transport * transport,
CORBA::ULong max_message_size)
@@ -42,14 +44,16 @@ TAO_On_Demand_Fragmentation_Strategy::fragment (
// marshaled, taking into account the alignment for the given data
// type.
ACE_CDR::ULong const total_pending_length =
- ACE_align_binary (cdr.total_length (), pending_alignment)
- + pending_length;
+ ACE_Utils::truncate_cast<ACE_CDR::ULong> (
+ ACE_align_binary (cdr.total_length (), pending_alignment)
+ + pending_length);
// Except for the last fragment, fragmented GIOP messages must
// always be aligned on an 8-byte boundary. Padding will be added
// if necessary.
ACE_CDR::ULong const aligned_length =
- ACE_align_binary (total_pending_length, ACE_CDR::MAX_ALIGNMENT);
+ ACE_Utils::truncate_cast<ACE_CDR::ULong> (
+ ACE_align_binary (total_pending_length, ACE_CDR::MAX_ALIGNMENT));
// this->max_message_size_ must be >= 24 bytes, i.e.:
// 12 for GIOP protocol header
diff --git a/TAO/tao/PortableServer/POAManager.inl b/TAO/tao/PortableServer/POAManager.inl
index 3dd8e658506..efb11b50208 100644
--- a/TAO/tao/PortableServer/POAManager.inl
+++ b/TAO/tao/PortableServer/POAManager.inl
@@ -91,10 +91,10 @@ TAO_POA_Manager::generate_manager_id (void) const
// 64-bit platforms.
if (sizeof (this) == 4) // 32 bit address
- id = reinterpret_cast <ptrdiff_t> (this);
+ id = static_cast<CORBA::Long> (reinterpret_cast <ptrdiff_t> (this));
else if (sizeof (this) == 8) // 64 bit address -- use lower 32 bits
- id = reinterpret_cast <ptrdiff_t> (this) & 0xFFFFFFFFu;
+ id = static_cast<CORBA::Long> (reinterpret_cast <ptrdiff_t> (this) & 0xFFFFFFFFu);
// @@ If we ever hit a platform where neither of the above cases are
// satisfied, we're up the creek!
diff --git a/TAO/tao/PortableServer/Servant_Base.cpp b/TAO/tao/PortableServer/Servant_Base.cpp
index 9abb539aab1..887154ad4bf 100644
--- a/TAO/tao/PortableServer/Servant_Base.cpp
+++ b/TAO/tao/PortableServer/Servant_Base.cpp
@@ -476,7 +476,8 @@ TAO_ServantBase::_find (const char *opname,
const size_t length)
{
ACE_FUNCTION_TIMEPROBE (TAO_SERVANT_BASE_FIND_START);
- return this->optable_->find (opname, skelfunc, length);
+ return this->optable_->find (opname, skelfunc,
+ static_cast<unsigned int> (length));
}
int
@@ -486,7 +487,8 @@ TAO_ServantBase::_find (const char *opname,
const size_t length)
{
ACE_FUNCTION_TIMEPROBE (TAO_SERVANT_BASE_FIND_START);
- return this->optable_->find (opname, skelfunc, st, length);
+ return this->optable_->find (opname, skelfunc, st,
+ static_cast<unsigned int> (length));
}
TAO_Stub *
diff --git a/TAO/tao/RTCORBA/Thread_Pool.cpp b/TAO/tao/RTCORBA/Thread_Pool.cpp
index 4b13e1a0b76..e101bb672f5 100644
--- a/TAO/tao/RTCORBA/Thread_Pool.cpp
+++ b/TAO/tao/RTCORBA/Thread_Pool.cpp
@@ -391,8 +391,8 @@ TAO_Thread_Lane::current_threads (void) const
this->lock_,
0);
- return (this->static_threads_.thr_count () +
- this->dynamic_threads_.thr_count ());
+ return static_cast<CORBA::ULong> (this->static_threads_.thr_count () +
+ this->dynamic_threads_.thr_count ());
}
diff --git a/TAO/tao/Storable_FlatFileStream.cpp b/TAO/tao/Storable_FlatFileStream.cpp
index 8e286ca4c7c..0c177d74a19 100644
--- a/TAO/tao/Storable_FlatFileStream.cpp
+++ b/TAO/tao/Storable_FlatFileStream.cpp
@@ -15,6 +15,7 @@
#include "ace/OS_NS_fcntl.h"
#include "ace/OS_NS_sys_stat.h"
#include "ace/Numeric_Limits.h"
+#include "ace/Truncate.h"
#include "tao/debug.h"
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -383,7 +384,8 @@ TAO::Storable_FlatFileStream::operator >> (unsigned int &i)
TAO::Storable_Base &
TAO::Storable_FlatFileStream::operator << (const TAO_OutputCDR & cdr)
{
- unsigned int const length = cdr.total_length ();
+ unsigned int const length =
+ ACE_Utils::truncate_cast<unsigned int> (cdr.total_length ());
*this << length;
for (const ACE_Message_Block *i = cdr.begin (); i != 0; i = i->cont ())
{
diff --git a/TAO/tao/Strategies/DIOP_Profile.cpp b/TAO/tao/Strategies/DIOP_Profile.cpp
index 852b24d9f5e..463806b64b3 100644
--- a/TAO/tao/Strategies/DIOP_Profile.cpp
+++ b/TAO/tao/Strategies/DIOP_Profile.cpp
@@ -12,6 +12,7 @@
#include "ace/OS_NS_stdio.h"
#include "ace/OS_NS_string.h"
#include "ace/os_include/os_netdb.h"
+#include "ace/Truncate.h"
static const char the_prefix[] = "diop";
@@ -190,7 +191,7 @@ TAO_DIOP_Profile::parse_string_i (const char *ior)
else if (cp_pos != 0)
{
// A port number or port name was specified.
- CORBA::ULong length_port = okd - cp_pos - 1;
+ CORBA::ULong length_port = ACE_Utils::truncate_cast<CORBA::ULong> (okd - cp_pos - 1);
CORBA::String_var tmp = CORBA::string_alloc (length_port);
@@ -219,10 +220,10 @@ TAO_DIOP_Profile::parse_string_i (const char *ior)
}
}
- length_host = cp_pos - ior;
+ length_host = ACE_Utils::truncate_cast<CORBA::ULong> (cp_pos - ior);
}
else
- length_host = okd - ior;
+ length_host = ACE_Utils::truncate_cast<CORBA::ULong> (okd - ior);
#if defined (ACE_HAS_IPV6)
if (ipv6_in_host)
diff --git a/TAO/tao/Strategies/DIOP_Transport.cpp b/TAO/tao/Strategies/DIOP_Transport.cpp
index d2ffe5ef408..05f210b7243 100644
--- a/TAO/tao/Strategies/DIOP_Transport.cpp
+++ b/TAO/tao/Strategies/DIOP_Transport.cpp
@@ -166,7 +166,7 @@ TAO_DIOP_Transport::handle_input (TAO_Resume_Handle &rh,
this->tms_->connection_closed ();
}
- return n;
+ return static_cast<int> (n);
}
// Set the write pointer in the stack buffer
diff --git a/TAO/tao/Strategies/SHMIOP_Profile.cpp b/TAO/tao/Strategies/SHMIOP_Profile.cpp
index c7291d9ee54..94c29e1ff66 100644
--- a/TAO/tao/Strategies/SHMIOP_Profile.cpp
+++ b/TAO/tao/Strategies/SHMIOP_Profile.cpp
@@ -12,7 +12,7 @@
#include "ace/OS_NS_stdio.h"
#include "ace/OS_NS_string.h"
#include "ace/os_include/os_netdb.h"
-#include "ace/os_include/os_netdb.h"
+#include "ace/Truncate.h"
static const char prefix_[] = "shmiop";
@@ -158,7 +158,7 @@ TAO_SHMIOP_Profile::parse_string_i (const char *string
// Don't increment the pointer 'cp' directly since we still need
// to use it immediately after this block.
- CORBA::ULong length = okd - (cp + 1);
+ CORBA::ULong length = ACE_Utils::truncate_cast<CORBA::ULong> (okd - (cp + 1));
// Don't allocate space for the colon ':'.
CORBA::String_var tmp = CORBA::string_alloc (length);
@@ -188,7 +188,7 @@ TAO_SHMIOP_Profile::parse_string_i (const char *string
}
}
- length = cp - start;
+ length = ACE_Utils::truncate_cast<CORBA::ULong> (cp - start);
tmp = CORBA::string_alloc (length);
diff --git a/TAO/tao/Transport.cpp b/TAO/tao/Transport.cpp
index e879e705a8e..60e530ee1ea 100644
--- a/TAO/tao/Transport.cpp
+++ b/TAO/tao/Transport.cpp
@@ -31,6 +31,7 @@
#include "ace/os_include/sys/os_uio.h"
#include "ace/High_Res_Timer.h"
#include "ace/CORBA_macros.h"
+#include "ace/Truncate.h"
/*
* Specialization hook to add include files from
@@ -1971,7 +1972,7 @@ TAO_Transport::handle_input_missing_data (TAO_Resume_Handle &rh,
if (n <= 0)
{
- return n;
+ return ACE_Utils::truncate_cast<int> (n);
}
if (TAO_debug_level > 3)
@@ -2201,7 +2202,7 @@ TAO_Transport::handle_input_parse_data (TAO_Resume_Handle &rh,
this->partial_message_->reset ();
}
- return n;
+ return ACE_Utils::truncate_cast<int> (n);
}
if (this->partial_message_ != 0 && this->partial_message_->length () > 0)
diff --git a/TAO/tao/TransportCurrent/Current_Impl.cpp b/TAO/tao/TransportCurrent/Current_Impl.cpp
index f3c01e64087..850ce1d621f 100644
--- a/TAO/tao/TransportCurrent/Current_Impl.cpp
+++ b/TAO/tao/TransportCurrent/Current_Impl.cpp
@@ -65,7 +65,7 @@ namespace TAO
{
const TAO_Transport* t = this->transport ();
- return (t==0) ? 0 : t->id ();
+ return (t==0) ? 0 : static_cast<CORBA::Long> (t->id ());
}
CounterT Current_Impl::bytes_sent (void)
diff --git a/TAO/tao/TypeCodeFactory/TypeCodeFactory_i.cpp b/TAO/tao/TypeCodeFactory/TypeCodeFactory_i.cpp
index e3fa279fe4c..236d726d792 100644
--- a/TAO/tao/TypeCodeFactory/TypeCodeFactory_i.cpp
+++ b/TAO/tao/TypeCodeFactory/TypeCodeFactory_i.cpp
@@ -581,7 +581,7 @@ TAO_TypeCodeFactory_i::create_union_tc (
rtc->union_parameters (name,
duped_disc_type,
cases, // Will be copied.
- cases.size (),
+ static_cast<CORBA::ULong> (cases.size ()),
default_index);
return recursive_tc._retn ();
@@ -592,7 +592,7 @@ TAO_TypeCodeFactory_i::create_union_tc (
name,
duped_disc_type,
cases, // Will be copied.
- cases.size (),
+ static_cast<CORBA::ULong> (cases.size ()),
default_index),
CORBA::NO_MEMORY ());
diff --git a/TAO/tao/Valuetype/ValueBase.cpp b/TAO/tao/Valuetype/ValueBase.cpp
index d01a38d9a49..9fc61b1b0c3 100644
--- a/TAO/tao/Valuetype/ValueBase.cpp
+++ b/TAO/tao/Valuetype/ValueBase.cpp
@@ -395,9 +395,9 @@ CORBA::ValueBase::_tao_unmarshal_find_factory (
CORBA::ValueFactory_var factory;
CORBA::Boolean requires_truncation = false;
- const CORBA::ULong num_ids = ids.size ();
+ const size_t num_ids = ids.size ();
const char *id = (num_ids) ? ids[0].c_str () : "{Null}";
- for (CORBA::ULong i = 0u; i < num_ids; ++i)
+ for (size_t i = 0u; i < num_ids; ++i)
{
factory = orb_core->orb ()->lookup_value_factory (ids[i].c_str ());
if (factory.in() != 0)
@@ -955,7 +955,8 @@ TAO_ChunkInfo::write_previous_chunk_size(TAO_OutputCDR &strm)
if (this->chunk_size_pos_ != 0)
{
// Calculate the chunk size.
- CORBA::Long const chunk_size = strm.total_length () - this->length_to_chunk_octets_pos_;
+ CORBA::Long const chunk_size =
+ static_cast<CORBA::Long> (strm.total_length () - this->length_to_chunk_octets_pos_);
// This should not happen since this is called in end_chunk() and
// the idl generated code always have the matched start_chunk() and