summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Corino <mcorino@remedy.nl>2015-06-01 09:07:30 +0200
committerMartin Corino <mcorino@remedy.nl>2015-06-01 09:07:30 +0200
commite23c3772c686b0b4af2eb0b7af622c7075b4b4df (patch)
tree8e58978fb3a8f7b1e7e2284904ff48d910f902c3
parentf2e0d66eb15f56231e44bd44c57b12e3d0b70765 (diff)
downloadATCD-e23c3772c686b0b4af2eb0b7af622c7075b4b4df.tar.gz
Fixing MSVC integer conversion warnings.
* TAO/tao/CDR.cpp: * TAO/tao/CORBALOC_Parser.cpp: * TAO/tao/CORBA_String.cpp: * TAO/tao/HTTP_Client.cpp: * TAO/tao/IIOP_Profile.cpp: * TAO/tao/Invocation_Adapter.cpp: * TAO/tao/MCAST_Parser.cpp: * TAO/tao/On_Demand_Fragmentation_Strategy.cpp: * TAO/tao/Storable_FlatFileStream.cpp: * TAO/tao/Transport.cpp:
-rw-r--r--TAO/tao/CDR.cpp6
-rw-r--r--TAO/tao/CORBALOC_Parser.cpp3
-rw-r--r--TAO/tao/CORBA_String.cpp9
-rw-r--r--TAO/tao/HTTP_Client.cpp3
-rw-r--r--TAO/tao/IIOP_Profile.cpp7
-rw-r--r--TAO/tao/Invocation_Adapter.cpp3
-rw-r--r--TAO/tao/MCAST_Parser.cpp5
-rw-r--r--TAO/tao/On_Demand_Fragmentation_Strategy.cpp10
-rw-r--r--TAO/tao/Storable_FlatFileStream.cpp4
-rw-r--r--TAO/tao/Transport.cpp5
10 files changed, 36 insertions, 19 deletions
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..0490672fb40 100644
--- a/TAO/tao/CORBA_String.cpp
+++ b/TAO/tao/CORBA_String.cpp
@@ -4,6 +4,7 @@
#include "ace/OS_NS_string.h"
#include "ace/OS_NS_wchar.h"
#include "ace/OS_Memory.h"
+#include "ace/Truncate.h"
// FUZZ: disable check_for_streams_include
#include "ace/streams.h"
@@ -31,7 +32,7 @@ istream &
operator>> (istream &is, CORBA::String_var &sv)
{
is.seekg (0, ios::end);
- sv = CORBA::string_alloc (is.tellg ());
+ sv = CORBA::string_alloc (ACE_Utils::truncate_cast<CORBA::ULong> (is.tellg ()));
is.seekg (0, ios::beg);
is >> sv.inout ();
return is;
@@ -48,7 +49,7 @@ istream &
operator>> (istream &is, CORBA::String_out &so)
{
is.seekg (0, ios::end);
- so = CORBA::string_alloc (is.tellg ());
+ so = CORBA::string_alloc (ACE_Utils::truncate_cast<CORBA::ULong> (is.tellg ()));
is.seekg (0, ios::beg);
is >> so.ptr ();
return is;
@@ -77,7 +78,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 = ACE_Utils::truncate_cast<CORBA::ULong> (is.tellg ());
wsv = CORBA::wstring_alloc (len);
is.seekg (0, ios::beg);
@@ -116,7 +117,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 = ACE_Utils::truncate_cast<CORBA::ULong> (is.tellg ());
wso = CORBA::wstring_alloc (len);
is.seekg (0, ios::beg);
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/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/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/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/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)