diff options
-rw-r--r-- | ChangeLog | 45 | ||||
-rw-r--r-- | ace/CDR_Stream.i | 8 | ||||
-rw-r--r-- | ace/OS_NS_stropts.inl | 15 | ||||
-rw-r--r-- | ace/OS_NS_sys_uio.cpp | 2 | ||||
-rw-r--r-- | ace/OS_NS_sys_uio.h | 6 | ||||
-rw-r--r-- | ace/OS_NS_sys_uio.inl | 4 | ||||
-rw-r--r-- | ace/Process.cpp | 6 | ||||
-rw-r--r-- | ace/SOCK_SEQPACK_Acceptor.cpp | 5 | ||||
-rw-r--r-- | ace/SOCK_SEQPACK_Association.cpp | 62 | ||||
-rw-r--r-- | ace/SOCK_SEQPACK_Association.h | 4 | ||||
-rw-r--r-- | ace/SOCK_SEQPACK_Association.i | 12 | ||||
-rw-r--r-- | ace/SOCK_SEQPACK_Connector.cpp | 5 | ||||
-rw-r--r-- | ace/UUID.cpp | 2 |
13 files changed, 126 insertions, 50 deletions
diff --git a/ChangeLog b/ChangeLog index 64f67dc1d6a..6a401941895 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,48 @@ +Thu Apr 29 11:25:49 2004 Steve Huston <shuston@riverace.com> + + These are all to quiet the 64-bit compiler on Win64. + + * ace/CDR_Stream.i (write_wstring): cast size_t return from + ACE_OS::strlen() to ACE_CDR::ULong to correct types. + + * ace/OS_NS_stropts.inl (putmsg): ACE_OS::write() returns ssize_t; + cast it back to int for return to caller. + + * ace/OS_NS_sys_uio.{h, inl, .cpp}: writev() returns ssize_t. Thus, + the writev_emulation() method also must return ssize_t. Also + corrected the ACE_OSCALL_RETURN 'type' argument from int to ssize_t. + + * ace/Process.cpp (spawn): When forming the +H command line options, + use %I64d, not %d, on Win64. + + * ace/SOCK_SEQPACK_Acceptor.cpp (shared_open): Cast the 'namelen' + argument to ACE_OS::bind() to int to match the signature. + + * ace/SOCK_SEQPACK_Association.{h i} (recvv_n, sendv_n): The iovec + count was changed from size_t to int to be consistent with the + other analogous methods in ACE. + + * ace/SOCK_SEQPACK_Association.cpp (get_local_addrs, get_remote_addrs): + Correct usage of int/size_t types. + + * ace/SOCK_SEQPACK_Connector.cpp (shared_connect_start): Use 'int', + not 'size_t' as address length argument to ACE_OS::bind(). + + * ace/UUID.cpp (to_string): Change UUID_STRING_LENGTH from int to + size_t to match string handling length types. + +======= +======= +======= +======= +======= +======= +Thu Apr 22 07:58:20 2004 Chad Elliott <elliott_c@ociweb.com> +======= +======= +======= +======= +======= Thu Apr 29 06:13:21 UTC 2004 Johnny Willemsen <jwillemsen@remedy.nl> * examples/APG/ThreadSafety/Tokens_Deadlock.cpp: diff --git a/ace/CDR_Stream.i b/ace/CDR_Stream.i index bb701e2e693..34fa8ddb46f 100644 --- a/ace/CDR_Stream.i +++ b/ace/CDR_Stream.i @@ -262,7 +262,11 @@ ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_wstring (const ACE_CDR::WChar *x) { if (x != 0) - return this->write_wstring (ACE_OS::strlen (x), x); + { + ACE_CDR::ULong len = + ACE_static_cast (ACE_CDR::ULong, ACE_OS::strlen (x)); + return this->write_wstring (len, x); + } return this->write_wstring (0, 0); } @@ -1145,7 +1149,7 @@ operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_wstring x) if (x.val_ != 0) { - len = ACE_OS::strlen (x.val_); + len = ACE_static_cast (ACE_CDR::ULong, ACE_OS::strlen (x.val_)); } os.write_wstring (len, x.val_); diff --git a/ace/OS_NS_stropts.inl b/ace/OS_NS_stropts.inl index 6200d8d8e3a..6bc526270ab 100644 --- a/ace/OS_NS_stropts.inl +++ b/ace/OS_NS_stropts.inl @@ -146,6 +146,7 @@ ACE_OS::putmsg (ACE_HANDLE handle, const struct strbuf *ctl, flags), int, -1); #else ACE_UNUSED_ARG (flags); + ssize_t result; if (ctl == 0 && data == 0) { errno = EINVAL; @@ -153,9 +154,15 @@ ACE_OS::putmsg (ACE_HANDLE handle, const struct strbuf *ctl, } // Handle the two easy cases. else if (ctl != 0) - return ACE_OS::write (handle, ctl->buf, ctl->len); + { + result = ACE_OS::write (handle, ctl->buf, ctl->len); + return ACE_static_cast (int, result); + } else if (data != 0) - return ACE_OS::write (handle, data->buf, data->len); + { + result = ACE_OS::write (handle, data->buf, data->len); + return ACE_static_cast (int, result); + } else { // This is the hard case. @@ -163,9 +170,9 @@ ACE_OS::putmsg (ACE_HANDLE handle, const struct strbuf *ctl, ACE_NEW_RETURN (buf, char [ctl->len + data->len], -1); ACE_OS::memcpy (buf, ctl->buf, ctl->len); ACE_OS::memcpy (buf + ctl->len, data->buf, data->len); - int result = ACE_OS::write (handle, buf, ctl->len + data->len); + result = ACE_OS::write (handle, buf, ctl->len + data->len); delete [] buf; - return result; + return ACE_static_cast (int, result); } #endif /* ACE_HAS_STREAM_PIPES */ } diff --git a/ace/OS_NS_sys_uio.cpp b/ace/OS_NS_sys_uio.cpp index 44a02cdb823..d3ee379e756 100644 --- a/ace/OS_NS_sys_uio.cpp +++ b/ace/OS_NS_sys_uio.cpp @@ -80,7 +80,7 @@ ACE_OS::readv_emulation (ACE_HANDLE handle, // "Fake" writev for operating systems without it. Note that this is // thread-safe. -int +ssize_t ACE_OS::writev_emulation (ACE_HANDLE handle, ACE_WRITEV_TYPE iov[], int n) { ACE_OS_TRACE ("ACE_OS::writev_emulation"); diff --git a/ace/OS_NS_sys_uio.h b/ace/OS_NS_sys_uio.h index ac59b952c91..0450563f5f1 100644 --- a/ace/OS_NS_sys_uio.h +++ b/ace/OS_NS_sys_uio.h @@ -56,9 +56,9 @@ namespace ACE_OS { // or inl. #if defined (ACE_LACKS_WRITEV) extern ACE_Export - int writev_emulation (ACE_HANDLE handle, - ACE_WRITEV_TYPE *iov, - int iovcnt); + ssize_t writev_emulation (ACE_HANDLE handle, + ACE_WRITEV_TYPE *iov, + int iovcnt); #endif /* ACE_LACKS_WRITEV */ } /* namespace ACE_OS */ diff --git a/ace/OS_NS_sys_uio.inl b/ace/OS_NS_sys_uio.inl index fdd9a1f1984..2b944d4684b 100644 --- a/ace/OS_NS_sys_uio.inl +++ b/ace/OS_NS_sys_uio.inl @@ -28,10 +28,10 @@ ACE_OS::writev (ACE_HANDLE handle, #if defined (ACE_LACKS_WRITEV) ACE_OSCALL_RETURN (ACE_OS::writev_emulation (handle, (ACE_WRITEV_TYPE *) iov, - iovcnt), int, -1); + iovcnt), ssize_t, -1); #else /* ACE_LACKS_WRITEV */ ACE_OSCALL_RETURN (::writev (handle, (ACE_WRITEV_TYPE *) iov, - iovcnt), int, -1); + iovcnt), ssize_t, -1); #endif /* ACE_LACKS_WRITEV */ } diff --git a/ace/Process.cpp b/ace/Process.cpp index dd883954cd9..ca3559d6ade 100644 --- a/ace/Process.cpp +++ b/ace/Process.cpp @@ -102,9 +102,15 @@ ACE_Process::spawn (ACE_Process_Options &options) h != ACE_INVALID_HANDLE && curr_len + 20 < max_len; h = h_iter ()) { +#if defined (ACE_WIN64) + curr_len += ACE_OS::sprintf (&cmd_line_buf[curr_len], + ACE_LIB_TEXT (" +H %I64d"), + h); +#else curr_len += ACE_OS::sprintf (&cmd_line_buf[curr_len], ACE_LIB_TEXT (" +H %d"), h); +#endif /* ACE_WIN64 */ } } diff --git a/ace/SOCK_SEQPACK_Acceptor.cpp b/ace/SOCK_SEQPACK_Acceptor.cpp index 147eda28514..af93dbb9186 100644 --- a/ace/SOCK_SEQPACK_Acceptor.cpp +++ b/ace/SOCK_SEQPACK_Acceptor.cpp @@ -401,11 +401,12 @@ ACE_SOCK_SEQPACK_Acceptor::shared_open (const ACE_Multihomed_INET_Addr &local_sa } #else // Call bind + size_t name_len = (sizeof local_inet_addr) * num_addresses; if (ACE_OS::bind (this->get_handle (), ACE_reinterpret_cast (sockaddr *, local_inet_addrs), - (sizeof local_inet_addr)*num_addresses) == -1) - error = 1; + ACE_static_cast (int, name_len)) == -1) + error = 1; #endif /* ACE_HAS_LKSCTP */ } diff --git a/ace/SOCK_SEQPACK_Association.cpp b/ace/SOCK_SEQPACK_Association.cpp index 3b62bc0ed4c..2b61ecad6d6 100644 --- a/ace/SOCK_SEQPACK_Association.cpp +++ b/ace/SOCK_SEQPACK_Association.cpp @@ -1,4 +1,4 @@ -// SOCK_SEQPACK_Association.cpp +// $Id$ #include "ace/SOCK_SEQPACK_Association.h" @@ -138,33 +138,39 @@ ACE_SOCK_SEQPACK_Association::get_local_addrs (ACE_INET_Addr *addrs, size_t &siz // Physical size of this array is its logical size multiplied by // the physical size of one of its elements. - int physical_size = size * sizeof(sockaddr_in); + size_t physical_size = size * sizeof(sockaddr_in); /* Clear the array */ ACE_OS::memset(addr_structs.get(), 0, physical_size); - /* Populate the array with real values from the getsockname system - call. The variables addr_structs and phycisal_size are - modified. */ + /* + ** Populate the array with real values from the getsockname system + ** call. addr_structs is modified, and name_size is modified to contain + ** the number of bytes written to addr_structs. + ** Use name_size to get the data types right across the call. + */ + int name_size = ACE_static_cast (int, physical_size); if (ACE_OS::getsockname (this->get_handle (), ACE_reinterpret_cast (sockaddr *, addr_structs.get()), - &physical_size) == -1) + &name_size) == -1) return -1; /* Calculate the NEW physical size of the array */ - size = physical_size / sizeof (sockaddr_in); + name_size /= sizeof (sockaddr_in); + size = ACE_static_cast (size_t, name_size); /* Copy each sockaddr_in to the address structure of an ACE_Addr from the passed-in array */ - for (size_t i = 0; i < size; ++i) { - - addrs[i].set_addr(&(addr_structs[i]), sizeof(sockaddr_in)); - addrs[i].set_type(addr_structs[i].sin_family); - addrs[i].set_size(sizeof(sockaddr_in)); - } + const int addrlen (ACE_static_cast (int, sizeof (sockaddr_in))); + for (int i = 0; i < name_size; ++i) + { + addrs[i].set_addr (&(addr_structs[i]), addrlen); + addrs[i].set_type (addr_structs[i].sin_family); + addrs[i].set_size (addrlen); + } #endif /* ACE_HAS_LKSCTP */ return 0; } @@ -269,33 +275,39 @@ ACE_SOCK_SEQPACK_Association::get_remote_addrs (ACE_INET_Addr *addrs, size_t &si // Physical size of this array is its logical size multiplied by // the physical size of one of its elements. - int physical_size = size * sizeof(sockaddr_in); + size_t physical_size = size * sizeof(sockaddr_in); /* Clear the array */ ACE_OS::memset(addr_structs.get(), 0, physical_size); - /* Populate the array with real values from the getpeername system - call. The variables addr_structs and phycisal_size are - modified. */ + /* + ** Populate the array with real values from the getpeername system + ** call. addr_structs is modified, and name_size is modified to contain + ** the number of bytes written to addr_structs. + ** Use name_size to get the data types right across the call. + */ + int name_size = ACE_static_cast (int, physical_size); if (ACE_OS::getpeername (this->get_handle (), ACE_reinterpret_cast (sockaddr *, addr_structs.get()), - &physical_size) == -1) + &name_size) == -1) return -1; /* Calculate the NEW physical size of the array */ - size = physical_size / sizeof (sockaddr_in); + name_size /= sizeof (sockaddr_in); + size = ACE_static_cast (size_t, name_size); /* Copy each sockaddr_in to the address structure of an ACE_Addr from the passed-in array */ - for (size_t i = 0; i < size; ++i) { - - addrs[i].set_addr(&(addr_structs[i]), sizeof(sockaddr_in)); - addrs[i].set_type(addr_structs[i].sin_family); - addrs[i].set_size(sizeof(sockaddr_in)); - } + const int addrlen (ACE_static_cast (int, sizeof (sockaddr_in))); + for (int i = 0; i < name_size; ++i) + { + addrs[i].set_addr (&(addr_structs[i]), addrlen); + addrs[i].set_type (addr_structs[i].sin_family); + addrs[i].set_size (addrlen); + } #endif /* ACE_HAS_LKSCTP */ return 0; } diff --git a/ace/SOCK_SEQPACK_Association.h b/ace/SOCK_SEQPACK_Association.h index 457bfa62679..88281ded0fa 100644 --- a/ace/SOCK_SEQPACK_Association.h +++ b/ace/SOCK_SEQPACK_Association.h @@ -122,7 +122,7 @@ public: /// Receive an <iovec> of size <iovcnt> from the connected socket. ssize_t recvv_n (iovec iov[], - size_t iovcnt, + int iovcnt, const ACE_Time_Value *timeout = 0, size_t *bytes_transferred = 0) const; @@ -148,7 +148,7 @@ public: /// Send an <iovec> of size <iovcnt> to the connected socket. ssize_t sendv_n (const iovec iov[], - size_t iovcnt, + int iovcnt, const ACE_Time_Value *timeout = 0, size_t *bytes_transferred = 0) const; diff --git a/ace/SOCK_SEQPACK_Association.i b/ace/SOCK_SEQPACK_Association.i index bcb837d40b8..ea7547b751c 100644 --- a/ace/SOCK_SEQPACK_Association.i +++ b/ace/SOCK_SEQPACK_Association.i @@ -77,9 +77,9 @@ ACE_SOCK_SEQPACK_Association::recv_n (void *buf, ASYS_INLINE ssize_t ACE_SOCK_SEQPACK_Association::recvv_n (iovec iov[], - size_t n, - const ACE_Time_Value *timeout, - size_t *bytes_transferred) const + int n, + const ACE_Time_Value *timeout, + size_t *bytes_transferred) const { ACE_TRACE ("ACE_SOCK_SEQPACK_Association::recvv_n"); return ACE::recvv_n (this->get_handle (), @@ -121,9 +121,9 @@ ACE_SOCK_SEQPACK_Association::send_n (const void *buf, ASYS_INLINE ssize_t ACE_SOCK_SEQPACK_Association::sendv_n (const iovec iov[], - size_t n, - const ACE_Time_Value *timeout, - size_t *bytes_transferred) const + int n, + const ACE_Time_Value *timeout, + size_t *bytes_transferred) const { ACE_TRACE ("ACE_SOCK_SEQPACK_Association::sendv_n"); return ACE::sendv_n (this->get_handle (), diff --git a/ace/SOCK_SEQPACK_Connector.cpp b/ace/SOCK_SEQPACK_Connector.cpp index 5a22f2e13be..3f6bab72479 100644 --- a/ace/SOCK_SEQPACK_Connector.cpp +++ b/ace/SOCK_SEQPACK_Connector.cpp @@ -88,7 +88,7 @@ ACE_SOCK_SEQPACK_Connector::shared_connect_start (ACE_SOCK_SEQPACK_Association & { sockaddr *laddr = ACE_reinterpret_cast (sockaddr *, local_sap.get_addr ()); - size_t size = local_sap.get_size (); + int size = local_sap.get_size (); if (ACE_OS::bind (new_association.get_handle (), laddr, @@ -200,10 +200,11 @@ ACE_SOCK_SEQPACK_Connector::shared_connect_start (ACE_SOCK_SEQPACK_Association & #else // Call bind + size_t name_len = (sizeof sockaddr_in) * num_addresses; if (ACE_OS::bind (new_association.get_handle (), ACE_reinterpret_cast (sockaddr *, local_inet_addrs), - (sizeof (sockaddr_in))*num_addresses) == -1) + ACE_static_cast (int, name_len)) == -1) { // Save/restore errno. ACE_Errno_Guard error (errno); diff --git a/ace/UUID.cpp b/ace/UUID.cpp index 343db734cc0..7275243855b 100644 --- a/ace/UUID.cpp +++ b/ace/UUID.cpp @@ -235,7 +235,7 @@ namespace ACE_Utils { // Get a buffer exactly the correct size. Use the nil UUID as a // gauge. Don't forget the trailing nul. - int UUID_STRING_LENGTH = 36 + thr_id_.length () + pid_.length (); + size_t UUID_STRING_LENGTH = 36 + thr_id_.length () + pid_.length (); char *buf; if ((thr_id_.length () != 0) && (pid_.length () != 0)) |