diff options
author | Ossama Othman <ossama-othman@users.noreply.github.com> | 2004-05-05 21:16:28 +0000 |
---|---|---|
committer | Ossama Othman <ossama-othman@users.noreply.github.com> | 2004-05-05 21:16:28 +0000 |
commit | adc6a560af058e98aeb7f752bcb07b90259fda3a (patch) | |
tree | ae0c901f25d09e86445be7783f6071190d823ed2 | |
parent | cc911e5d700d2d00980b987ae2fc925387ad506c (diff) | |
download | ATCD-adc6a560af058e98aeb7f752bcb07b90259fda3a.tar.gz |
ChangeLogTag:Wed May 5 14:14:53 2004 Ossama Othman <ossama@dre.vanderbilt.edu>
139 files changed, 1214 insertions, 1107 deletions
diff --git a/ChangeLog b/ChangeLog index edf582b362e..8a8135740a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,162 @@ +Wed May 5 14:14:53 2004 Ossama Othman <ossama@dre.vanderbilt.edu> + + * ace/Future.h (ACE_Future_Rep): + * ace/Map_Manager.h (ACE_Map_Manager): + * ace/Refcounted_Auto_Ptr.h: + + Declare lock members as "mutable" to avoid using a + const_cast<> hack in const methods that modify the lock + member through an ACE_GUARD. + + * ace/Future.cpp (get): + * ace/Map_Manager.i (current_size, total_size): + * ace/Refcounted_Auto_Ptr.i: + + Removed const_cast<> around lock member. It is no longer + needed since the lock member is now declared "mutable". + + * ace/CDR_Stream.h: + + Minor Doxygen documentation update. + + * ace/ACE.cpp: + * ace/ARGV.cpp: + * ace/ARGV.i: + * ace/ATM_Acceptor.cpp: + * ace/ATM_Connector.cpp: + * ace/ATM_Stream.cpp: + * ace/Acceptor.cpp: + * ace/Activation_Queue.cpp: + * ace/Arg_Shifter.cpp: + * ace/Asynch_Acceptor.cpp: + * ace/Asynch_Connector.cpp: + * ace/Asynch_IO.cpp: + * ace/Atomic_Op.cpp: + * ace/Atomic_Op.i: + * ace/Base_Thread_Adapter.cpp: + * ace/Based_Pointer_T.i: + * ace/Basic_Stats.cpp: + * ace/Basic_Types.h: + * ace/Basic_Types.i: + * ace/CDR_Base.cpp: + * ace/CDR_Base.inl: + * ace/CDR_Stream.cpp: + * ace/CDR_Stream.i: + * ace/Caching_Utility_T.cpp: + * ace/Cleanup.cpp: + * ace/Codecs.cpp: + * ace/Codeset_IBM1047.cpp: + * ace/Condition_T.inl: + * ace/Configuration.cpp: + * ace/Connector.cpp: + * ace/Containers_T.cpp: + * ace/DEV_Addr.i: + * ace/DEV_IO.cpp: + * ace/DEV_IO.i: + * ace/DLL.cpp: + * ace/DLL_Manager.cpp: + * ace/Dev_Poll_Reactor.cpp: + * ace/Dynamic_Service.cpp: + * ace/Env_Value_T.h: + * ace/FIFO_Recv_Msg.i: + * ace/FIFO_Send_Msg.cpp: + * ace/FIFO_Send_Msg.i: + * ace/FILE_Addr.cpp: + * ace/FILE_Connector.cpp: + * ace/FILE_IO.cpp: + * ace/FlReactor.cpp: + * ace/Framework_Component.cpp: + * ace/Functor_T.i: + * ace/Future_Set.cpp: + * ace/Get_Opt.cpp: + * ace/Global_Macros.h: + * ace/Hash_Map_Manager_T.cpp: + * ace/Hash_Map_Manager_T.i: + * ace/High_Res_Timer.cpp: + * ace/INET_Addr.cpp: + * ace/INET_Addr.i: + * ace/Lib_Find.cpp: + * ace/Local_Name_Space.cpp: + * ace/Log_Record.i: + * ace/MEM_Addr.cpp: + * ace/MEM_Connector.cpp: + * ace/MEM_IO.i: + * ace/MEM_SAP.i: + * ace/Malloc_T.cpp: + * ace/Malloc_T.i: + * ace/Mem_Map.cpp: + * ace/Mem_Map.i: + * ace/Memory_Pool.i: + * ace/Message_Queue.i: + * ace/Multihomed_INET_Addr.cpp: + * ace/Mutex.inl: + * ace/Name_Proxy.cpp: + * ace/Name_Request_Reply.cpp: + * ace/OS_NS_Thread.inl: + * ace/OS_NS_arpa_inet.inl: + * ace/OS_NS_dirent.inl: + * ace/OS_NS_dlfcn.inl: + * ace/OS_NS_math.inl: + * ace/OS_NS_netdb.inl: + * ace/OS_NS_signal.inl: + * ace/OS_NS_stdio.inl: + * ace/OS_NS_stdlib.inl: + * ace/OS_NS_string.inl: + * ace/OS_NS_stropts.inl: + * ace/OS_NS_sys_msg.inl: + * ace/OS_NS_sys_shm.inl: + * ace/OS_NS_sys_socket.inl: + * ace/OS_NS_sys_stat.inl: + * ace/OS_NS_time.inl: + * ace/OS_NS_unistd.inl: + * ace/OS_TLI.inl: + * ace/Object_Manager.i: + * ace/Obstack_T.i: + * ace/Process.cpp: + * ace/Process_Manager.cpp: + * ace/Profile_Timer.cpp: + * ace/RB_Tree.i: + * ace/Recursive_Thread_Mutex.inl: + * ace/Registry.cpp: + * ace/SOCK.cpp: + * ace/SOCK_Dgram.cpp: + * ace/SOCK_Dgram.i: + * ace/SOCK_IO.cpp: + * ace/SOCK_IO.i: + * ace/SPIPE_Addr.cpp: + * ace/SPIPE_Stream.cpp: + * ace/SString.i: + * ace/SUN_Proactor.cpp: + * ace/SV_Semaphore_Simple.cpp: + * ace/SV_Semaphore_Simple.h: + * ace/Select_Reactor_Base.cpp: + * ace/Service_Config.cpp: + * ace/Service_Manager.cpp: + * ace/Service_Object.cpp: + * ace/Service_Types.cpp: + * ace/Service_Types.i: + * ace/Shared_Memory_MM.i: + * ace/Shared_Memory_SV.i: + * ace/Signal.i: + * ace/Stats.cpp: + * ace/Strategies_T.cpp: + * ace/String_Base.cpp: + * ace/String_Base.i: + * ace/Svc_Conf.h: + * ace/Task.cpp: + * ace/Thread_Adapter.cpp: + * ace/Thread_Manager.i: + * ace/Time_Value.inl: + * ace/Typed_SV_Message_Queue.i: + * ace/ace_wchar.inl: + + Converted all uses of ACE cast macros to their corresponding + ANSI C++ equivalent. The ACE cast macros are deprecated. + + * ace/OS_NS_fcntl.h: + + Nuked trailing whitespace. + Wed May 5 16:16:33 2004 Steve Huston <shuston@riverace.com> * ace/WIN32_Proactor.cpp (post_completion): reinterpret_cast the void* @@ -75,7 +234,7 @@ Tue May 4 18:16:33 2004 Steve Huston <shuston@riverace.com> Tue May 4 09:51:24 2004 Balachandran Natarajan <bala@dre.vanderbilt.edu> * bin/make_release: - + Fix for [BUG 1798]. Thanks to Johnny for reporting this bug. Mon May 3 18:12:30 2004 Steve Huston <shuston@riverace.com> diff --git a/ace/ACE.cpp b/ace/ACE.cpp index 4075946fdcd..f8c7c741748 100644 --- a/ace/ACE.cpp +++ b/ace/ACE.cpp @@ -795,7 +795,7 @@ ACE::recv_n_i (ACE_HANDLE handle, } } - return ACE_static_cast (ssize_t, bytes_transferred); + return static_cast<ssize_t> (bytes_transferred); } ssize_t @@ -862,7 +862,7 @@ ACE::recv_n_i (ACE_HANDLE handle, if (error) return result; else - return ACE_static_cast (ssize_t, bytes_transferred); + return static_cast<ssize_t> (bytes_transferred); } #if defined (ACE_HAS_TLI) @@ -1034,7 +1034,7 @@ ACE::recv_n_i (ACE_HANDLE handle, } } - return ACE_static_cast (ssize_t, bytes_transferred); + return static_cast<ssize_t> (bytes_transferred); } ssize_t @@ -1099,7 +1099,7 @@ ACE::recv_n_i (ACE_HANDLE handle, if (error) return result; else - return ACE_static_cast (ssize_t, bytes_transferred); + return static_cast<ssize_t> (bytes_transferred); } // This is basically an interface to ACE_OS::readv, that doesn't use @@ -1112,7 +1112,7 @@ ssize_t ACE::recv (ACE_HANDLE handle, size_t n, ...) { va_list argp; - int total_tuples = ACE_static_cast (int, (n / 2)); + int total_tuples = static_cast<int> (n / 2); iovec *iovp; #if defined (ACE_HAS_ALLOCA) iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); @@ -1214,15 +1214,13 @@ ACE::recvv_n_i (ACE_HANDLE handle, for (bytes_transferred += n; s < iovcnt - && n >= ACE_static_cast (ssize_t, - iov[s].iov_len); + && n >= static_cast<ssize_t> (iov[s].iov_len); s++) n -= iov[s].iov_len; if (n != 0) { - char *base = ACE_static_cast (char *, - iov[s].iov_base); + char *base = static_cast<char *> (iov[s].iov_base); iov[s].iov_base = base + n; iov[s].iov_len = iov[s].iov_len - n; } @@ -1289,15 +1287,13 @@ ACE::recvv_n_i (ACE_HANDLE handle, for (bytes_transferred += n; s < iovcnt - && n >= ACE_static_cast (ssize_t, - iov[s].iov_len); + && n >= static_cast<ssize_t> (iov[s].iov_len); s++) n -= iov[s].iov_len; if (n != 0) { - char *base = ACE_reinterpret_cast (char *, - iov[s].iov_base); + char *base = reinterpret_cast<char *> (iov[s].iov_base); iov[s].iov_base = base + n; iov[s].iov_len = iov[s].iov_len - n; } @@ -1343,7 +1339,7 @@ ACE::recv_n (ACE_HANDLE handle, this_chunk_length = ULONG_MAX; else this_chunk_length = - ACE_static_cast (u_long, current_message_block_length); + static_cast<u_long> (current_message_block_length); // Collect the data in the iovec. iov[iovcnt].iov_base = this_rd_ptr; iov[iovcnt].iov_len = this_chunk_length; @@ -1921,7 +1917,7 @@ ssize_t ACE::send (ACE_HANDLE handle, size_t n, ...) { va_list argp; - int total_tuples = ACE_static_cast (int, (n / 2)); + int total_tuples = static_cast<int> (n / 2); iovec *iovp; #if defined (ACE_HAS_ALLOCA) iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); @@ -1986,7 +1982,7 @@ ACE::sendv_n_i (ACE_HANDLE handle, size_t &bytes_transferred = bt == 0 ? temp : *bt; bytes_transferred = 0; - iovec *iov = ACE_const_cast (iovec *, i); + iovec *iov = const_cast<iovec *> (i); for (int s = 0; s < iovcnt; @@ -2025,15 +2021,13 @@ ACE::sendv_n_i (ACE_HANDLE handle, for (bytes_transferred += n; s < iovcnt - && n >= ACE_static_cast (ssize_t, - iov[s].iov_len); + && n >= static_cast<ssize_t> (iov[s].iov_len); s++) n -= iov[s].iov_len; if (n != 0) { - char *base = ACE_reinterpret_cast (char *, - iov[s].iov_base); + char *base = reinterpret_cast<char *> (iov[s].iov_base); iov[s].iov_base = base + n; iov[s].iov_len = iov[s].iov_len - n; } @@ -2058,7 +2052,7 @@ ACE::sendv_n_i (ACE_HANDLE handle, int val = 0; ACE::record_and_set_non_blocking_mode (handle, val); - iovec *iov = ACE_const_cast (iovec *, i); + iovec *iov = const_cast<iovec *> (i); for (int s = 0; s < iovcnt; @@ -2102,15 +2096,13 @@ ACE::sendv_n_i (ACE_HANDLE handle, for (bytes_transferred += n; s < iovcnt - && n >= ACE_static_cast (ssize_t, - iov[s].iov_len); + && n >= static_cast<ssize_t> (iov[s].iov_len); s++) n -= iov[s].iov_len; if (n != 0) { - char *base = ACE_reinterpret_cast (char *, - iov[s].iov_base); + char *base = reinterpret_cast<char *> (iov[s].iov_base); iov[s].iov_base = base + n; iov[s].iov_len = iov[s].iov_len - n; } @@ -2155,7 +2147,7 @@ ACE::write_n (ACE_HANDLE handle, this_chunk_length = ULONG_MAX; else this_chunk_length = - ACE_static_cast (u_long, current_message_block_length); + static_cast<u_long> (current_message_block_length); // Collect the data in the iovec. iov[iovcnt].iov_base = this_block_ptr; iov[iovcnt].iov_len = this_chunk_length; @@ -2253,7 +2245,7 @@ ACE::send_n (ACE_HANDLE handle, this_chunk_length = ULONG_MAX; else this_chunk_length = - ACE_static_cast (u_long, current_message_block_length); + static_cast<u_long> (current_message_block_length); // Collect the data in the iovec. iov[iovcnt].iov_base = this_block_ptr; iov[iovcnt].iov_len = this_chunk_length; @@ -2344,15 +2336,13 @@ ACE::readv_n (ACE_HANDLE handle, for (bytes_transferred += n; s < iovcnt - && n >= ACE_static_cast (ssize_t, - iov[s].iov_len); + && n >= static_cast<ssize_t> (iov[s].iov_len); s++) n -= iov[s].iov_len; if (n != 0) { - char *base = ACE_reinterpret_cast (char *, - iov[s].iov_base); + char *base = reinterpret_cast<char *> (iov[s].iov_base); iov[s].iov_base = base + n; iov[s].iov_len = iov[s].iov_len - n; } @@ -2371,7 +2361,7 @@ ACE::writev_n (ACE_HANDLE handle, size_t &bytes_transferred = bt == 0 ? temp : *bt; bytes_transferred = 0; - iovec *iov = ACE_const_cast (iovec *, i); + iovec *iov = const_cast<iovec *> (i); for (int s = 0; s < iovcnt; @@ -2385,15 +2375,13 @@ ACE::writev_n (ACE_HANDLE handle, for (bytes_transferred += n; s < iovcnt - && n >= ACE_static_cast (ssize_t, - iov[s].iov_len); + && n >= static_cast<ssize_t> (iov[s].iov_len); s++) n -= iov[s].iov_len; if (n != 0) { - char *base = ACE_reinterpret_cast (char *, - iov[s].iov_base); + char *base = reinterpret_cast<char *> (iov[s].iov_base); iov[s].iov_base = base + n; iov[s].iov_len = iov[s].iov_len - n; } @@ -3392,9 +3380,8 @@ ACE::strndup (const wchar_t *str, size_t n) wchar_t *s; ACE_ALLOCATOR_RETURN (s, - ACE_static_cast (wchar_t *, - ACE_OS::malloc ((len + 1) - * sizeof (wchar_t))), + static_cast<wchar_t *> ( + ACE_OS::malloc ((len + 1) * sizeof (wchar_t))), 0); return ACE_OS::strsncpy (s, str, len + 1); } diff --git a/ace/ARGV.cpp b/ace/ARGV.cpp index 448fa0a753f..a38f09eccdd 100644 --- a/ace/ARGV.cpp +++ b/ace/ARGV.cpp @@ -27,7 +27,7 @@ ACE_ARGV::dump (void) const ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("argc_ = %d"), this->argc_)); - ACE_ARGV *this_obj = ACE_const_cast (ACE_ARGV *, this); + ACE_ARGV *this_obj = const_cast<ACE_ARGV *> (this); for (int i = 0; i < this->argc_; i++) ACE_DEBUG ((LM_DEBUG, diff --git a/ace/ARGV.i b/ace/ARGV.i index bb62b91259e..00c465f6250 100644 --- a/ace/ARGV.i +++ b/ace/ARGV.i @@ -60,11 +60,8 @@ ACE_ARGV::operator[] (size_t i) ACE_TRACE ("ACE_ARGV::operator[]"); // Don't go out of bounds. - if (i >= ACE_static_cast (size_t, this->argc_)) + if (i >= static_cast<size_t> (this->argc_)) return 0; return (const ACE_TCHAR *) this->argv ()[i]; } - - - diff --git a/ace/ATM_Acceptor.cpp b/ace/ATM_Acceptor.cpp index 08a5af64d68..65db53062dc 100644 --- a/ace/ATM_Acceptor.cpp +++ b/ace/ATM_Acceptor.cpp @@ -29,7 +29,7 @@ ACE_ATM_Acceptor::~ACE_ATM_Acceptor (void) ACE_TRACE ("ACE_ATM_Acceptor::~ACE_ATM_Acceptor"); } -int +int ACE_ATM_Acceptor::get_local_addr (ACE_ATM_Addr &local_addr) { ACE_TRACE ("ACE_ATM_Acceptor::get_local_addr"); @@ -40,34 +40,34 @@ ACE_ATM_Acceptor::get_local_addr (ACE_ATM_Addr &local_addr) ATM_ADDRESS addr; struct sockaddr_atm *laddr; - if (::WSAIoctl ((int) ((ACE_SOCK_Acceptor *)this) -> get_handle (), - SIO_GET_ATM_ADDRESS, - (LPVOID) &deviceID, - sizeof (DWORD), + if (::WSAIoctl ((int) ((ACE_SOCK_Acceptor *)this) -> get_handle (), + SIO_GET_ATM_ADDRESS, + (LPVOID) &deviceID, + sizeof (DWORD), (LPVOID)&addr, sizeof (ATM_ADDRESS), &ret, 0, 0) == SOCKET_ERROR) { - ACE_OS::printf ("ATM_Acceptor (get_local_addr): WSIoctl: %d\n", + ACE_OS::printf ("ATM_Acceptor (get_local_addr): WSIoctl: %d\n", ::WSAGetLastError ()); return -1; } laddr = (struct sockaddr_atm *)local_addr.get_addr (); - ACE_OS::memcpy ((void *)& (laddr -> satm_number), - (void *)&addr, + ACE_OS::memcpy ((void *)& (laddr -> satm_number), + (void *)&addr, ATM_ADDR_SIZE - 1); return 0; #elif defined (ACE_HAS_FORE_ATM_XTI) ACE_UNUSED_ARG (local_addr); - + return 0; #elif defined (ACE_HAS_LINUX_ATM) ATM_Addr *myaddr = (ATM_Addr *)local_addr.get_addr (); int addrlen = sizeof (myaddr->sockaddratmsvc); - + if (ACE_OS::getsockname (acceptor_.get_handle (), (struct sockaddr *) & (myaddr->sockaddratmsvc), &addrlen) < 0) { @@ -127,23 +127,23 @@ ACE_ATM_Acceptor::open (const ACE_Addr &remote_sap, ACE_OS::memset ((void *) &local_atm_addr, 0, sizeof local_atm_addr); local_atm_addr.satm_family = AF_ATM; local_atm_addr.satm_number.AddressType = SAP_FIELD_ANY_AESA_REST; - local_atm_addr.satm_number.Addr[ ATM_ADDR_SIZE - 1 ] + local_atm_addr.satm_number.Addr[ ATM_ADDR_SIZE - 1 ] = ((ACE_ATM_Addr *)&remote_sap) -> get_selector (); local_atm_addr.satm_blli.Layer2Protocol = SAP_FIELD_ANY; local_atm_addr.satm_blli.Layer3Protocol = SAP_FIELD_ABSENT; local_atm_addr.satm_bhli.HighLayerInfoType = SAP_FIELD_ABSENT; /* Associate address with endpoint */ - if (ACE_OS::bind (( (ACE_SOCK_Acceptor *)this) -> get_handle (), - ACE_reinterpret_cast (struct sockaddr *, &local_atm_addr), + if (ACE_OS::bind (((ACE_SOCK_Acceptor *)this) -> get_handle (), + reinterpret_cast<struct sockaddr *> (&local_atm_addr), sizeof local_atm_addr) == -1) { - ACE_OS::printf ("Acceptor (open): bind %d\n", ::WSAGetLastError ()); + ACE_OS::printf ("Acceptor (open): bind %d\n", ::WSAGetLastError ()); return (ACE_INVALID_HANDLE); } /* Make endpoint listen for service requests */ - if (ACE_OS::listen (( (ACE_SOCK_Acceptor *)this) -> get_handle (), - backlog) + if (ACE_OS::listen (( (ACE_SOCK_Acceptor *)this) -> get_handle (), + backlog) == -1) { ACE_OS::printf ("Acceptor (open): listen %d\n", ::WSAGetLastError ()); return (ACE_INVALID_HANDLE); @@ -160,12 +160,12 @@ ACE_ATM_Acceptor::open (const ACE_Addr &remote_sap, ATM_QoS qos = def_qos.get_qos (); ACE_HANDLE handle; - if ((handle = ACE_OS::socket (params.get_protocol_family (), - params.get_type (), - params.get_protocol (), - params.get_protocol_info (), - params.get_sock_group (), - params.get_flags () + if ((handle = ACE_OS::socket (params.get_protocol_family (), + params.get_type (), + params.get_protocol (), + params.get_protocol_info (), + params.get_sock_group (), + params.get_flags () )) == ACE_INVALID_HANDLE) { ACE_DEBUG (LM_DEBUG, @@ -173,12 +173,12 @@ ACE_ATM_Acceptor::open (const ACE_Addr &remote_sap, errno); return (ACE_INVALID_HANDLE); } - + ((ACE_SOCK_Acceptor *)this) -> set_handle (handle); if (ACE_OS::setsockopt (handle, SOL_ATM, SO_ATMQOS, - ACE_reinterpret_cast (char*, &qos), + reinterpret_cast<char*> (&qos), sizeof (qos)) < 0) { ACE_OS::printf ("Acceptor (setsockopt): setsockopt:%d\n", errno); @@ -201,8 +201,8 @@ ACE_ATM_Acceptor::open (const ACE_Addr &remote_sap, local_sap.set_selector (( (ACE_ATM_Addr*)&remote_sap)->get_selector ()); if (ACE_OS::bind (handle, - ACE_reinterpret_cast (struct sockaddr *, - & (local_sap_addr->sockaddratmsvc)), + reinterpret_cast<struct sockaddr *> ( + &(local_sap_addr->sockaddratmsvc)), sizeof (local_sap_addr->sockaddratmsvc) ) == -1) { ACE_DEBUG (LM_DEBUG, @@ -212,7 +212,7 @@ ACE_ATM_Acceptor::open (const ACE_Addr &remote_sap, } // Make endpoint listen for service requests if (ACE_OS::listen (handle, - backlog) + backlog) == -1) { ACE_DEBUG (LM_DEBUG, ACE_LIB_TEXT ("Acceptor (listen): listen %d\n"), @@ -252,14 +252,13 @@ ACE_ATM_Acceptor::accept (ACE_ATM_Stream &new_sap, #elif defined (ACE_HAS_FORE_ATM_WS2) ACE_HANDLE n_handle; ACE_HANDLE s_handle = ((ACE_SOCK_Acceptor *) this) -> get_handle (); - struct sockaddr_atm *cli_addr + struct sockaddr_atm *cli_addr = (struct sockaddr_atm *)remote_addr -> get_addr (); - int caddr_len = sizeof (struct sockaddr_atm); + int caddr_len = sizeof (struct sockaddr_atm); do { n_handle = ACE_OS::accept (s_handle, - ACE_reinterpret_cast (struct sockaddr *, - cli_addr), + reinterpret_cast<struct sockaddr *> (cli_addr), &caddr_len); } while (n_handle == ACE_INVALID_HANDLE && errno == EINTR); @@ -277,10 +276,9 @@ ACE_ATM_Acceptor::accept (ACE_ATM_Stream &new_sap, if (ACE_OS::setsockopt (s_handle, SOL_ATM, SO_ATMQOS, - ACE_reinterpret_cast (char*, - &accept_qos), + reinterpret_cast<char*> (&accept_qos), sizeof (accept_qos)) < 0) { - ACE_OS::printf ("Acceptor (accept): error setting Qos"); + ACE_OS::printf ("Acceptor (accept): error setting Qos"); } return (acceptor_.accept (new_sap.get_stream (), diff --git a/ace/ATM_Connector.cpp b/ace/ATM_Connector.cpp index f4704038b6a..4dbda277787 100644 --- a/ace/ATM_Connector.cpp +++ b/ace/ATM_Connector.cpp @@ -24,12 +24,12 @@ ACE_ATM_Connector::ACE_ATM_Connector (void) // <timeout> amount of time if necessary. int -ACE_ATM_Connector::connect (ACE_ATM_Stream &new_stream, - const ACE_ATM_Addr &remote_sap, +ACE_ATM_Connector::connect (ACE_ATM_Stream &new_stream, + const ACE_ATM_Addr &remote_sap, ACE_ATM_Params params, ACE_ATM_QoS options, ACE_Time_Value *timeout, - const ACE_ATM_Addr &local_sap, + const ACE_ATM_Addr &local_sap, int reuse_addr, int flags, int perms) @@ -65,15 +65,15 @@ ACE_ATM_Connector::connect (ACE_ATM_Stream &new_stream, ACE_DEBUG(LM_DEBUG, ACE_LIB_TEXT ("ATM_Connector(connect): connecting...\n")); - int result = ACE_OS::connect( s, - ( struct sockaddr *)saddr, - sizeof( struct sockaddr_atm ), + int result = ACE_OS::connect( s, + ( struct sockaddr *)saddr, + sizeof( struct sockaddr_atm ), qos_params ); - - if ( result != 0 ) - ACE_OS::printf( "ATM_Connector(connect): connection failed, %d\n", + + if ( result != 0 ) + ACE_OS::printf( "ATM_Connector(connect): connection failed, %d\n", ::WSAGetLastError()); - + return result; #elif defined (ACE_HAS_LINUX_ATM) ACE_UNUSED_ARG (params); @@ -90,8 +90,7 @@ ACE_ATM_Connector::connect (ACE_ATM_Stream &new_stream, if (ACE_OS::setsockopt(handle, SOL_ATM, SO_ATMSAP, - ACE_reinterpret_cast(char*, - &(local_addr->atmsap)), + reinterpret_cast<char*> (&(local_addr->atmsap)), sizeof(local_addr->atmsap)) < 0) { ACE_OS::printf( "ATM_Connector(connect): unable to set atmsap %d\nContinuing...", errno); @@ -99,8 +98,7 @@ ACE_ATM_Connector::connect (ACE_ATM_Stream &new_stream, if (ACE_OS::setsockopt(handle, SOL_ATM, SO_ATMQOS, - ACE_reinterpret_cast(char*, - &qos), + reinterpret_cast<char*> (&qos), sizeof(qos)) < 0) { ACE_DEBUG((LM_DEBUG,ACE_LIB_TEXT ("ATM_Connector(connect): unable to set qos %d\n"), errno)); @@ -108,9 +106,9 @@ ACE_ATM_Connector::connect (ACE_ATM_Stream &new_stream, } int result = ACE_OS::connect(handle, - (struct sockaddr *)&(remote_addr->sockaddratmsvc), + (struct sockaddr *)&(remote_addr->sockaddratmsvc), sizeof( remote_addr->sockaddratmsvc)); - + if ( result != 0 ) ACE_DEBUG(LM_DEBUG, ACE_LIB_TEXT ("ATM_Connector(connect): connection failed, %d\n"), @@ -132,4 +130,3 @@ ACE_ATM_Connector::connect (ACE_ATM_Stream &new_stream, } #endif /* ACE_HAS_ATM */ - diff --git a/ace/ATM_Stream.cpp b/ace/ATM_Stream.cpp index fbcd1db85f5..6753783bbb8 100644 --- a/ace/ATM_Stream.cpp +++ b/ace/ATM_Stream.cpp @@ -16,13 +16,13 @@ char* ACE_ATM_Stream::get_peer_name (void) const { ACE_TRACE ("ACE_ATM_Stream::get_peer_name"); -#if defined (ACE_HAS_FORE_ATM_XTI) +#if defined (ACE_HAS_FORE_ATM_XTI) // // Use t_getprotaddr for XTI/ATM - // struct t_bind *localaddr + // struct t_bind *localaddr // = (struct t_bind *) ACE_OS::t_alloc (get_handle (), // T_BIND, // T_ADDR); - // struct t_bind *peeraddr + // struct t_bind *peeraddr // = (struct t_bind *) ACE_OS::t_alloc (get_handle (), // T_BIND, // T_ADDR); @@ -52,7 +52,7 @@ ACE_ATM_Stream::get_peer_name (void) const // &name); return (name.buf); -#elif defined (ACE_HAS_FORE_ATM_WS2) +#elif defined (ACE_HAS_FORE_ATM_WS2) // Use getpeername for WinSock2. struct sockaddr_atm name; ACE_OS::memset (&name, 0, sizeof (name)); @@ -72,7 +72,7 @@ ACE_ATM_Stream::get_peer_name (void) const buffer[ (ATM_ADDR_SIZE - 1) * 3 ] = '\0'; sprintf (buffer, "%s%02x.", buffer, 0); buffer[ ATM_ADDR_SIZE * 3 - 1 ] = '\0'; - for (index = 0; index < ACE_OS::strlen (buffer); ++index) + for (index = 0; index < ACE_OS::strlen (buffer); ++index) buffer[index] = tolower (buffer[index]); ifstream atm_hosts ("C:/WINNT/atmhosts"); @@ -86,9 +86,9 @@ ACE_ATM_Stream::get_peer_name (void) const while (!atm_hosts.eof ()) { atm_hosts.getline (line, 256); // Convert the line to lower case to ease comparison - for (index = 0; index < ACE_OS::strlen (line); ++index) + for (index = 0; index < ACE_OS::strlen (line); ++index) line[index] = tolower (line[index]); - if (ACE_OS::strstr (line, buffer) != 0) + if (ACE_OS::strstr (line, buffer) != 0) { char *strtok_p; // Grab the second token which is the host name @@ -100,7 +100,7 @@ ACE_ATM_Stream::get_peer_name (void) const } return host_name; -#elif defined (ACE_HAS_LINUX_ATM) +#elif defined (ACE_HAS_LINUX_ATM) ATM_Addr name; int nameSize = sizeof (name.sockaddratmsvc); @@ -114,7 +114,7 @@ ACE_ATM_Stream::get_peer_name (void) const static ACE_TCHAR buffer[MAX_ATM_ADDR_LEN + 1]; int total_len; if ((total_len = atm2text (buffer,sizeof buffer, - (struct sockaddr *) & (name.sockaddratmsvc), + (struct sockaddr *) & (name.sockaddratmsvc), A2T_PRETTY|A2T_NAME)) < 0) { ACE_DEBUG ((LM_DEBUG,ACE_LIB_TEXT ("ACE_ATM_Stream (get_peer_name) :%d"),errno)); return 0; @@ -130,7 +130,7 @@ ACE_HANDLE ACE_ATM_Stream::get_handle (void) const { ACE_TRACE ("ACE_ATM_Stream::get_handle"); -#if defined (ACE_HAS_FORE_ATM_XTI) || defined (ACE_HAS_FORE_ATM_WS2) || defined (ACE_HAS_LINUX_ATM) +#if defined (ACE_HAS_FORE_ATM_XTI) || defined (ACE_HAS_FORE_ATM_WS2) || defined (ACE_HAS_LINUX_ATM) return stream_.get_handle (); #else return 0; @@ -142,7 +142,7 @@ ACE_ATM_Stream::get_vpi_vci (ACE_UINT16 &vpi, ACE_UINT16 &vci) const { ACE_TRACE ("ACE_ATM_Stream::get_vpi_vci"); -#if defined (ACE_HAS_FORE_ATM_XTI) +#if defined (ACE_HAS_FORE_ATM_XTI) struct t_atm_conn_prop conn_prop; char* connect_opts = (char *) &conn_prop; int opt_size = sizeof (t_atm_conn_prop); @@ -150,14 +150,14 @@ ACE_ATM_Stream::get_vpi_vci (ACE_UINT16 &vpi, struct t_optmgmt opt_req, opt_ret; if (ACE_OS::t_getinfo (stream_.get_handle (), - &info) < 0) + &info) < 0) { ACE_OS::t_error ("t_getinfo"); return -1; } char *buf_req = (char *) ACE_OS::malloc (info.options); - if (buf_req == 0) + if (buf_req == 0) { ACE_OS::fprintf (stderr, "Unable to allocate %ld bytes for options\n", @@ -166,7 +166,7 @@ ACE_ATM_Stream::get_vpi_vci (ACE_UINT16 &vpi, } char *buf_ret = (char *) ACE_OS::malloc (info.options); - if (buf_ret == 0) + if (buf_ret == 0) { ACE_OS::fprintf (stderr, "Unable to allocate %ld bytes for options\n", @@ -215,19 +215,19 @@ ACE_ATM_Stream::get_vpi_vci (ACE_UINT16 &vpi, vpi = conn_prop.vpi; vci = conn_prop.vci; return (0); -#elif defined (ACE_HAS_FORE_ATM_WS2) +#elif defined (ACE_HAS_FORE_ATM_WS2) ATM_CONNECTION_ID connID; DWORD bytes = 0; - - if (::WSAIoctl ((int) this -> get_handle (), - SIO_GET_ATM_CONNECTION_ID, - 0, - 0, - (LPVOID) &connID, - sizeof (ATM_CONNECTION_ID), - &bytes, - 0, - 0) + + if (::WSAIoctl ((int) this -> get_handle (), + SIO_GET_ATM_CONNECTION_ID, + 0, + 0, + (LPVOID) &connID, + sizeof (ATM_CONNECTION_ID), + &bytes, + 0, + 0) == SOCKET_ERROR) { ACE_OS::printf ("Error: WSAIoctl %d\n", WSAGetLastError ()); } @@ -236,14 +236,14 @@ ACE_ATM_Stream::get_vpi_vci (ACE_UINT16 &vpi, vci = (ACE_UINT16) connID.VCI; return 0; -#elif defined (ACE_HAS_LINUX_ATM) +#elif defined (ACE_HAS_LINUX_ATM) #if defined (SO_ATMPVC) /* atm version>=0.62 */ struct sockaddr_atmpvc mypvcaddr; int addrpvclen = sizeof (mypvcaddr); if (ACE_OS::getsockopt (stream_.get_handle (), SOL_ATM, - SO_ATMPVC, - ACE_reinterpret_cast (char*,&mypvcaddr), + SO_ATMPVC, + reinterpret_cast<char*> (&mypvcaddr), &addrpvclen) < 0) { ACE_DEBUG (LM_DEBUG, ACE_LIB_TEXT ("ACE_ATM_Stream::get_vpi_vci: getsockopt %d\n"), @@ -255,11 +255,11 @@ ACE_ATM_Stream::get_vpi_vci (ACE_UINT16 &vpi, return 0; #elif defined (SO_VCID) /* patch for atm version 0.59 */ - struct atm_vcid mypvcid; + struct atm_vcid mypvcid; int pvcidlen = sizeof (mypvcid); if (ACE_OS::getsockopt (stream_.get_handle (), SOL_ATM,SO_VCID, - ACE_reinterpret_cast (char*,&mypvcid), + reinterpret_cast<char*> (&mypvcid), &pvcidlen) < 0) { ACE_DEBUG (LM_DEBUG, ACE_LIB_TEXT ("ACE_ATM_Stream::get_vpi_vci: getsockopt %d\n"), diff --git a/ace/Acceptor.cpp b/ace/Acceptor.cpp index 109b64de900..4f343653905 100644 --- a/ace/Acceptor.cpp +++ b/ace/Acceptor.cpp @@ -44,7 +44,7 @@ template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> ACE_PEER_ACCEPTOR & ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::acceptor (void) const { ACE_TRACE ("ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::acceptor"); - return ACE_const_cast (ACE_PEER_ACCEPTOR &, this->peer_acceptor_); + return const_cast<ACE_PEER_ACCEPTOR &> (this->peer_acceptor_); } // Returns ACE_HANDLE of the underlying Acceptor_Strategy. @@ -185,7 +185,7 @@ ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::info (ACE_TCHAR **strp, return -1; else ACE_OS::strsncpy (*strp, buf, length); - return ACE_static_cast (int, ACE_OS::strlen (buf)); + return static_cast<int> (ACE_OS::strlen (buf)); } template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int @@ -824,7 +824,7 @@ ACE_Strategy_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::info (ACE_TCHAR **strp, return -1; else ACE_OS::strsncpy (*strp, buf, length); - return ACE_static_cast (int, ACE_OS::strlen (buf)); + return static_cast<int> (ACE_OS::strlen (buf)); } template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int @@ -1178,7 +1178,7 @@ ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::info (ACE_TCHAR **strp, return -1; else ACE_OS::strsncpy (*strp, buf, length); - return ACE_static_cast (int, ACE_OS::strlen (buf)); + return static_cast<int> (ACE_OS::strlen (buf)); } template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int diff --git a/ace/Activation_Queue.cpp b/ace/Activation_Queue.cpp index 476bc900e25..b8ca36e00db 100644 --- a/ace/Activation_Queue.cpp +++ b/ace/Activation_Queue.cpp @@ -64,8 +64,7 @@ ACE_Activation_Queue::dequeue (ACE_Time_Value *tv) { // Get the next <Method_Request>. ACE_Method_Request *mr = - ACE_reinterpret_cast (ACE_Method_Request *, - mb->base ()); + reinterpret_cast<ACE_Method_Request *> (mb->base ()); // Delete the message block. mb->release (); return mr; @@ -84,8 +83,7 @@ ACE_Activation_Queue::enqueue (ACE_Method_Request *mr, // correctly. Since we also pass <mr> note that no unnecessary // memory is actually allocated -- just the size field is set. ACE_NEW_MALLOC_RETURN (mb, - ACE_static_cast(ACE_Message_Block *, - this->allocator_->malloc (sizeof (ACE_Message_Block))), + static_cast<ACE_Message_Block *> (this->allocator_->malloc (sizeof (ACE_Message_Block))), ACE_Message_Block (sizeof (*mr), // size ACE_Message_Block::MB_DATA, // type 0, // cont diff --git a/ace/Arg_Shifter.cpp b/ace/Arg_Shifter.cpp index 5504c03ecf9..358746e23fc 100644 --- a/ace/Arg_Shifter.cpp +++ b/ace/Arg_Shifter.cpp @@ -133,7 +133,7 @@ ACE_Arg_Shifter::cur_arg_strncasecmp (const ACE_TCHAR *flag) size_t remaining = ACE_OS::strspn (this->temp_[current_index_] + flag_length, ACE_LIB_TEXT (" ")) + flag_length; - return ACE_static_cast (int, remaining); + return static_cast<int> (remaining); } } } diff --git a/ace/Asynch_Acceptor.cpp b/ace/Asynch_Acceptor.cpp index bd2ef107a17..3d7c5c0a60b 100644 --- a/ace/Asynch_Acceptor.cpp +++ b/ace/Asynch_Acceptor.cpp @@ -122,8 +122,7 @@ ACE_Asynch_Acceptor<HANDLER>::open (const ACE_INET_Addr &address, // Bind to the specified port. if (ACE_OS::bind (this->listen_handle_, - ACE_reinterpret_cast (sockaddr *, - address.get_addr ()), + reinterpret_cast<sockaddr *> (address.get_addr ()), address.get_size ()) == -1) { ACE_Errno_Guard g (errno); @@ -383,17 +382,17 @@ ACE_Asynch_Acceptor<HANDLER>::parse_address (const int remote_size = 0; ::GetAcceptExSockaddrs (message_block.rd_ptr (), - ACE_static_cast (DWORD, this->bytes_to_read_), - ACE_static_cast (DWORD, this->address_size ()), - ACE_static_cast (DWORD, this->address_size ()), + static_cast<DWORD> (this->bytes_to_read_), + static_cast<DWORD> (this->address_size ()), + static_cast<DWORD> (this->address_size ()), &local_addr, &local_size, &remote_addr, &remote_size); - local_address.set (ACE_reinterpret_cast (sockaddr_in *, local_addr), + local_address.set (reinterpret_cast<sockaddr_in *> (local_addr), local_size); - remote_address.set (ACE_reinterpret_cast (sockaddr_in *, remote_addr), + remote_address.set (reinterpret_cast<sockaddr_in *> (remote_addr), remote_size); #else // just in case diff --git a/ace/Asynch_Connector.cpp b/ace/Asynch_Connector.cpp index 5519ee73842..927a70e6aa8 100644 --- a/ace/Asynch_Connector.cpp +++ b/ace/Asynch_Connector.cpp @@ -203,8 +203,7 @@ ACE_Asynch_Connector<HANDLER>::parse_address (const ACE_Asynch_Connect::Result & // Get the local address. if (ACE_OS::getsockname (result.connect_handle (), - ACE_reinterpret_cast (sockaddr *, - &local_addr), + reinterpret_cast<sockaddr *> (&local_addr), &local_size) < 0) ACE_ERROR ((LM_ERROR, ACE_LIB_TEXT("%p\n"), @@ -212,19 +211,16 @@ ACE_Asynch_Connector<HANDLER>::parse_address (const ACE_Asynch_Connect::Result & // Get the remote address. if (ACE_OS::getpeername (result.connect_handle (), - ACE_reinterpret_cast (sockaddr *, - &remote_addr), + reinterpret_cast<sockaddr *> (&remote_addr), &remote_size) < 0) ACE_ERROR ((LM_ERROR, ACE_LIB_TEXT("%p\n"), ACE_LIB_TEXT("ACE_Asynch_Connector::<getpeername> failed"))); // Set the addresses. - local_address.set (ACE_reinterpret_cast (sockaddr_in *, - &local_addr), + local_address.set (reinterpret_cast<sockaddr_in *> (&local_addr), local_size); - remote_address.set (ACE_reinterpret_cast (sockaddr_in *, - &remote_addr), + remote_address.set (reinterpret_cast<sockaddr_in *> (&remote_addr), remote_size); #if 0 diff --git a/ace/Asynch_IO.cpp b/ace/Asynch_IO.cpp index dd51bc3312a..93d33c6f6ca 100644 --- a/ace/Asynch_IO.cpp +++ b/ace/Asynch_IO.cpp @@ -79,7 +79,7 @@ ACE_Asynch_Result::ACE_Asynch_Result (ACE_Asynch_Result_Impl *implementation) ACE_Asynch_Result::~ACE_Asynch_Result (void) { - // Proactor deletes the implementation when the <complete> finishes. + // Proactor deletes the implementation when the <complete> finishes. } ACE_Asynch_Result_Impl * @@ -163,14 +163,14 @@ ACE_Asynch_Read_Stream::open (ACE_Handler &handler, // Now let us get the implementation initialized. if ((this->implementation_ = proactor->create_asynch_read_stream ()) == 0) return -1; - - // Call the <open> method of the base class. + + // Call the <open> method of the base class. return ACE_Asynch_Operation::open (handler, handle, completion_key, proactor); } - + int ACE_Asynch_Read_Stream::read (ACE_Message_Block &message_block, size_t bytes_to_read, @@ -228,7 +228,7 @@ ACE_Asynch_Read_Stream::Result::handle (void) const } ACE_Asynch_Read_Stream::Result::Result (ACE_Asynch_Read_Stream_Result_Impl *implementation) - : ACE_Asynch_Result (implementation), + : ACE_Asynch_Result (implementation), implementation_ (implementation) { } @@ -271,7 +271,7 @@ ACE_Asynch_Write_Stream::open (ACE_Handler &handler, // Now let us get the implementation initialized. if ((this->implementation_ = proactor->create_asynch_write_stream ()) == 0) return -1; - + // Call the <open> method of the base class. return ACE_Asynch_Operation::open (handler, handle, @@ -358,14 +358,14 @@ ACE_Asynch_Write_Stream::Result::implementation (void) const ACE_Asynch_Read_File::ACE_Asynch_Read_File (void) : implementation_ (0) { -} +} ACE_Asynch_Read_File::~ACE_Asynch_Read_File (void) { // Delete the implementation. delete this->implementation_; this->implementation_ = 0; -} +} int ACE_Asynch_Read_File::open (ACE_Handler &handler, @@ -379,7 +379,7 @@ ACE_Asynch_Read_File::open (ACE_Handler &handler, // Now let us get the implementation initialized. if ((this->implementation_ = proactor->create_asynch_read_file ()) == 0) return -1; - + // Call the <open> method of the base class. return ACE_Asynch_Operation::open (handler, handle, @@ -438,7 +438,7 @@ ACE_Asynch_Read_File::Result::Result (ACE_Asynch_Read_File_Result_Impl *implemen implementation_ (implementation) { } - + ACE_Asynch_Read_File::Result::~Result (void) { // Proactor will delete the implementation when <complete> call @@ -477,7 +477,7 @@ ACE_Asynch_Write_File::open (ACE_Handler &handler, // Now let us get the implementation initialized. if ((this->implementation_ = proactor->create_asynch_write_file ()) == 0) return -1; - + // Call the <open> method of the base class. return ACE_Asynch_Operation::open (handler, handle, @@ -540,7 +540,7 @@ ACE_Asynch_Write_File::Result::Result (ACE_Asynch_Write_File_Result_Impl *implem ACE_Asynch_Write_File::Result::~Result (void) { // Proactor will delete the implementation when the <complete> call - // completes. + // completes. } ACE_Asynch_Write_File_Result_Impl * @@ -575,7 +575,7 @@ ACE_Asynch_Accept::open (ACE_Handler &handler, // Now let us get the implementation initialized. if ((this->implementation_ = proactor->create_asynch_accept ()) == 0) return -1; - + // Call the <open> method of the base class. return ACE_Asynch_Operation::open (handler, handle, @@ -677,7 +677,7 @@ ACE_Asynch_Connect::open (ACE_Handler &handler, // Now let us get the implementation initialized. if ((this->implementation_ = proactor->create_asynch_connect ()) == 0) return -1; - + // Call the <open> method of the base class. return ACE_Asynch_Operation::open (handler, handle, @@ -762,7 +762,7 @@ ACE_Asynch_Transmit_File::open (ACE_Handler &handler, // Now let us get the implementation initialized. if ((this->implementation_ = proactor->create_asynch_transmit_file ()) == 0) return -1; - + // Call the <open> method of the base class. return ACE_Asynch_Operation::open (handler, handle, @@ -947,7 +947,7 @@ ACE_Asynch_Transmit_File::Header_And_Trailer::transmit_buffers (void) this->transmit_buffers_.Head = this->header_->rd_ptr (); #if defined(ACE_WIN64) this->transmit_buffers_.HeadLength = - ACE_static_cast (DWORD, this->header_bytes_); + static_cast<DWORD> (this->header_bytes_); #else this->transmit_buffers_.HeadLength = this->header_bytes_; #endif /* ACE_WIN64 */ @@ -964,7 +964,7 @@ ACE_Asynch_Transmit_File::Header_And_Trailer::transmit_buffers (void) this->transmit_buffers_.Tail = this->trailer_->rd_ptr (); #if defined(ACE_WIN64) this->transmit_buffers_.TailLength = - ACE_static_cast (DWORD, this->trailer_bytes_); + static_cast<DWORD> (this->trailer_bytes_); #else this->transmit_buffers_.TailLength = this->trailer_bytes_; #endif /* ACE_WIN64 */ @@ -1131,7 +1131,7 @@ ACE_Asynch_Read_Dgram::open (ACE_Handler &handler, if ((this->implementation_ = proactor->create_asynch_read_dgram ()) == 0) return -1; - // Call the <open> method of the base class. + // Call the <open> method of the base class. return ACE_Asynch_Operation::open (handler, handle, completion_key, @@ -1237,7 +1237,7 @@ ACE_Asynch_Write_Dgram::open (ACE_Handler &handler, // Now let us get the implementation initialized. if ((this->implementation_ = proactor->create_asynch_write_dgram ()) == 0) return -1; - + // Call the <open> method of the base class. return ACE_Asynch_Operation::open (handler, handle, diff --git a/ace/Atomic_Op.cpp b/ace/Atomic_Op.cpp index daa6f93e98a..3aec838b006 100644 --- a/ace/Atomic_Op.cpp +++ b/ace/Atomic_Op.cpp @@ -3,7 +3,9 @@ #include "ace/Atomic_Op.h" #include "ace/OS_NS_unistd.h" -ACE_RCSID(ace, Atomic_Op, "$Id$") +ACE_RCSID (ace, + Atomic_Op, + "$Id$") #if !defined (__ACE_INLINE__) #include "ace/Atomic_Op.i" @@ -56,7 +58,7 @@ ACE_Atomic_Op<ACE_Thread_Mutex, long>::single_cpu_increment (volatile long *valu { #if defined (__GNUC__) && defined (ACE_HAS_PENTIUM) long tmp = 1; - unsigned long addr = ACE_reinterpret_cast (unsigned long, value); + unsigned long addr = reinterpret_cast<unsigned long> (value); asm( "xadd %0, (%1)" : "+r"(tmp) : "r"(addr) ); return tmp + 1; #else /* __GNUC__ && ACE_HAS_PENTIUM */ @@ -70,7 +72,7 @@ ACE_Atomic_Op<ACE_Thread_Mutex, long>::single_cpu_decrement (volatile long *valu { #if defined (__GNUC__) && defined (ACE_HAS_PENTIUM) long tmp = -1; - unsigned long addr = ACE_reinterpret_cast (unsigned long, value); + unsigned long addr = reinterpret_cast<unsigned long> (value); asm( "xadd %0, (%1)" : "+r"(tmp) : "r"(addr) ); return tmp - 1; #else /* __GNUC__ && ACE_HAS_PENTIUM */ @@ -85,7 +87,7 @@ ACE_Atomic_Op<ACE_Thread_Mutex, long>::single_cpu_exchange ( long rhs) { #if defined (__GNUC__) && defined (ACE_HAS_PENTIUM) - unsigned long addr = ACE_reinterpret_cast (unsigned long, value); + unsigned long addr = reinterpret_cast<unsigned long> (value); asm( "xchg %0, (%1)" : "+r"(rhs) : "r"(addr) ); return rhs; #else /* __GNUC__ && ACE_HAS_PENTIUM */ @@ -100,7 +102,7 @@ ACE_Atomic_Op<ACE_Thread_Mutex, long>::single_cpu_exchange_add (volatile long *v long rhs) { #if defined (__GNUC__) && defined (ACE_HAS_PENTIUM) - unsigned long addr = ACE_reinterpret_cast (unsigned long, value); + unsigned long addr = reinterpret_cast<unsigned long> (value); asm( "xadd %0, (%1)" : "+r"(rhs) : "r"(addr) ); return rhs; #elif defined (WIN32) && !defined (ACE_HAS_INTERLOCKED_EXCHANGEADD) @@ -114,7 +116,7 @@ ACE_Atomic_Op<ACE_Thread_Mutex, long>::single_cpu_exchange_add (volatile long *v // Return value is already in EAX register. # elif defined (__BORLANDC__) _EAX = rhs; - _EDX = ACE_reinterpret_cast (unsigned long, value); + _EDX = reinterpret_cast<unsigned long> (value); __emit__(0x0F, 0xC1, 0x02); // xadd [edx], eax // Return value is already in EAX register. # else /* _MSC_VER */ @@ -134,7 +136,7 @@ ACE_Atomic_Op<ACE_Thread_Mutex, long>::multi_cpu_increment (volatile long *value { #if defined (__GNUC__) && defined (ACE_HAS_PENTIUM) long tmp = 1; - unsigned long addr = ACE_reinterpret_cast (unsigned long, value); + unsigned long addr = reinterpret_cast<unsigned long> (value); asm( "lock ; xadd %0, (%1)" : "+r"(tmp) : "r"(addr) ); return tmp + 1; #else /* __GNUC__ && ACE_HAS_PENTIUM */ @@ -148,7 +150,7 @@ ACE_Atomic_Op<ACE_Thread_Mutex, long>::multi_cpu_decrement (volatile long *value { #if defined (__GNUC__) && defined (ACE_HAS_PENTIUM) long tmp = -1; - unsigned long addr = ACE_reinterpret_cast (unsigned long, value); + unsigned long addr = reinterpret_cast<unsigned long> (value); asm( "lock ; xadd %0, (%1)" : "+r"(tmp) : "r"(addr) ); return tmp - 1; #else /* __GNUC__ && ACE_HAS_PENTIUM */ @@ -163,7 +165,7 @@ ACE_Atomic_Op<ACE_Thread_Mutex, long>::multi_cpu_exchange ( long rhs) { #if defined (__GNUC__) && defined (ACE_HAS_PENTIUM) - unsigned long addr = ACE_reinterpret_cast (unsigned long, value); + unsigned long addr = reinterpret_cast<unsigned long> (value); // The XCHG instruction automatically follows LOCK semantics asm( "xchg %0, (%1)" : "+r"(rhs) : "r"(addr) ); return rhs; @@ -179,7 +181,7 @@ ACE_Atomic_Op<ACE_Thread_Mutex, long>::multi_cpu_exchange_add (volatile long *va long rhs) { #if defined (__GNUC__) && defined (ACE_HAS_PENTIUM) - unsigned long addr = ACE_reinterpret_cast (unsigned long, value); + unsigned long addr = reinterpret_cast<unsigned long> (value); asm( "lock ; xadd %0, (%1)" : "+r"(rhs) : "r"(addr) ); return rhs; #elif defined (WIN32) && !defined (ACE_HAS_INTERLOCKED_EXCHANGEADD) @@ -193,7 +195,7 @@ ACE_Atomic_Op<ACE_Thread_Mutex, long>::multi_cpu_exchange_add (volatile long *va // Return value is already in EAX register. # elif defined (__BORLANDC__) _EAX = rhs; - _EDX = ACE_reinterpret_cast (unsigned long, value); + _EDX = reinterpret_cast<unsigned long> (value); __emit__(0xF0, 0x0F, 0xC1, 0x02); // lock xadd [edx], eax // Return value is already in EAX register. # else /* _MSC_VER */ diff --git a/ace/Atomic_Op.i b/ace/Atomic_Op.i index 2cbaa125be6..6194d8a7318 100644 --- a/ace/Atomic_Op.i +++ b/ace/Atomic_Op.i @@ -28,7 +28,7 @@ ACE_INLINE long ACE_Atomic_Op<ACE_Thread_Mutex, long>::operator++ (void) { #if defined (WIN32) - return ::InterlockedIncrement (ACE_const_cast (long *, &this->value_)); + return ::InterlockedIncrement (const_cast<long *> (&this->value_)); #else /* WIN32 */ return (*increment_fn_) (&this->value_); #endif /* WIN32 */ @@ -44,7 +44,7 @@ ACE_INLINE long ACE_Atomic_Op<ACE_Thread_Mutex, long>::operator-- (void) { #if defined (WIN32) - return ::InterlockedDecrement (ACE_const_cast (long *, &this->value_)); + return ::InterlockedDecrement (const_cast<long *> (&this->value_)); #else /* WIN32 */ return (*decrement_fn_) (&this->value_); #endif /* WIN32 */ @@ -60,7 +60,7 @@ ACE_INLINE long ACE_Atomic_Op<ACE_Thread_Mutex, long>::operator+= (long rhs) { #if defined (WIN32) && defined (ACE_HAS_INTERLOCKED_EXCHANGEADD) - return ::InterlockedExchangeAdd (ACE_const_cast (long *, &this->value_), + return ::InterlockedExchangeAdd (const_cast<long *> (&this->value_), rhs) + rhs; #else /* WIN32 && ACE_HAS_INTERLOCKED_EXCHANGEADD */ return (*exchange_add_fn_) (&this->value_, rhs) + rhs; @@ -71,7 +71,7 @@ ACE_INLINE long ACE_Atomic_Op<ACE_Thread_Mutex, long>::operator-= (long rhs) { #if defined (WIN32) && defined (ACE_HAS_INTERLOCKED_EXCHANGEADD) - return ::InterlockedExchangeAdd (ACE_const_cast (long *, &this->value_), + return ::InterlockedExchangeAdd (const_cast<long *> (&this->value_), -rhs) - rhs; #else /* WIN32 && ACE_HAS_INTERLOCKED_EXCHANGEADD */ return (*exchange_add_fn_) (&this->value_, -rhs) - rhs; @@ -118,7 +118,7 @@ ACE_INLINE void ACE_Atomic_Op<ACE_Thread_Mutex, long>::operator= (long rhs) { #if defined (WIN32) - ::InterlockedExchange (ACE_const_cast (long *, &this->value_), rhs); + ::InterlockedExchange (const_cast<long *> (&this->value_), rhs); #else /* WIN32 */ (*exchange_fn_) (&this->value_, rhs); #endif /* WIN32 */ @@ -129,7 +129,7 @@ ACE_Atomic_Op<ACE_Thread_Mutex, long>::operator= ( const ACE_Atomic_Op<ACE_Thread_Mutex, long> &rhs) { #if defined (WIN32) - ::InterlockedExchange (ACE_const_cast (long *, &this->value_), rhs.value_); + ::InterlockedExchange (const_cast<long *> (&this->value_), rhs.value_); #else /* WIN32 */ (*exchange_fn_) (&this->value_, rhs.value_); #endif /* WIN32 */ diff --git a/ace/Base_Thread_Adapter.cpp b/ace/Base_Thread_Adapter.cpp index 6ca57e8b609..5aa59b6a113 100644 --- a/ace/Base_Thread_Adapter.cpp +++ b/ace/Base_Thread_Adapter.cpp @@ -87,7 +87,7 @@ ACE_Base_Thread_Adapter::thr_desc_log_msg (void) // be an extern "C" to make certain compilers happy... #if defined (ACE_PSOS) -extern "C" void +extern "C" void ace_thread_adapter (unsigned long args) { ACE_OS_TRACE ("ace_thread_adapter"); @@ -101,7 +101,7 @@ ace_thread_adapter (unsigned long args) #endif /* ACE_HAS_TSS_EMULATION */ ACE_Base_Thread_Adapter *thread_args = - ACE_static_cast(ACE_Base_Thread_Adapter *, args); + static_cast<ACE_Base_Thread_Adapter *> (args); // Invoke the user-supplied function with the args. thread_args->invoke (); @@ -121,9 +121,9 @@ ace_thread_adapter (void *args) #endif /* ACE_HAS_TSS_EMULATION */ ACE_Base_Thread_Adapter *thread_args = - ACE_static_cast (ACE_Base_Thread_Adapter *, args); + static_cast<ACE_Base_Thread_Adapter *> (args); -#ifdef ACE_USES_GPROF +#ifdef ACE_USES_GPROF setitimer (ITIMER_PROF, thread_args->timerval (), 0); #endif // ACE_USES_GPROF diff --git a/ace/Based_Pointer_T.i b/ace/Based_Pointer_T.i index b2b5afea868..28272f8a861 100644 --- a/ace/Based_Pointer_T.i +++ b/ace/Based_Pointer_T.i @@ -39,8 +39,7 @@ template <class CONCRETE> ACE_INLINE CONCRETE ACE_Based_Pointer_Basic<CONCRETE>::operator *(void) const { ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator *"); - return *ACE_reinterpret_cast (CONCRETE *, - ACE_COMPUTE_BASED_POINTER (this)); + return *reinterpret_cast<CONCRETE *> (ACE_COMPUTE_BASED_POINTER (this)); } template <class CONCRETE> ACE_INLINE CONCRETE * @@ -51,8 +50,7 @@ ACE_Based_Pointer_Basic<CONCRETE>::addr (void) const if (this->target_ == -1) return 0; else - return ACE_reinterpret_cast (CONCRETE *, - ACE_COMPUTE_BASED_POINTER (this)); + return reinterpret_cast<CONCRETE *> (ACE_COMPUTE_BASED_POINTER (this)); } template <class CONCRETE> ACE_INLINE @@ -67,8 +65,8 @@ template <class CONCRETE> ACE_INLINE CONCRETE ACE_Based_Pointer_Basic<CONCRETE>::operator [] (int index) const { ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator []"); - CONCRETE *c = ACE_reinterpret_cast (CONCRETE *, - ACE_COMPUTE_BASED_POINTER (this)); + CONCRETE *c = + reinterpret_cast<CONCRETE *> (ACE_COMPUTE_BASED_POINTER (this)); return c[index]; } diff --git a/ace/Basic_Stats.cpp b/ace/Basic_Stats.cpp index 7447430394c..3ed5dc739ad 100644 --- a/ace/Basic_Stats.cpp +++ b/ace/Basic_Stats.cpp @@ -52,8 +52,7 @@ ACE_Basic_Stats::dump_results (const ACE_TCHAR *msg, const ACE_UINT64 avg = this->sum_ / this->samples_count_; ACE_UINT64 dev = # if defined ACE_LACKS_LONGLONG_T - ACE_static_cast (ACE_U_LongLong, - this->sum2_ / this->samples_count_) + static_cast<ACE_U_LongLong> (this->sum2_ / this->samples_count_) - avg * ACE_U64_TO_U32(avg); # else /* ! ACE_LACKS_LONGLONG_T */ this->sum2_ / this->samples_count_ - avg * avg; diff --git a/ace/Basic_Types.h b/ace/Basic_Types.h index 9c1d8148261..155286a1b96 100644 --- a/ace/Basic_Types.h +++ b/ace/Basic_Types.h @@ -335,10 +335,10 @@ typedef ptrdiff_t ptr_arith_t; // pointer will be more than 32 bits wide if the platform does not // support 64-bit integers. # define ACE_LONGLONG_TO_PTR(PTR_TYPE, L) \ - ACE_reinterpret_cast (PTR_TYPE, L.lo ()) + reinterpret_cast<PTR_TYPE> (L.lo ()) #else /* ! ACE_LACKS_LONGLONG_T */ # define ACE_LONGLONG_TO_PTR(PTR_TYPE, L) \ - ACE_reinterpret_cast (PTR_TYPE, ACE_static_cast (ptrdiff_t, L)) + reinterpret_cast<PTR_TYPE> (static_cast<ptrdiff_t> (L)) #endif /* ! ACE_LACKS_LONGLONG_T */ // If the platform lacks a long long, define one. @@ -530,9 +530,9 @@ typedef ptrdiff_t ptr_arith_t; # define ACE_U64_TO_U32(n) ((n).lo ()) # define ACE_CU64_TO_CU32(n) ((n).lo ()) # else /* ! ACE_LACKS_LONGLONG_T */ -# define ACE_U64_TO_U32(n) (ACE_static_cast (ACE_UINT32, (n))) +# define ACE_U64_TO_U32(n) (static_cast<ACE_UINT32> (n)) # define ACE_CU64_TO_CU32(n) \ - (ACE_static_cast (ACE_CAST_CONST ACE_UINT32, (n))) + (static_cast<ACE_CAST_CONST ACE_UINT32> (n)) # endif /* ! ACE_LACKS_LONGLONG_T */ // 64-bit literals require special marking on some platforms. @@ -588,7 +588,7 @@ typedef ptrdiff_t ptr_arith_t; // Only use the low 32 bits. # define ACE_UINT64_DBLCAST_ADAPTER(n) ACE_U64_TO_U32 (n) # elif defined (ACE_WIN32) -# define ACE_UINT64_DBLCAST_ADAPTER(n) ACE_static_cast (__int64, n) +# define ACE_UINT64_DBLCAST_ADAPTER(n) static_cast<__int64> (n) # else /* ! ACE_WIN32 && ! ACE_LACKS_LONGLONG_T */ # define ACE_UINT64_DBLCAST_ADAPTER(n) (n) # endif /* ! ACE_WIN32 && ! ACE_LACKS_LONGLONG_T */ diff --git a/ace/Basic_Types.i b/ace/Basic_Types.i index 5a1e323330d..b7deb43b71b 100644 --- a/ace/Basic_Types.i +++ b/ace/Basic_Types.i @@ -75,7 +75,7 @@ ACE_U_LongLong::operator< (const ACE_U_LongLong &n) const ACE_INLINE bool ACE_U_LongLong::operator< (const ACE_UINT32 n) const { - return operator< (ACE_static_cast (const ACE_U_LongLong, n)); + return operator< (static_cast<const ACE_U_LongLong> (n)); } ACE_INLINE bool @@ -89,7 +89,7 @@ ACE_U_LongLong::operator<= (const ACE_U_LongLong &n) const ACE_INLINE bool ACE_U_LongLong::operator<= (const ACE_UINT32 n) const { - return operator<= (ACE_static_cast (const ACE_U_LongLong, n)); + return operator<= (static_cast<const ACE_U_LongLong> (n)); } ACE_INLINE bool @@ -103,7 +103,7 @@ ACE_U_LongLong::operator> (const ACE_U_LongLong &n) const ACE_INLINE bool ACE_U_LongLong::operator> (const ACE_UINT32 n) const { - return operator> (ACE_static_cast (const ACE_U_LongLong, n)); + return operator> (static_cast<const ACE_U_LongLong> (n)); } ACE_INLINE bool @@ -117,7 +117,7 @@ ACE_U_LongLong::operator>= (const ACE_U_LongLong &n) const ACE_INLINE bool ACE_U_LongLong::operator>= (const ACE_UINT32 n) const { - return operator>= (ACE_static_cast (const ACE_U_LongLong, n)); + return operator>= (static_cast<const ACE_U_LongLong> (n)); } ACE_INLINE @@ -141,7 +141,7 @@ ACE_U_LongLong::operator= (const ACE_INT32 &rhs) { if (rhs >= 0) { - l_ () = ACE_static_cast (ACE_UINT32, rhs); + l_ () = static_cast<ACE_UINT32> (rhs); h_ () = 0; } else @@ -179,7 +179,7 @@ ACE_U_LongLong::operator+ (const ACE_U_LongLong &n) const ACE_INLINE ACE_U_LongLong ACE_U_LongLong::operator+ (const ACE_UINT32 n) const { - return operator+ (ACE_static_cast (const ACE_U_LongLong, n)); + return operator+ (static_cast<const ACE_U_LongLong> (n)); } ACE_INLINE ACE_U_LongLong @@ -194,7 +194,7 @@ ACE_U_LongLong::operator- (const ACE_U_LongLong &n) const ACE_INLINE ACE_U_LongLong ACE_U_LongLong::operator- (const ACE_UINT32 n) const { - return operator- (ACE_static_cast (const ACE_U_LongLong, n)); + return operator- (static_cast<const ACE_U_LongLong> (n)); } ACE_INLINE ACE_U_LongLong @@ -261,7 +261,7 @@ ACE_U_LongLong::operator+= (const ACE_U_LongLong &n) ACE_INLINE ACE_U_LongLong & ACE_U_LongLong::operator+= (const ACE_UINT32 n) { - return operator+= (ACE_static_cast (const ACE_U_LongLong, n)); + return operator+= (static_cast<const ACE_U_LongLong> (n)); } #define ACE_HIGHBIT (~(~0UL >> 1)) @@ -369,7 +369,7 @@ ACE_U_LongLong::operator-= (const ACE_U_LongLong &n) ACE_INLINE ACE_U_LongLong & ACE_U_LongLong::operator-= (const ACE_UINT32 n) { - return operator-= (ACE_static_cast (const ACE_U_LongLong, n)); + return operator-= (static_cast<const ACE_U_LongLong> (n)); } ACE_INLINE ACE_U_LongLong & @@ -422,7 +422,7 @@ ACE_U_LongLong::operator|= (const ACE_U_LongLong n) ACE_INLINE ACE_U_LongLong & ACE_U_LongLong::operator|= (const ACE_UINT32 n) { - return operator|= (ACE_static_cast (const ACE_U_LongLong, n)); + return operator|= (static_cast<const ACE_U_LongLong> (n)); } ACE_INLINE ACE_U_LongLong & @@ -437,7 +437,7 @@ ACE_U_LongLong::operator&= (const ACE_U_LongLong n) ACE_INLINE ACE_U_LongLong & ACE_U_LongLong::operator&= (const ACE_UINT32 n) { - return operator&= (ACE_static_cast (const ACE_U_LongLong, n)); + return operator&= (static_cast<const ACE_U_LongLong> (n)); } ACE_INLINE ACE_UINT32 diff --git a/ace/CDR_Base.cpp b/ace/CDR_Base.cpp index f4809a00afa..a3447451c72 100644 --- a/ace/CDR_Base.cpp +++ b/ace/CDR_Base.cpp @@ -67,15 +67,15 @@ ACE_CDR::swap_2_array (const char* orig, char* target, size_t n) { #if defined (ACE_HAS_PENTIUM) && defined (__GNUG__) unsigned int a = - * ACE_reinterpret_cast (const unsigned int*, orig); + * reinterpret_cast<const unsigned int*> (orig); unsigned int b = - * ACE_reinterpret_cast (const unsigned int*, orig + 4); + * reinterpret_cast<const unsigned int*> (orig + 4); asm ( "bswap %1" : "=r" (a) : "0" (a) ); asm ( "bswap %1" : "=r" (b) : "0" (b) ); asm ( "rol $16, %1" : "=r" (a) : "0" (a) ); asm ( "rol $16, %1" : "=r" (b) : "0" (b) ); - * ACE_reinterpret_cast (unsigned int*, target) = a; - * ACE_reinterpret_cast (unsigned int*, target + 4) = b; + * reinterpret_cast<unsigned int*> (target) = a; + * reinterpret_cast<unsigned int*> (target + 4) = b; #elif defined(ACE_HAS_PENTIUM) \ && (defined(_MSC_VER) || defined(__BORLANDC__)) \ && !defined(ACE_LACKS_INLINE_ASSEMBLY) @@ -92,19 +92,19 @@ ACE_CDR::swap_2_array (const char* orig, char* target, size_t n) #elif ACE_SIZEOF_LONG == 8 // 64 bit architecture. register unsigned long a = - * ACE_reinterpret_cast (const unsigned long*, orig); + * reinterpret_cast<const unsigned long*> (orig); register unsigned long a1 = (a & 0x00ff00ff00ff00ffUL) << 8; register unsigned long a2 = (a & 0xff00ff00ff00ff00UL) >> 8; a = (a1 | a2); - * ACE_reinterpret_cast (unsigned long*, target) = a; + * reinterpret_cast<unsigned long*> (target) = a; #else register ACE_UINT32 a = - * ACE_reinterpret_cast (const ACE_UINT32*, orig); + * reinterpret_cast<const ACE_UINT32*> (orig); register ACE_UINT32 b = - * ACE_reinterpret_cast (const ACE_UINT32*, orig + 4); + * reinterpret_cast<const ACE_UINT32*> (orig + 4); register ACE_UINT32 a1 = (a & 0x00ff00ffU) << 8; register ACE_UINT32 b1 = (b & 0x00ff00ffU) << 8; @@ -114,8 +114,8 @@ ACE_CDR::swap_2_array (const char* orig, char* target, size_t n) a = (a1 | a2); b = (b1 | b2); - * ACE_reinterpret_cast (ACE_UINT32*, target) = a; - * ACE_reinterpret_cast (ACE_UINT32*, target + 4) = b; + * reinterpret_cast<ACE_UINT32*> (target) = a; + * reinterpret_cast<ACE_UINT32*> (target + 4) = b; #endif orig += 8; target += 8; @@ -128,21 +128,21 @@ ACE_CDR::swap_2_array (const char* orig, char* target, size_t n) { #if defined (ACE_HAS_PENTIUM) && defined (__GNUG__) unsigned int a = - * ACE_reinterpret_cast (const unsigned int*, orig); + * reinterpret_cast<const unsigned int*> (orig); unsigned int b = - * ACE_reinterpret_cast (const unsigned int*, orig + 4); + * reinterpret_cast<const unsigned int*> (orig + 4); asm ( "bswap %1" : "=r" (a) : "0" (a) ); asm ( "bswap %1" : "=r" (b) : "0" (b) ); // We're little endian. - * ACE_reinterpret_cast (unsigned short*, target + 2) + * reinterpret_cast<unsigned short*> (target + 2) = (unsigned short) (a & 0xffff); - * ACE_reinterpret_cast (unsigned short*, target + 6) + * reinterpret_cast<unsigned short*> (target + 6) = (unsigned short) (b & 0xffff); asm ( "shrl $16, %1" : "=r" (a) : "0" (a) ); asm ( "shrl $16, %1" : "=r" (b) : "0" (b) ); - * ACE_reinterpret_cast (unsigned short*, target + 0) + * reinterpret_cast<unsigned short*> (target + 0) = (unsigned short) (a & 0xffff); - * ACE_reinterpret_cast (unsigned short*, target + 4) + * reinterpret_cast<unsigned short*> (target + 4) = (unsigned short) (b & 0xffff); #elif defined (ACE_HAS_PENTIUM) \ && (defined (_MSC_VER) || defined (__BORLANDC__)) \ @@ -163,34 +163,34 @@ ACE_CDR::swap_2_array (const char* orig, char* target, size_t n) #elif ACE_SIZEOF_LONG == 8 // 64 bit architecture. register unsigned long a = - * ACE_reinterpret_cast (const unsigned long*, orig); + * reinterpret_cast<const unsigned long*> (orig); register unsigned long a1 = (a & 0x00ff00ff00ff00ffUL) << 8; register unsigned long a2 = (a & 0xff00ff00ff00ff00UL) >> 8; a = (a1 | a2); - ACE_UINT16 b1 = ACE_static_cast (ACE_UINT16, (a >> 48)); - ACE_UINT16 b2 = ACE_static_cast (ACE_UINT16, ((a >> 32) & 0xffff)); - ACE_UINT16 b3 = ACE_static_cast (ACE_UINT16, ((a >> 16) & 0xffff)); - ACE_UINT16 b4 = ACE_static_cast (ACE_UINT16, (a & 0xffff)); + ACE_UINT16 b1 = static_cast<ACE_UINT16> (a >> 48); + ACE_UINT16 b2 = static_cast<ACE_UINT16> ((a >> 32) & 0xffff); + ACE_UINT16 b3 = static_cast<ACE_UINT16> ((a >> 16) & 0xffff); + ACE_UINT16 b4 = static_cast<ACE_UINT16> (a & 0xffff); #if defined(ACE_LITTLE_ENDIAN) - * ACE_reinterpret_cast (ACE_UINT16*, target) = b4; - * ACE_reinterpret_cast (ACE_UINT16*, target + 2) = b3; - * ACE_reinterpret_cast (ACE_UINT16*, target + 4) = b2; - * ACE_reinterpret_cast (ACE_UINT16*, target + 6) = b1; + * reinterpret_cast<ACE_UINT16*> (target) = b4; + * reinterpret_cast<ACE_UINT16*> (target + 2) = b3; + * reinterpret_cast<ACE_UINT16*> (target + 4) = b2; + * reinterpret_cast<ACE_UINT16*> (target + 6) = b1; #else - * ACE_reinterpret_cast (ACE_UINT16*, target) = b1; - * ACE_reinterpret_cast (ACE_UINT16*, target + 2) = b2; - * ACE_reinterpret_cast (ACE_UINT16*, target + 4) = b3; - * ACE_reinterpret_cast (ACE_UINT16*, target + 6) = b4; + * reinterpret_cast<ACE_UINT16*> (target) = b1; + * reinterpret_cast<ACE_UINT16*> (target + 2) = b2; + * reinterpret_cast<ACE_UINT16*> (target + 4) = b3; + * reinterpret_cast<ACE_UINT16*> (target + 6) = b4; #endif #else register ACE_UINT32 a = - * ACE_reinterpret_cast (const ACE_UINT32*, orig); + * reinterpret_cast<const ACE_UINT32*> (orig); register ACE_UINT32 b = - * ACE_reinterpret_cast (const ACE_UINT32*, orig + 4); + * reinterpret_cast<const ACE_UINT32*> (orig + 4); register ACE_UINT32 a1 = (a & 0x00ff00ff) << 8; register ACE_UINT32 b1 = (b & 0x00ff00ff) << 8; @@ -200,21 +200,21 @@ ACE_CDR::swap_2_array (const char* orig, char* target, size_t n) a = (a1 | a2); b = (b1 | b2); - ACE_UINT32 c1 = ACE_static_cast (ACE_UINT16, (a >> 16)); - ACE_UINT32 c2 = ACE_static_cast (ACE_UINT16, (a & 0xffff)); - ACE_UINT32 c3 = ACE_static_cast (ACE_UINT16, (b >> 16)); - ACE_UINT32 c4 = ACE_static_cast (ACE_UINT16, (b & 0xffff)); + ACE_UINT32 c1 = static_cast<ACE_UINT16> (a >> 16); + ACE_UINT32 c2 = static_cast<ACE_UINT16> (a & 0xffff); + ACE_UINT32 c3 = static_cast<ACE_UINT16> (b >> 16); + ACE_UINT32 c4 = static_cast<ACE_UINT16> (b & 0xffff); #if defined(ACE_LITTLE_ENDIAN) - * ACE_reinterpret_cast (ACE_UINT16*, target) = c2; - * ACE_reinterpret_cast (ACE_UINT16*, target + 2) = c1; - * ACE_reinterpret_cast (ACE_UINT16*, target + 4) = c4; - * ACE_reinterpret_cast (ACE_UINT16*, target + 6) = c3; + * reinterpret_cast<ACE_UINT16*> (target) = c2; + * reinterpret_cast<ACE_UINT16*> (target + 2) = c1; + * reinterpret_cast<ACE_UINT16*> (target + 4) = c4; + * reinterpret_cast<ACE_UINT16*> (target + 6) = c3; #else - * ACE_reinterpret_cast (ACE_UINT16*, target) = c1; - * ACE_reinterpret_cast (ACE_UINT16*, target + 2) = c2; - * ACE_reinterpret_cast (ACE_UINT16*, target + 4) = c3; - * ACE_reinterpret_cast (ACE_UINT16*, target + 6) = c4; + * reinterpret_cast<ACE_UINT16*> (target) = c1; + * reinterpret_cast<ACE_UINT16*> (target + 2) = c2; + * reinterpret_cast<ACE_UINT16*> (target + 4) = c3; + * reinterpret_cast<ACE_UINT16*> (target + 6) = c4; #endif #endif @@ -278,9 +278,9 @@ ACE_CDR::swap_4_array (const char* orig, char* target, size_t n) while (orig < end) { register unsigned long a = - * ACE_reinterpret_cast (const long*, orig); + * reinterpret_cast<const long*> (orig); register unsigned long b = - * ACE_reinterpret_cast (const long*, orig + 8); + * reinterpret_cast<const long*> (orig + 8); register unsigned long a84 = (a & 0x000000ff000000ffL) << 24; register unsigned long b84 = (b & 0x000000ff000000ffL) << 24; @@ -294,8 +294,8 @@ ACE_CDR::swap_4_array (const char* orig, char* target, size_t n) a = (a84 | a73 | a62 | a51); b = (b84 | b73 | b62 | b51); - * ACE_reinterpret_cast (long*, target) = a; - * ACE_reinterpret_cast (long*, target + 8) = b; + * reinterpret_cast<long*> (target) = a; + * reinterpret_cast<long*> (target + 8) = b; orig += 16; target += 16; @@ -307,9 +307,9 @@ ACE_CDR::swap_4_array (const char* orig, char* target, size_t n) while (orig < end) { register unsigned long a = - * ACE_reinterpret_cast (const long*, orig); + * reinterpret_cast<const long*> (orig); register unsigned long b = - * ACE_reinterpret_cast (const long*, orig + 8); + * reinterpret_cast<const long*> (orig + 8); register unsigned long a84 = (a & 0x000000ff000000ffL) << 24; register unsigned long b84 = (b & 0x000000ff000000ffL) << 24; @@ -323,21 +323,21 @@ ACE_CDR::swap_4_array (const char* orig, char* target, size_t n) a = (a84 | a73 | a62 | a51); b = (b84 | b73 | b62 | b51); - ACE_UINT32 c1 = ACE_static_cast (ACE_UINT32, (a >> 32)); - ACE_UINT32 c2 = ACE_static_cast (ACE_UINT32, (a & 0xffffffff)); - ACE_UINT32 c3 = ACE_static_cast (ACE_UINT32, (b >> 32)); - ACE_UINT32 c4 = ACE_static_cast (ACE_UINT32, (b & 0xffffffff)); + ACE_UINT32 c1 = static_cast<ACE_UINT32> (a >> 32); + ACE_UINT32 c2 = static_cast<ACE_UINT32> (a & 0xffffffff); + ACE_UINT32 c3 = static_cast<ACE_UINT32> (b >> 32); + ACE_UINT32 c4 = static_cast<ACE_UINT32> (b & 0xffffffff); #if defined (ACE_LITTLE_ENDIAN) - * ACE_reinterpret_cast (ACE_UINT32*, target + 0) = c2; - * ACE_reinterpret_cast (ACE_UINT32*, target + 4) = c1; - * ACE_reinterpret_cast (ACE_UINT32*, target + 8) = c4; - * ACE_reinterpret_cast (ACE_UINT32*, target + 12) = c3; + * reinterpret_cast<ACE_UINT32*> (target + 0) = c2; + * reinterpret_cast<ACE_UINT32*> (target + 4) = c1; + * reinterpret_cast<ACE_UINT32*> (target + 8) = c4; + * reinterpret_cast<ACE_UINT32*> (target + 12) = c3; #else - * ACE_reinterpret_cast (ACE_UINT32*, target + 0) = c1; - * ACE_reinterpret_cast (ACE_UINT32*, target + 4) = c2; - * ACE_reinterpret_cast (ACE_UINT32*, target + 8) = c3; - * ACE_reinterpret_cast (ACE_UINT32*, target + 12) = c4; + * reinterpret_cast<ACE_UINT32*> (target + 0) = c1; + * reinterpret_cast<ACE_UINT32*> (target + 4) = c2; + * reinterpret_cast<ACE_UINT32*> (target + 8) = c3; + * reinterpret_cast<ACE_UINT32*> (target + 12) = c4; #endif orig += 16; target += 16; @@ -350,23 +350,23 @@ ACE_CDR::swap_4_array (const char* orig, char* target, size_t n) { #if defined (ACE_HAS_PENTIUM) && defined (__GNUG__) register unsigned int a = - *ACE_reinterpret_cast (const unsigned int*, orig); + *reinterpret_cast<const unsigned int*> (orig); register unsigned int b = - *ACE_reinterpret_cast (const unsigned int*, orig + 4); + *reinterpret_cast<const unsigned int*> (orig + 4); register unsigned int c = - *ACE_reinterpret_cast (const unsigned int*, orig + 8); + *reinterpret_cast<const unsigned int*> (orig + 8); register unsigned int d = - *ACE_reinterpret_cast (const unsigned int*, orig + 12); + *reinterpret_cast<const unsigned int*> (orig + 12); asm ("bswap %1" : "=r" (a) : "0" (a)); asm ("bswap %1" : "=r" (b) : "0" (b)); asm ("bswap %1" : "=r" (c) : "0" (c)); asm ("bswap %1" : "=r" (d) : "0" (d)); - *ACE_reinterpret_cast (unsigned int*, target) = a; - *ACE_reinterpret_cast (unsigned int*, target + 4) = b; - *ACE_reinterpret_cast (unsigned int*, target + 8) = c; - *ACE_reinterpret_cast (unsigned int*, target + 12) = d; + *reinterpret_cast<unsigned int*> (target) = a; + *reinterpret_cast<unsigned int*> (target + 4) = b; + *reinterpret_cast<unsigned int*> (target + 8) = c; + *reinterpret_cast<unsigned int*> (target + 12) = d; #elif defined (ACE_HAS_PENTIUM) \ && (defined (_MSC_VER) || defined (__BORLANDC__)) \ && !defined (ACE_LACKS_INLINE_ASSEMBLY) @@ -386,13 +386,13 @@ ACE_CDR::swap_4_array (const char* orig, char* target, size_t n) __asm mov 12[esi], eax #else register ACE_UINT32 a = - * ACE_reinterpret_cast (const ACE_UINT32*, orig); + * reinterpret_cast<const ACE_UINT32*> (orig); register ACE_UINT32 b = - * ACE_reinterpret_cast (const ACE_UINT32*, orig + 4); + * reinterpret_cast<const ACE_UINT32*> (orig + 4); register ACE_UINT32 c = - * ACE_reinterpret_cast (const ACE_UINT32*, orig + 8); + * reinterpret_cast<const ACE_UINT32*> (orig + 8); register ACE_UINT32 d = - * ACE_reinterpret_cast (const ACE_UINT32*, orig + 12); + * reinterpret_cast<const ACE_UINT32*> (orig + 12); // Expect the optimizer reordering this A LOT. // We leave it this way for clarity. @@ -401,10 +401,10 @@ ACE_CDR::swap_4_array (const char* orig, char* target, size_t n) c = (c << 24) | ((c & 0xff00) << 8) | ((c & 0xff0000) >> 8) | (c >> 24); d = (d << 24) | ((d & 0xff00) << 8) | ((d & 0xff0000) >> 8) | (d >> 24); - * ACE_reinterpret_cast (ACE_UINT32*, target) = a; - * ACE_reinterpret_cast (ACE_UINT32*, target + 4) = b; - * ACE_reinterpret_cast (ACE_UINT32*, target + 8) = c; - * ACE_reinterpret_cast (ACE_UINT32*, target + 12) = d; + * reinterpret_cast<ACE_UINT32*> (target) = a; + * reinterpret_cast<ACE_UINT32*> (target + 4) = b; + * reinterpret_cast<ACE_UINT32*> (target + 8) = c; + * reinterpret_cast<ACE_UINT32*> (target + 12) = d; #endif orig += 16; diff --git a/ace/CDR_Base.inl b/ace/CDR_Base.inl index 613a7a64a38..40ef426166c 100644 --- a/ace/CDR_Base.inl +++ b/ace/CDR_Base.inl @@ -50,9 +50,9 @@ ACE_CDR::swap_2 (const char *orig, char* target) #if defined(ACE_HAS_PENTIUM) # if defined(__GNUG__) unsigned short a = - *ACE_reinterpret_cast(const unsigned short*, orig); + *reinterpret_cast<const unsigned short*> (orig); asm( "rolw $8, %0" : "=r" (a) : "0" (a) ); - *ACE_reinterpret_cast(unsigned short*, target) = a; + *reinterpret_cast<unsigned short*> (target) = a; # elif (defined(_MSC_VER) || defined(__BORLANDC__)) \ && !defined(ACE_LACKS_INLINE_ASSEMBLY) __asm mov ebx, orig; @@ -66,8 +66,8 @@ ACE_CDR::swap_2 (const char *orig, char* target) target[0] = orig[1]; # endif #else - register ACE_UINT16 usrc = * ACE_reinterpret_cast(const ACE_UINT16*, orig); - register ACE_UINT16* udst = ACE_reinterpret_cast(ACE_UINT16*, target); + register ACE_UINT16 usrc = * reinterpret_cast<const ACE_UINT16*> (orig); + register ACE_UINT16* udst = reinterpret_cast<ACE_UINT16*> (target); *udst = (usrc << 8) | (usrc >> 8); #endif /* ACE_HAS_PENTIUM */ } @@ -78,9 +78,9 @@ ACE_CDR::swap_4 (const char* orig, char* target) #if defined(ACE_HAS_PENTIUM) && defined(__GNUG__) // We have ACE_HAS_PENTIUM, so we know the sizeof's. register unsigned int j = - *ACE_reinterpret_cast(const unsigned int*, orig); + *reinterpret_cast<const unsigned int*> (orig); asm ("bswap %1" : "=r" (j) : "0" (j)); - *ACE_reinterpret_cast(unsigned int*, target) = j; + *reinterpret_cast<unsigned int*> (target) = j; #elif defined(ACE_HAS_PENTIUM) \ && (defined(_MSC_VER) || defined(__BORLANDC__)) \ && !defined(ACE_LACKS_INLINE_ASSEMBLY) @@ -90,9 +90,9 @@ ACE_CDR::swap_4 (const char* orig, char* target) __asm bswap eax; __asm mov [ecx], eax; #else - register ACE_UINT32 x = * ACE_reinterpret_cast(const ACE_UINT32*, orig); + register ACE_UINT32 x = * reinterpret_cast<const ACE_UINT32*> (orig); x = (x << 24) | ((x & 0xff00) << 8) | ((x & 0xff0000) >> 8) | (x >> 24); - * ACE_reinterpret_cast(ACE_UINT32*, target) = x; + * reinterpret_cast<ACE_UINT32*> (target) = x; #endif } @@ -101,13 +101,13 @@ ACE_CDR::swap_8 (const char* orig, char* target) { #if defined(ACE_HAS_PENTIUM) && defined(__GNUG__) register unsigned int i = - *ACE_reinterpret_cast(const unsigned int*, orig); + *reinterpret_cast<const unsigned int*> (orig); register unsigned int j = - *ACE_reinterpret_cast(const unsigned int*, orig + 4); + *reinterpret_cast<const unsigned int*> (orig + 4); asm ("bswap %1" : "=r" (i) : "0" (i)); asm ("bswap %1" : "=r" (j) : "0" (j)); - *ACE_reinterpret_cast(unsigned int*, target + 4) = i; - *ACE_reinterpret_cast(unsigned int*, target) = j; + *reinterpret_cast<unsigned int*> (target + 4) = i; + *reinterpret_cast<unsigned int*> (target) = j; #elif defined(ACE_HAS_PENTIUM) \ && (defined(_MSC_VER) || defined(__BORLANDC__)) \ && !defined(ACE_LACKS_INLINE_ASSEMBLY) @@ -122,23 +122,23 @@ ACE_CDR::swap_8 (const char* orig, char* target) #elif ACE_SIZEOF_LONG == 8 // 64 bit architecture. register unsigned long x = - * ACE_reinterpret_cast(const unsigned long*, orig); + * reinterpret_cast<const unsigned long*> (orig); register unsigned long x84 = (x & 0x000000ff000000ffUL) << 24; register unsigned long x73 = (x & 0x0000ff000000ff00UL) << 8; register unsigned long x62 = (x & 0x00ff000000ff0000UL) >> 8; register unsigned long x51 = (x & 0xff000000ff000000UL) >> 24; x = (x84 | x73 | x62 | x51); x = (x << 32) | (x >> 32); - *ACE_reinterpret_cast(unsigned long*, target) = x; + *reinterpret_cast<unsigned long*> (target) = x; #else register ACE_UINT32 x = - * ACE_reinterpret_cast(const ACE_UINT32*, orig); + * reinterpret_cast<const ACE_UINT32*> (orig); register ACE_UINT32 y = - * ACE_reinterpret_cast(const ACE_UINT32*, orig + 4); + * reinterpret_cast<const ACE_UINT32*> (orig + 4); x = (x << 24) | ((x & 0xff00) << 8) | ((x & 0xff0000) >> 8) | (x >> 24); y = (y << 24) | ((y & 0xff00) << 8) | ((y & 0xff0000) >> 8) | (y >> 24); - * ACE_reinterpret_cast(ACE_UINT32*, target) = y; - * ACE_reinterpret_cast(ACE_UINT32*, target + 4) = x; + * reinterpret_cast<ACE_UINT32*> (target) = y; + * reinterpret_cast<ACE_UINT32*> (target + 4) = x; #endif } diff --git a/ace/CDR_Stream.cpp b/ace/CDR_Stream.cpp index 4ecfdf1be0f..150d4c86ecf 100644 --- a/ace/CDR_Stream.cpp +++ b/ace/CDR_Stream.cpp @@ -187,48 +187,51 @@ ACE_OutputCDR::write_wchar (ACE_CDR::WChar x) errno = EACCES; return (this->good_bit_ = false); } - if (ACE_static_cast (ACE_CDR::Short, major_version_) == 1 - && ACE_static_cast (ACE_CDR::Short, minor_version_) == 2) + if (static_cast<ACE_CDR::Short> (major_version_) == 1 + && static_cast<ACE_CDR::Short> (minor_version_) == 2) { - ACE_CDR::Octet len = ACE_static_cast (ACE_CDR::Octet, ACE_OutputCDR::wchar_maxbytes_); + ACE_CDR::Octet len = + static_cast<ACE_CDR::Octet> (ACE_OutputCDR::wchar_maxbytes_); if (this->write_1 (&len)) { if (ACE_OutputCDR::wchar_maxbytes_ == sizeof(ACE_CDR::WChar)) - return this->write_octet_array (ACE_reinterpret_cast - (const ACE_CDR::Octet*, &x), - ACE_static_cast (ACE_CDR::ULong, len)); + return + this->write_octet_array ( + reinterpret_cast<const ACE_CDR::Octet*> (&x), + static_cast<ACE_CDR::ULong> (len)); else if (ACE_OutputCDR::wchar_maxbytes_ == 2) { - ACE_CDR::Short sx = ACE_static_cast(ACE_CDR::Short,x); - return this->write_octet_array(ACE_reinterpret_cast - (const ACE_CDR::Octet*, &sx), - ACE_static_cast (ACE_CDR::ULong, len)); + ACE_CDR::Short sx = static_cast<ACE_CDR::Short> (x); + return + this->write_octet_array ( + reinterpret_cast<const ACE_CDR::Octet*> (&sx), + static_cast<ACE_CDR::ULong> (len)); } else { - ACE_CDR::Octet ox = ACE_static_cast(ACE_CDR::Octet,x); - return this->write_octet_array(ACE_reinterpret_cast - (const ACE_CDR::Octet*, &ox), - ACE_static_cast (ACE_CDR::ULong, len)); + ACE_CDR::Octet ox = static_cast<ACE_CDR::Octet> (x); + return + this->write_octet_array ( + reinterpret_cast<const ACE_CDR::Octet*> (&ox), + static_cast<ACE_CDR::ULong> (len)); } } } - else if (ACE_static_cast (ACE_CDR::Short, minor_version_) == 0) + else if (static_cast<ACE_CDR::Short> (minor_version_) == 0) { // wchar is not allowed with GIOP 1.0. errno = EINVAL; return (this->good_bit_ = false); } if (ACE_OutputCDR::wchar_maxbytes_ == sizeof (ACE_CDR::WChar)) - return this->write_4 (ACE_reinterpret_cast (const ACE_CDR::ULong *, &x)); + return this->write_4 (reinterpret_cast<const ACE_CDR::ULong *> (&x)); else if (ACE_OutputCDR::wchar_maxbytes_ == 2) { - ACE_CDR::Short sx = ACE_static_cast(ACE_CDR::Short,x); - return this->write_2 (ACE_reinterpret_cast (const ACE_CDR::UShort *, - &sx)); + ACE_CDR::Short sx = static_cast<ACE_CDR::Short> (x); + return this->write_2 (reinterpret_cast<const ACE_CDR::UShort *> (&sx)); } - ACE_CDR::Octet ox = ACE_static_cast (ACE_CDR::Octet,x); - return this->write_1 (ACE_reinterpret_cast (const ACE_CDR::Octet *, &ox)); + ACE_CDR::Octet ox = static_cast<ACE_CDR::Octet> (x); + return this->write_1 (reinterpret_cast<const ACE_CDR::Octet *> (&ox)); } ACE_CDR::Boolean @@ -264,7 +267,7 @@ ACE_OutputCDR::write_string (const ACE_CString &x) { // @@ Leave this method in here, not the `.i' file so that we don't // have to unnecessarily pull in the `ace/SString.h' header. - return this->write_string (ACE_static_cast (ACE_CDR::ULong, x.length ()), + return this->write_string (static_cast<ACE_CDR::ULong> (x.length ()), x.c_str()); } @@ -284,8 +287,8 @@ ACE_OutputCDR::write_wstring (ACE_CDR::ULong len, return (this->good_bit_ = false); } - if (ACE_static_cast (ACE_CDR::Short, this->major_version_) == 1 - && ACE_static_cast (ACE_CDR::Short, this->minor_version_) == 2) + if (static_cast<ACE_CDR::Short> (this->major_version_) == 1 + && static_cast<ACE_CDR::Short> (this->minor_version_) == 2) { if (x != 0) { @@ -329,7 +332,7 @@ ACE_OutputCDR::write_octet_array_mb (const ACE_Message_Block* mb) if (! this->write_array (i->rd_ptr (), ACE_CDR::OCTET_SIZE, ACE_CDR::OCTET_ALIGN, - ACE_static_cast (ACE_CDR::ULong, length))) + static_cast<ACE_CDR::ULong> (length))) return (this->good_bit_ = false); continue; } @@ -340,7 +343,7 @@ ACE_OutputCDR::write_octet_array_mb (const ACE_Message_Block* mb) if (! this->write_array (i->rd_ptr (), ACE_CDR::OCTET_SIZE, ACE_CDR::OCTET_ALIGN, - ACE_static_cast (ACE_CDR::ULong, length))) + static_cast<ACE_CDR::ULong> (length))) return (this->good_bit_ = false); continue; } @@ -380,7 +383,7 @@ ACE_OutputCDR::write_1 (const ACE_CDR::Octet *x) char *buf; if (this->adjust (1, buf) == 0) { - *ACE_reinterpret_cast (ACE_CDR::Octet*, buf) = *x; + *reinterpret_cast<ACE_CDR::Octet*> (buf) = *x; return true; } @@ -394,17 +397,17 @@ ACE_OutputCDR::write_2 (const ACE_CDR::UShort *x) if (this->adjust (ACE_CDR::SHORT_SIZE, buf) == 0) { #if !defined (ACE_ENABLE_SWAP_ON_WRITE) - *ACE_reinterpret_cast(ACE_CDR::UShort*,buf) = *x; + *reinterpret_cast<ACE_CDR::UShort*> (buf) = *x; return true; #else if (!this->do_byte_swap_) { - *ACE_reinterpret_cast (ACE_CDR::UShort *, buf) = *x; + *reinterpret_cast<ACE_CDR::UShort *> (buf) = *x; return true; } else { - ACE_CDR::swap_2 (ACE_reinterpret_cast (const char*, x), buf); + ACE_CDR::swap_2 (reinterpret_cast<const char*> (x), buf); return true; } #endif /* ACE_ENABLE_SWAP_ON_WRITE */ @@ -420,17 +423,17 @@ ACE_OutputCDR::write_4 (const ACE_CDR::ULong *x) if (this->adjust (ACE_CDR::LONG_SIZE, buf) == 0) { #if !defined (ACE_ENABLE_SWAP_ON_WRITE) - *ACE_reinterpret_cast(ACE_CDR::ULong*,buf) = *x; + *reinterpret_cast<ACE_CDR::ULong*> (buf) = *x; return 1; #else if (!this->do_byte_swap_) { - *ACE_reinterpret_cast (ACE_CDR::ULong *, buf) = *x; + *reinterpret_cast<ACE_CDR::ULong *> (buf) = *x; return true; } else { - ACE_CDR::swap_4 (ACE_reinterpret_cast (const char*, x), buf); + ACE_CDR::swap_4 (reinterpret_cast<const char*> (x), buf); return true; } #endif /* ACE_ENABLE_SWAP_ON_WRITE */ @@ -448,28 +451,28 @@ ACE_OutputCDR::write_8 (const ACE_CDR::ULongLong *x) { #if defined (__arm__) // Convert to Intel format (12345678 => 56781234) - const char *orig = ACE_reinterpret_cast (const char *, x); + const char *orig = reinterpret_cast<const char *> (x); char *target = buf; register ACE_UINT32 x = - *ACE_reinterpret_cast (const ACE_UINT32 *, orig); + *reinterpret_cast<const ACE_UINT32 *> (orig); register ACE_UINT32 y = - *ACE_reinterpret_cast (const ACE_UINT32 *, orig + 4); - *ACE_reinterpret_cast (ACE_UINT32 *, target) = y; - *ACE_reinterpret_cast (ACE_UINT32 *, target + 4) = x; + *reinterpret_cast<const ACE_UINT32 *> (orig + 4); + *reinterpret_cast<ACE_UINT32 *> (target) = y; + *reinterpret_cast<ACE_UINT32 *> (target + 4) = x; return true; #else # if !defined (ACE_ENABLE_SWAP_ON_WRITE) - *ACE_reinterpret_cast (ACE_CDR::ULongLong *,buf) = *x; + *reinterpret_cast<ACE_CDR::ULongLong *> (buf) = *x; return true; # else if (!this->do_byte_swap_) { - *ACE_reinterpret_cast (ACE_CDR::ULongLong *, buf) = *x; + *reinterpret_cast<ACE_CDR::ULongLong *> (buf) = *x; return true; } else { - ACE_CDR::swap_8 (ACE_reinterpret_cast (const char*, x), buf); + ACE_CDR::swap_8 (reinterpret_cast<const char*> (x), buf); return true; } # endif /* ACE_ENABLE_SWAP_ON_WRITE */ @@ -488,17 +491,17 @@ ACE_OutputCDR::write_16 (const ACE_CDR::LongDouble *x) buf) == 0) { #if !defined (ACE_ENABLE_SWAP_ON_WRITE) - *ACE_reinterpret_cast(ACE_CDR::LongDouble*,buf) = *x; + *reinterpret_cast<ACE_CDR::LongDouble*> (buf) = *x; return 1; #else if (!this->do_byte_swap_) { - *ACE_reinterpret_cast (ACE_CDR::LongDouble *, buf) = *x; + *reinterpret_cast<ACE_CDR::LongDouble *> (buf) = *x; return true; } else { - ACE_CDR::swap_16 (ACE_reinterpret_cast (const char*, x), buf); + ACE_CDR::swap_16 (reinterpret_cast<const char*> (x), buf); return true; } #endif /* ACE_ENABLE_SWAP_ON_WRITE */ @@ -522,24 +525,24 @@ ACE_OutputCDR::write_wchar_array_i (const ACE_CDR::WChar *x, { if (ACE_OutputCDR::wchar_maxbytes_ == 2) { - ACE_CDR::UShort *sb = ACE_reinterpret_cast(ACE_CDR::UShort *, buf); - for (size_t i = 0; i < length; i++) + ACE_CDR::UShort *sb = reinterpret_cast<ACE_CDR::UShort *> (buf); + for (size_t i = 0; i < length; ++i) #if !defined (ACE_ENABLE_SWAP_ON_WRITE) - sb[i] = ACE_static_cast (ACE_CDR::UShort, x[i]); + sb[i] = static_cast<ACE_CDR::UShort> (x[i]); #else if (!this->do_byte_swap_) - sb[i] = ACE_static_cast (ACE_CDR::UShort, x[i]); + sb[i] = static_cast<ACE_CDR::UShort> (x[i]); else { - ACE_CDR::UShort sx = ACE_static_cast (ACE_CDR::UShort, x[i]); - ACE_CDR::swap_2 (ACE_reinterpret_cast(char *,&sx),&buf[i*2]); + ACE_CDR::UShort sx = static_cast<ACE_CDR::UShort> (x[i]); + ACE_CDR::swap_2 (reinterpret_cast<char *> (&sx), &buf[i * 2]); } #endif /* ACE_DISABLE_SWAP_ON_READ */ } else { - for (size_t i = 0; i < length; i++) - buf[i] = ACE_static_cast (ACE_CDR::Octet, x[i]); + for (size_t i = 0; i < length; ++i) + buf[i] = static_cast<ACE_CDR::Octet> (x[i]); } return this->good_bit_; } @@ -569,7 +572,7 @@ ACE_OutputCDR::write_array (const void *x, } else { - const char *source = ACE_reinterpret_cast (const char *, x); + const char *source = reinterpret_cast<const char *> (x); switch (size) { case 2: @@ -859,20 +862,20 @@ ACE_InputCDR::ACE_InputCDR (const ACE_OutputCDR& rhs, ACE_CDR::Boolean ACE_InputCDR::skip_wchar (void) { - if (ACE_static_cast (ACE_CDR::Short, major_version_) == 1 - && ACE_static_cast (ACE_CDR::Short, minor_version_) == 2) + if (static_cast<ACE_CDR::Short> (major_version_) == 1 + && static_cast<ACE_CDR::Short> (minor_version_) == 2) { ACE_CDR::Octet len; if (this->read_1 (&len)) - return this->skip_bytes (ACE_static_cast (size_t, len)); + return this->skip_bytes (static_cast<size_t> (len)); } else { ACE_CDR::WChar x; if (sizeof (ACE_CDR::WChar) == 2) - return this->read_2 (ACE_reinterpret_cast (ACE_CDR::UShort *,&x)); + return this->read_2 (reinterpret_cast<ACE_CDR::UShort *> (&x)); else - return this->read_4 (ACE_reinterpret_cast (ACE_CDR::ULong *,&x)); + return this->read_4 (reinterpret_cast<ACE_CDR::ULong *> (&x)); } return (this->good_bit_ = false); @@ -894,27 +897,27 @@ ACE_InputCDR::read_wchar (ACE_CDR::WChar& x) if (ACE_OutputCDR::wchar_maxbytes_ == sizeof (ACE_CDR::WChar)) { - if (ACE_static_cast (ACE_CDR::Short, major_version_) == 1 - && ACE_static_cast (ACE_CDR::Short, minor_version_) == 2) + if (static_cast<ACE_CDR::Short> (major_version_) == 1 + && static_cast<ACE_CDR::Short> (minor_version_) == 2) { ACE_CDR::Octet len; if (this->read_1 (&len)) return this->read_octet_array - (ACE_reinterpret_cast (ACE_CDR::Octet*, &x), - ACE_static_cast (ACE_CDR::ULong, len)); + (reinterpret_cast<ACE_CDR::Octet*> (&x), + static_cast<ACE_CDR::ULong> (len)); else return (this->good_bit_ = false); } if (sizeof (ACE_CDR::WChar) == 2) - return this->read_2 (ACE_reinterpret_cast (ACE_CDR::UShort *, &x)); + return this->read_2 (reinterpret_cast<ACE_CDR::UShort *> (&x)); else - return this->read_4 (ACE_reinterpret_cast (ACE_CDR::ULong *, &x)); + return this->read_4 (reinterpret_cast<ACE_CDR::ULong *> (&x)); } - if (ACE_static_cast (ACE_CDR::Short, major_version_) == 1 - && ACE_static_cast (ACE_CDR::Short, minor_version_) == 2) + if (static_cast<ACE_CDR::Short> (major_version_) == 1 + && static_cast<ACE_CDR::Short> (minor_version_) == 2) { ACE_CDR::Octet len; @@ -924,10 +927,10 @@ ACE_InputCDR::read_wchar (ACE_CDR::WChar& x) { ACE_CDR::Short sx; if (this->read_octet_array - (ACE_reinterpret_cast (ACE_CDR::Octet*, &sx), - ACE_static_cast (ACE_CDR::ULong, len))) + (reinterpret_cast<ACE_CDR::Octet*> (&sx), + static_cast<ACE_CDR::ULong> (len))) { - x = ACE_static_cast(ACE_CDR::WChar, sx); + x = static_cast<ACE_CDR::WChar> (sx); return true; } } @@ -935,10 +938,10 @@ ACE_InputCDR::read_wchar (ACE_CDR::WChar& x) { ACE_CDR::Octet ox; if (this->read_octet_array - (ACE_reinterpret_cast (ACE_CDR::Octet*, &ox), - ACE_static_cast (ACE_CDR::ULong, len))) + (reinterpret_cast<ACE_CDR::Octet*> (&ox), + static_cast<ACE_CDR::ULong> (len))) { - x = ACE_static_cast(ACE_CDR::WChar, ox); + x = static_cast<ACE_CDR::WChar> (ox); return true; } } @@ -949,9 +952,9 @@ ACE_InputCDR::read_wchar (ACE_CDR::WChar& x) if (ACE_OutputCDR::wchar_maxbytes_ == 2) { ACE_CDR::UShort sx; - if (this->read_2 (ACE_reinterpret_cast (ACE_CDR::UShort *, &sx))) + if (this->read_2 (reinterpret_cast<ACE_CDR::UShort *> (&sx))) { - x = ACE_static_cast(ACE_CDR::WChar, sx); + x = static_cast<ACE_CDR::WChar> (sx); return true; } } @@ -960,7 +963,7 @@ ACE_InputCDR::read_wchar (ACE_CDR::WChar& x) ACE_CDR::Octet ox; if (this->read_1 (&ox)) { - x = ACE_static_cast(ACE_CDR::WChar, ox); + x = static_cast<ACE_CDR::WChar> (ox); return true; } @@ -1004,7 +1007,7 @@ ACE_InputCDR::read_string (ACE_CDR::Char *&x) ACE_NEW_RETURN (x, ACE_CDR::Char[1], 0); - ACE_OS::strcpy (ACE_const_cast (char *&, x), ""); + ACE_OS::strcpy (const_cast<char *&> (x), ""); return true; } @@ -1054,8 +1057,8 @@ ACE_InputCDR::read_wstring (ACE_CDR::WChar*& x) if (len > 0 && len <= this->length ()) { - if (ACE_static_cast (ACE_CDR::Short, this->major_version_) == 1 - && ACE_static_cast (ACE_CDR::Short, this->minor_version_) == 2) + if (static_cast<ACE_CDR::Short> (this->major_version_) == 1 + && static_cast<ACE_CDR::Short> (this->minor_version_) == 2) { len /= ACE_OutputCDR::wchar_maxbytes_; @@ -1122,7 +1125,7 @@ ACE_InputCDR::read_array (void* x, ACE_OS::memcpy (x, buf, size*length); else { - char *target = ACE_reinterpret_cast (char*, x); + char *target = reinterpret_cast<char*> (x); switch (size) { case 2: @@ -1164,25 +1167,25 @@ ACE_InputCDR::read_wchar_array_i (ACE_CDR::WChar* x, { if (ACE_OutputCDR::wchar_maxbytes_ == 2) { - ACE_CDR::UShort *sb = ACE_reinterpret_cast(ACE_CDR::UShort *, buf); + ACE_CDR::UShort *sb = reinterpret_cast<ACE_CDR::UShort *> (buf); for (size_t i = 0; i < length; ++i) #if defined (ACE_DISABLE_SWAP_ON_READ) - x[i] = ACE_static_cast (ACE_CDR::WChar, sb[i]); + x[i] = static_cast<ACE_CDR::WChar> (sb[i]); #else if (!this->do_byte_swap_) - x[i] = ACE_static_cast (ACE_CDR::WChar, sb[i]); + x[i] = static_cast<ACE_CDR::WChar> (sb[i]); else { ACE_CDR::UShort sx; - ACE_CDR::swap_2 (&buf[i*2], ACE_reinterpret_cast(char *,&sx)); - x[i] = ACE_static_cast (ACE_CDR::WChar,sx); + ACE_CDR::swap_2 (&buf[i * 2], reinterpret_cast<char *> (&sx)); + x[i] = static_cast<ACE_CDR::WChar> (sx); } #endif /* ACE_DISABLE_SWAP_ON_READ */ } else { for (size_t i = 0; i < length; ++i) - x[i] = ACE_static_cast (ACE_CDR::Octet, buf[i]); + x[i] = static_cast<ACE_CDR::Octet> (buf[i]); } return this->good_bit_; } @@ -1218,7 +1221,7 @@ ACE_InputCDR::read_1 (ACE_CDR::Octet *x) { if (this->rd_ptr () < this->wr_ptr ()) { - *x = *ACE_reinterpret_cast (ACE_CDR::Octet*,this->rd_ptr ()); + *x = *reinterpret_cast<ACE_CDR::Octet*> (this->rd_ptr ()); this->start_.rd_ptr (1); return true; } @@ -1235,11 +1238,11 @@ ACE_InputCDR::read_2 (ACE_CDR::UShort *x) { #if !defined (ACE_DISABLE_SWAP_ON_READ) if (!this->do_byte_swap_) - *x = *ACE_reinterpret_cast (ACE_CDR::UShort*, buf); + *x = *reinterpret_cast<ACE_CDR::UShort*> (buf); else - ACE_CDR::swap_2 (buf, ACE_reinterpret_cast (char*, x)); + ACE_CDR::swap_2 (buf, reinterpret_cast<char*> (x)); #else - *x = *ACE_reinterpret_cast(ACE_CDR::UShort*,buf); + *x = *reinterpret_cast<ACE_CDR::UShort*> (buf); #endif /* ACE_DISABLE_SWAP_ON_READ */ return true; } @@ -1255,11 +1258,11 @@ ACE_InputCDR::read_4 (ACE_CDR::ULong *x) { #if !defined (ACE_DISABLE_SWAP_ON_READ) if (!this->do_byte_swap_) - *x = *ACE_reinterpret_cast (ACE_CDR::ULong*, buf); + *x = *reinterpret_cast<ACE_CDR::ULong*> (buf); else - ACE_CDR::swap_4 (buf, ACE_reinterpret_cast (char*, x)); + ACE_CDR::swap_4 (buf, reinterpret_cast<char*> (x)); #else - *x = *ACE_reinterpret_cast(ACE_CDR::ULong*,buf); + *x = *reinterpret_cast<ACE_CDR::ULong*> (buf); #endif /* ACE_DISABLE_SWAP_ON_READ */ return true; } @@ -1280,36 +1283,36 @@ ACE_InputCDR::read_8 (ACE_CDR::ULongLong *x) { // Convert from Intel format (12345678 => 56781234) const char *orig = buf; - char *target = ACE_reinterpret_cast (char *, x); + char *target = reinterpret_cast<char *> (x); register ACE_UINT32 x = - *ACE_reinterpret_cast (const ACE_UINT32 *, orig); + *reinterpret_cast<const ACE_UINT32 *> (orig); register ACE_UINT32 y = - *ACE_reinterpret_cast (const ACE_UINT32 *, orig + 4); - *ACE_reinterpret_cast (ACE_UINT32 *, target) = y; - *ACE_reinterpret_cast (ACE_UINT32 *, target + 4) = x; + *reinterpret_cast<const ACE_UINT32 *> (orig + 4); + *reinterpret_cast<ACE_UINT32 *> (target) = y; + *reinterpret_cast<ACE_UINT32 *> (target + 4) = x; } else { // Convert from Sparc format (12345678 => 43218765) const char *orig = buf; - char *target = ACE_reinterpret_cast (char *, x); + char *target = reinterpret_cast<char *> (x); register ACE_UINT32 x = - *ACE_reinterpret_cast (const ACE_UINT32 *, orig); + *reinterpret_cast<const ACE_UINT32 *> (orig); register ACE_UINT32 y = - *ACE_reinterpret_cast (const ACE_UINT32 *, orig + 4); + *reinterpret_cast<const ACE_UINT32 *> (orig + 4); x = (x << 24) | ((x & 0xff00) << 8) | ((x & 0xff0000) >> 8) | (x >> 24); y = (y << 24) | ((y & 0xff00) << 8) | ((y & 0xff0000) >> 8) | (y >> 24); - *ACE_reinterpret_cast (ACE_UINT32 *, target) = x; - *ACE_reinterpret_cast (ACE_UINT32 *, target + 4) = y; + *reinterpret_cast<ACE_UINT32 *> (target) = x; + *reinterpret_cast<ACE_UINT32 *> (target + 4) = y; } # else if (!this->do_byte_swap_) - *x = *ACE_reinterpret_cast (ACE_CDR::ULongLong *, buf); + *x = *reinterpret_cast<ACE_CDR::ULongLong *> (buf); else - ACE_CDR::swap_8 (buf, ACE_reinterpret_cast (char *, x)); + ACE_CDR::swap_8 (buf, reinterpret_cast<char *> (x)); # endif /* !__arm__ */ #else - *x = *ACE_reinterpret_cast (ACE_CDR::ULongLong *, buf); + *x = *reinterpret_cast<ACE_CDR::ULongLong *> (buf); #endif /* ACE_DISABLE_SWAP_ON_READ */ return true; } @@ -1328,11 +1331,11 @@ ACE_InputCDR::read_16 (ACE_CDR::LongDouble *x) { #if !defined (ACE_DISABLE_SWAP_ON_READ) if (!this->do_byte_swap_) - *x = *ACE_reinterpret_cast (ACE_CDR::LongDouble *, buf); + *x = *reinterpret_cast<ACE_CDR::LongDouble *> (buf); else - ACE_CDR::swap_16 (buf, ACE_reinterpret_cast (char*, x)); + ACE_CDR::swap_16 (buf, reinterpret_cast<char*> (x)); #else - *x = *ACE_reinterpret_cast(ACE_CDR::LongDouble*,buf); + *x = *reinterpret_cast<ACE_CDR::LongDouble*> (buf); #endif /* ACE_DISABLE_SWAP_ON_READ */ return true; } @@ -1367,8 +1370,8 @@ ACE_InputCDR::skip_wstring (void) if (continue_skipping != 0 && len != 0) { - if (ACE_static_cast (ACE_CDR::Short, this->major_version_) == 1 - && ACE_static_cast (ACE_CDR::Short, this->minor_version_) == 2) + if (static_cast<ACE_CDR::Short> (this->major_version_) == 1 + && static_cast<ACE_CDR::Short> (this->minor_version_) == 2) continue_skipping = this->skip_bytes ((size_t)len); else while (continue_skipping != 0 && len--) @@ -1610,13 +1613,13 @@ ACE_InputCDR::reset_contents (void) ACE_CDR::Boolean ACE_OutputCDR::write_float (ACE_CDR::Float x) { - return this->write_4 (ACE_reinterpret_cast (const ACE_CDR::ULong*, &x)); + return this->write_4 (reinterpret_cast<const ACE_CDR::ULong*> (&x)); } ACE_CDR::Boolean ACE_InputCDR::read_float (ACE_CDR::Float &x) { - return this->read_4 (ACE_reinterpret_cast (ACE_CDR::ULong*, &x)); + return this->read_4 (reinterpret_cast<ACE_CDR::ULong*> (&x)); } #endif /* VXWORKS && ghs */ diff --git a/ace/CDR_Stream.h b/ace/CDR_Stream.h index b8806e7f679..0781a8cda41 100644 --- a/ace/CDR_Stream.h +++ b/ace/CDR_Stream.h @@ -643,12 +643,14 @@ public: struct ACE_Export to_string { - /// The constructor taking a non-const string is - /// now deprecated (C++ mapping 00-01-02), but we - /// keep it around for backward compatibility. - to_string (ACE_CDR::Char *&s, + /** + * @deprecated The constructor taking a non-const string is now + * deprecated (C++ mapping 00-01-02), but we keep it + * around for backward compatibility. + */ + to_string (char *&s, ACE_CDR::ULong b); - to_string (const ACE_CDR::Char *&s, + to_string (const char *&s, ACE_CDR::ULong b); const ACE_CDR::Char *&val_; ACE_CDR::ULong bound_; diff --git a/ace/CDR_Stream.i b/ace/CDR_Stream.i index 34fa8ddb46f..c5f532135cd 100644 --- a/ace/CDR_Stream.i +++ b/ace/CDR_Stream.i @@ -70,7 +70,7 @@ ACE_INLINE ACE_OutputCDR::from_string::from_string (const ACE_CDR::Char *s, ACE_CDR::ULong b, ACE_CDR::Boolean nocopy) - : val_ (ACE_const_cast (ACE_CDR::Char *, s)), + : val_ (const_cast<ACE_CDR::Char *> (s)), bound_ (b), nocopy_ (nocopy) { @@ -79,7 +79,7 @@ ACE_OutputCDR::from_string::from_string (const ACE_CDR::Char *s, ACE_INLINE ACE_InputCDR::to_string::to_string (ACE_CDR::Char *&s, ACE_CDR::ULong b) - : val_ (ACE_const_cast (const ACE_CDR::Char *&, s)), + : val_ (const_cast<const ACE_CDR::Char *&> (s)), bound_ (b) { } @@ -106,7 +106,7 @@ ACE_INLINE ACE_OutputCDR::from_wstring::from_wstring (const ACE_CDR::WChar *ws, ACE_CDR::ULong b, ACE_CDR::Boolean nocopy) - : val_ (ACE_const_cast (ACE_CDR::WChar *, ws)), + : val_ (const_cast<ACE_CDR::WChar *> (ws)), bound_ (b), nocopy_ (nocopy) { @@ -115,7 +115,7 @@ ACE_OutputCDR::from_wstring::from_wstring (const ACE_CDR::WChar *ws, ACE_INLINE ACE_InputCDR::to_wstring::to_wstring (ACE_CDR::WChar *&ws, ACE_CDR::ULong b) - : val_ (ACE_const_cast (const ACE_CDR::WChar *&, ws)), + : val_ (const_cast<const ACE_CDR::WChar *&> (ws)), bound_ (b) { } @@ -173,7 +173,7 @@ ACE_OutputCDR::reset (void) ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_octet (ACE_CDR::Octet x) { - return this->write_1 (ACE_reinterpret_cast (const ACE_CDR::Octet *, &x)); + return this->write_1 (reinterpret_cast<const ACE_CDR::Octet *> (&x)); } ACE_INLINE ACE_CDR::Boolean @@ -186,64 +186,64 @@ ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_char (ACE_CDR::Char x) { if (this->char_translator_ == 0) - return this->write_1 (ACE_reinterpret_cast (const ACE_CDR::Octet*, &x)); + return this->write_1 (reinterpret_cast<const ACE_CDR::Octet*> (&x)); return this->char_translator_->write_char (*this, x); } ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_short (ACE_CDR::Short x) { - return this->write_2 (ACE_reinterpret_cast (const ACE_CDR::UShort*, &x)); + return this->write_2 (reinterpret_cast<const ACE_CDR::UShort*> (&x)); } ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_ushort (ACE_CDR::UShort x) { - return this->write_2 (ACE_reinterpret_cast (const ACE_CDR::UShort*, &x)); + return this->write_2 (reinterpret_cast<const ACE_CDR::UShort*> (&x)); } ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_long (ACE_CDR::Long x) { - return this->write_4 (ACE_reinterpret_cast (const ACE_CDR::ULong*, &x)); + return this->write_4 (reinterpret_cast<const ACE_CDR::ULong*> (&x)); } ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_ulong (ACE_CDR::ULong x) { - return this->write_4 (ACE_reinterpret_cast (const ACE_CDR::ULong*, &x)); + return this->write_4 (reinterpret_cast<const ACE_CDR::ULong*> (&x)); } ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_longlong (const ACE_CDR::LongLong &x) { - return this->write_8 (ACE_reinterpret_cast (const ACE_CDR::ULongLong*, &x)); + return this->write_8 (reinterpret_cast<const ACE_CDR::ULongLong*> (&x)); } ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_ulonglong (const ACE_CDR::ULongLong &x) { - return this->write_8 (ACE_reinterpret_cast (const ACE_CDR::ULongLong*,&x)); + return this->write_8 (reinterpret_cast<const ACE_CDR::ULongLong*> (&x)); } #if !defined (VXWORKS) || !defined (ghs) ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_float (ACE_CDR::Float x) { - return this->write_4 (ACE_reinterpret_cast (const ACE_CDR::ULong*, &x)); + return this->write_4 (reinterpret_cast<const ACE_CDR::ULong*> (&x)); } #endif /* !VXWORKS || !ghs */ ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_double (const ACE_CDR::Double &x) { - return this->write_8 (ACE_reinterpret_cast (const ACE_CDR::ULongLong*, &x)); + return this->write_8 (reinterpret_cast<const ACE_CDR::ULongLong*> (&x)); } ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_longdouble (const ACE_CDR::LongDouble &x) { - return this->write_16 (ACE_reinterpret_cast (const ACE_CDR::LongDouble*,&x)); + return this->write_16 (reinterpret_cast<const ACE_CDR::LongDouble*> (&x)); } ACE_INLINE ACE_CDR::Boolean @@ -251,8 +251,8 @@ ACE_OutputCDR::write_string (const ACE_CDR::Char *x) { if (x != 0) { - ACE_CDR::ULong len = - ACE_static_cast (ACE_CDR::ULong, ACE_OS::strlen (x)); + const ACE_CDR::ULong len = + static_cast<ACE_CDR::ULong> (ACE_OS::strlen (x)); return this->write_string (len, x); } return this->write_string (0, 0); @@ -264,7 +264,7 @@ ACE_OutputCDR::write_wstring (const ACE_CDR::WChar *x) if (x != 0) { ACE_CDR::ULong len = - ACE_static_cast (ACE_CDR::ULong, ACE_OS::strlen (x)); + static_cast<ACE_CDR::ULong> (ACE_OS::strlen (x)); return this->write_wstring (len, x); } return this->write_wstring (0, 0); @@ -571,7 +571,7 @@ ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_char (ACE_CDR::Char &x) { if (this->char_translator_ == 0) - return this->read_1 (ACE_reinterpret_cast (ACE_CDR::Octet*, &x)); + return this->read_1 (reinterpret_cast<ACE_CDR::Octet*> (&x)); return this->char_translator_->read_char (*this, x); } @@ -579,60 +579,60 @@ ACE_InputCDR::read_char (ACE_CDR::Char &x) ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_short (ACE_CDR::Short &x) { - return this->read_2 (ACE_reinterpret_cast (ACE_CDR::UShort*, &x)); + return this->read_2 (reinterpret_cast<ACE_CDR::UShort*> (&x)); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_ushort (ACE_CDR::UShort &x) { - return this->read_2 (ACE_reinterpret_cast (ACE_CDR::UShort*, &x)); + return this->read_2 (reinterpret_cast<ACE_CDR::UShort*> (&x)); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_long (ACE_CDR::Long &x) { - return this->read_4 (ACE_reinterpret_cast (ACE_CDR::ULong*, &x)); + return this->read_4 (reinterpret_cast<ACE_CDR::ULong*> (&x)); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_ulong (ACE_CDR::ULong &x) { - return this->read_4 (ACE_reinterpret_cast (ACE_CDR::ULong*, &x)); + return this->read_4 (reinterpret_cast<ACE_CDR::ULong*> (&x)); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_longlong (ACE_CDR::LongLong &x) { - return this->read_8 (ACE_reinterpret_cast (ACE_CDR::ULongLong*, &x)); + return this->read_8 (reinterpret_cast<ACE_CDR::ULongLong*> (&x)); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_ulonglong (ACE_CDR::ULongLong &x) { - return this->read_8 (ACE_reinterpret_cast (ACE_CDR::ULongLong*,&x)); + return this->read_8 (reinterpret_cast<ACE_CDR::ULongLong*> (&x)); } #if !defined (VXWORKS) || !defined (ghs) ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_float (ACE_CDR::Float &x) { - return this->read_4 (ACE_reinterpret_cast (ACE_CDR::ULong*, &x)); + return this->read_4 (reinterpret_cast<ACE_CDR::ULong*> (&x)); } #endif /* !VXWORKS || !ghs */ ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_double (ACE_CDR::Double &x) { - return this->read_8 (ACE_reinterpret_cast (ACE_CDR::ULongLong*, &x)); + return this->read_8 (reinterpret_cast<ACE_CDR::ULongLong*> (&x)); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_longdouble (ACE_CDR::LongDouble &x) { - return this->read_16 (ACE_reinterpret_cast (ACE_CDR::LongDouble*,&x)); + return this->read_16 (reinterpret_cast<ACE_CDR::LongDouble*> (&x)); } ACE_INLINE size_t @@ -869,7 +869,7 @@ ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::skip_char (void) { ACE_CDR::Char x; - return this->read_1 (ACE_reinterpret_cast (ACE_CDR::Octet*,&x)); + return this->read_1 (reinterpret_cast<ACE_CDR::Octet*> (&x)); } ACE_INLINE ACE_CDR::Boolean @@ -891,42 +891,42 @@ ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::skip_short (void) { ACE_CDR::Short x; - return this->read_2 (ACE_reinterpret_cast (ACE_CDR::UShort*,&x)); + return this->read_2 (reinterpret_cast<ACE_CDR::UShort*> (&x)); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::skip_ushort (void) { ACE_CDR::UShort x; - return this->read_2 (ACE_reinterpret_cast (ACE_CDR::UShort*,&x)); + return this->read_2 (reinterpret_cast<ACE_CDR::UShort*> (&x)); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::skip_long (void) { ACE_CDR::Long x; - return this->read_4 (ACE_reinterpret_cast (ACE_CDR::ULong*,&x)); + return this->read_4 (reinterpret_cast<ACE_CDR::ULong*> (&x)); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::skip_ulong (void) { ACE_CDR::ULong x; - return this->read_4 (ACE_reinterpret_cast (ACE_CDR::ULong*,&x)); + return this->read_4 (reinterpret_cast<ACE_CDR::ULong*> (&x)); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::skip_longlong (void) { ACE_CDR::LongLong x; - return this->read_8 (ACE_reinterpret_cast (ACE_CDR::ULongLong*,&x)); + return this->read_8 (reinterpret_cast<ACE_CDR::ULongLong*> (&x)); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::skip_ulonglong (void) { ACE_CDR::ULongLong x; - return this->read_8 (ACE_reinterpret_cast (ACE_CDR::ULongLong*,&x)); + return this->read_8 (reinterpret_cast<ACE_CDR::ULongLong*> (&x)); } ACE_INLINE ACE_CDR::Boolean @@ -942,14 +942,14 @@ ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::skip_double (void) { double x; - return this->read_8 (ACE_reinterpret_cast (ACE_CDR::ULongLong*,&x)); + return this->read_8 (reinterpret_cast<ACE_CDR::ULongLong*> (&x)); } ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::skip_longdouble (void) { ACE_CDR::LongDouble x; - return this->read_16 (ACE_reinterpret_cast (ACE_CDR::LongDouble*,&x)); + return this->read_16 (reinterpret_cast<ACE_CDR::LongDouble*> (&x)); } ACE_INLINE char* @@ -1134,7 +1134,7 @@ operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_string x) if (x.val_ != 0) { - len = ACE_static_cast (ACE_CDR::ULong, ACE_OS::strlen (x.val_)); + len = static_cast<ACE_CDR::ULong> (ACE_OS::strlen (x.val_)); } os.write_string (len, x.val_); @@ -1149,7 +1149,7 @@ operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_wstring x) if (x.val_ != 0) { - len = ACE_static_cast (ACE_CDR::ULong, ACE_OS::strlen (x.val_)); + len = static_cast<ACE_CDR::ULong> (ACE_OS::strlen (x.val_)); } os.write_wstring (len, x.val_); @@ -1275,7 +1275,7 @@ operator>> (ACE_InputCDR &is, ACE_InputCDR::to_octet x) ACE_INLINE ACE_CDR::Boolean operator>> (ACE_InputCDR &is, ACE_InputCDR::to_string x) { - is.read_string (ACE_const_cast (char *&, x.val_)); + is.read_string (const_cast<char *&> (x.val_)); // check if the bounds are satisfied return (ACE_CDR::Boolean) (is.good_bit () @@ -1286,7 +1286,7 @@ operator>> (ACE_InputCDR &is, ACE_InputCDR::to_string x) ACE_INLINE ACE_CDR::Boolean operator>> (ACE_InputCDR &is, ACE_InputCDR::to_wstring x) { - is.read_wstring (ACE_const_cast (ACE_CDR::WChar *&, x.val_)); + is.read_wstring (const_cast<ACE_CDR::WChar *&> (x.val_)); // check if the bounds are satisfied return (ACE_CDR::Boolean) (is.good_bit () diff --git a/ace/Caching_Utility_T.cpp b/ace/Caching_Utility_T.cpp index 351255c1dfa..19a3b25ebb2 100644 --- a/ace/Caching_Utility_T.cpp +++ b/ace/Caching_Utility_T.cpp @@ -58,10 +58,9 @@ ACE_Pair_Caching_Utility<KEY, VALUE, CONTAINER, ITERATOR, ATTRIBUTES>::clear_cac // Calculate the no of entries to remove from the cache depending // upon the <purge_percent>. size_t entries_to_remove - = ACE_MAX (ACE_static_cast (size_t, 1), - ACE_static_cast (size_t, - ACE_static_cast(double, purge_percent) - / 100 * current_map_size)); + = ACE_MAX (static_cast<size_t> (1), + static_cast<size_t> (static_cast<double> (purge_percent) + / 100 * current_map_size)); KEY *key_to_remove = 0; VALUE *value_to_remove = 0; @@ -159,10 +158,9 @@ ACE_Recyclable_Handler_Caching_Utility<KEY, VALUE, CONTAINER, ITERATOR, ATTRIBUT // Calculate the no of entries to remove from the cache depending // upon the <purge_percent>. size_t entries_to_remove - = ACE_MAX (ACE_static_cast (size_t, 1), - ACE_static_cast(size_t, - ACE_static_cast(double, purge_percent) - / 100 * current_map_size)); + = ACE_MAX (static_cast<size_t> (1), + static_cast<size_t> (static_cast<double> (purge_percent) + / 100 * current_map_size)); KEY *key_to_remove = 0; VALUE *value_to_remove = 0; @@ -279,10 +277,9 @@ ACE_Refcounted_Recyclable_Handler_Caching_Utility<KEY, VALUE, CONTAINER, ITERATO // Calculate the no of entries to remove from the cache depending // upon the <purge_percent>. size_t entries_to_remove - = ACE_MAX (ACE_static_cast (size_t, 1), - ACE_static_cast(size_t, - ACE_static_cast(double, purge_percent) - / 100 * available_entries)); + = ACE_MAX (static_cast<size_t> (1), + static_cast<size_t> (static_cast<double> (purge_percent) + / 100 * available_entries)); if (entries_to_remove >= available_entries || entries_to_remove == 0) @@ -404,10 +401,9 @@ ACE_Handler_Caching_Utility<KEY, VALUE, CONTAINER, ITERATOR, ATTRIBUTES>::clear_ // Calculate the no of entries to remove from the cache depending // upon the <purge_percent>. size_t entries_to_remove - = ACE_MAX (ACE_static_cast (size_t, 1), - ACE_static_cast(size_t, - ACE_static_cast(double, purge_percent) - / 100 * current_map_size)); + = ACE_MAX (static_cast<size_t> (1), + static_cast<size_t> (static_cast<double> (purge_percent) + / 100 * current_map_size)); KEY *key_to_remove = 0; VALUE *value_to_remove = 0; diff --git a/ace/Cleanup.cpp b/ace/Cleanup.cpp index 1bb4eca58a9..9e51dd6cf70 100644 --- a/ace/Cleanup.cpp +++ b/ace/Cleanup.cpp @@ -172,15 +172,13 @@ ACE_OS_Exit_Info::call_hooks () iter = iter->next_) { ACE_Cleanup_Info &info = iter->cleanup_info_; - if (info.cleanup_hook_ == ACE_reinterpret_cast (ACE_CLEANUP_FUNC, - ace_cleanup_destroyer)) + if (info.cleanup_hook_ == reinterpret_cast<ACE_CLEANUP_FUNC> (ace_cleanup_destroyer)) // The object is an ACE_Cleanup. - ace_cleanup_destroyer (ACE_reinterpret_cast (ACE_Cleanup *, - info.object_), + ace_cleanup_destroyer (reinterpret_cast<ACE_Cleanup *> (info.object_), info.param_); else if (info.object_ == &ace_exit_hook_marker) // The hook is an ACE_EXIT_HOOK. - (* ACE_reinterpret_cast (ACE_EXIT_HOOK, info.cleanup_hook_)) (); + (* reinterpret_cast<ACE_EXIT_HOOK> (info.cleanup_hook_)) (); else (*info.cleanup_hook_) (info.object_, info.param_); } diff --git a/ace/Codecs.cpp b/ace/Codecs.cpp index 872393086d6..ebacffa2fa4 100644 --- a/ace/Codecs.cpp +++ b/ace/Codecs.cpp @@ -97,7 +97,7 @@ ACE_Base64::length (const ACE_Byte* input) if (!ACE_Base64::init_) ACE_Base64::init(); - ACE_Byte* ptr = ACE_const_cast (ACE_Byte*, input); + ACE_Byte* ptr = const_cast<ACE_Byte*> (input); while (*ptr != 0 && (member_[*(ptr)] == 1 || *ptr == pad_ || ACE_OS::ace_isspace (*ptr))) @@ -120,7 +120,7 @@ ACE_Base64::decode (const ACE_Byte* input, size_t* output_len) ACE_Byte* result = 0; ACE_NEW_RETURN (result, ACE_Byte[result_len], 0); - ACE_Byte* ptr = ACE_const_cast (ACE_Byte*, input); + ACE_Byte* ptr = const_cast<ACE_Byte*> (input); while (*ptr != 0 && (member_[*(ptr)] == 1 || *ptr == pad_ || ACE_OS::ace_isspace (*ptr))) diff --git a/ace/Codeset_IBM1047.cpp b/ace/Codeset_IBM1047.cpp index e529f1b15ee..aeda9a3c43e 100644 --- a/ace/Codeset_IBM1047.cpp +++ b/ace/Codeset_IBM1047.cpp @@ -50,7 +50,7 @@ ACE_CDR::Boolean ACE_IBM1047_ISO8859::read_char (ACE_InputCDR &in, ACE_CDR::Char &x) { - if (this->read_1 (in, ACE_reinterpret_cast (ACE_CDR::Octet*, &x))) + if (this->read_1 (in, reinterpret_cast<ACE_CDR::Octet*> (&x))) { x = ACE_to_IBM1047[x]; return 1; @@ -106,9 +106,9 @@ ACE_CDR::Boolean ACE_IBM1047_ISO8859::write_char (ACE_OutputCDR& out, ACE_CDR::Char x) { - return this->write_1 (out, - ACE_reinterpret_cast (const ACE_CDR::Octet*, - &ACE_from_IBM1047[x])); + return + this->write_1 (out, + reinterpret_cast<const ACE_CDR::Octet*> (&ACE_from_IBM1047[x])); } ACE_CDR::Boolean @@ -168,7 +168,7 @@ ACE_CDR::Boolean ACE_ISO8859_IBM1047::read_char (ACE_InputCDR& in, ACE_CDR::Char& x) { - if (this->read_1 (in, ACE_reinterpret_cast (ACE_CDR::Octet*, &x))) + if (this->read_1 (in, reinterpret_cast<ACE_CDR::Octet*> (&x))) { x = ACE_from_IBM1047[x]; return 1; @@ -224,9 +224,9 @@ ACE_CDR::Boolean ACE_ISO8859_IBM1047::write_char (ACE_OutputCDR &out, ACE_CDR::Char x) { - return this->write_1 (out, - ACE_reinterpret_cast (const ACE_CDR::Octet *, - &ACE_to_IBM1047[x])); + return + this->write_1 (out, + reinterpret_cast<const ACE_CDR::Octet *> (&ACE_to_IBM1047[x])); } ACE_CDR::Boolean diff --git a/ace/Condition_T.inl b/ace/Condition_T.inl index 4e67ffdb1fc..cb927320208 100644 --- a/ace/Condition_T.inl +++ b/ace/Condition_T.inl @@ -29,9 +29,8 @@ ACE_Condition<MUTEX>::remove (void) ACE_OS::munmap (this->process_cond_, sizeof (ACE_cond_t)); ACE_OS::shm_unlink (this->condname_); - ACE_OS::free (ACE_static_cast (void *, - ACE_const_cast (ACE_TCHAR *, - this->condname_))); + ACE_OS::free ( + static_cast<void *> (const_cast<ACE_TCHAR *> (this->condname_))); } else if (this->process_cond_) { diff --git a/ace/Configuration.cpp b/ace/Configuration.cpp index e1eddc9e062..08c874050e4 100644 --- a/ace/Configuration.cpp +++ b/ace/Configuration.cpp @@ -269,8 +269,8 @@ ACE_Configuration::operator== (const ACE_Configuration& rhs) const bool rc = true; int sectionIndex = 0; ACE_TString sectionName; - ACE_Configuration *nonconst_this = ACE_const_cast (ACE_Configuration*, this); - ACE_Configuration &nonconst_rhs = ACE_const_cast (ACE_Configuration&, rhs); + ACE_Configuration *nonconst_this = const_cast<ACE_Configuration*> (this); + ACE_Configuration &nonconst_rhs = const_cast<ACE_Configuration&> (rhs); const ACE_Configuration_Section_Key& rhsRoot = rhs.root_section (); ACE_Configuration_Section_Key rhsSection; @@ -773,7 +773,7 @@ ACE_Configuration_Win32Registry::set_string_value (const ACE_Configuration_Secti return -1; int errnum; - DWORD len = ACE_static_cast (DWORD, value.length () + 1); + DWORD len = static_cast<DWORD> (value.length () + 1); len *= sizeof (ACE_TCHAR); if ((errnum = ACE_TEXT_RegSetValueEx (base_key, t_name, @@ -838,7 +838,7 @@ ACE_Configuration_Win32Registry::set_binary_value (const ACE_Configuration_Secti 0, REG_BINARY, (BYTE *) data, - ACE_static_cast (DWORD, length))) + static_cast<DWORD> (length))) != ERROR_SUCCESS) { errno = errnum; @@ -2086,7 +2086,7 @@ ACE_Configuration_Heap::get_string_value (const ACE_Configuration_Section_Key& k } // everythings ok, return the data - value = ACE_static_cast (ACE_TCHAR*, VIntId.data_.ptr_); + value = static_cast<ACE_TCHAR*> (VIntId.data_.ptr_); return 0; } diff --git a/ace/Connector.cpp b/ace/Connector.cpp index 6e179193662..cff2d563863 100644 --- a/ace/Connector.cpp +++ b/ace/Connector.cpp @@ -245,7 +245,7 @@ ACE_Connector<SVC_HANDLER, ACE_PEER_CONNECTOR_2>::activate_svc_handler (SVC_HAND template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1> ACE_PEER_CONNECTOR & ACE_Connector<SVC_HANDLER, ACE_PEER_CONNECTOR_2>::connector (void) const { - return ACE_const_cast (ACE_PEER_CONNECTOR &, this->connector_); + return const_cast<ACE_PEER_CONNECTOR &> (this->connector_); } template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1> int @@ -538,8 +538,7 @@ ACE_Connector<SVC_HANDLER, ACE_PEER_CONNECTOR_2>::nonblocking_connect // If we're starting connection under timer control then we need to // schedule a timeout with the ACE_Reactor. - tv = ACE_const_cast (ACE_Time_Value *, - synch_options.time_value ()); + tv = const_cast<ACE_Time_Value *> (synch_options.time_value ()); if (tv == 0) return 0; @@ -731,7 +730,7 @@ ACE_Connector<SVC_HANDLER, ACE_PEER_CONNECTOR_2>::info (ACE_TCHAR **strp, size_t return -1; else ACE_OS::strsncpy (*strp, buf, length); - return ACE_static_cast (int, ACE_OS::strlen (buf)); + return static_cast<int> (ACE_OS::strlen (buf)); } template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1> int diff --git a/ace/Containers_T.cpp b/ace/Containers_T.cpp index 22ef667fc0a..6bb6311e021 100644 --- a/ace/Containers_T.cpp +++ b/ace/Containers_T.cpp @@ -252,8 +252,7 @@ ACE_Unbounded_Stack<T>::push (const T &new_item) ACE_Node<T> *temp; ACE_NEW_MALLOC_RETURN (temp, - ACE_static_cast(ACE_Node<T> *, - this->allocator_->malloc (sizeof (ACE_Node<T>))), + static_cast<ACE_Node<T> *> (this->allocator_->malloc (sizeof (ACE_Node<T>))), ACE_Node<T> (new_item, this->head_->next_), -1); this->head_->next_ = temp; @@ -398,14 +397,14 @@ ACE_Double_Linked_List_Iterator_Base<T>::reset (ACE_Double_Linked_List<T> &dll) template <class T> int ACE_Double_Linked_List_Iterator_Base<T>::go_head (void) { - this->current_ = ACE_static_cast (T*, dllist_->head_->next_); + this->current_ = static_cast<T*> (dllist_->head_->next_); return this->current_ ? 1 : 0; } template <class T> int ACE_Double_Linked_List_Iterator_Base<T>::go_tail (void) { - this->current_ = ACE_static_cast (T*, dllist_->head_->prev_); + this->current_ = static_cast<T*> (dllist_->head_->prev_); return this->current_ ? 1 : 0; } @@ -423,7 +422,7 @@ ACE_Double_Linked_List_Iterator_Base<T>::do_advance (void) { if (this->not_done ()) { - this->current_ = ACE_static_cast (T*, this->current_->next_); + this->current_ = static_cast<T*> (this->current_->next_); return this->not_done (); } else @@ -435,7 +434,7 @@ ACE_Double_Linked_List_Iterator_Base<T>::do_retreat (void) { if (this->not_done ()) { - this->current_ = ACE_static_cast (T*, this->current_->prev_); + this->current_ = static_cast<T*> (this->current_->prev_); return this->not_done (); } else @@ -457,7 +456,7 @@ template <class T> ACE_Double_Linked_List_Iterator<T>::ACE_Double_Linked_List_Iterator (const ACE_Double_Linked_List<T> &dll) : ACE_Double_Linked_List_Iterator_Base <T> (dll) { - this->current_ = ACE_static_cast (T*, dll.head_->next_); + this->current_ = static_cast<T*> (dll.head_->next_); // Advance current_ out of the null area and onto the first item in // the list } @@ -466,7 +465,7 @@ template <class T> void ACE_Double_Linked_List_Iterator<T>::reset (ACE_Double_Linked_List<T> &dll) { this->ACE_Double_Linked_List_Iterator_Base <T>::reset (dll); - this->current_ = ACE_static_cast (T*, dll.head_->next_); + this->current_ = static_cast<T*> (dll.head_->next_); // Advance current_ out of the null area and onto the first item in // the list } @@ -494,7 +493,8 @@ ACE_Double_Linked_List_Iterator<T>::advance_and_remove (int dont_remove) item = this->next (); this->do_advance (); // It seems dangerous to remove nodes in an iterator, but so it goes... - ACE_Double_Linked_List<T> *dllist = ACE_const_cast (ACE_Double_Linked_List<T> *, this->dllist_); + ACE_Double_Linked_List<T> *dllist = + const_cast<ACE_Double_Linked_List<T> *> (this->dllist_); dllist->remove (item); } return item; @@ -561,7 +561,7 @@ ACE_ALLOC_HOOK_DEFINE(ACE_Double_Linked_List_Reverse_Iterator) ACE_Double_Linked_List_Reverse_Iterator<T>::ACE_Double_Linked_List_Reverse_Iterator (ACE_Double_Linked_List<T> &dll) : ACE_Double_Linked_List_Iterator_Base <T> (dll) { - this->current_ = ACE_static_cast (T*, dll.head_->prev_); + this->current_ = static_cast<T*> (dll.head_->prev_); // Advance current_ out of the null area and onto the last item in // the list } @@ -570,7 +570,7 @@ template <class T> void ACE_Double_Linked_List_Reverse_Iterator<T>::reset (ACE_Double_Linked_List<T> &dll) { this->ACE_Double_Linked_List_Iterator_Base <T>::reset (dll); - this->current_ = ACE_static_cast (T*, dll.head_->prev_); + this->current_ = static_cast<T*> (dll.head_->prev_); // Advance current_ out of the null area and onto the last item in // the list } @@ -598,7 +598,8 @@ ACE_Double_Linked_List_Reverse_Iterator<T>::advance_and_remove (int dont_remove) item = this->next (); this->do_retreat (); // It seems dangerous to remove nodes in an iterator, but so it goes... - ACE_Double_Linked_List<T> *dllist = ACE_const_cast (ACE_Double_Linked_List<T> *, this->dllist_); + ACE_Double_Linked_List<T> *dllist = + const_cast<ACE_Double_Linked_List<T> *> (this->dllist_); dllist->remove (item); } return item; @@ -745,8 +746,7 @@ ACE_Double_Linked_List<T>::delete_head (void) if (this->is_empty ()) return 0; - temp = ACE_static_cast (T *, - this->head_->next_); + temp = static_cast<T *> (this->head_->next_); // Detach it from the list. this->remove_element (temp); return temp; @@ -760,8 +760,7 @@ ACE_Double_Linked_List<T>::delete_tail (void) if (this->is_empty ()) return 0; - temp = ACE_static_cast (T *, - this->head_->prev_); + temp = static_cast <T *> (this->head_->prev_); // Detach it from the list. this->remove_element (temp); return temp; @@ -841,7 +840,7 @@ ACE_Double_Linked_List<T>::delete_nodes (void) { while (! this->is_empty ()) { - T * temp = ACE_static_cast (T*, this->head_->next_); + T * temp = static_cast<T*> (this->head_->next_); this->remove_element (temp); ACE_DES_FREE (temp, this->allocator_->free, @@ -880,8 +879,7 @@ ACE_Double_Linked_List<T>::insert_element (T *new_item, old_item = this->head_; if (before) - old_item = ACE_static_cast (T *, - old_item->prev_); + old_item = static_cast<T *> (old_item->prev_); new_item->next_ = old_item->next_; new_item->next_->prev_ = new_item; @@ -1082,12 +1080,12 @@ ACE_Fixed_Set_Iterator<T, ACE_SIZE>::advance (void) ACE_TRACE ("ACE_Fixed_Set_Iterator<T, ACE_SIZE>::advance"); for (++this->next_; - ACE_static_cast(size_t, this->next_) < this->s_.cur_size_ + static_cast<size_t> (this->next_) < this->s_.cur_size_ && this->s_.search_structure_[this->next_].is_free_; ++this->next_) continue; - return ACE_static_cast(size_t, this->next_) < this->s_.cur_size_; + return static_cast<size_t> (this->next_) < this->s_.cur_size_; } template <class T, size_t ACE_SIZE> int @@ -1104,7 +1102,7 @@ ACE_Fixed_Set_Iterator<T, ACE_SIZE>::done (void) const { ACE_TRACE ("ACE_Fixed_Set_Iterator<T, ACE_SIZE>::done"); - return ACE_static_cast (ACE_CAST_CONST size_t, this->next_) >= + return static_cast<ACE_CAST_CONST size_t> (this->next_) >= this->s_.cur_size_; } @@ -1112,7 +1110,7 @@ template <class T, size_t ACE_SIZE> int ACE_Fixed_Set_Iterator<T, ACE_SIZE>::next (T *&item) { ACE_TRACE ("ACE_Fixed_Set_Iterator<T, ACE_SIZE>::next"); - if (ACE_static_cast (size_t, this->next_) < this->s_.cur_size_) + if (static_cast<size_t> (this->next_) < this->s_.cur_size_) { item = &this->s_.search_structure_[this->next_].item_; return 1; @@ -1146,12 +1144,12 @@ ACE_Fixed_Set_Const_Iterator<T, ACE_SIZE>::advance (void) ACE_TRACE ("ACE_Fixed_Set_Const_Iterator<T, ACE_SIZE>::advance"); for (++this->next_; - ACE_static_cast(size_t, this->next_) < this->s_.cur_size_ + static_cast<size_t> (this->next_) < this->s_.cur_size_ && this->s_.search_structure_[this->next_].is_free_; ++this->next_) continue; - return ACE_static_cast(size_t, this->next_) < this->s_.cur_size_; + return static_cast<size_t> (this->next_) < this->s_.cur_size_; } template <class T, size_t ACE_SIZE> int @@ -1168,7 +1166,7 @@ ACE_Fixed_Set_Const_Iterator<T, ACE_SIZE>::done (void) const { ACE_TRACE ("ACE_Fixed_Set_Const_Iterator<T, ACE_SIZE>::done"); - return ACE_static_cast (ACE_CAST_CONST size_t, this->next_) >= + return static_cast<ACE_CAST_CONST size_t> (this->next_) >= this->s_.cur_size_; } @@ -1176,7 +1174,7 @@ template <class T, size_t ACE_SIZE> int ACE_Fixed_Set_Const_Iterator<T, ACE_SIZE>::next (T *&item) { ACE_TRACE ("ACE_Fixed_Set_Const_Iterator<T, ACE_SIZE>::next"); - if (ACE_static_cast (size_t, this->next_) < this->s_.cur_size_) + if (static_cast<size_t> (this->next_) < this->s_.cur_size_) { item = &this->s_.search_structure_[this->next_].item_; return 1; @@ -1205,14 +1203,14 @@ ACE_Bounded_Set<T>::~ACE_Bounded_Set (void) template <class T> ACE_Bounded_Set<T>::ACE_Bounded_Set (void) : cur_size_ (0), - max_size_ (ACE_static_cast(size_t, ACE_Bounded_Set<T>::DEFAULT_SIZE)) + max_size_ (static_cast<size_t> (ACE_Bounded_Set<T>::DEFAULT_SIZE)) { ACE_TRACE ("ACE_Bounded_Set<T>::ACE_Bounded_Set"); ACE_NEW (this->search_structure_, ACE_TYPENAME ACE_Bounded_Set<T>::Search_Structure[this->max_size_]); - for (size_t i = 0; i < this->max_size_; i++) + for (size_t i = 0; i < this->max_size_; ++i) this->search_structure_[i].is_free_ = 1; } @@ -1292,7 +1290,7 @@ ACE_Bounded_Set<T>::insert (const T &item) && this->search_structure_[i].is_free_ == 0) return 1; else if (this->search_structure_[i].is_free_ && first_free == -1) - first_free = ACE_static_cast (int, i); + first_free = static_cast<int> (i); if (first_free > -1) // If we found a free spot let's reuse it. { @@ -1367,12 +1365,12 @@ ACE_Bounded_Set_Iterator<T>::advance (void) ACE_TRACE ("ACE_Bounded_Set_Iterator<T>::advance"); for (++this->next_; - ACE_static_cast(size_t, this->next_) < this->s_.cur_size_ + static_cast<size_t> (this->next_) < this->s_.cur_size_ && this->s_.search_structure_[this->next_].is_free_; ++this->next_) continue; - return ACE_static_cast(size_t, this->next_) < this->s_.cur_size_; + return static_cast<size_t> (this->next_) < this->s_.cur_size_; } template <class T> int @@ -1389,7 +1387,7 @@ ACE_Bounded_Set_Iterator<T>::done (void) const { ACE_TRACE ("ACE_Bounded_Set_Iterator<T>::done"); - return ACE_static_cast (ACE_CAST_CONST size_t, this->next_) >= + return static_cast<ACE_CAST_CONST size_t> (this->next_) >= this->s_.cur_size_; } @@ -1397,7 +1395,7 @@ template <class T> int ACE_Bounded_Set_Iterator<T>::next (T *&item) { ACE_TRACE ("ACE_Bounded_Set_Iterator<T>::next"); - if (ACE_static_cast(size_t, this->next_) < this->s_.cur_size_) + if (static_cast<size_t> (this->next_) < this->s_.cur_size_) { item = &this->s_.search_structure_[this->next_].item_; return 1; @@ -1641,8 +1639,7 @@ ACE_Ordered_MultiSet<T>::insert_from (const T &item, ACE_DNode<T> *position, // create a new node ACE_DNode<T> *temp; ACE_NEW_MALLOC_RETURN (temp, - ACE_static_cast(ACE_DNode<T>*, - this->allocator_->malloc (sizeof (ACE_DNode<T>))), + static_cast<ACE_DNode<T>*> (this->allocator_->malloc (sizeof (ACE_DNode<T>))), ACE_DNode<T> (item), -1); // obtain approximate location of the node @@ -1829,8 +1826,7 @@ ACE_DLList<T>::insert_tail (T *new_item) { ACE_DLList_Node *temp1, *temp2; ACE_NEW_MALLOC_RETURN (temp1, - ACE_static_cast(ACE_DLList_Node *, - this->allocator_->malloc (sizeof (ACE_DLList_Node))), + static_cast<ACE_DLList_Node *> (this->allocator_->malloc (sizeof (ACE_DLList_Node))), ACE_DLList_Node ((void *&)new_item), 0); temp2 = ACE_DLList_Base::insert_tail (temp1); diff --git a/ace/DEV_Addr.i b/ace/DEV_Addr.i index 2233943ced3..c3fd906d0ad 100644 --- a/ace/DEV_Addr.i +++ b/ace/DEV_Addr.i @@ -12,7 +12,7 @@ ACE_DEV_Addr::set (const ACE_TCHAR *devname) ACE_TRACE ("ACE_DEV_Addr::set"); this->ACE_Addr::base_set - (AF_DEV, ACE_static_cast (int, ACE_OS::strlen (devname))); + (AF_DEV, static_cast<int> (ACE_OS::strlen (devname))); ACE_OS::strsncpy (this->devname_, devname, MAXPATHLEN); } diff --git a/ace/DEV_IO.cpp b/ace/DEV_IO.cpp index 4d1d00c2772..95ad587312c 100644 --- a/ace/DEV_IO.cpp +++ b/ace/DEV_IO.cpp @@ -14,7 +14,7 @@ ACE_ALLOC_HOOK_DEFINE(ACE_DEV_IO) // Return the local endpoint address. -int +int ACE_DEV_IO::get_local_addr (ACE_DEV_Addr &addr) const { ACE_TRACE ("ACE_DEV_IO::get_local_addr"); @@ -26,7 +26,7 @@ ACE_DEV_IO::get_local_addr (ACE_DEV_Addr &addr) const // Return the address of the remotely connected peer (if there is // one). -int +int ACE_DEV_IO::get_remote_addr (ACE_DEV_Addr &addr) const { ACE_TRACE ("ACE_DEV_IO::get_remote_addr"); @@ -46,7 +46,7 @@ ACE_DEV_IO::dump (void) const #endif /* ACE_HAS_DUMP */ } -// Simple-minded do nothing constructor. +// Simple-minded do nothing constructor. ACE_DEV_IO::ACE_DEV_IO (void) { @@ -62,8 +62,8 @@ ssize_t ACE_DEV_IO::send (size_t n, ...) const { ACE_TRACE ("ACE_DEV_IO::send"); - va_list argp; - int total_tuples = ACE_static_cast (int, (n / 2)); + va_list argp; + int total_tuples = static_cast<int> (n / 2); iovec *iovp; #if defined (ACE_HAS_ALLOCA) iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); @@ -99,12 +99,12 @@ ssize_t ACE_DEV_IO::recv (size_t n, ...) const { ACE_TRACE ("ACE_DEV_IO::recv"); - va_list argp; - int total_tuples = ACE_static_cast (int, (n / 2)); + va_list argp; + int total_tuples = static_cast<int> (n / 2); iovec *iovp; #if defined (ACE_HAS_ALLOCA) iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); -#else +#else ACE_NEW_RETURN (iovp, iovec[total_tuples], -1); @@ -125,4 +125,3 @@ ACE_DEV_IO::recv (size_t n, ...) const va_end (argp); return result; } - diff --git a/ace/DEV_IO.i b/ace/DEV_IO.i index 29b30d71807..26b7dad7368 100644 --- a/ace/DEV_IO.i +++ b/ace/DEV_IO.i @@ -61,14 +61,14 @@ ASYS_INLINE ssize_t ACE_DEV_IO::send (const iovec iov[], size_t n) const { ACE_TRACE ("ACE_DEV_IO::send"); - return ACE_OS::writev (this->get_handle (), iov, ACE_static_cast (int, n)); + return ACE_OS::writev (this->get_handle (), iov, static_cast<int> (n)); } ASYS_INLINE ssize_t ACE_DEV_IO::recv (iovec iov[], size_t n) const { ACE_TRACE ("ACE_DEV_IO::recv"); - return ACE_OS::readv (this->get_handle (), iov, ACE_static_cast (int, n)); + return ACE_OS::readv (this->get_handle (), iov, static_cast<int> (n)); } ASYS_INLINE ssize_t diff --git a/ace/DLL.cpp b/ace/DLL.cpp index e42db1f700a..5ea9b0510bc 100644 --- a/ace/DLL.cpp +++ b/ace/DLL.cpp @@ -191,8 +191,8 @@ ACE_DLL::error (void) const { ACE_TRACE ("ACE_DLL::error"); if (this->error_) - return ACE_const_cast (ACE_TCHAR *, - ACE_LIB_TEXT ("Error: check log for details.")); + return + const_cast<ACE_TCHAR *> (ACE_LIB_TEXT ("Error: check log for details.")); return 0; } diff --git a/ace/DLL_Manager.cpp b/ace/DLL_Manager.cpp index 3016926cb86..49fef30bbc8 100644 --- a/ace/DLL_Manager.cpp +++ b/ace/DLL_Manager.cpp @@ -452,8 +452,8 @@ ACE_DLL_Manager::close (void) { if (this->handle_vector_[i]) { - ACE_DLL_Handle *s = ACE_const_cast (ACE_DLL_Handle *, - this->handle_vector_[i]); + ACE_DLL_Handle *s = + const_cast<ACE_DLL_Handle *> (this->handle_vector_[i]); this->handle_vector_[i] = 0; this->unload_dll (s, force_close); delete s; @@ -508,9 +508,9 @@ ACE_DLL_Manager::unload_dll (ACE_DLL_Handle *dll_handle, int force_unload) void *unload_policy_ptr = dll_handle->symbol (ACE_TEXT ("_get_dll_unload_policy"), 1); ptrdiff_t temp_p = - ACE_reinterpret_cast (ptrdiff_t, unload_policy_ptr); + reinterpret_cast<ptrdiff_t> (unload_policy_ptr); the_policy = - ACE_reinterpret_cast (dll_unload_policy, temp_p); + reinterpret_cast<dll_unload_policy> (temp_p); if (the_policy != 0) unload = ACE_BIT_DISABLED (the_policy (), ACE_DLL_UNLOAD_POLICY_LAZY); diff --git a/ace/Dev_Poll_Reactor.cpp b/ace/Dev_Poll_Reactor.cpp index 313c8572f3c..23b1d2b2641 100644 --- a/ace/Dev_Poll_Reactor.cpp +++ b/ace/Dev_Poll_Reactor.cpp @@ -920,7 +920,7 @@ ACE_Dev_Poll_Reactor::open (size_t size, if (mm == (void *) MAP_FAILED) result = -1; else - this->mmap_ = ACE_static_cast (char *, mm); + this->mmap_ = static_cast<char *> (mm); } #else @@ -1130,8 +1130,7 @@ ACE_Dev_Poll_Reactor::work_pending_i (ACE_Time_Value * max_wait_time) // Retrieve the results from the memory map. this->start_pfds_ = - ACE_reinterpret_cast (struct pollfd *, - this->mmap_ + evp.ep_resoff); + reinterpret_cast<struct pollfd *> (this->mmap_ + evp.ep_resoff); #else diff --git a/ace/Dynamic_Service.cpp b/ace/Dynamic_Service.cpp index d475bd5a17b..7c1417345f0 100644 --- a/ace/Dynamic_Service.cpp +++ b/ace/Dynamic_Service.cpp @@ -19,8 +19,8 @@ template <class TYPE> TYPE * ACE_Dynamic_Service<TYPE>::instance (const ACE_TCHAR *name) { - ACE_Service_Object *svc_obj = - ACE_static_cast (ACE_Service_Object *, ACE_Dynamic_Service_Base::instance (name)); + ACE_Service_Object *svc_obj = + static_cast<ACE_Service_Object *> (ACE_Dynamic_Service_Base::instance (name)); return ACE_dynamic_cast (TYPE *, svc_obj); } diff --git a/ace/Env_Value_T.h b/ace/Env_Value_T.h index 3429b7914bd..0e1d90ca789 100644 --- a/ace/Env_Value_T.h +++ b/ace/Env_Value_T.h @@ -113,20 +113,19 @@ ACE_Convert (const ACE_TCHAR *s, const ACE_TCHAR *&v) inline void ACE_Convert (const ACE_TCHAR *s, short &si) { - si = ACE_static_cast (short, ACE_OS::strtol (s, 0, 10)); + si = static_cast<short> (ACE_OS::strtol (s, 0, 10)); } inline void ACE_Convert (const ACE_TCHAR *s, u_short &us) { - us = ACE_static_cast (u_short, ACE_OS::strtol (s, 0, 10)); + us = static_cast <u_short> (ACE_OS::strtol (s, 0, 10)); } inline void ACE_Convert (const ACE_TCHAR *s, u_int &i) { - i = ACE_static_cast (u_int, - ACE_OS::strtol (s, 0, 10)); + i = static_cast<u_int> (ACE_OS::strtol (s, 0, 10)); } inline void @@ -138,7 +137,7 @@ ACE_Convert (const ACE_TCHAR *s, long &l) inline void ACE_Convert (const ACE_TCHAR *s, int &i) { - i = ACE_static_cast (int, ACE_OS::strtol (s, 0, 10)); + i = static_cast<int> (ACE_OS::strtol (s, 0, 10)); } inline void diff --git a/ace/FIFO_Recv_Msg.i b/ace/FIFO_Recv_Msg.i index a29d8f345fc..4e67e63ad97 100644 --- a/ace/FIFO_Recv_Msg.i +++ b/ace/FIFO_Recv_Msg.i @@ -1,4 +1,5 @@ -/* -*- C++ -*- */ +// -*- C++ -*- +// // $Id$ // FIFO_Recv_Msg.i @@ -16,24 +17,24 @@ ACE_FIFO_Recv_Msg::recv (ACE_Str_Buf &recv_msg) (strbuf *) &recv_msg, &i) == -1) return -1; - else + else return recv_msg.len; #else /* Do the ol' 2-read trick... */ - if (ACE_OS::read (this->get_handle (), - (char *) &recv_msg.len, + if (ACE_OS::read (this->get_handle (), + (char *) &recv_msg.len, sizeof recv_msg.len) != sizeof recv_msg.len) return -1; else { - size_t remaining = ACE_static_cast (size_t, recv_msg.len); - size_t requested = ACE_static_cast (size_t, recv_msg.maxlen); - ssize_t recv_len = ACE_OS::read (this->get_handle (), - (char *) recv_msg.buf, + size_t remaining = static_cast<size_t> (recv_msg.len); + size_t requested = static_cast<size_t> (recv_msg.maxlen); + ssize_t recv_len = ACE_OS::read (this->get_handle (), + (char *) recv_msg.buf, ACE_MIN (remaining, requested)); if (recv_len == -1) return -1; // Tell caller what's really in the buffer. - recv_msg.len = ACE_static_cast (int, recv_len); + recv_msg.len = static_cast<int> (recv_len); // If there are more bytes remaining in the message, read them and // throw them away. Leaving them in the FIFO would make it difficult @@ -63,7 +64,7 @@ ASYS_INLINE ssize_t ACE_FIFO_Recv_Msg::recv (void *buf, size_t max_len) { ACE_TRACE ("ACE_FIFO_Recv_Msg::recv"); - ACE_Str_Buf recv_msg ((char *) buf, 0, ACE_static_cast (int, max_len)); + ACE_Str_Buf recv_msg ((char *) buf, 0, static_cast<int> (max_len)); return this->recv (recv_msg); } @@ -75,7 +76,7 @@ ACE_FIFO_Recv_Msg::recv (ACE_Str_Buf *data, int *flags) { ACE_TRACE ("ACE_FIFO_Recv_Msg::recv"); - if (ACE_OS::getmsg (this->get_handle (), + if (ACE_OS::getmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, flags) == -1) @@ -91,7 +92,7 @@ ACE_FIFO_Recv_Msg::recv (int *band, int *flags) { ACE_TRACE ("ACE_FIFO_Recv_Msg::recv"); - if (ACE_OS::getpmsg (this->get_handle (), + if (ACE_OS::getpmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, band, diff --git a/ace/FIFO_Send_Msg.cpp b/ace/FIFO_Send_Msg.cpp index c5173781581..a28182625da 100644 --- a/ace/FIFO_Send_Msg.cpp +++ b/ace/FIFO_Send_Msg.cpp @@ -32,7 +32,7 @@ ACE_FIFO_Send_Msg::send (const ACE_Str_Buf &send_msg) (strbuf *) &send_msg, 0) == -1) return -1; - else + else return send_msg.len; #else iovec iov[2]; @@ -41,7 +41,7 @@ ACE_FIFO_Send_Msg::send (const ACE_Str_Buf &send_msg) iov[0].iov_len = sizeof send_msg.len; iov[1].iov_base = (char *) send_msg.buf; - iov[1].iov_len = ACE_static_cast (u_long, send_msg.len); + iov[1].iov_len = static_cast<u_long> (send_msg.len); ssize_t sent = ACE_OS::writev (this->get_handle (), iov, 2); if (sent > 0) diff --git a/ace/FIFO_Send_Msg.i b/ace/FIFO_Send_Msg.i index 6e420151c39..bbfee9a6767 100644 --- a/ace/FIFO_Send_Msg.i +++ b/ace/FIFO_Send_Msg.i @@ -1,27 +1,27 @@ -/* -*- C++ -*- */ +// -*- C++ -*- +// // $Id$ -// FIFO_Send_Msg.i ASYS_INLINE ssize_t ACE_FIFO_Send_Msg::send (const void *buf, size_t len) { ACE_TRACE ("ACE_FIFO_Send_Msg::send"); - ACE_Str_Buf send_msg ((char *) buf, ACE_static_cast (int, len)); + ACE_Str_Buf send_msg ((char *) buf, static_cast<int> (len)); return this->send (send_msg); } #if defined (ACE_HAS_STREAM_PIPES) ASYS_INLINE ssize_t -ACE_FIFO_Send_Msg::send (const ACE_Str_Buf *data, - const ACE_Str_Buf *cntl, +ACE_FIFO_Send_Msg::send (const ACE_Str_Buf *data, + const ACE_Str_Buf *cntl, int flags) { ACE_TRACE ("ACE_FIFO_Send_Msg::send"); - if (ACE_OS::putmsg (this->get_handle (), - (strbuf *) cntl, - (strbuf *) data, + if (ACE_OS::putmsg (this->get_handle (), + (strbuf *) cntl, + (strbuf *) data, flags) == -1) return-1; else @@ -29,17 +29,17 @@ ACE_FIFO_Send_Msg::send (const ACE_Str_Buf *data, } ASYS_INLINE ssize_t -ACE_FIFO_Send_Msg::send (int band, - const ACE_Str_Buf *data, - const ACE_Str_Buf *cntl, +ACE_FIFO_Send_Msg::send (int band, + const ACE_Str_Buf *data, + const ACE_Str_Buf *cntl, int flags) { ACE_TRACE ("ACE_FIFO_Send_Msg::send"); - if (ACE_OS::putpmsg (this->get_handle (), - (strbuf *) cntl, - (strbuf *) data, - band, + if (ACE_OS::putpmsg (this->get_handle (), + (strbuf *) cntl, + (strbuf *) data, + band, flags) == -1) return -1; else diff --git a/ace/FILE_Addr.cpp b/ace/FILE_Addr.cpp index 6f302367fcb..14e5a1e4478 100644 --- a/ace/FILE_Addr.cpp +++ b/ace/FILE_Addr.cpp @@ -49,8 +49,7 @@ ACE_FILE_Addr::set (const ACE_FILE_Addr &sa) if (ACE_OS::mktemp (this->filename_) == 0) return -1; this->base_set (AF_FILE, - ACE_static_cast (int, - ACE_OS::strlen (this->filename_) + 1)); + static_cast<int> (ACE_OS::strlen (this->filename_) + 1)); } else { @@ -76,8 +75,7 @@ int ACE_FILE_Addr::set (const ACE_TCHAR *filename) { this->ACE_Addr::base_set (AF_FILE, - ACE_static_cast (int, - ACE_OS::strlen (filename) + 1)); + static_cast<int> (ACE_OS::strlen (filename) + 1)); (void) ACE_OS::strsncpy (this->filename_, filename, sizeof this->filename_ / sizeof (ACE_TCHAR)); diff --git a/ace/FILE_Connector.cpp b/ace/FILE_Connector.cpp index 5c65696fa17..db1dd6ab256 100644 --- a/ace/FILE_Connector.cpp +++ b/ace/FILE_Connector.cpp @@ -44,9 +44,8 @@ ACE_FILE_Connector::connect (ACE_FILE_IO &new_io, ACE_HANDLE handle = ACE_INVALID_HANDLE; // Check to see if caller has requested that we create the filename. - if (ACE_reinterpret_cast (const ACE_Addr &, - ACE_const_cast (ACE_FILE_Addr &, - remote_sap)) == ACE_Addr::sap_any) + if (reinterpret_cast<const ACE_Addr &> ( + const_cast<ACE_FILE_Addr &> (remote_sap)) == ACE_Addr::sap_any) { // Create a new temporary file. #ifdef ACE_LACKS_MKSTEMP diff --git a/ace/FILE_IO.cpp b/ace/FILE_IO.cpp index 4f6226151e5..d2cdd7d4f28 100644 --- a/ace/FILE_IO.cpp +++ b/ace/FILE_IO.cpp @@ -42,8 +42,8 @@ ssize_t ACE_FILE_IO::send (size_t n, ...) const { ACE_TRACE ("ACE_FILE_IO::send"); - va_list argp; - int total_tuples = (ACE_static_cast (int, n)) / 2; + va_list argp; + int total_tuples = (static_cast<int> (n)) / 2; iovec *iovp; #if defined (ACE_HAS_ALLOCA) iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); @@ -61,7 +61,7 @@ ACE_FILE_IO::send (size_t n, ...) const iovp[i].iov_len = va_arg (argp, int); } - ssize_t result = ACE_OS::writev (this->get_handle (), + ssize_t result = ACE_OS::writev (this->get_handle (), iovp, total_tuples); #if !defined (ACE_HAS_ALLOCA) @@ -81,8 +81,8 @@ ssize_t ACE_FILE_IO::recv (size_t n, ...) const { ACE_TRACE ("ACE_FILE_IO::recv"); - va_list argp; - int total_tuples = ACE_static_cast (int, (n / 2)); + va_list argp; + int total_tuples = static_cast<int> (n / 2); iovec *iovp; #if defined (ACE_HAS_ALLOCA) iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); @@ -101,7 +101,7 @@ ACE_FILE_IO::recv (size_t n, ...) const } ssize_t result = ACE_OS::readv (this->get_handle (), - iovp, + iovp, total_tuples); #if !defined (ACE_HAS_ALLOCA) delete [] iovp; diff --git a/ace/FlReactor.cpp b/ace/FlReactor.cpp index af196809e71..1b15981844b 100644 --- a/ace/FlReactor.cpp +++ b/ace/FlReactor.cpp @@ -107,8 +107,8 @@ ACE_FlReactor::wait_for_multiple_events (ACE_Select_Reactor_Handle_Set &handle_s void ACE_FlReactor::fl_io_proc (int fd, void* reactor) { - ACE_FlReactor *self = ACE_static_cast(ACE_FlReactor *, reactor); - ACE_HANDLE handle = (ACE_HANDLE)fd; //ACE_reinterpret_cast(ACE_HANDLE, fd); + ACE_FlReactor *self = static_cast<ACE_FlReactor *> (reactor); + ACE_HANDLE handle = (ACE_HANDLE)fd; //reinterpret_cast<ACE_HANDLE> (fd); // my copy isn't const. ACE_Time_Value zero = ACE_Time_Value::zero; @@ -149,7 +149,7 @@ ACE_FlReactor::fl_io_proc (int fd, void* reactor) void ACE_FlReactor::fl_timeout_proc (void* reactor) { - ACE_FlReactor *self = ACE_static_cast (ACE_FlReactor *, reactor); + ACE_FlReactor *self = static_cast<ACE_FlReactor *> (reactor); // Deal with any timer events ACE_Select_Reactor_Handle_Set handle_set; @@ -188,7 +188,7 @@ ACE_FlReactor::register_handler_i (ACE_HANDLE handle, if (condition != 0) { - Fl::add_fd ((int)handle, // ACE_reinterpret_cast(int,handle), + Fl::add_fd ((int)handle, // reinterpret_cast<int> (handle), ACE_FlReactor::fl_io_proc, this); } @@ -216,7 +216,7 @@ ACE_FlReactor::remove_handler_i (ACE_HANDLE handle, // in reverse order. // First clean up the corresponding X11Input. - Fl::remove_fd ((int)handle); // ACE_reinterpret_cast(int,handle)); + Fl::remove_fd ((int)handle); // reinterpret_cast<int> (handle); // Now let the reactor do its work. return ACE_Select_Reactor::remove_handler_i (handle, diff --git a/ace/Framework_Component.cpp b/ace/Framework_Component.cpp index 148601186b8..774dc30376e 100644 --- a/ace/Framework_Component.cpp +++ b/ace/Framework_Component.cpp @@ -19,8 +19,8 @@ ACE_Framework_Component::~ACE_Framework_Component (void) { ACE_TRACE ("ACE_Framework_Component::~ACE_Framework_Component"); - ACE::strdelete (ACE_const_cast (ACE_TCHAR*, this->dll_name_)); - ACE::strdelete (ACE_const_cast (ACE_TCHAR*, this->name_)); + ACE::strdelete (const_cast<ACE_TCHAR*> (this->dll_name_)); + ACE::strdelete (const_cast<ACE_TCHAR*> (this->name_)); } /***************************************************************/ @@ -69,8 +69,8 @@ ACE_Framework_Repository::close (void) if (this->component_vector_[i]) { ACE_Framework_Component *s = - ACE_const_cast (ACE_Framework_Component *, - this->component_vector_[i]); + const_cast<ACE_Framework_Component *> ( + this->component_vector_[i]); this->component_vector_[i] = 0; delete s; diff --git a/ace/Functor_T.i b/ace/Functor_T.i index 1ebd950292c..51caa11825d 100644 --- a/ace/Functor_T.i +++ b/ace/Functor_T.i @@ -17,7 +17,7 @@ ACE_Pointer_Hash<TYPE>::operator () (TYPE t) const # pragma warning(push) # pragma warning(disable : 4311) /* Truncate pointer to unsigned long */ #endif /* ACE_WIN64 */ - return ACE_reinterpret_cast (unsigned long, t); + return reinterpret_cast<unsigned long> (t); #if defined (ACE_WIN64) # pragma warning(pop) #endif /* ACE_WIN64 */ diff --git a/ace/Future.cpp b/ace/Future.cpp index f0a1646d6ee..2dc0fa5ddb8 100644 --- a/ace/Future.cpp +++ b/ace/Future.cpp @@ -209,14 +209,14 @@ ACE_Future_Rep<T>::get (T &value, if (this->value_ == 0) { ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, - ACE_const_cast (ACE_Recursive_Thread_Mutex &, this->value_ready_mutex_), + this->value_ready_mutex_, -1)); // If the value is not yet defined we must block until the // producer writes to it. while (this->value_ == 0) // Perform a timed wait. - if ((ACE_const_cast (ACE_Condition_Recursive_Thread_Mutex &, this->value_ready_)).wait (tv) == -1) + if (this->value_ready_.wait (tv) == -1) return -1; // Destructor releases the lock. diff --git a/ace/Future.h b/ace/Future.h index b6af57802f1..9d1e0f7800b 100644 --- a/ace/Future.h +++ b/ace/Future.h @@ -215,13 +215,17 @@ private: OBSERVER_COLLECTION observer_collection_; // = Condition variable and mutex that protect the <value_>. - ACE_Recursive_Thread_Mutex value_ready_mutex_; - ACE_Condition_Recursive_Thread_Mutex value_ready_; + mutable ACE_Recursive_Thread_Mutex value_ready_mutex_; + mutable ACE_Condition_Recursive_Thread_Mutex value_ready_; private: - // = Constructor and destructor private. + ACE_Future_Rep (void); + +protected: + ~ACE_Future_Rep (void); + }; /** diff --git a/ace/Future_Set.cpp b/ace/Future_Set.cpp index 5b0069fac4f..feac0b0d54f 100644 --- a/ace/Future_Set.cpp +++ b/ace/Future_Set.cpp @@ -85,7 +85,7 @@ template <class T> void ACE_Future_Set<T>::update (const ACE_Future<T> &future) { ACE_Message_Block *mb; - FUTURE &local_future = ACE_const_cast (ACE_Future<T> &, future); + FUTURE &local_future = const_cast<ACE_Future<T> &> (future); ACE_NEW (mb, ACE_Message_Block ((char *) local_future.get_rep (), 0)); @@ -109,9 +109,7 @@ ACE_Future_Set<T>::next_readable (ACE_Future<T> &future, tv) != -1) { // Extract future rep from the message block. - future_rep = - ACE_reinterpret_cast (FUTURE_REP *, - mb->base ()); + future_rep = reinterpret_cast<FUTURE_REP *> (mb->base ()); // Delete the message block. mb->release (); diff --git a/ace/Get_Opt.cpp b/ace/Get_Opt.cpp index 200ffbc54da..d3627e6edb4 100644 --- a/ace/Get_Opt.cpp +++ b/ace/Get_Opt.cpp @@ -1,4 +1,3 @@ -// Get_Opt.cpp // $Id$ #include "ace/Get_Opt.h" @@ -12,7 +11,9 @@ #include "ace/SString.h" #include "ace/OS_NS_string.h" -ACE_RCSID(ace, Get_Opt, "$Id$") +ACE_RCSID (ace, + Get_Opt, + "$Id$") /* * Copyright (c) 1987, 1993, 1994 @@ -359,8 +360,8 @@ ACE_Get_Opt::short_option_i (void) this->last_option (opt); ACE_TCHAR *oli = 0; - oli = ACE_const_cast (ACE_TCHAR*, - ACE_OS::strchr (this->optstring_->c_str (), opt)); + oli = + const_cast<ACE_TCHAR*> (ACE_OS::strchr (this->optstring_->c_str (), opt)); /* Increment `optind' when we start to process its last character. */ if (*this->nextchar_ == '\0') @@ -490,9 +491,9 @@ ACE_Get_Opt::long_option (const ACE_TCHAR *name, // If the short_option already exists, make sure it matches, otherwise // add it. ACE_TCHAR *s = 0; - if ((s = ACE_const_cast (ACE_TCHAR*, - ACE_OS::strchr (this->optstring_->c_str (), - short_option))) != 0) + if ((s = const_cast<ACE_TCHAR*> ( + ACE_OS::strchr (this->optstring_->c_str (), + short_option))) != 0) { // Short option exists, so verify the argument options if (s[1] == ':') @@ -703,22 +704,23 @@ ACE_Get_Opt::permute (void) } const ACE_TCHAR * -ACE_Get_Opt::optstring (void) const -{ +ACE_Get_Opt::optstring (void) const +{ return this->optstring_->c_str (); } -ACE_Get_Opt::ACE_Get_Opt_Long_Option::ACE_Get_Opt_Long_Option (const ACE_TCHAR *name, - int has_arg, - int val) - : name_ (ACE::strnew(name)), +ACE_Get_Opt::ACE_Get_Opt_Long_Option::ACE_Get_Opt_Long_Option ( + const ACE_TCHAR *name, + int has_arg, + int val) + : name_ (ACE::strnew (name)), has_arg_ (has_arg), val_ (val) {} ACE_Get_Opt::ACE_Get_Opt_Long_Option::~ACE_Get_Opt_Long_Option (void) { - delete [] ACE_const_cast (ACE_TCHAR*, this->name_); + delete [] this->name_; } #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) diff --git a/ace/Global_Macros.h b/ace/Global_Macros.h index c9649582919..d1c865c048c 100644 --- a/ace/Global_Macros.h +++ b/ace/Global_Macros.h @@ -602,7 +602,7 @@ _make_##SERVICE_CLASS (ACE_Service_Object_Exterminator *); # define ACE_FACTORY_DEFINE(CLS,SERVICE_CLASS) \ void _gobble_##SERVICE_CLASS (void *p) { \ - ACE_Service_Object *_p = ACE_static_cast (ACE_Service_Object *, p); \ + ACE_Service_Object *_p = static_cast<ACE_Service_Object *> (p); \ ACE_ASSERT (_p != 0); \ delete _p; } \ extern "C" CLS##_Export ACE_Service_Object *\ diff --git a/ace/Hash_Map_Manager_T.cpp b/ace/Hash_Map_Manager_T.cpp index df38488f3e9..846223a77ac 100644 --- a/ace/Hash_Map_Manager_T.cpp +++ b/ace/Hash_Map_Manager_T.cpp @@ -398,14 +398,13 @@ ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>: this->index_++; return this->forward_i (); } - else if (this->index_ >= ACE_static_cast (ssize_t, this->map_man_->total_size_)) + else if (this->index_ >= static_cast<ssize_t> (this->map_man_->total_size_)) return 0; this->next_ = this->next_->next_; if (this->next_ == &this->map_man_->table_[this->index_]) { - while (++this->index_ < ACE_static_cast (ssize_t, - this->map_man_->total_size_)) + while (++this->index_ < static_cast<ssize_t> (this->map_man_->total_size_)) { this->next_ = this->map_man_->table_[this->index_].next_; if (this->next_ != &this->map_man_->table_[this->index_]) @@ -413,7 +412,7 @@ ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>: } } - return this->index_ < ACE_static_cast (ssize_t, this->map_man_->total_size_); + return this->index_ < static_cast<ssize_t> (this->map_man_->total_size_); } template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK> int @@ -423,7 +422,7 @@ ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>: if (this->map_man_->table_ == 0) return -1; - else if (this->index_ == ACE_static_cast (ssize_t, this->map_man_->total_size_)) + else if (this->index_ == static_cast<ssize_t> (this->map_man_->total_size_)) { this->index_--; return this->reverse_i (); diff --git a/ace/Hash_Map_Manager_T.i b/ace/Hash_Map_Manager_T.i index a4968cfda1d..d1b05afa492 100644 --- a/ace/Hash_Map_Manager_T.i +++ b/ace/Hash_Map_Manager_T.i @@ -405,7 +405,7 @@ ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>: ACE_TRACE ("ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::next"); if (this->map_man_->table_ != 0 - && this->index_ < ACE_static_cast (ssize_t, this->map_man_->total_size_) + && this->index_ < static_cast<ssize_t> (this->map_man_->total_size_) && this->index_ >= 0 && this->next_ != &this->map_man_->table_[this->index_]) { @@ -422,7 +422,7 @@ ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>: ACE_TRACE ("ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::done"); return this->map_man_->table_ == 0 - || this->index_ >= ACE_static_cast (ssize_t, this->map_man_->total_size_) + || this->index_ >= static_cast<ssize_t> (this->map_man_->total_size_) || this->index_ < 0; } diff --git a/ace/High_Res_Timer.cpp b/ace/High_Res_Timer.cpp index 4767d6c6636..d549a2ee64c 100644 --- a/ace/High_Res_Timer.cpp +++ b/ace/High_Res_Timer.cpp @@ -203,8 +203,7 @@ ACE_High_Res_Timer::global_scale_factor (void) (uint64_freq / (ACE_UINT32) ACE_ONE_SECOND_IN_USECS); # else ACE_High_Res_Timer::global_scale_factor - (ACE_static_cast (unsigned int, - freq.QuadPart / ACE_HR_SCALE_CONVERSION)); + (static_cast<unsigned int> (freq.QuadPart / ACE_HR_SCALE_CONVERSION)); # endif // (ACE_LACKS_LONGLONG_T) ACE_High_Res_Timer::global_scale_factor_status_ = 1; @@ -361,10 +360,9 @@ ACE_High_Res_Timer::elapsed_time (struct timespec &elapsed_time) const // Then it converts that to nanoseconds by dividing by the scale // factor to convert to usec, and multiplying by 1000.) The cast // avoids a MSVC 4.1 compiler warning about narrowing. - u_long nseconds = ACE_static_cast (u_long, - (this->end_ - this->start_) % - global_scale_factor () * 1000u / - global_scale_factor ()); + u_long nseconds = static_cast<u_long> ((this->end_ - this->start_) % + global_scale_factor () * 1000u / + global_scale_factor ()); // Get just the microseconds (dropping any left over nanoseconds). ACE_UINT32 useconds = (ACE_UINT32) ((this->end_ - this->start_) / global_scale_factor ()); @@ -436,11 +434,9 @@ ACE_High_Res_Timer::print_ave (const ACE_TCHAR *str, // Separate to seconds and nanoseconds. u_long total_secs = - ACE_static_cast (u_long, - total_nanoseconds / (ACE_UINT32) ACE_ONE_SECOND_IN_NSECS); + static_cast<u_long> (total_nanoseconds / (ACE_UINT32) ACE_ONE_SECOND_IN_NSECS); ACE_UINT32 extra_nsecs = - ACE_static_cast (ACE_UINT32, - total_nanoseconds % (ACE_UINT32) ACE_ONE_SECOND_IN_NSECS); + static_cast<ACE_UINT32> (total_nanoseconds % (ACE_UINT32) ACE_ONE_SECOND_IN_NSECS); ACE_TCHAR buf[100]; if (count > 1) diff --git a/ace/INET_Addr.cpp b/ace/INET_Addr.cpp index aa71399a995..caaed4bc155 100644 --- a/ace/INET_Addr.cpp +++ b/ace/INET_Addr.cpp @@ -151,8 +151,8 @@ ACE_INET_Addr::string_to_addr (const char s[]) if (port_p == 0) // Assume it's a port number. { char *endp = 0; - u_short port = ACE_static_cast (u_short, - ACE_OS::strtol (ip_addr, &endp, 10)); + u_short port = + static_cast<u_short> (ACE_OS::strtol (ip_addr, &endp, 10)); if (port > 0 && *endp == '\0') result = this->set (port, ACE_UINT32 (INADDR_ANY)); else // port name @@ -163,8 +163,7 @@ ACE_INET_Addr::string_to_addr (const char s[]) *port_p = '\0'; ++port_p; // skip over ':' char *endp = 0; - u_short port = ACE_static_cast (u_short, - ACE_OS::strtol (port_p, &endp, 10)); + u_short port = static_cast<u_short> (ACE_OS::strtol (port_p, &endp, 10)); if (port > 0 && *endp == '\0') result = this->set (port, ip_addr); else @@ -221,7 +220,7 @@ ACE_INET_Addr::set (u_short port_number, int map) { ACE_TRACE ("ACE_INET_Addr::set"); - this->set_address (ACE_reinterpret_cast (const char *, &inet_address), + this->set_address (reinterpret_cast<const char *> (&inet_address), sizeof inet_address, encode, map); this->set_port_number (port_number, encode); @@ -329,15 +328,14 @@ static int get_port_number_from_name (const char port_name[], // Maybe port_name is directly a port number? char *endp = 0; - port_number = ACE_static_cast (int, - ACE_OS::strtol (port_name, &endp, 10)); + port_number = static_cast<int> (ACE_OS::strtol (port_name, &endp, 10)); if (port_number >= 0 && *endp == '\0') { // Ok, port_name was really a number, and nothing else. We // store that value as the port number. NOTE: this number must // be returned in network byte order! - u_short n = ACE_static_cast (u_short, port_number); + u_short n = static_cast<u_short> (port_number); n = htons (n); return n; } @@ -386,7 +384,7 @@ ACE_INET_Addr::set (const char port_name[], address_family = AF_INET6; # endif /* ACE_HAS_IPV6 */ - return this->set (ACE_static_cast (u_short, port_number), + return this->set (static_cast<u_short> (port_number), host_name, 0, address_family); } @@ -407,7 +405,7 @@ ACE_INET_Addr::set (const char port_name[], ACE_NOTSUP_RETURN (-1); } - return this->set (ACE_static_cast (u_short, port_number), + return this->set (static_cast<u_short> (port_number), inet_address, 0); } @@ -476,7 +474,7 @@ ACE_INET_Addr::set (const sockaddr_in *addr, int len) if (addr->sin_family == AF_INET) { - int maxlen = ACE_static_cast (int, sizeof (this->inet_addr_.in4_)); + int maxlen = static_cast<int> (sizeof (this->inet_addr_.in4_)); if (len > maxlen) len = maxlen; ACE_OS::memcpy (&this->inet_addr_.in4_, addr, len); @@ -486,7 +484,7 @@ ACE_INET_Addr::set (const sockaddr_in *addr, int len) #if defined (ACE_HAS_IPV6) else if (addr->sin_family == AF_INET6) { - int maxlen = ACE_static_cast (int, sizeof (this->inet_addr_.in6_)); + int maxlen = static_cast<int> (sizeof (this->inet_addr_.in6_)); if (len > maxlen) len = maxlen; ACE_OS::memcpy (&this->inet_addr_.in6_, addr, len); @@ -504,7 +502,7 @@ void ACE_INET_Addr::set_addr (void *addr, int /* len */, int map) { ACE_TRACE ("ACE_INET_Addr::set_addr"); - struct sockaddr_in *getfamily = ACE_static_cast (struct sockaddr_in *, addr); + struct sockaddr_in *getfamily = static_cast<struct sockaddr_in *> (addr); if (getfamily->sin_family == AF_INET) { @@ -515,16 +513,16 @@ ACE_INET_Addr::set_addr (void *addr, int /* len */, int map) #endif /* ACE_HAS_IPV6 */ this->set_type (AF_INET); this->set_port_number (getfamily->sin_port, 0); - this->set_address (ACE_reinterpret_cast (const char*, &getfamily->sin_addr), + this->set_address (reinterpret_cast<const char*> (&getfamily->sin_addr), sizeof (getfamily->sin_addr), 0, map); } #if defined (ACE_HAS_IPV6) else if (getfamily->sin_family == AF_INET6) { - struct sockaddr_in6 *in6 = ACE_static_cast (struct sockaddr_in6*, addr); + struct sockaddr_in6 *in6 = static_cast<struct sockaddr_in6*> (addr); this->set_port_number (in6->sin6_port, 0); - this->set_address (ACE_reinterpret_cast (const char*, &in6->sin6_addr), + this->set_address (reinterpret_cast<const char*> (&in6->sin6_addr), sizeof (in6->sin6_addr), 0); } @@ -803,7 +801,7 @@ int ACE_INET_Addr::set_address (const char *ip_addr, if (len == 4) { - ACE_UINT32 ip4 = *ACE_reinterpret_cast (const ACE_UINT32 *, ip_addr); + ACE_UINT32 ip4 = *reinterpret_cast<const ACE_UINT32 *> (ip_addr); if (encode) ip4 = ACE_HTONL (ip4); @@ -938,8 +936,8 @@ ACE_INET_Addr::get_host_addr (char *dst, int size) const } # if defined (ACE_WIN32) - if (0 == ::getnameinfo (ACE_reinterpret_cast (const sockaddr*, - &this->inet_addr_.in6_), + if (0 == ::getnameinfo (reinterpret_cast<const sockaddr*> ( + &this->inet_addr_.in6_), this->get_size (), dst, size, @@ -967,7 +965,7 @@ ACE_INET_Addr::get_host_addr (char *dst, int size) const // on vxworks or lack of thread safety. // // So, we use the way that vxworks suggests. - ACE_INET_Addr *ncthis = ACE_const_cast (ACE_INET_Addr *, this); + ACE_INET_Addr *ncthis = const_cast<ACE_INET_Addr *> (this); inet_ntoa_b (this->inet_addr_.in4_.sin_addr, ncthis->buf_); ACE_OS::strsncpy (dst, &buf_[0], size); return &buf_[0]; @@ -993,7 +991,7 @@ ACE_INET_Addr::get_host_addr (void) const // on vxworks or lack of thread safety. // // So, we use the way that vxworks suggests. - ACE_INET_Addr *ncthis = ACE_const_cast (ACE_INET_Addr *, this); + ACE_INET_Addr *ncthis = const_cast<ACE_INET_Addr *> (this); inet_ntoa_b (this->inet_addr_.in4_.sin_addr, ncthis->buf_); return &buf_[0]; # else /* VXWORKS */ diff --git a/ace/INET_Addr.i b/ace/INET_Addr.i index 6fec9877441..2f1b4f6c968 100644 --- a/ace/INET_Addr.i +++ b/ace/INET_Addr.i @@ -60,17 +60,17 @@ ACE_INET_Addr::ip_addr_size (void) const // within the range of an int anyway. #if defined (ACE_HAS_IPV6) if (this->get_type () == PF_INET) - return ACE_static_cast (int, sizeof this->inet_addr_.in4_.sin_addr); + return static_cast<int> (sizeof this->inet_addr_.in4_.sin_addr); else - return ACE_static_cast (int, sizeof this->inet_addr_.in6_.sin6_addr); + return static_cast<int> (sizeof this->inet_addr_.in6_.sin6_addr); #else // These _UNICOS changes were picked up from pre-IPv6 code in // get_host_name_i... the IPv6 section above may need something // similar, so keep an eye out for it. # if !defined(_UNICOS) - return ACE_static_cast (int, sizeof this->inet_addr_.in4_.sin_addr.s_addr); + return static_cast<int> (sizeof this->inet_addr_.in4_.sin_addr.s_addr); # else /* _UNICOS */ - return ACE_static_cast (int, sizeof this->inet_addr_.in4_.sin_addr); + return static_cast<int> (sizeof this->inet_addr_.in4_.sin_addr); # endif /* ! _UNICOS */ #endif /* ACE_HAS_IPV6 */ } diff --git a/ace/Lib_Find.cpp b/ace/Lib_Find.cpp index f7ca48a2a72..1a99fad9796 100644 --- a/ace/Lib_Find.cpp +++ b/ace/Lib_Find.cpp @@ -233,10 +233,9 @@ ACE_Lib_Find::ldfind (const ACE_TCHAR* filename, ACE_LIB_TEXT ("%s%s%s"), searchpathname, searchfilename, - got_suffix ? ACE_static_cast (ACE_TCHAR *, - ACE_LIB_TEXT ("")) - : ACE_static_cast (ACE_TCHAR *, - dll_suffix)); + got_suffix + ? static_cast<ACE_TCHAR *> (ACE_LIB_TEXT ("")) + : static_cast<ACE_TCHAR *> (dll_suffix)); #else /* ! defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS) */ ACE_OS::sprintf (pathname, ACE_LIB_TEXT ("%s%s%s"), @@ -254,10 +253,9 @@ ACE_Lib_Find::ldfind (const ACE_TCHAR* filename, searchpathname, ACE_DLL_PREFIX, searchfilename, - got_suffix ? ACE_static_cast (ACE_TCHAR *, - ACE_LIB_TEXT ("")) - : ACE_static_cast (ACE_TCHAR *, - dll_suffix)); + got_suffix + ? static_cast<ACE_TCHAR *> (ACE_LIB_TEXT ("")) + : static_cast<ACE_TCHAR *> (dll_suffix)); #else /* ! defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS) */ ACE_OS::sprintf (pathname, ACE_LIB_TEXT ("%s%s%s%s"), @@ -277,13 +275,13 @@ ACE_Lib_Find::ldfind (const ACE_TCHAR* filename, { #if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) ACE_TCHAR *file_component = 0; - DWORD pathlen = ACE_TEXT_SearchPath (0, - searchfilename, - dll_suffix, - ACE_static_cast (DWORD, - maxpathnamelen), - pathname, - &file_component); + DWORD pathlen = + ACE_TEXT_SearchPath (0, + searchfilename, + dll_suffix, + static_cast<DWORD> (maxpathnamelen), + pathname, + &file_component); if (pathlen >= maxpathnamelen) { errno = ENOMEM; @@ -296,13 +294,13 @@ ACE_Lib_Find::ldfind (const ACE_TCHAR* filename, // prefixed ACE_OS::strcpy (searchfilename, ACE_DLL_PREFIX); ACE_OS::strcat (searchfilename, tempcopy); - pathlen = ACE_TEXT_SearchPath (0, - searchfilename, - dll_suffix, - ACE_static_cast (DWORD, - maxpathnamelen), - pathname, - &file_component); + pathlen = + ACE_TEXT_SearchPath (0, + searchfilename, + dll_suffix, + static_cast<DWORD> (maxpathnamelen), + pathname, + &file_component); if (pathlen >= maxpathnamelen) { errno = ENOMEM; @@ -399,10 +397,9 @@ ACE_Lib_Find::ldfind (const ACE_TCHAR* filename, path_entry, ACE_DIRECTORY_SEPARATOR_CHAR, searchfilename, - got_suffix ? ACE_static_cast (ACE_TCHAR *, - ACE_LIB_TEXT ("")) - : ACE_static_cast (ACE_TCHAR *, - dll_suffix)); + got_suffix + ? static_cast<ACE_TCHAR *> (ACE_LIB_TEXT ("")) + : static_cast<ACE_TCHAR *> (dll_suffix)); #else /* ! defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS) */ ACE_OS::sprintf (pathname, ACE_LIB_TEXT ("%s%c%s%s"), @@ -423,10 +420,9 @@ ACE_Lib_Find::ldfind (const ACE_TCHAR* filename, ACE_DIRECTORY_SEPARATOR_CHAR, ACE_DLL_PREFIX, searchfilename, - got_suffix ? ACE_static_cast (ACE_TCHAR *, - ACE_LIB_TEXT ("")) - : ACE_static_cast (ACE_TCHAR *, - dll_suffix)); + got_suffix + ? static_cast<ACE_TCHAR *> (ACE_LIB_TEXT ("")) + : static_cast<ACE_TCHAR *> (dll_suffix)); #else /* ! defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS) */ ACE_OS::sprintf (pathname, ACE_LIB_TEXT ("%s%c%s%s%s"), @@ -525,12 +521,12 @@ ACE_Lib_Find::get_temp_dir (ACE_TCHAR *buffer, size_t buffer_len) { int result; #if defined (ACE_WIN32) - result = ACE_TEXT_GetTempPath (ACE_static_cast (DWORD, buffer_len), + result = ACE_TEXT_GetTempPath (static_cast<DWORD> (buffer_len), buffer); // Make sure to return -1 if there is an error if (result == 0 && ::GetLastError () != ERROR_SUCCESS - || result > ACE_static_cast (int, buffer_len)) + || result > static_cast<int> (buffer_len)) result = -1; #else /* ACE_WIN32 */ diff --git a/ace/Local_Name_Space.cpp b/ace/Local_Name_Space.cpp index b292ce67163..6cc578a7f8c 100644 --- a/ace/Local_Name_Space.cpp +++ b/ace/Local_Name_Space.cpp @@ -89,7 +89,7 @@ ACE_NS_String::strstr (const ACE_NS_String &s) const if (j == pat_len) // Found a match! Return the index. - return ACE_static_cast (int, i); + return static_cast<int> (i); } return -1; @@ -127,8 +127,7 @@ u_long ACE_NS_String::hash (void) const { return ACE::hash_pjw - (ACE_reinterpret_cast (char *, ACE_const_cast (ACE_WCHAR_T *, - this->rep_)), + (reinterpret_cast<char *> (const_cast<ACE_WCHAR_T *> (this->rep_)), this->len_); } diff --git a/ace/Log_Record.i b/ace/Log_Record.i index a61bc5415e0..c30d974e313 100644 --- a/ace/Log_Record.i +++ b/ace/Log_Record.i @@ -64,10 +64,10 @@ ASYS_INLINE void ACE_Log_Record::length (long l) { ACE_TRACE ("ACE_Log_Record::length"); - this->length_ = ACE_static_cast (ACE_UINT32, l); + this->length_ = static_cast<ACE_UINT32> (l); } -ASYS_INLINE ACE_Time_Value +ASYS_INLINE ACE_Time_Value ACE_Log_Record::time_stamp (void) const { ACE_TRACE ("ACE_Log_Record::time_stamp"); diff --git a/ace/MEM_Addr.cpp b/ace/MEM_Addr.cpp index e6d193a841e..971f8f7bc7f 100644 --- a/ace/MEM_Addr.cpp +++ b/ace/MEM_Addr.cpp @@ -42,11 +42,9 @@ ACE_MEM_Addr::ACE_MEM_Addr (const ACE_TCHAR port_number[]) : ACE_Addr (AF_INET, sizeof (ACE_MEM_Addr)) { ACE_TRACE ("ACE_MEM_Addr::ACE_MEM_Addr"); - u_short pn - = ACE_static_cast (u_short, - ACE_OS::strtoul (port_number, - 0, - 10)); + u_short pn = static_cast<u_short> (ACE_OS::strtoul (port_number, + 0, + 10)); this->initialize_local (pn); } @@ -100,11 +98,9 @@ ACE_MEM_Addr::string_to_addr (const ACE_TCHAR s[]) { ACE_TRACE ("ACE_MEM_Addr::string_to_addr"); - u_short pn - = ACE_static_cast (u_short, - ACE_OS::strtoul (s, - 0, - 10)); + u_short pn = static_cast<u_short> (ACE_OS::strtoul (s, + 0, + 10)); return this->set (pn); } diff --git a/ace/MEM_Connector.cpp b/ace/MEM_Connector.cpp index 7d852a0f8fb..7722c35d60b 100644 --- a/ace/MEM_Connector.cpp +++ b/ace/MEM_Connector.cpp @@ -134,7 +134,8 @@ ACE_MEM_Connector::connect (ACE_MEM_Stream &new_stream, ACE_LIB_TEXT ("ACE_MEM_Connector::connect error receiving shm filename.\n")), -1); - if (new_stream.init (buf, ACE_static_cast (ACE_MEM_IO::Signal_Strategy, server_strategy), + if (new_stream.init (buf, + static_cast<ACE_MEM_IO::Signal_Strategy> (server_strategy), &this->malloc_options_) == -1) return -1; diff --git a/ace/MEM_IO.i b/ace/MEM_IO.i index 3d80a0f8840..2f98ab2c273 100644 --- a/ace/MEM_IO.i +++ b/ace/MEM_IO.i @@ -61,10 +61,9 @@ ACE_Reactive_MEM_IO::get_buf_len (const off_t off, ACE_MEM_SAP_Node *&buf) ACE_SEH_TRY { - buf = ACE_reinterpret_cast (ACE_MEM_SAP_Node *, - (ACE_static_cast(char *, - this->shm_malloc_->base_addr ()) - + off)); + buf = + reinterpret_cast<ACE_MEM_SAP_Node *> ( + static_cast<char *> (this->shm_malloc_->base_addr ()) + off); retv = buf->size (); } ACE_SEH_EXCEPT (this->shm_malloc_->memory_pool ().seh_selector (GetExceptionInformation ())) diff --git a/ace/MEM_SAP.i b/ace/MEM_SAP.i index da73dd09a7c..172231e303d 100644 --- a/ace/MEM_SAP.i +++ b/ace/MEM_SAP.i @@ -49,8 +49,8 @@ ACE_MEM_SAP::acquire_buffer (const ssize_t size) ACE_MEM_SAP_Node *buf = 0; ACE_NEW_MALLOC_RETURN (buf, - ACE_static_cast (ACE_MEM_SAP_Node *, - this->shm_malloc_->malloc (sizeof (ACE_MEM_SAP_Node) + size)), + static_cast<ACE_MEM_SAP_Node *> + (this->shm_malloc_->malloc (sizeof (ACE_MEM_SAP_Node) + size)), ACE_MEM_SAP_Node (size), 0); return buf; diff --git a/ace/Malloc_T.cpp b/ace/Malloc_T.cpp index 20c54b0403f..d48228d3cb6 100644 --- a/ace/Malloc_T.cpp +++ b/ace/Malloc_T.cpp @@ -688,8 +688,7 @@ ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::shared_bind (const char *name, NAME_NODE *result = new (new_node) NAME_NODE (name, name_ptr, - ACE_reinterpret_cast (char *, - pointer), + reinterpret_cast<char *> (pointer), this->cb_ptr_->name_head_); this->cb_ptr_->name_head_ = result; return 0; diff --git a/ace/Malloc_T.i b/ace/Malloc_T.i index 4d137ac1228..b24436fb868 100644 --- a/ace/Malloc_T.i +++ b/ace/Malloc_T.i @@ -1,8 +1,7 @@ -/* -*- C++ -*- */ +// -*- C++ -*- +// // $Id$ -// Malloc_T.i - #include "ace/OS_NS_string.h" template <class T> ACE_INLINE T * @@ -11,7 +10,7 @@ ACE_Cached_Mem_Pool_Node<T>::addr (void) // This should be done using a single reinterpret_cast, but Sun/CC // (4.2) gets awfully confused when T is a char[20] (and maybe other // types). - return ACE_static_cast (T *, ACE_static_cast (void *, this)); + return static_cast<T *> (static_cast <void *> (this)); } template <class T> ACE_INLINE ACE_Cached_Mem_Pool_Node<T> * diff --git a/ace/Map_Manager.h b/ace/Map_Manager.h index acd447d45eb..ffcc9c1219b 100644 --- a/ace/Map_Manager.h +++ b/ace/Map_Manager.h @@ -404,7 +404,7 @@ protected: ACE_Allocator *allocator_; /// Synchronization variable for the MT_SAFE <ACE_Map_Manager>. - ACE_LOCK lock_; + mutable ACE_LOCK lock_; /// Implement the Map as a resizeable array of <ACE_Map_Entry>. ACE_Map_Entry<EXT_ID, INT_ID> *search_structure_; diff --git a/ace/Map_Manager.i b/ace/Map_Manager.i index e58a77fc6a1..7ef6fdfbf3b 100644 --- a/ace/Map_Manager.i +++ b/ace/Map_Manager.i @@ -180,14 +180,14 @@ ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::unbind (const EXT_ID &ext_id) template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE size_t ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::current_size (void) const { - ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, ACE_const_cast (ACE_LOCK &, this->lock_), ACE_static_cast (size_t, -1)); + ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, static_cast<size_t> (-1)); return this->cur_size_; } template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE size_t ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::total_size (void) const { - ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, ACE_const_cast (ACE_LOCK &, this->lock_), ACE_static_cast (size_t, -1)); + ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, static_cast<size_t> (-1)); return this->total_size_; } diff --git a/ace/Mem_Map.cpp b/ace/Mem_Map.cpp index e5d6da640b3..e08b29e213a 100644 --- a/ace/Mem_Map.cpp +++ b/ace/Mem_Map.cpp @@ -127,7 +127,7 @@ ACE_Mem_Map::map_it (ACE_HANDLE handle, #endif /* CHORUS */ // At this point we know <result> is not negative... - size_t current_file_length = ACE_static_cast (size_t, result); + size_t current_file_length = static_cast<size_t> (result); // Flag to indicate if we need to extend the back store int extend_backing_store = 0; @@ -170,7 +170,7 @@ ACE_Mem_Map::map_it (ACE_HANDLE handle, if (requested_file_length > 0) // This will make the file size <requested_file_length> null_byte_position = - ACE_static_cast (off_t, requested_file_length - 1); + static_cast<off_t> (requested_file_length - 1); else // This will make the file size 1 null_byte_position = 0; diff --git a/ace/Mem_Map.i b/ace/Mem_Map.i index cc0d3c4f314..d499a7807d9 100644 --- a/ace/Mem_Map.i +++ b/ace/Mem_Map.i @@ -231,7 +231,9 @@ ACE_INLINE int ACE_Mem_Map::advise (int behavior, int len) { ACE_TRACE ("ACE_Mem_Map::advise"); - size_t advise_len = len < 0 ? this->length_ : ACE_static_cast (size_t, len); + const size_t advise_len = + len < 0 ? this->length_ : static_cast<size_t> (len); + return ACE_OS::madvise ((caddr_t) this->base_addr_, advise_len, behavior); diff --git a/ace/Memory_Pool.i b/ace/Memory_Pool.i index 2a011c14dca..de87de3b331 100644 --- a/ace/Memory_Pool.i +++ b/ace/Memory_Pool.i @@ -56,7 +56,7 @@ ACE_INLINE size_t ACE_MMAP_Memory_Pool::round_up (size_t nbytes) { ACE_TRACE ("ACE_MMAP_Memory_Pool::round_up"); - return ACE::round_to_pagesize (ACE_static_cast (off_t, nbytes)); + return ACE::round_to_pagesize (static_cast<off_t> (nbytes)); } ACE_INLINE void * @@ -88,7 +88,7 @@ ACE_INLINE size_t ACE_Local_Memory_Pool::round_up (size_t nbytes) { ACE_TRACE ("ACE_Local_Memory_Pool::round_up"); - return ACE::round_to_pagesize (ACE_static_cast (off_t, nbytes)); + return ACE::round_to_pagesize (static_cast<off_t> (nbytes)); } #if !defined (ACE_LACKS_SYSV_SHMEM) @@ -234,7 +234,7 @@ ACE_Pagefile_Memory_Pool::round_to_chunk_size (size_t nbytes) ACE_INLINE size_t ACE_Pagefile_Memory_Pool::round_to_page_size (size_t nbytes) { - return ACE::round_to_pagesize (ACE_static_cast (off_t, nbytes)); + return ACE::round_to_pagesize (static_cast<off_t> (nbytes)); } ACE_INLINE int diff --git a/ace/Message_Queue.i b/ace/Message_Queue.i index c166c77efda..fa03235d6a7 100644 --- a/ace/Message_Queue.i +++ b/ace/Message_Queue.i @@ -23,10 +23,10 @@ ACE_Message_Queue_Base::state (void) // Specialization to use native VxWorks Message Queues. ACE_INLINE MSG_Q_ID -ACE_Message_Queue_Vx::msgq () +ACE_Message_Queue_Vx::msgq (void) { // Hijack the tail_ field to store the MSG_Q_ID. - return ACE_reinterpret_cast (MSG_Q_ID, tail_); + return reinterpret_cast<MSG_Q_ID> (tail_); } ACE_INLINE int diff --git a/ace/Multihomed_INET_Addr.cpp b/ace/Multihomed_INET_Addr.cpp index 79f269b9402..6bd18e8a502 100644 --- a/ace/Multihomed_INET_Addr.cpp +++ b/ace/Multihomed_INET_Addr.cpp @@ -177,7 +177,7 @@ ACE_Multihomed_INET_Addr::get_addresses(sockaddr_in *addrs, { // Copy primary address to the first slot of the user-supplied array if (size > 0) { - addrs[0] = *ACE_reinterpret_cast (sockaddr_in*, this->get_addr()); + addrs[0] = *reinterpret_cast<sockaddr_in*> (this->get_addr ()); } // Copy secondary addresses to remaining slots of the user-supplied @@ -187,7 +187,8 @@ ACE_Multihomed_INET_Addr::get_addresses(sockaddr_in *addrs, size - 1 : this->secondaries_.size(); for (size_t i = 0; i < top; ++i) { - addrs[i+1] = *ACE_reinterpret_cast (sockaddr_in*, this->secondaries_[i].get_addr()); + addrs[i+1] = + *reinterpret_cast<sockaddr_in*> (this->secondaries_[i].get_addr()); } } @@ -199,9 +200,7 @@ ACE_Multihomed_INET_Addr::get_addresses(sockaddr_in6 *addrs, // Copy primary address to the first slot of the user-supplied array if (size > 0) { - addrs[0] = - *ACE_reinterpret_cast (sockaddr_in6*, - this->get_addr ()); + addrs[0] = *reinterpret_cast<sockaddr_in6*> (this->get_addr ()); } // Copy secondary addresses to remaining slots of the user-supplied @@ -213,8 +212,7 @@ ACE_Multihomed_INET_Addr::get_addresses(sockaddr_in6 *addrs, for (size_t i = 0; i < top; ++i) { addrs[i+1] = - *ACE_reinterpret_cast (sockaddr_in6*, - this->secondaries_[i].get_addr()); + *reinterpret_cast<sockaddr_in6*> (this->secondaries_[i].get_addr()); } } #endif /* ACE_HAS_IPV6 */ diff --git a/ace/Mutex.inl b/ace/Mutex.inl index 9535bfd4413..a038aa6d9be 100644 --- a/ace/Mutex.inl +++ b/ace/Mutex.inl @@ -148,9 +148,9 @@ ACE_Mutex::remove (void) ACE_OS::munmap ((void *) this->process_lock_, sizeof (ACE_mutex_t)); ACE_OS::shm_unlink (this->lockname_); - ACE_OS::free (ACE_static_cast (void *, - ACE_const_cast (ACE_TCHAR *, - this->lockname_))); + ACE_OS::free ( + static_cast<void *> ( + const_cast<ACE_TCHAR *> (this->lockname_))); } } } diff --git a/ace/Name_Proxy.cpp b/ace/Name_Proxy.cpp index 64937e3dfd3..a5157d5d9ac 100644 --- a/ace/Name_Proxy.cpp +++ b/ace/Name_Proxy.cpp @@ -39,7 +39,7 @@ ACE_Name_Proxy::open (const ACE_INET_Addr &remote_addr, ACE_Time_Value *timeout = 0; if (options[ACE_Synch_Options::USE_TIMEOUT]) - timeout = ACE_const_cast (ACE_Time_Value *, options.time_value ()); + timeout = const_cast<ACE_Time_Value *> (options.time_value ()); // Initiate the connection. return this->connector_.connect (this->peer_, diff --git a/ace/Name_Request_Reply.cpp b/ace/Name_Request_Reply.cpp index de76953a384..7554555457c 100644 --- a/ace/Name_Request_Reply.cpp +++ b/ace/Name_Request_Reply.cpp @@ -70,7 +70,7 @@ ACE_Name_Request::ACE_Name_Request ( // ... then add in the amount of the variable-sized portion. len += name_length + value_length + type_length ; - this->length (ACE_static_cast (ACE_UINT32, len)); + this->length (static_cast<ACE_UINT32> (len)); } // Initialize length_ in order to avoid problems with byte-ordering. diff --git a/ace/OS_NS_Thread.inl b/ace/OS_NS_Thread.inl index 15ba3825f97..0ef8aef2b07 100644 --- a/ace/OS_NS_Thread.inl +++ b/ace/OS_NS_Thread.inl @@ -83,12 +83,12 @@ ACE_TSS_Emulation::ts_object (const ACE_thread_key_t key) if (0 == taskIdCurrent->ACE_VXWORKS_SPARE) { taskIdCurrent->ACE_VXWORKS_SPARE = - ACE_reinterpret_cast (int, new void *[ACE_TSS_THREAD_KEYS_MAX]); + reinterpret_cast<int> (new void *[ACE_TSS_THREAD_KEYS_MAX]); // Zero the entire TSS array. Do it manually instead of using // memset, for optimum speed. Though, memset may be faster :-) void **tss_base_p = - ACE_reinterpret_cast (void **, taskIdCurrent->ACE_VXWORKS_SPARE); + reinterpret_cast> (void **> (taskIdCurrent->ACE_VXWORKS_SPARE); for (u_int i = 0; i < ACE_TSS_THREAD_KEYS_MAX; ++i, ++tss_base_p) { *tss_base_p = 0; @@ -387,7 +387,7 @@ ACE_OS::cond_init (ACE_cond_t *cv, ace_result_), int, -1); # elif defined (ACE_PSOS) && defined (ACE_PSOS_HAS_COND_T) - ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::cv_create (ACE_const_cast (char *, name), + ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::cv_create (const_cast<char *> (name), attributes, cv), ace_result_), @@ -858,7 +858,7 @@ ACE_OS::event_init (ACE_event_t *event, event->waiting_threads_ = 0; int result = ACE_OS::cond_init (&event->condition_, - ACE_static_cast (short, type), + static_cast<short> (type), name, arg); if (result == 0) @@ -1709,7 +1709,7 @@ ACE_OS::priority_control (ACE_idtype_t idtype, ACE_id_t id, int cmd, void *arg) { ACE_OS_TRACE ("ACE_OS::priority_control"); #if defined (ACE_HAS_PRIOCNTL) - ACE_OSCALL_RETURN (priocntl (idtype, id, cmd, ACE_static_cast (caddr_t, arg)), + ACE_OSCALL_RETURN (priocntl (idtype, id, cmd, static_cast<caddr_t> (arg)), int, -1); #else /* ! ACE_HAS_PRIOCNTL*/ ACE_UNUSED_ARG (idtype); diff --git a/ace/OS_NS_arpa_inet.inl b/ace/OS_NS_arpa_inet.inl index a0f452c6aec..8e42c253f6a 100644 --- a/ace/OS_NS_arpa_inet.inl +++ b/ace/OS_NS_arpa_inet.inl @@ -69,8 +69,7 @@ ACE_OS::inet_ntop (int family, const void *addrptr, char *strptr, size_t len) #if defined (ACE_HAS_IPV6) && !defined (ACE_WIN32) ACE_OSCALL_RETURN (::inet_ntop (family, addrptr, strptr, len), const char *, 0); #else - const u_char *p = - ACE_reinterpret_cast (const u_char *, addrptr); + const u_char *p = reinterpret_cast<const u_char *> (addrptr); if (family == AF_INET) { @@ -120,4 +119,3 @@ ACE_OS::inet_pton (int family, const char *strptr, void *addrptr) ACE_NOTSUP_RETURN(-1); #endif /* ACE_HAS_IPV6 */ } - diff --git a/ace/OS_NS_dirent.inl b/ace/OS_NS_dirent.inl index 1d7c9aedfc7..38b6e25df8f 100644 --- a/ace/OS_NS_dirent.inl +++ b/ace/OS_NS_dirent.inl @@ -40,9 +40,7 @@ ACE_OS::opendir (const ACE_TCHAR *filename) ACE_DIR *dir; u_long result; ACE_NEW_RETURN (dir, ACE_DIR, 0); - result = ::open_dir (ACE_const_cast (ACE_TCHAR *, - filename), - &dir->xdir); + result = ::open_dir (const_cast<ACE_TCHAR *> (filename), &dir->xdir); if (result == 0) return dir; else @@ -55,7 +53,7 @@ ACE_OS::opendir (const ACE_TCHAR *filename) return ::ACE_OS::opendir_emulation (filename); # else /* ! ACE_WIN32 && ACE_LACKS_OPENDIR */ // VxWorks' ::opendir () is declared with a non-const argument. - return ::opendir (ACE_const_cast (ACE_TCHAR *, filename)); + return ::opendir (const_cast<ACE_TCHAR *> (filename)); # endif /* ACE_WIN32 && ACE_LACKS_OPENDIR */ # endif /* ACE_PSOS */ #else diff --git a/ace/OS_NS_dlfcn.inl b/ace/OS_NS_dlfcn.inl index b137d4074b8..ed3a95c609a 100644 --- a/ace/OS_NS_dlfcn.inl +++ b/ace/OS_NS_dlfcn.inl @@ -109,7 +109,7 @@ ACE_OS::dlopen (const ACE_TCHAR *fname, ACE_OS_TRACE ("ACE_OS::dlopen"); // Get the correct OS type. - ACE_DL_TYPE filename = ACE_const_cast (ACE_DL_TYPE, fname); + ACE_DL_TYPE filename = const_cast<ACE_DL_TYPE> (fname); # if defined (ACE_HAS_SVR4_DYNAMIC_LINKING) void *handle; @@ -199,7 +199,7 @@ ACE_OS::dlsym (ACE_SHLIB_HANDLE handle, #if defined (ACE_HAS_WINCE) const wchar_t *symbolname = sname; #elif defined (ACE_HAS_CHARPTR_DL) - char *symbolname = ACE_const_cast (char *, sname); + char *symbolname = const_cast<char *> (sname); #elif !defined (ACE_WIN32) || !defined (ACE_USES_WCHAR) const char *symbolname = sname; #endif /* ACE_HAS_CHARPTR_DL */ diff --git a/ace/OS_NS_fcntl.h b/ace/OS_NS_fcntl.h index b16465b4c3a..a903316cdaa 100644 --- a/ace/OS_NS_fcntl.h +++ b/ace/OS_NS_fcntl.h @@ -64,13 +64,13 @@ namespace ACE_OS { /// the end prior to each write, as specified by POSIX. This /// is generally good enough for typical situations, but it is ``not /// quite right'' in its semantics. - extern ACE_Export + extern ACE_Export ACE_HANDLE open (const char *filename, int mode, int perms = ACE_DEFAULT_OPEN_PERMS, LPSECURITY_ATTRIBUTES sa = 0); #if defined (ACE_HAS_WCHAR) - extern ACE_Export + extern ACE_Export ACE_HANDLE open (const wchar_t *filename, int mode, int perms = ACE_DEFAULT_OPEN_PERMS, diff --git a/ace/OS_NS_math.inl b/ace/OS_NS_math.inl index 9ff3151ab4f..244919a7107 100644 --- a/ace/OS_NS_math.inl +++ b/ace/OS_NS_math.inl @@ -5,7 +5,7 @@ ACE_INLINE double ACE_OS::floor (double x) { // This method computes the largest integral value not greater than x. - return double (ACE_static_cast (long, x)); + return double (static_cast<long> (x)); } ACE_INLINE double diff --git a/ace/OS_NS_netdb.inl b/ace/OS_NS_netdb.inl index e83ca69ae7c..555521fb74c 100644 --- a/ace/OS_NS_netdb.inl +++ b/ace/OS_NS_netdb.inl @@ -51,7 +51,7 @@ ACE_OS::gethostbyaddr (const char *addr, int length, int type) ACE_UNUSED_ARG (type); ACE_NOTSUP_RETURN (0); # elif defined (ACE_HAS_NONCONST_GETBY) - ACE_SOCKCALL_RETURN (::gethostbyaddr (ACE_const_cast (char *, addr), + ACE_SOCKCALL_RETURN (::gethostbyaddr (const_cast<char *> (addr), (ACE_SOCKET_LEN) length, type), struct hostent *, @@ -127,7 +127,7 @@ ACE_OS::gethostbyaddr_r (const char *addr, ACE_UNUSED_ARG (result); ACE_UNUSED_ARG (buffer); ACE_UNUSED_ARG (h_errnop); - ACE_SOCKCALL_RETURN (::gethostbyaddr (ACE_const_cast (char *, addr), + ACE_SOCKCALL_RETURN (::gethostbyaddr (const_cast<char *> (addr), (ACE_SOCKET_LEN) length, type), struct hostent *, @@ -153,7 +153,7 @@ ACE_OS::gethostbyname (const char *name) ACE_UNUSED_ARG (name); ACE_NOTSUP_RETURN (0); # elif defined (ACE_HAS_NONCONST_GETBY) - ACE_SOCKCALL_RETURN (::gethostbyname (ACE_const_cast (char *, name)), + ACE_SOCKCALL_RETURN (::gethostbyname (const_cast<char *> (name)), struct hostent *, 0); # else @@ -228,7 +228,7 @@ ACE_OS::gethostbyname_r (const char *name, ACE_UNUSED_ARG (result); ACE_UNUSED_ARG (buffer); ACE_UNUSED_ARG (h_errnop); - ACE_SOCKCALL_RETURN (::gethostbyname (ACE_const_cast (char *, name)), + ACE_SOCKCALL_RETURN (::gethostbyname (const_cast<char *> (name)), struct hostent *, 0); # else @@ -263,8 +263,8 @@ ACE_OS::getipnodebyaddr (const void *src, size_t len, int family) #else // IPv4-only implementation if (family == AF_INET) - return ACE_OS::gethostbyaddr (ACE_static_cast (const char *, src), - ACE_static_cast (int, len), + return ACE_OS::gethostbyaddr (static_cast<const char *> (src), + static_cast<int> (len), family); ACE_NOTSUP_RETURN (0); @@ -284,7 +284,7 @@ ACE_OS::getipnodebyname (const char *name, int family, int flags) # if defined (__GLIBC__) ACE_UNUSED_ARG (flags); # if defined (ACE_HAS_NONCONST_GETBY) - ACE_SOCKCALL_RETURN (::gethostbyname2 (ACE_const_cast (char *, name), + ACE_SOCKCALL_RETURN (::gethostbyname2 (const_cast<char *> (name), family), struct hostent *, 0); # else @@ -319,7 +319,7 @@ ACE_OS::getprotobyname (const char *name) ACE_UNUSED_ARG (name); ACE_NOTSUP_RETURN (0); #elif defined (ACE_HAS_NONCONST_GETBY) - ACE_SOCKCALL_RETURN (::getprotobyname (ACE_const_cast (char *, name)), + ACE_SOCKCALL_RETURN (::getprotobyname (const_cast<char *> (name)), struct protoent *, 0); #else @@ -372,7 +372,7 @@ ACE_OS::getprotobyname_r (const char *name, #elif defined (ACE_HAS_NONCONST_GETBY) ACE_UNUSED_ARG (result); ACE_UNUSED_ARG (buffer); - ACE_SOCKCALL_RETURN (::getprotobyname (ACE_const_cast (char *, name)), + ACE_SOCKCALL_RETURN (::getprotobyname (const_cast<char *> (name)), struct protoent *, 0); #else ACE_UNUSED_ARG (buffer); @@ -451,8 +451,8 @@ ACE_OS::getservbyname (const char *svc, const char *proto) ACE_UNUSED_ARG (proto); ACE_NOTSUP_RETURN (0); #elif defined (ACE_HAS_NONCONST_GETBY) - ACE_SOCKCALL_RETURN (::getservbyname (ACE_const_cast (char *, svc), - ACE_const_cast (char *, proto)), + ACE_SOCKCALL_RETURN (::getservbyname (const_cast<char *> (svc), + const_cast<char *> (proto)), struct servent *, 0); #else @@ -512,8 +512,8 @@ ACE_OS::getservbyname_r (const char *svc, #elif defined (ACE_HAS_NONCONST_GETBY) ACE_UNUSED_ARG (buf); ACE_UNUSED_ARG (result); - ACE_SOCKCALL_RETURN (::getservbyname (ACE_const_cast (char *, svc), - ACE_const_cast (char *, proto)), + ACE_SOCKCALL_RETURN (::getservbyname (const_cast<char *> (svc), + const_cast<char *> (proto)), struct servent *, 0); #else diff --git a/ace/OS_NS_signal.inl b/ace/OS_NS_signal.inl index 8d6ea5ea91c..f804090e373 100644 --- a/ace/OS_NS_signal.inl +++ b/ace/OS_NS_signal.inl @@ -62,7 +62,7 @@ ACE_OS::sigaction (int signum, ACE_NOTSUP_RETURN (-1); #elif !defined (ACE_HAS_SIGACTION_CONSTP2) ACE_OSCALL_RETURN (::sigaction (signum, - ACE_const_cast (struct sigaction*, nsa), + const_cast<struct sigaction*> (nsa), osa), int, -1); #else diff --git a/ace/OS_NS_stdio.inl b/ace/OS_NS_stdio.inl index f2adf882f84..afff48d31d9 100644 --- a/ace/OS_NS_stdio.inl +++ b/ace/OS_NS_stdio.inl @@ -174,7 +174,7 @@ ACE_OS::flock_unlock (ACE_OS::ace_flock_t *lock, // release lock ACE_OSCALL_RETURN (ACE_OS::fcntl (lock->handle_, F_SETLK, - ACE_reinterpret_cast (long, &lock->lock_)), + reinterpret_cast<long> (&lock->lock_)), int, -1); #endif /* ACE_WIN32 */ } @@ -200,9 +200,8 @@ ACE_OS::flock_destroy (ACE_OS::ace_flock_t *lock, sizeof (ACE_mutex_t)); if (unlink_file) ACE_OS::shm_unlink (lock->lockname_); - ACE_OS::free (ACE_static_cast (void *, - ACE_const_cast (ACE_TCHAR *, - lock->lockname_))); + ACE_OS::free ( + static_cast<void *> (const_cast<ACE_TCHAR *> (lock->lockname_))); } else if (lock->process_lock_) // Just unmap the memory. @@ -213,9 +212,8 @@ ACE_OS::flock_destroy (ACE_OS::ace_flock_t *lock, { if (unlink_file) ACE_OS::unlink (lock->lockname_); - ACE_OS::free (ACE_static_cast (void *, - ACE_const_cast (ACE_TCHAR *, - lock->lockname_))); + ACE_OS::free ( + static_cast<void *> (const_cast<ACE_TCHAR *> (lock->lockname_))); } #endif /* CHORUS */ lock->lockname_ = 0; @@ -266,7 +264,7 @@ ACE_OS::flock_rdlock (ACE_OS::ace_flock_t *lock, lock->lock_.l_type = F_RDLCK; // set read lock // block, if no access ACE_OSCALL_RETURN (ACE_OS::fcntl (lock->handle_, F_SETLKW, - ACE_reinterpret_cast (long, &lock->lock_)), + reinterpret_cast<long> (&lock->lock_)), int, -1); #endif /* ACE_WIN32 */ } @@ -315,7 +313,7 @@ ACE_OS::flock_tryrdlock (ACE_OS::ace_flock_t *lock, int result = 0; // Does not block, if no access, returns -1 and set errno = EBUSY; ACE_OSCALL (ACE_OS::fcntl (lock->handle_, F_SETLK, - ACE_reinterpret_cast (long, &lock->lock_)), + reinterpret_cast<long> (&lock->lock_)), int, -1, result); # if ! defined (ACE_PSOS) @@ -372,7 +370,7 @@ ACE_OS::flock_trywrlock (ACE_OS::ace_flock_t *lock, // Does not block, if no access, returns -1 and set errno = EBUSY; ACE_OSCALL (ACE_OS::fcntl (lock->handle_, F_SETLK, - ACE_reinterpret_cast (long, &lock->lock_)), + reinterpret_cast<long> (&lock->lock_)), int, -1, result); # if ! defined (ACE_PSOS) @@ -427,7 +425,7 @@ ACE_OS::flock_wrlock (ACE_OS::ace_flock_t *lock, lock->lock_.l_type = F_WRLCK; // set write lock // block, if no access ACE_OSCALL_RETURN (ACE_OS::fcntl (lock->handle_, F_SETLKW, - ACE_reinterpret_cast (long, &lock->lock_)), + reinterpret_cast<long> (&lock->lock_)), int, -1); #endif /* ACE_WIN32 */ } diff --git a/ace/OS_NS_stdlib.inl b/ace/OS_NS_stdlib.inl index 54718026562..8482bbde11d 100644 --- a/ace/OS_NS_stdlib.inl +++ b/ace/OS_NS_stdlib.inl @@ -84,7 +84,7 @@ ACE_OS::atop (const char *s) #else int ip = ::atoi (s); #endif /* ACE_WIN64 */ - void *p = ACE_reinterpret_cast (void *, ip); + void *p = reinterpret_cast<void *> (ip); return p; } @@ -97,7 +97,7 @@ ACE_OS::atop (const wchar_t *s) # else int ip = ACE_OS::atoi (s); # endif /* ACE_WIN64 */ - void *p = ACE_reinterpret_cast (void *, ip); + void *p = reinterpret_cast<void *> (ip); return p; } #endif /* ACE_HAS_WCHAR */ diff --git a/ace/OS_NS_string.inl b/ace/OS_NS_string.inl index 705cc203a9f..13168942e68 100644 --- a/ace/OS_NS_string.inl +++ b/ace/OS_NS_string.inl @@ -1,4 +1,5 @@ // -*- C++ -*- +// // $Id$ // OS_NS_wchar.h is only needed to get the emulation methods. @@ -19,8 +20,9 @@ ACE_OS::memchr (const void *s, int c, size_t len) ACE_INLINE void * ACE_OS::memchr (void *s, int c, size_t len) { - return ACE_const_cast (void *, - ACE_OS::memchr (ACE_static_cast (const void *, s), c, len)); + return const_cast<void *> (ACE_OS::memchr (static_cast<const void *> (s), + c, + len)); } ACE_INLINE int @@ -102,8 +104,9 @@ ACE_OS::strchr (char *s, int c) ACE_INLINE wchar_t * ACE_OS::strchr (wchar_t *s, wint_t c) { - return ACE_const_cast (wchar_t *, - ACE_OS::strchr (ACE_static_cast (const wchar_t *, s), c)); + return + const_cast<wchar_t *> (ACE_OS::strchr (static_cast<const wchar_t *> (s), + c)); } #endif /* ACE_HAS_WCHAR */ @@ -210,19 +213,22 @@ ACE_OS::strnchr (char *s, int c, size_t len) { #if defined ACE_PSOS_DIAB_PPC /* Compiler problem Diab 4.2b */ const char *const_char_s = s; - return ACE_const_cast (char *, - ACE_OS::strnchr (const_char_s, c, len)); + return const_cast<char *> (ACE_OS::strnchr (const_char_s, c, len)); #else - return ACE_const_cast (char *, - ACE_OS::strnchr (ACE_static_cast (const char *, s), c, len)); + return const_cast<char *> (ACE_OS::strnchr (static_cast<const char *> (s), + c, + len)); #endif } ACE_INLINE ACE_WCHAR_T * ACE_OS::strnchr (ACE_WCHAR_T *s, ACE_WINT_T c, size_t len) { - return ACE_const_cast (ACE_WCHAR_T *, - ACE_OS::strnchr (ACE_static_cast (const ACE_WCHAR_T *, s), c, len)); + return + const_cast<ACE_WCHAR_T *> (ACE_OS::strnchr ( + static_cast<const ACE_WCHAR_T *> (s), + c, + len)); } ACE_INLINE int @@ -299,8 +305,11 @@ ACE_OS::strnstr (char *s, const char *t, size_t len) ACE_INLINE ACE_WCHAR_T * ACE_OS::strnstr (ACE_WCHAR_T *s, const ACE_WCHAR_T *t, size_t len) { - return ACE_const_cast (ACE_WCHAR_T *, - ACE_OS::strnstr (ACE_static_cast (const ACE_WCHAR_T *, s), t, len)); + return + const_cast<ACE_WCHAR_T *> (ACE_OS::strnstr ( + static_cast<const ACE_WCHAR_T *> (s), + t, + len)); } ACE_INLINE const char * @@ -339,8 +348,8 @@ ACE_OS::strpbrk (char *s1, const char *s2) ACE_INLINE wchar_t * ACE_OS::strpbrk (wchar_t *s, const wchar_t *t) { - return ACE_const_cast (wchar_t *, - ACE_OS::strpbrk (ACE_static_cast (const wchar_t *, s), t)); + return const_cast<wchar_t *> (ACE_OS::strpbrk ( + static_cast<const wchar_t *> (s), t)); } #endif /* ACE_HAS_WCHAR */ @@ -380,8 +389,8 @@ ACE_OS::strrchr (char *s, int c) ACE_INLINE wchar_t * ACE_OS::strrchr (wchar_t *s, wint_t c) { - return ACE_const_cast (wchar_t *, - ACE_OS::strrchr (ACE_static_cast (const wchar_t *, s), c)); + return const_cast<wchar_t *> (ACE_OS::strrchr ( + static_cast<const wchar_t *> (s), c)); } #endif /* ACE_HAS_WCHAR */ @@ -492,4 +501,3 @@ ACE_OS::strtok_r (ACE_WCHAR_T *s, const ACE_WCHAR_T *tokens, ACE_WCHAR_T **lasts #endif /* ACE_LACKS_WCSTOK */ } #endif // ACE_HAS_WCHAR - diff --git a/ace/OS_NS_stropts.inl b/ace/OS_NS_stropts.inl index 6bc526270ab..1e33d9d59d9 100644 --- a/ace/OS_NS_stropts.inl +++ b/ace/OS_NS_stropts.inl @@ -112,7 +112,7 @@ ACE_OS::ioctl (ACE_HANDLE handle, ACE_SOCKET sock = (ACE_SOCKET) handle; ACE_SOCKCALL_RETURN (::ioctlsocket (sock, cmd, (unsigned long *) val), int, -1); #elif defined (VXWORKS) - ACE_OSCALL_RETURN (::ioctl (handle, cmd, ACE_reinterpret_cast (int, val)), + ACE_OSCALL_RETURN (::ioctl (handle, cmd, reinterpret_cast<int> (val)), int, -1); #elif defined (ACE_PSOS) ACE_OSCALL_RETURN (::ioctl (handle, cmd, (char *) val), int, -1); @@ -156,12 +156,12 @@ ACE_OS::putmsg (ACE_HANDLE handle, const struct strbuf *ctl, else if (ctl != 0) { result = ACE_OS::write (handle, ctl->buf, ctl->len); - return ACE_static_cast (int, result); + return static_cast<int> (result); } else if (data != 0) { result = ACE_OS::write (handle, data->buf, data->len); - return ACE_static_cast (int, result); + return static_cast<int> (result); } else { @@ -172,7 +172,7 @@ ACE_OS::putmsg (ACE_HANDLE handle, const struct strbuf *ctl, ACE_OS::memcpy (buf + ctl->len, data->buf, data->len); result = ACE_OS::write (handle, buf, ctl->len + data->len); delete [] buf; - return ACE_static_cast (int, result); + return static_cast<int> (result); } #endif /* ACE_HAS_STREAM_PIPES */ } diff --git a/ace/OS_NS_sys_msg.inl b/ace/OS_NS_sys_msg.inl index 5ae5d81bb7e..8368a4494b1 100644 --- a/ace/OS_NS_sys_msg.inl +++ b/ace/OS_NS_sys_msg.inl @@ -66,7 +66,10 @@ ACE_OS::msgsnd (int int_id, const void *buf, size_t len, int flags) # elif defined (ACE_LACKS_POSIX_PROTOTYPES) || defined (ACE_LACKS_SOME_POSIX_PROTOTYPES) ACE_OSCALL_RETURN (::msgsnd (int_id, (msgbuf *) buf, len, flags), int, -1); # else - ACE_OSCALL_RETURN (::msgsnd (int_id, ACE_const_cast (void *, buf), len, flags), int, -1); + ACE_OSCALL_RETURN (::msgsnd (int_id, + const_cast<void *> (buf), len, flags), + int, + -1); # endif /* ACE_LACKS_POSIX_PROTOTYPES || ACE_HAS_NONCONST_MSGSND */ #else ACE_UNUSED_ARG (int_id); @@ -77,4 +80,3 @@ ACE_OS::msgsnd (int int_id, const void *buf, size_t len, int flags) ACE_NOTSUP_RETURN (-1); #endif /* ACE_HAS_SYSV_IPC */ } - diff --git a/ace/OS_NS_sys_shm.inl b/ace/OS_NS_sys_shm.inl index d394666b1cf..4de31f06737 100644 --- a/ace/OS_NS_sys_shm.inl +++ b/ace/OS_NS_sys_shm.inl @@ -64,4 +64,3 @@ ACE_OS::shmget (key_t key, int size, int flags) ACE_NOTSUP_RETURN (-1); #endif /* ACE_HAS_SYSV_IPC */ } - diff --git a/ace/OS_NS_sys_socket.inl b/ace/OS_NS_sys_socket.inl index 526e6acbac4..1fafea990d5 100644 --- a/ace/OS_NS_sys_socket.inl +++ b/ace/OS_NS_sys_socket.inl @@ -248,7 +248,7 @@ ACE_OS::recv (ACE_HANDLE handle, char *buf, size_t len, int flags) // can be used, as this is not an issue. #if defined (ACE_WIN32) ACE_SOCKCALL_RETURN (::recv ((ACE_SOCKET) handle, buf, - ACE_static_cast (int, len), flags), int, -1); + static_cast<int> (len), flags), int, -1); #else int ace_result_; ace_result_ = ::recv ((ACE_SOCKET) handle, buf, len, flags); @@ -293,7 +293,7 @@ ACE_OS::recvfrom (ACE_HANDLE handle, int, -1); # endif /* defined ACE_PSOS_DIAB_PPC */ #elif defined (ACE_WIN32) - int shortened_len = ACE_static_cast (int, len); + int shortened_len = static_cast<int> (len); int result = ::recvfrom ((ACE_SOCKET) handle, buf, shortened_len, @@ -347,7 +347,7 @@ ACE_OS::recvfrom (ACE_HANDLE handle, ACE_OS::set_errno_to_last_error (); } flags = the_flags; - number_of_bytes_recvd = ACE_static_cast (size_t, bytes_recvd); + number_of_bytes_recvd = static_cast<size_t> (bytes_recvd); return result; #else ACE_UNUSED_ARG (handle); @@ -474,7 +474,7 @@ ACE_OS::send (ACE_HANDLE handle, const char *buf, size_t len, int flags) #if defined (ACE_WIN32) ACE_SOCKCALL_RETURN (::send ((ACE_SOCKET) handle, buf, - ACE_static_cast (int, len), + static_cast<int> (len), flags), int, -1); #else int ace_result_; @@ -554,8 +554,11 @@ ACE_OS::sendto (ACE_HANDLE handle, { ACE_OS_TRACE ("ACE_OS::sendto"); #if defined (VXWORKS) - ACE_SOCKCALL_RETURN (::sendto ((ACE_SOCKET) handle, (char *) buf, len, flags, - ACE_const_cast (struct sockaddr *, addr), addrlen), + ACE_SOCKCALL_RETURN (::sendto ((ACE_SOCKET) handle, (char *) buf, + len, + flags, + const_cast<struct sockaddr *> (addr), + addrlen), int, -1); #elif defined (ACE_PSOS) # if !defined (ACE_PSOS_DIAB_PPC) @@ -569,13 +572,20 @@ ACE_OS::sendto (ACE_HANDLE handle, # endif /*defined ACE_PSOS_DIAB_PPC */ #else # if defined (ACE_WIN32) - ACE_SOCKCALL_RETURN (::sendto ((ACE_SOCKET) handle, buf, - ACE_static_cast (int, len), flags, - ACE_const_cast (struct sockaddr *, addr), addrlen), + ACE_SOCKCALL_RETURN (::sendto ((ACE_SOCKET) handle, + buf, + static_cast<int> (len), + flags, + const_cast<struct sockaddr *> (addr), + addrlen), int, -1); # else - ACE_SOCKCALL_RETURN (::sendto ((ACE_SOCKET) handle, buf, len, flags, - ACE_const_cast (struct sockaddr *, addr), addrlen), + ACE_SOCKCALL_RETURN (::sendto ((ACE_SOCKET) handle, + buf, + len, + flags, + const_cast<struct sockaddr *> (addr), + addrlen), int, -1); # endif /* ACE_WIN32 */ #endif /* VXWORKS */ @@ -607,7 +617,7 @@ ACE_OS::sendto (ACE_HANDLE handle, if (result != 0) { ACE_OS::set_errno_to_last_error (); } - number_of_bytes_sent = ACE_static_cast (size_t, bytes_sent); + number_of_bytes_sent = static_cast<size_t> (bytes_sent); return result; #else ACE_UNUSED_ARG (overlapped); @@ -620,7 +630,7 @@ ACE_OS::sendto (ACE_HANDLE handle, for (int i = 0; i < buffer_count; i++) { result = ACE_OS::sendto (handle, - ACE_reinterpret_cast (char *ACE_CAST_CONST, + reinterpret_cast<char *ACE_CAST_CONST> ( buffers[i].iov_base), buffers[i].iov_len, flags, diff --git a/ace/OS_NS_sys_stat.inl b/ace/OS_NS_sys_stat.inl index 2992abca714..cd4ffe1c8cf 100644 --- a/ace/OS_NS_sys_stat.inl +++ b/ace/OS_NS_sys_stat.inl @@ -83,7 +83,7 @@ ACE_OS::fstat (ACE_HANDLE handle, ACE_stat *stp) stp->st_atime = ACE_Time_Value (fdata.ftLastAccessTime).sec (); stp->st_mtime = ACE_Time_Value (fdata.ftLastWriteTime).sec (); stp->st_ctime = ACE_Time_Value (fdata.ftCreationTime).sec (); - stp->st_nlink = ACE_static_cast (short, fdata.nNumberOfLinks); + stp->st_nlink = static_cast (short> (fdata.nNumberOfLinks); stp->st_dev = stp->st_rdev = 0; // No equivalent conversion. stp->st_mode = S_IXOTH | S_IROTH | (fdata.dwFileAttributes & FILE_ATTRIBUTE_READONLY ? 0 : S_IWOTH) | diff --git a/ace/OS_NS_time.inl b/ace/OS_NS_time.inl index 1e502585f79..07a9738d720 100644 --- a/ace/OS_NS_time.inl +++ b/ace/OS_NS_time.inl @@ -66,7 +66,7 @@ ACE_OS::clock_gettime (clockid_t clockid, struct timespec *ts) ACE_UNUSED_ARG (clockid); ACE_PSOS_Time_t pt; int result = ACE_PSOS_Time_t::get_system_time (pt); - *ts = ACE_static_cast (struct timespec, pt); + *ts = static_cast<struct timespec> (pt); return result; #else ACE_UNUSED_ARG (clockid); @@ -232,7 +232,8 @@ ACE_OS::gethrtime (const ACE_HRTimer_Op op) ::QueryPerformanceCounter (&freq); # if defined (ACE_LACKS_LONGLONG_T) - ACE_UINT64 uint64_freq(freq.u.LowPart, ACE_static_cast (unsigned int, freq.u.HighPart)); + ACE_UINT64 uint64_freq (freq.u.LowPart, + static_cast<unsigned int> (freq.u.HighPart)); return uint64_freq; # else return freq.QuadPart; @@ -292,16 +293,16 @@ ACE_OS::gethrtime (const ACE_HRTimer_Op op) // Carefully create the return value to avoid arithmetic overflow // if ACE_hrtime_t is ACE_U_LongLong. - return ACE_static_cast (ACE_hrtime_t, ts.tv_sec) * - ACE_U_ONE_SECOND_IN_NSECS + ACE_static_cast (ACE_hrtime_t, ts.tv_nsec); + return static_cast<ACE_hrtime_t> (ts.tv_sec) * + ACE_U_ONE_SECOND_IN_NSECS + static_cast<ACE_hrtime_t> (ts.tv_nsec); #else ACE_UNUSED_ARG (op); const ACE_Time_Value now = ACE_OS::gettimeofday (); // Carefully create the return value to avoid arithmetic overflow // if ACE_hrtime_t is ACE_U_LongLong. - return (ACE_static_cast (ACE_hrtime_t, now.sec ()) * (ACE_UINT32) 1000000 + - ACE_static_cast (ACE_hrtime_t, now.usec ())) * (ACE_UINT32) 1000; + return (static_cast<ACE_hrtime_t> (now.sec ()) * (ACE_UINT32) 1000000 + + static_cast<ACE_hrtime_t> (now.usec ())) * (ACE_UINT32) 1000; #endif /* ACE_HAS_HI_RES_TIMER */ } @@ -372,35 +373,33 @@ ACE_OS::nanosleep (const struct timespec *requested, return ::nanosleep ((ACE_TIMESPEC_PTR) requested, remaining); #elif defined (ACE_PSOS) # if ! defined (ACE_PSOS_DIAB_MIPS) - double ticks = KC_TICKS2SEC * requested->tv_sec + - ( ACE_static_cast (double, requested->tv_nsec) * - ACE_static_cast (double, KC_TICKS2SEC) ) / - ACE_static_cast (double, ACE_ONE_SECOND_IN_NSECS); + double ticks = + KC_TICKS2SEC * requested->tv_sec + + (static_cast<double> (requested->tv_nsec) * + static_cast<double> (KC_TICKS2SEC) ) / + static_cast<double> (ACE_ONE_SECOND_IN_NSECS); - if (ticks > ACE_static_cast (double, ACE_PSOS_Time_t::max_ticks)) - { - ticks -= ACE_static_cast (double, ACE_PSOS_Time_t::max_ticks); - remaining->tv_sec = ACE_static_cast (time_t, - (ticks / - ACE_static_cast (double, - KC_TICKS2SEC))); - ticks -= ACE_static_cast (double, remaining->tv_sec) * - ACE_static_cast (double, KC_TICKS2SEC); - - remaining->tv_nsec = - ACE_static_cast (long, - (ticks * ACE_static_cast (double, - ACE_ONE_SECOND_IN_NSECS)) / - ACE_static_cast (double, KC_TICKS2SEC)); - - ::tm_wkafter (ACE_PSOS_Time_t::max_ticks); - } + if (ticks > static_cast<double> (ACE_PSOS_Time_t::max_ticks)) + { + ticks -= static_cast<double> (ACE_PSOS_Time_t::max_ticks); + remaining->tv_sec = + static_cast<time_t> ((ticks / static_cast<double> (KC_TICKS2SEC))); + ticks -= static_cast<double> (remaining->tv_sec) * + static_cast<double> (KC_TICKS2SEC); + + remaining->tv_nsec = + static_cast<long> ((ticks + * static_cast<double> (ACE_ONE_SECOND_IN_NSECS)) / + static_cast<double> (KC_TICKS2SEC)); + + ::tm_wkafter (ACE_PSOS_Time_t::max_ticks); + } else - { - remaining->tv_sec = 0; - remaining->tv_nsec = 0; - ::tm_wkafter (ACE_static_cast (u_long, ticks)); - } + { + remaining->tv_sec = 0; + remaining->tv_nsec = 0; + ::tm_wkafter (static_cast<u_long> (ticks)); + } // tm_wkafter always returns 0 # endif /* ACE_PSOS_DIAB_MIPS */ diff --git a/ace/OS_NS_unistd.inl b/ace/OS_NS_unistd.inl index c15084d8d66..a150f78792e 100644 --- a/ace/OS_NS_unistd.inl +++ b/ace/OS_NS_unistd.inl @@ -112,7 +112,7 @@ ACE_OS::chdir (const char *path) { ACE_OS_TRACE ("ACE_OS::chdir"); #if defined (VXWORKS) - ACE_OSCALL_RETURN (::chdir (ACE_const_cast (char *, path)), int, -1); + ACE_OSCALL_RETURN (::chdir (const_cast<char *> (path)), int, -1); #elif defined (ACE_PSOS_LACKS_PHILE) ACE_UNUSED_ARG (path); @@ -219,9 +219,9 @@ ACE_OS::close (ACE_HANDLE handle) if (result != 0) { errno = result; - return ACE_static_cast (int, -1); + return static_cast<int> (-1); } - return ACE_static_cast (int, 0); + return static_cast<int> (0); #else ACE_OSCALL_RETURN (::close (handle), int, -1); #endif /* ACE_WIN32 */ @@ -505,9 +505,9 @@ ACE_OS::getcwd (ACE_TCHAR *buf, size_t size) ACE_NOTSUP_RETURN (0); #elif defined (ACE_WIN32) # if defined (ACE_USES_WCHAR) - return ::_wgetcwd (buf, ACE_static_cast (int, size)); + return ::_wgetcwd (buf, static_cast<int> (size)); # else - return ::getcwd (buf, ACE_static_cast (int, size)); + return ::getcwd (buf, static_cast<int> (size)); # endif /* ACE_USES_WCHAR */ #else ACE_OSCALL_RETURN (::getcwd (buf, size), char *, 0); @@ -522,7 +522,7 @@ ACE_OS::getgid (void) // getgid() is not supported: just one user anyways return 0; # elif defined (ACE_WIN32) || defined (CHORUS) - ACE_NOTSUP_RETURN (ACE_static_cast (gid_t, -1)); + ACE_NOTSUP_RETURN (static_cast<gid_t> (-1)); # else ACE_OSCALL_RETURN (::getgid (), gid_t, (gid_t) -1); # endif /* VXWORKS || ACE_PSOS */ @@ -623,7 +623,7 @@ ACE_OS::getuid (void) // getuid() is not supported: just one user anyways return 0; # elif defined (ACE_WIN32) || defined (CHORUS) - ACE_NOTSUP_RETURN (ACE_static_cast (uid_t, -1)); + ACE_NOTSUP_RETURN (static_cast<uid_t> (-1)); # else ACE_OSCALL_RETURN (::getuid (), uid_t, (uid_t) -1); # endif /* VXWORKS || ACE_PSOS */ @@ -766,12 +766,12 @@ ACE_OS::lseek (ACE_HANDLE handle, off_t offset, int whence) break; default: errno = EINVAL; - return ACE_static_cast (off_t, -1); // rather safe than sorry + return static_cast<off_t> (-1); // rather safe than sorry } # endif /* SEEK_SET != FILE_BEGIN || SEEK_CUR != FILE_CURRENT || SEEK_END != FILE_END */ DWORD result = ::SetFilePointer (handle, offset, 0, whence); if (result == ACE_SYSCALL_FAILED) - ACE_FAIL_RETURN (ACE_static_cast (off_t, -1)); + ACE_FAIL_RETURN (static_cast<off_t> (-1)); else return result; #elif defined (ACE_PSOS) @@ -779,7 +779,7 @@ ACE_OS::lseek (ACE_HANDLE handle, off_t offset, int whence) ACE_UNUSED_ARG (handle); ACE_UNUSED_ARG (offset); ACE_UNUSED_ARG (whence); - ACE_NOTSUP_RETURN (ACE_static_cast (off_t, -1)); + ACE_NOTSUP_RETURN (static_cast<off_t> (-1)); # else unsigned long oldptr, newptr, result; // seek to the requested position @@ -787,16 +787,16 @@ ACE_OS::lseek (ACE_HANDLE handle, off_t offset, int whence) if (result != 0) { errno = result; - return ACE_static_cast (off_t, -1); + return static_cast<off_t> (-1); } // now do a dummy seek to the current position to obtain the position result = ::lseek_f (handle, SEEK_CUR, 0, &newptr); if (result != 0) { errno = result; - return ACE_static_cast (off_t, -1); + return static_cast<off_t> (-1); } - return ACE_static_cast (off_t, newptr); + return static_cast<off_t> (newptr); # endif /* defined (ACE_PSOS_LACKS_PHILE */ #else ACE_OSCALL_RETURN (::lseek (handle, offset, whence), off_t, -1); @@ -837,7 +837,7 @@ ACE_OS::read (ACE_HANDLE handle, void *buf, size_t len) ACE_OS_TRACE ("ACE_OS::read"); #if defined (ACE_WIN32) DWORD ok_len; - if (::ReadFile (handle, buf, ACE_static_cast (DWORD, len), &ok_len, 0)) + if (::ReadFile (handle, buf, static_cast<DWORD> (len), &ok_len, 0)) return (ssize_t) ok_len; else ACE_FAIL_RETURN (-1); @@ -851,9 +851,9 @@ ACE_OS::read (ACE_HANDLE handle, void *buf, size_t len) u_long count; u_long result = ::read_f (handle, buf, len, &count); if (result != 0) - return ACE_static_cast (ssize_t, -1); + return static_cast<ssize_t> (-1); else - return ACE_static_cast (ssize_t, count == len ? count : 0); + return static_cast<ssize_t> (count == len ? count : 0); # endif /* defined (ACE_PSOS_LACKS_PHILE */ #else @@ -893,7 +893,7 @@ ACE_OS::read (ACE_HANDLE handle, void *buf, size_t len, overlapped = overlapped; #if defined (ACE_WIN32) DWORD ok_len; - DWORD short_len = ACE_static_cast (DWORD, len); + DWORD short_len = static_cast<DWORD> (len); if (::ReadFile (handle, buf, short_len, &ok_len, overlapped)) return (ssize_t) ok_len; else @@ -1130,10 +1130,8 @@ ACE_OS::swab (const void *src, ssize_t length) { #if defined (ACE_LACKS_SWAB) - const char *from = ACE_static_cast (const char*, - src); - char *to = ACE_static_cast (char *, - dest); + const char *from = static_cast<const char*> (src); + char *to = static_cast<char *> (dest); ssize_t ptr = 0; for (ptr = 1; ptr < length; ptr += 2) { @@ -1145,12 +1143,9 @@ ACE_OS::swab (const void *src, if (ptr == length) /* I.e., if length is odd, */ to[ptr-1] = 0; /* then pad with a NUL. */ #elif defined (ACE_HAS_NONCONST_SWAB) - const char *tmp = ACE_static_cast (const char*, - src); - char *from = ACE_const_cast (char *, - tmp); - char *to = ACE_static_cast (char *, - dest); + const char *tmp = static_cast<const char*> (src); + char *from = const_cast<char *> (tmp); + char *to = static_cast<char *> (dest); ::swab (from, to, length); #else ::swab (src, dest, length); @@ -1262,7 +1257,7 @@ ACE_OS::unlink (const ACE_TCHAR *path) { ACE_OS_TRACE ("ACE_OS::unlink"); # if defined (VXWORKS) - ACE_OSCALL_RETURN (::unlink (ACE_const_cast (char *, path)), int, -1); + ACE_OSCALL_RETURN (::unlink (const_cast<char *> (path)), int, -1); # elif defined (ACE_PSOS) && ! defined (ACE_PSOS_LACKS_PHILE) ACE_OSCALL_RETURN (::remove_f ((char *) path), int , -1); # elif defined (ACE_PSOS) && defined (ACE_PSOS_HAS_C_LIBRARY) @@ -1292,7 +1287,7 @@ ACE_OS::write (ACE_HANDLE handle, const void *buf, size_t nbyte) // Strictly correctly, we should loop writing all the data if more // than a DWORD length can hold. - DWORD short_nbyte = ACE_static_cast (DWORD, nbyte); + DWORD short_nbyte = static_cast<DWORD> (nbyte); if (::WriteFile (handle, buf, short_nbyte, &bytes_written, 0)) return (ssize_t) bytes_written; else @@ -1333,7 +1328,7 @@ ACE_OS::write (ACE_HANDLE handle, #if defined (ACE_WIN32) DWORD bytes_written; // This is set to 0 byte WriteFile. - DWORD short_nbyte = ACE_static_cast (DWORD, nbyte); + DWORD short_nbyte = static_cast<DWORD> (nbyte); if (::WriteFile (handle, buf, short_nbyte, &bytes_written, overlapped)) return (ssize_t) bytes_written; else diff --git a/ace/OS_TLI.inl b/ace/OS_TLI.inl index e0d6fa07888..09595026dcd 100644 --- a/ace/OS_TLI.inl +++ b/ace/OS_TLI.inl @@ -4,7 +4,7 @@ #include "ace/OS_NS_errno.h" ACE_INLINE int -ACE_OS::t_accept (ACE_HANDLE handle, +ACE_OS::t_accept (ACE_HANDLE handle, ACE_HANDLE reshandle, struct t_call *call) { @@ -91,7 +91,7 @@ ACE_OS::t_error (const char *errmsg) { #if defined (ACE_HAS_TLI) #if defined (ACE_HAS_BROKEN_T_ERROR) - ::t_error (ACE_const_cast (char *, errmsg)); + ::t_error (const_cast<char *> (errmsg)); #else ::t_error (errmsg); #endif /* ACE_HAS_BROKEN_T_ERROR */ diff --git a/ace/Object_Manager.i b/ace/Object_Manager.i index a93cbc208b1..19ba4079a9c 100644 --- a/ace/Object_Manager.i +++ b/ace/Object_Manager.i @@ -30,6 +30,6 @@ ACE_Object_Manager::default_mask (void) { // A safe cast, but this static method shouldn't be used anyways. // Use ACE_Object_Manager::default_mask () instead. - return *ACE_reinterpret_cast (ACE_Sig_Set *, - ACE_OS_Object_Manager::default_mask ()); + return + *reinterpret_cast<ACE_Sig_Set *> (ACE_OS_Object_Manager::default_mask ()); } diff --git a/ace/Obstack_T.i b/ace/Obstack_T.i index f6ff337ba6e..57e049ef1ea 100644 --- a/ace/Obstack_T.i +++ b/ace/Obstack_T.i @@ -15,17 +15,15 @@ ACE_Obstack_T<CHAR>::size () const template <class CHAR> ACE_INLINE void ACE_Obstack_T<CHAR>::grow_fast (CHAR c) { - * (ACE_reinterpret_cast (CHAR *, - this->curr_->cur_)) = c; + * (reinterpret_cast<CHAR *> (this->curr_->cur_)) = c; this->curr_->cur_ += sizeof (CHAR); } template <class CHAR> ACE_INLINE CHAR * ACE_Obstack_T<CHAR>::freeze (void) { - CHAR *retv = ACE_reinterpret_cast (CHAR *, this->curr_->block_); - * (ACE_reinterpret_cast (CHAR *, - this->curr_->cur_)) = 0; + CHAR *retv = reinterpret_cast<CHAR *> (this->curr_->block_); + * (reinterpret_cast<CHAR *> (this->curr_->cur_)) = 0; this->curr_->cur_ += sizeof (CHAR); this->curr_->block_ = this->curr_->cur_; diff --git a/ace/Process.cpp b/ace/Process.cpp index ca3559d6ade..edb83e5e86a 100644 --- a/ace/Process.cpp +++ b/ace/Process.cpp @@ -92,7 +92,7 @@ ACE_Process::spawn (ACE_Process_Options &options) { int maxlen = 0; ACE_TCHAR *cmd_line_buf = options.command_line_buf (&maxlen); - size_t max_len = ACE_static_cast (size_t, maxlen); + size_t max_len = static_cast<size_t> (maxlen); size_t curr_len = ACE_OS::strlen (cmd_line_buf); ACE_Handle_Set_Iterator h_iter (*set_p); // Because the length of the to-be-formatted +H option is not @@ -931,14 +931,14 @@ ACE_Process_Options::pass_handle (ACE_HANDLE h) { HANDLE dup_handle; if (!DuplicateHandle (GetCurrentProcess (), - ACE_static_cast (HANDLE, h), + static_cast<HANDLE> (h), GetCurrentProcess (), &dup_handle, 0, TRUE, // Inheritable DUPLICATE_SAME_ACCESS)) return -1; - dup_handles_.set_bit (ACE_static_cast (ACE_HANDLE, dup_handle)); + dup_handles_.set_bit (static_cast<ACE_HANDLE> (dup_handle)); } # endif /* ACE_HAS_WINCE */ #endif /* ACE_WIN32 */ diff --git a/ace/Process_Manager.cpp b/ace/Process_Manager.cpp index 5e991e12b2f..0f4a3c4a36f 100644 --- a/ace/Process_Manager.cpp +++ b/ace/Process_Manager.cpp @@ -705,7 +705,7 @@ ACE_Process_Manager::wait (const ACE_Time_Value &timeout) // else Process terminated...wait for more... } - return ACE_static_cast (int, this->current_count_); + return static_cast<int> (this->current_count_); } // Collect a single child process' exit status. Store the exit code @@ -775,7 +775,7 @@ ACE_Process_Manager::wait (pid_t pid, handles[i] = process_table_[i].process_->gethandle (); - DWORD handle_count = ACE_static_cast (DWORD, this->current_count_); + DWORD handle_count = static_cast<DWORD> (this->current_count_); DWORD result = ::WaitForMultipleObjects (handle_count, handles, FALSE, diff --git a/ace/Profile_Timer.cpp b/ace/Profile_Timer.cpp index ca72b14d6d3..1caaf6f0ea7 100644 --- a/ace/Profile_Timer.cpp +++ b/ace/Profile_Timer.cpp @@ -35,7 +35,7 @@ ACE_Profile_Timer::ACE_Profile_Timer (void) # if defined (ACE_HAS_PRUSAGE_T) ACE_OS::memset (&this->last_usage_, 0, sizeof this->last_usage_); char buf[20]; - ACE_OS::sprintf (buf, "/proc/%d", ACE_static_cast (int, ACE_OS::getpid ())); + ACE_OS::sprintf (buf, "/proc/%d", static_cast<int> (ACE_OS::getpid ())); this->proc_handle_ = ACE_OS::open (buf, O_RDONLY, 0); if (this->proc_handle_ == -1) diff --git a/ace/RB_Tree.i b/ace/RB_Tree.i index d5a83c3e61f..d90f3c5b8a6 100644 --- a/ace/RB_Tree.i +++ b/ace/RB_Tree.i @@ -643,11 +643,16 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::find (const EXT_ID &k) { ACE_TRACE ("ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::find (const EXT_ID &k)"); - // The reinterpret cast is to ensure that when this deprecated method is removed, and - // is replaced (as planned) by a find method that takes the same argument signature - // but returns an int, that the compiler will cough if this return macro is not - // changed to just return an int (whose value will be -1). Please leave this as is. - ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, ACE_reinterpret_cast(INT_ID*, 0L)); + // The reinterpret cast is to ensure that when this deprecated + // method is removed, and is replaced (as planned) by a find method + // that takes the same argument signature but returns an int, that + // the compiler will cough if this return macro is not changed to + // just return an int (whose value will be -1). Please leave this + // as is. + ACE_READ_GUARD_RETURN (ACE_LOCK, + ace_mon, + this->lock_, + reinterpret_cast<INT_ID*> (0L)); ACE_RB_Tree_Node<EXT_ID, INT_ID> *entry; int result = this->find_i (k, entry); @@ -668,7 +673,10 @@ ACE_INLINE INT_ID* ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::insert (const EXT_ID &k, const INT_ID &t) { ACE_TRACE ("ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::insert"); - ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, ACE_reinterpret_cast(INT_ID*, 0L)); + ACE_WRITE_GUARD_RETURN (ACE_LOCK, + ace_mon, + this->lock_, + reinterpret_cast<INT_ID*> (0L)); return this->insert_i (k, t); } diff --git a/ace/Recursive_Thread_Mutex.inl b/ace/Recursive_Thread_Mutex.inl index 312aa98b3c7..a1d84584315 100644 --- a/ace/Recursive_Thread_Mutex.inl +++ b/ace/Recursive_Thread_Mutex.inl @@ -11,8 +11,7 @@ ACE_INLINE ACE_thread_mutex_t & ACE_Recursive_Thread_Mutex::get_nesting_mutex (void) { #if defined (ACE_HAS_RECURSIVE_MUTEXES) - return ACE_static_cast (ACE_thread_mutex_t &, - lock_); + return static_cast<ACE_thread_mutex_t &> (lock_); #else return lock_.nesting_mutex_; #endif /* ACE_HAS_RECURSIVE_MUTEXES */ diff --git a/ace/Refcounted_Auto_Ptr.h b/ace/Refcounted_Auto_Ptr.h index f270cbb6bf1..7de2186c06b 100644 --- a/ace/Refcounted_Auto_Ptr.h +++ b/ace/Refcounted_Auto_Ptr.h @@ -176,7 +176,7 @@ private: // = Mutex variable to protect the <ptr_>. /// Synchronization variable for the MT_SAFE <ACE_Hash_Map_Manager_Ex>. - ACE_LOCK lock_; + mutable ACE_LOCK lock_; private: /// Allows us to check for NULL on all ACE_Refcounted_Auto_Ptr objects. diff --git a/ace/Refcounted_Auto_Ptr.i b/ace/Refcounted_Auto_Ptr.i index 256a5caa7e4..47c18678dfe 100644 --- a/ace/Refcounted_Auto_Ptr.i +++ b/ace/Refcounted_Auto_Ptr.i @@ -8,7 +8,7 @@ template <class X, class ACE_LOCK> inline int ACE_Refcounted_Auto_Ptr_Rep<X, ACE_LOCK>::count (void) const { - ACE_GUARD_RETURN (ACE_LOCK, guard, ACE_const_cast (ACE_LOCK &, this->lock_), 0); + ACE_GUARD_RETURN (ACE_LOCK, guard, this->lock_, 0); return this->ref_count_; } @@ -21,10 +21,9 @@ ACE_Refcounted_Auto_Ptr<X, ACE_LOCK>::count (void) const template <class X, class ACE_LOCK> inline int ACE_Refcounted_Auto_Ptr_Rep<X, ACE_LOCK>::null (void) const { - ACE_GUARD_RETURN (ACE_LOCK, guard, - ACE_const_cast (ACE_LOCK&, this->lock_), 0); + ACE_GUARD_RETURN (ACE_LOCK, guard, this->lock_, 0); - return this->ptr_.get() == 0; + return this->ptr_.get () == 0; } template <class X, class ACE_LOCK> inline int @@ -141,7 +140,7 @@ ACE_Refcounted_Auto_Ptr_Rep<X, ACE_LOCK>::reset (X *p) template <class X, class ACE_LOCK> inline X * ACE_Refcounted_Auto_Ptr_Rep<X, ACE_LOCK>::get (void) const { - ACE_GUARD_RETURN (ACE_LOCK, guard, ACE_const_cast (ACE_LOCK &, this->lock_), 0); + ACE_GUARD_RETURN (ACE_LOCK, guard, this->lock_, 0); return this->ptr_.get (); } diff --git a/ace/Registry.cpp b/ace/Registry.cpp index dca6e14d0d2..232143e6db7 100644 --- a/ace/Registry.cpp +++ b/ace/Registry.cpp @@ -613,7 +613,7 @@ ACE_TString ACE_Registry::make_string (const Name &const_name) { ACE_TString string; - Name &name = ACE_const_cast (Name &, const_name); + Name &name = const_cast<Name &> (const_name); // Iterator through the components of name for (Name::iterator iterator = name.begin (); @@ -1100,9 +1100,10 @@ ACE_Predefined_Naming_Contexts::connect (ACE_Registry::Naming_Context &naming_co machine_name = 0; if (predefined == HKEY_LOCAL_MACHINE || predefined == HKEY_USERS) - result = ACE_TEXT_RegConnectRegistry (ACE_const_cast(ACE_TCHAR *, machine_name), - predefined, - &naming_context.key_); + result = + ACE_TEXT_RegConnectRegistry (const_cast<ACE_TCHAR *> (machine_name), + predefined, + &naming_context.key_); if (predefined == HKEY_CURRENT_USER || predefined == HKEY_CLASSES_ROOT) // Make sure that for these types, the machine is local if (machine_name == 0 || diff --git a/ace/SOCK.cpp b/ace/SOCK.cpp index 2d17363dcf1..8d25f26684e 100644 --- a/ace/SOCK.cpp +++ b/ace/SOCK.cpp @@ -34,14 +34,13 @@ ACE_SOCK::get_remote_addr (ACE_Addr &sa) const ACE_TRACE ("ACE_SOCK::get_remote_addr"); int len = sa.get_size (); - sockaddr *addr = ACE_reinterpret_cast (sockaddr *, - sa.get_addr ()); + sockaddr *addr = reinterpret_cast<sockaddr *> (sa.get_addr ()); if (ACE_OS::getpeername (this->get_handle (), addr, &len) == -1) return -1; - + sa.set_size (len); sa.set_type (addr->sa_family); return 0; @@ -53,8 +52,7 @@ ACE_SOCK::get_local_addr (ACE_Addr &sa) const ACE_TRACE ("ACE_SOCK::get_local_addr"); int len = sa.get_size (); - sockaddr *addr = ACE_reinterpret_cast (sockaddr *, - sa.get_addr ()); + sockaddr *addr = reinterpret_cast<sockaddr *> (sa.get_addr ()); if (ACE_OS::getsockname (this->get_handle (), addr, @@ -83,8 +81,8 @@ ACE_SOCK::close (void) } int -ACE_SOCK::open (int type, - int protocol_family, +ACE_SOCK::open (int type, + int protocol_family, int protocol, int reuse_addr) { @@ -97,8 +95,8 @@ ACE_SOCK::open (int type, if (this->get_handle () == ACE_INVALID_HANDLE) return -1; - else if (protocol_family != PF_UNIX - && reuse_addr + else if (protocol_family != PF_UNIX + && reuse_addr && this->set_option (SOL_SOCKET, SO_REUSEADDR, &one, @@ -113,14 +111,14 @@ ACE_SOCK::open (int type, // General purpose constructor for performing server ACE_SOCK // creation. -ACE_SOCK::ACE_SOCK (int type, - int protocol_family, +ACE_SOCK::ACE_SOCK (int type, + int protocol_family, int protocol, int reuse_addr) { // ACE_TRACE ("ACE_SOCK::ACE_SOCK"); if (this->open (type, - protocol_family, + protocol_family, protocol, reuse_addr) == -1) ACE_ERROR ((LM_ERROR, @@ -129,8 +127,8 @@ ACE_SOCK::ACE_SOCK (int type, } int -ACE_SOCK::open (int type, - int protocol_family, +ACE_SOCK::open (int type, + int protocol_family, int protocol, ACE_Protocol_Info *protocolinfo, ACE_SOCK_GROUP g, @@ -149,7 +147,7 @@ ACE_SOCK::open (int type, if (this->get_handle () == ACE_INVALID_HANDLE) return -1; - else if (reuse_addr + else if (reuse_addr && this->set_option (SOL_SOCKET, SO_REUSEADDR, &one, @@ -161,9 +159,9 @@ ACE_SOCK::open (int type, else return 0; } - -ACE_SOCK::ACE_SOCK (int type, - int protocol_family, + +ACE_SOCK::ACE_SOCK (int type, + int protocol_family, int protocol, ACE_Protocol_Info *protocolinfo, ACE_SOCK_GROUP g, diff --git a/ace/SOCK_Dgram.cpp b/ace/SOCK_Dgram.cpp index f260449ad02..9538e59996b 100644 --- a/ace/SOCK_Dgram.cpp +++ b/ace/SOCK_Dgram.cpp @@ -122,15 +122,14 @@ ACE_SOCK_Dgram::shared_open (const ACE_Addr &local, #endif /* ACE_HAS_IPV6 */ ) { - if (ACE::bind_port (this->get_handle (), - INADDR_ANY, + if (ACE::bind_port (this->get_handle (), + INADDR_ANY, protocol_family) == -1) error = 1; } } else if (ACE_OS::bind (this->get_handle (), - ACE_reinterpret_cast (sockaddr *, - local.get_addr ()), + reinterpret_cast<sockaddr *> (local.get_addr ()), local.get_size ()) == -1) error = 1; @@ -533,8 +532,7 @@ ACE_SOCK_Dgram::set_nic (const char *option_value) /* Cast this into the required format */ sockaddr_in *socket_address; - socket_address = ACE_reinterpret_cast(sockaddr_in *, - &if_address.ifr_addr); + socket_address = reinterpret_cast<sockaddr_in *> (&if_address.ifr_addr); multicast_address.imr_interface.s_addr = socket_address->sin_addr.s_addr; #endif /* ACE_WIN32 */ diff --git a/ace/SOCK_Dgram.i b/ace/SOCK_Dgram.i index da83f714441..7d3fbe93493 100644 --- a/ace/SOCK_Dgram.i +++ b/ace/SOCK_Dgram.i @@ -3,7 +3,7 @@ // SOCK_Dgram.i -// Here's the simple-minded constructor. +// Here's the simple-minded constructor. ASYS_INLINE ACE_SOCK_Dgram::ACE_SOCK_Dgram (void) @@ -20,18 +20,18 @@ ACE_SOCK_Dgram::~ACE_SOCK_Dgram (void) // <sendto> an N byte datagram to <addr> (connectionless version). ASYS_INLINE ssize_t -ACE_SOCK_Dgram::send (const void *buf, - size_t n, - const ACE_Addr &addr, +ACE_SOCK_Dgram::send (const void *buf, + size_t n, + const ACE_Addr &addr, int flags) const { ACE_TRACE ("ACE_SOCK_Dgram::send"); sockaddr *saddr = (sockaddr *) addr.get_addr (); int len = addr.get_size (); - return ACE_OS::sendto (this->get_handle (), + return ACE_OS::sendto (this->get_handle (), (const char *) buf, n, - flags, + flags, (struct sockaddr *) saddr, len); } @@ -39,23 +39,23 @@ ACE_SOCK_Dgram::send (const void *buf, // <recvfrom> an n byte datagram (connectionless version). ASYS_INLINE ssize_t -ACE_SOCK_Dgram::recv (void *buf, - size_t n, - ACE_Addr &addr, +ACE_SOCK_Dgram::recv (void *buf, + size_t n, + ACE_Addr &addr, int flags) const { ACE_TRACE ("ACE_SOCK_Dgram::recv"); sockaddr *saddr = (sockaddr *) addr.get_addr (); int addr_len = addr.get_size (); - ssize_t status = ACE_OS::recvfrom (this->get_handle (), + ssize_t status = ACE_OS::recvfrom (this->get_handle (), (char *) buf, n, - flags, + flags, (sockaddr *) saddr, &addr_len); addr.set_size (addr_len); - addr.set_type (ACE_reinterpret_cast(sockaddr_in *, saddr)->sin_family); + addr.set_type (reinterpret_cast<sockaddr_in *> (saddr)->sin_family); return status; } @@ -71,11 +71,11 @@ ACE_SOCK_Dgram::send (const iovec buffers[], ACE_TRACE ("ACE_SOCK_Dgram::send"); sockaddr *saddr = (sockaddr *) addr.get_addr (); int len = addr.get_size (); - return ACE_OS::sendto (this->get_handle (), + return ACE_OS::sendto (this->get_handle (), buffers, buffer_count, number_of_bytes_sent, - flags, + flags, (const sockaddr *) saddr, len, overlapped, @@ -95,26 +95,26 @@ ACE_SOCK_Dgram::recv (iovec buffers[], sockaddr *saddr = (sockaddr *) addr.get_addr (); int addr_len = addr.get_size (); - ssize_t status = ACE_OS::recvfrom (this->get_handle (), + ssize_t status = ACE_OS::recvfrom (this->get_handle (), buffers, buffer_count, number_of_bytes_recvd, - flags, + flags, (sockaddr *) saddr, &addr_len, overlapped, func); addr.set_size (addr_len); - addr.set_type (ACE_reinterpret_cast(sockaddr_in *, saddr)->sin_family); + addr.set_type (reinterpret_cast<sockaddr_in *> (saddr)->sin_family); return status; } // <sendto> an N byte datagram to <addr> (connectionless version). ASYS_INLINE ssize_t -ACE_SOCK_Dgram::send (const void *buf, - size_t n, - const ACE_Addr &addr, +ACE_SOCK_Dgram::send (const void *buf, + size_t n, + const ACE_Addr &addr, int flags, ACE_OVERLAPPED *overlapped, ACE_OVERLAPPED_COMPLETION_FUNC func) const @@ -122,7 +122,7 @@ ACE_SOCK_Dgram::send (const void *buf, ACE_TRACE ("ACE_SOCK_Dgram::send"); iovec buffer[1]; - buffer[0].iov_len = ACE_static_cast (u_long, n); // Betting on < 4G + buffer[0].iov_len = static_cast<u_long> (n); // Betting on < 4G buffer[0].iov_base = (char *) buf; size_t number_of_bytes_sent = 0; return this->send (buffer, @@ -137,9 +137,9 @@ ACE_SOCK_Dgram::send (const void *buf, // <recvfrom> an n byte datagram (connectionless version). ASYS_INLINE ssize_t -ACE_SOCK_Dgram::recv (void *buf, - size_t n, - ACE_Addr &addr, +ACE_SOCK_Dgram::recv (void *buf, + size_t n, + ACE_Addr &addr, int flags, ACE_OVERLAPPED *overlapped, ACE_OVERLAPPED_COMPLETION_FUNC func) const @@ -147,7 +147,7 @@ ACE_SOCK_Dgram::recv (void *buf, ACE_TRACE ("ACE_SOCK_Dgram::recv"); iovec buffer[1]; - buffer[0].iov_len = ACE_static_cast (u_long, n); // Betting on < 4G + buffer[0].iov_len = static_cast<u_long> (n); // Betting on < 4G buffer[0].iov_base = (char *) buf; size_t number_of_bytes_recvd = 0; return this->recv (buffer, diff --git a/ace/SOCK_IO.cpp b/ace/SOCK_IO.cpp index c9a8a881289..57d36de38ad 100644 --- a/ace/SOCK_IO.cpp +++ b/ace/SOCK_IO.cpp @@ -100,7 +100,7 @@ ACE_SOCK_IO::send (size_t n, ...) const ACE_TRACE ("ACE_SOCK_IO::send"); va_list argp; - int total_tuples = ACE_static_cast (int, n) / 2; + int total_tuples = static_cast<int> (n) / 2; iovec *iovp; #if defined (ACE_HAS_ALLOCA) iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); @@ -140,7 +140,7 @@ ACE_SOCK_IO::recv (size_t n, ...) const ACE_TRACE ("ACE_SOCK_IO::recv"); va_list argp; - int total_tuples = ACE_static_cast (int, (n / 2)); + int total_tuples = static_cast<int> (n / 2); iovec *iovp; #if defined (ACE_HAS_ALLOCA) iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); diff --git a/ace/SOCK_IO.i b/ace/SOCK_IO.i index f8f91016330..81be001f2a0 100644 --- a/ace/SOCK_IO.i +++ b/ace/SOCK_IO.i @@ -62,7 +62,7 @@ ACE_SOCK_IO::recv (iovec iov[], { ACE_TRACE ("ACE_SOCK_IO::recv"); return this->recvv (iov, - ACE_static_cast (int, n), + static_cast<int> (n), timeout); } @@ -132,7 +132,7 @@ ACE_SOCK_IO::send (const iovec iov[], { ACE_TRACE ("ACE_SOCK_IO::send"); return this->sendv (iov, - ACE_static_cast (int, n), + static_cast<int> (n), timeout); } diff --git a/ace/SPIPE_Addr.cpp b/ace/SPIPE_Addr.cpp index 48cad77f436..85dae45be0c 100644 --- a/ace/SPIPE_Addr.cpp +++ b/ace/SPIPE_Addr.cpp @@ -22,24 +22,24 @@ ACE_SPIPE_Addr::dump (void) const } // Set a pointer to the address. -void +void ACE_SPIPE_Addr::set_addr (void *addr, int len) { ACE_TRACE ("ACE_SPIPE_Addr::set_addr"); this->ACE_Addr::base_set (AF_SPIPE, len); ACE_OS::memcpy ((void *) &this->SPIPE_addr_, - (void *) addr, + (void *) addr, len); } -// Do nothing constructor. +// Do nothing constructor. ACE_SPIPE_Addr::ACE_SPIPE_Addr (void) : ACE_Addr (AF_SPIPE, sizeof this->SPIPE_addr_) { - (void) ACE_OS::memset ((void *) &this->SPIPE_addr_, - 0, + (void) ACE_OS::memset ((void *) &this->SPIPE_addr_, + 0, sizeof this->SPIPE_addr_); } @@ -63,7 +63,7 @@ ACE_SPIPE_Addr::set (const ACE_SPIPE_Addr &sa) else (void) ACE_OS::memcpy ((void *) &this->SPIPE_addr_, (void *) &sa.SPIPE_addr_, - sa.get_size ()); + sa.get_size ()); return 0; } @@ -77,7 +77,7 @@ ACE_SPIPE_Addr::ACE_SPIPE_Addr (const ACE_SPIPE_Addr &sa) int ACE_SPIPE_Addr::set (const ACE_TCHAR *addr, - gid_t gid, + gid_t gid, uid_t uid) { int len = sizeof (this->SPIPE_addr_.uid_); @@ -94,7 +94,7 @@ ACE_SPIPE_Addr::set (const ACE_TCHAR *addr, } else { - + if (ACE_OS::strncmp (addr, ACE_LIB_TEXT ("localhost"), ACE_OS::strlen ("localhost")) == 0) @@ -105,7 +105,7 @@ ACE_SPIPE_Addr::set (const ACE_TCHAR *addr, ACE_OS::strcpy (temp, ACE_LIB_TEXT ("\\\\")); ACE_TCHAR *t; - + // We need to allocate a duplicate so that we can write a // NUL character into it. ACE_ALLOCATOR_RETURN (t, ACE_OS::strdup (addr), -1); @@ -119,7 +119,7 @@ ACE_SPIPE_Addr::set (const ACE_TCHAR *addr, ACE_OS::strcat (temp, ACE_LIB_TEXT ("\\pipe\\")); ACE_OS::strcat (temp, colonp + 1); } - len += ACE_static_cast (int, ACE_OS::strlen (temp)); + len += static_cast<int> (ACE_OS::strlen (temp)); this->ACE_Addr::base_set (AF_SPIPE, len); ACE_OS::strcpy (this->SPIPE_addr_.rendezvous_, temp); @@ -135,13 +135,12 @@ ACE_SPIPE_Addr::set (const ACE_TCHAR *addr, return 0; } -// Create a ACE_Addr from a ACE_SPIPE pathname. +// Create a ACE_Addr from a ACE_SPIPE pathname. ACE_SPIPE_Addr::ACE_SPIPE_Addr (const ACE_TCHAR *addr, - gid_t gid, + gid_t gid, uid_t uid) : ACE_Addr (AF_SPIPE, sizeof this->SPIPE_addr_) { this->set (addr, gid, uid); } - diff --git a/ace/SPIPE_Stream.cpp b/ace/SPIPE_Stream.cpp index 7717db32ca5..76968d15e56 100644 --- a/ace/SPIPE_Stream.cpp +++ b/ace/SPIPE_Stream.cpp @@ -35,8 +35,8 @@ ssize_t ACE_SPIPE_Stream::send (size_t n, ...) const { // ACE_TRACE ("ACE_SPIPE_Stream::send"); - va_list argp; - int total_tuples = ACE_static_cast (int, (n / 2)); + va_list argp; + int total_tuples = static_cast<int> (n / 2); iovec *iovp; #if defined (ACE_HAS_ALLOCA) iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); @@ -72,8 +72,8 @@ ssize_t ACE_SPIPE_Stream::recv (size_t n, ...) const { ACE_TRACE ("ACE_SPIPE_Stream::recv"); - va_list argp; - int total_tuples = ACE_static_cast (int, (n / 2)); + va_list argp; + int total_tuples = static_cast<int> (n / 2); iovec *iovp; #if defined (ACE_HAS_ALLOCA) iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); diff --git a/ace/SString.i b/ace/SString.i index 2787bf8b0d9..a985c5456af 100644 --- a/ace/SString.i +++ b/ace/SString.i @@ -205,7 +205,7 @@ ACE_INLINE int ACE_SString::rfind (char c, int pos) const { if (pos == ACE_SString::npos) - pos = ACE_static_cast (int, this->len_); + pos = static_cast<int> (this->len_); for (int i = pos - 1; i >= 0; i--) if (this->rep_[i] == c) diff --git a/ace/SUN_Proactor.cpp b/ace/SUN_Proactor.cpp index b3d374d1f12..5c42b2169ff 100644 --- a/ace/SUN_Proactor.cpp +++ b/ace/SUN_Proactor.cpp @@ -14,7 +14,7 @@ #endif /* __ACE_INLINE__ */ ACE_SUN_Proactor::ACE_SUN_Proactor (size_t max_aio_operations) - : ACE_POSIX_AIOCB_Proactor (max_aio_operations, + : ACE_POSIX_AIOCB_Proactor (max_aio_operations, ACE_POSIX_Proactor::PROACTOR_SUN), condition_ (mutex_) { @@ -96,16 +96,16 @@ ACE_SUN_Proactor::handle_events_i (ACE_Time_Value *delta) if (result == 0) { // timeout, do nothing, - // we should process "post_completed" queue + // we should process "post_completed" queue } - else if (ACE_reinterpret_cast (long, result) == -1) + else if (reinterpret_cast<long> (result) == -1) { // Check errno for EINVAL,EAGAIN,EINTR ?? switch (errno) { case EINTR : // aiowait() was interrupted by a signal. case EINVAL: // there are no outstanding asynchronous I/O requests. - break; // we should process "post_completed" queue + break; // we should process "post_completed" queue default: // EFAULT ACE_ERROR_RETURN ((LM_ERROR, @@ -166,7 +166,7 @@ ACE_SUN_Proactor::get_result_status (ACE_POSIX_Asynch_Result* asynch_result, if (op_return < 0) transfer_count = 0; // zero bytes transferred else - transfer_count = ACE_static_cast (size_t, op_return); + transfer_count = static_cast<size_t> (op_return); return 1; // completed } @@ -183,7 +183,7 @@ ACE_SUN_Proactor::find_completed_aio (aio_result_t *result, transfer_count = 0; // we call find_completed_aio always with result != 0 - + for (ai = 0; ai < aiocb_list_max_size_; ai++) if (aiocb_list_[ai] != 0 && //check for non zero result == &aiocb_list_[ai]->aio_resultp) @@ -243,7 +243,7 @@ ACE_SUN_Proactor::start_aio_i (ACE_POSIX_Asynch_Result *result) // Start IO switch (result->aio_lio_opcode) { - case LIO_READ : + case LIO_READ : ptype = ACE_LIB_TEXT ("read"); ret_val = aioread (result->aio_fildes, (char *) result->aio_buf, @@ -297,7 +297,7 @@ ACE_SUN_Proactor::cancel_aiocb (ACE_POSIX_Asynch_Result *result) if (rc == 0) // AIO_CANCELED { // after aiocancel Sun does not notify us - // so we should send notification + // so we should send notification // to save POSIX behavoir. // Also we should do this for deffered aio's diff --git a/ace/SV_Semaphore_Simple.cpp b/ace/SV_Semaphore_Simple.cpp index fa1ca90eb0e..5963cf70b72 100644 --- a/ace/SV_Semaphore_Simple.cpp +++ b/ace/SV_Semaphore_Simple.cpp @@ -84,7 +84,7 @@ ACE_SV_Semaphore_Simple::open (key_t k, ACE_TRACE ("ACE_SV_Semaphore_Simple::open"); union semun ivalue; - if (k == IPC_PRIVATE || k == ACE_static_cast (key_t, ACE_INVALID_SEM_KEY)) + if (k == IPC_PRIVATE || k == static_cast<key_t> (ACE_INVALID_SEM_KEY)) return -1; ivalue.val = initial_value; @@ -131,7 +131,7 @@ ACE_SV_Semaphore_Simple::name_2_key (const char *name) if (name == 0) { errno = EINVAL; - return ACE_static_cast (key_t, ACE_INVALID_SEM_KEY); + return static_cast<key_t> (ACE_INVALID_SEM_KEY); } // Basically "hash" the values in the <name>. This won't diff --git a/ace/SV_Semaphore_Simple.h b/ace/SV_Semaphore_Simple.h index a7d34ea7d3c..4d9e0c41cf1 100644 --- a/ace/SV_Semaphore_Simple.h +++ b/ace/SV_Semaphore_Simple.h @@ -163,7 +163,7 @@ protected: * caller should not pass strings which match each other for the first * LUSED characters when he wants to get a different key. */ - int init (key_t k = ACE_static_cast (key_t, ACE_INVALID_SEM_KEY), + int init (key_t k = static_cast<key_t> (ACE_INVALID_SEM_KEY), int i = -1); key_t name_2_key (const char *name); }; diff --git a/ace/Select_Reactor_Base.cpp b/ace/Select_Reactor_Base.cpp index cc9e02f549f..4f777da74ab 100644 --- a/ace/Select_Reactor_Base.cpp +++ b/ace/Select_Reactor_Base.cpp @@ -108,7 +108,7 @@ ACE_Select_Reactor_Handler_Repository::open (size_t size) // Try to increase the number of handles if <size> is greater than // the current limit. - return ACE::set_handle_limit (ACE_static_cast (int, size)); + return ACE::set_handle_limit (static_cast<int> (size)); } // Initialize a repository of the appropriate <size>. diff --git a/ace/Service_Config.cpp b/ace/Service_Config.cpp index 8354574dd62..86cddef60ae 100644 --- a/ace/Service_Config.cpp +++ b/ace/Service_Config.cpp @@ -131,7 +131,7 @@ ACE_Service_Config::ACE_Service_Config (int ignore_static_svcs, ACE_Service_Config::signum_ = signum; // Initialize the Service Repository. - ACE_Service_Repository::instance (ACE_static_cast (int, size)); + ACE_Service_Repository::instance (static_cast<int> (size)); // Initialize the ACE_Reactor (the ACE_Reactor should be the same // size as the ACE_Service_Repository). @@ -390,9 +390,9 @@ ACE_Service_Config::get_xml_svc_conf (ACE_DLL &xmldll) foo = xmldll.symbol (ACE_LIB_TEXT ("_ACEXML_create_XML_Svc_Conf_Object")); // Cast the void* to long first. - long tmp = ACE_reinterpret_cast (long, foo); + long tmp = reinterpret_cast<long> (foo); ACE_XML_Svc_Conf::Factory factory = - ACE_reinterpret_cast (ACE_XML_Svc_Conf::Factory, tmp); + reinterpret_cast<ACE_XML_Svc_Conf::Factory> (tmp); if (factory == 0) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("Unable to resolve factory: %p\n"), diff --git a/ace/Service_Manager.cpp b/ace/Service_Manager.cpp index 72ec3825449..36ad46e3893 100644 --- a/ace/Service_Manager.cpp +++ b/ace/Service_Manager.cpp @@ -84,7 +84,7 @@ ACE_Service_Manager::info (ACE_TCHAR **strp, size_t length) const return -1; else ACE_OS::strsncpy (*strp, buf, length); - return ACE_static_cast (int, ACE_OS::strlen (buf)); + return static_cast<int> (ACE_OS::strlen (buf)); } int @@ -320,7 +320,7 @@ ACE_Service_Manager::handle_input (ACE_HANDLE) { result = client_stream_.recv (offset, remaining); error = errno; - if (result == 0 && error != EWOULDBLOCK) + if (result == 0 && error != EWOULDBLOCK) remaining = 0; if (result >= 0) diff --git a/ace/Service_Object.cpp b/ace/Service_Object.cpp index 72696a3321d..16f26803532 100644 --- a/ace/Service_Object.cpp +++ b/ace/Service_Object.cpp @@ -50,8 +50,7 @@ ACE_Service_Type::ACE_Service_Type (const ACE_TCHAR *n, fini_already_called_ (0) { ACE_TRACE ("ACE_Service_Type::ACE_Service_Type"); - ACE_DLL &dll = ACE_const_cast (ACE_DLL &, - this->dll_); + ACE_DLL &dll = const_cast<ACE_DLL &> (this->dll_); dll.set_handle (handle); this->name (n); } diff --git a/ace/Service_Types.cpp b/ace/Service_Types.cpp index fe4d3c747ae..f2be2b635d6 100644 --- a/ace/Service_Types.cpp +++ b/ace/Service_Types.cpp @@ -207,7 +207,7 @@ ACE_Module_Type::info (ACE_TCHAR **str, size_t len) const return -1; else ACE_OS::strsncpy (*str, buf, len); - return ACE_static_cast (int, ACE_OS::strlen (buf)); + return static_cast<int> (ACE_OS::strlen (buf)); } void @@ -291,7 +291,7 @@ ACE_Stream_Type::info (ACE_TCHAR **str, size_t len) const return -1; else ACE_OS::strsncpy (*str, buf, len); - return ACE_static_cast (int, ACE_OS::strlen (buf)); + return static_cast<int> (ACE_OS::strlen (buf)); } int diff --git a/ace/Service_Types.i b/ace/Service_Types.i index 6df8fe65f1a..480983cfe61 100644 --- a/ace/Service_Types.i +++ b/ace/Service_Types.i @@ -22,7 +22,7 @@ ACE_Service_Type_Impl::name (const ACE_TCHAR *n) { ACE_TRACE ("ACE_Service_Type_Impl::name"); - ACE::strdelete (ACE_const_cast (ACE_TCHAR*, this->name_)); + ACE::strdelete (const_cast<ACE_TCHAR*> (this->name_)); this->name_ = ACE::strnew (n); } diff --git a/ace/Shared_Memory_MM.i b/ace/Shared_Memory_MM.i index 67925b29129..0c6b18d8aba 100644 --- a/ace/Shared_Memory_MM.i +++ b/ace/Shared_Memory_MM.i @@ -45,7 +45,7 @@ ACE_Shared_Memory_MM::get_segment_size (void) const { ACE_TRACE ("ACE_Shared_Memory_MM::get_segment_size"); // This cast is legit since the original length in open() is an int. - return ACE_static_cast (int, this->shared_memory_.size ()); + return static_cast<int> (this->shared_memory_.size ()); } // Unmaps the shared memory segment. diff --git a/ace/Shared_Memory_SV.i b/ace/Shared_Memory_SV.i index 96699c87097..7f9d6d963fd 100644 --- a/ace/Shared_Memory_SV.i +++ b/ace/Shared_Memory_SV.i @@ -5,20 +5,20 @@ #include "ace/Global_Macros.h" -ACE_INLINE int -ACE_Shared_Memory_SV::open (key_t id, - int length, - int create, - int perms, - void *addr, +ACE_INLINE int +ACE_Shared_Memory_SV::open (key_t id, + int length, + int create, + int perms, + void *addr, int flags) { ACE_TRACE ("ACE_Shared_Memory_SV::open"); - return shared_memory_.open_and_attach (id, length, create, + return shared_memory_.open_and_attach (id, length, create, perms, addr, flags); } -// The overall size of the segment. +// The overall size of the segment. ACE_INLINE int ACE_Shared_Memory_SV::get_segment_size (void) const @@ -26,7 +26,7 @@ ACE_Shared_Memory_SV::get_segment_size (void) const ACE_TRACE ("ACE_Shared_Memory_SV::get_segment_size"); // This cast is ok since the 'open' method for this class allows only // an 'int' size. Therefore, this case should not lose information. - return ACE_static_cast (int, this->shared_memory_.get_segment_size ()); + return static_cast<int> (this->shared_memory_.get_segment_size ()); } // Removes the shared memory segment. @@ -38,7 +38,7 @@ ACE_Shared_Memory_SV::remove (void) return shared_memory_.remove (); } -// Closes (detaches) the shared memory segment. +// Closes (detaches) the shared memory segment. ACE_INLINE int ACE_Shared_Memory_SV::close (void) @@ -69,7 +69,7 @@ ACE_Shared_Memory_SV::ACE_Shared_Memory_SV (void) ACE_TRACE ("ACE_Shared_Memory_SV::ACE_Shared_Memory_SV"); } -ACE_INLINE int +ACE_INLINE int ACE_Shared_Memory_SV::free (void *p) { ACE_TRACE ("ACE_Shared_Memory_SV::free"); diff --git a/ace/Signal.i b/ace/Signal.i index 908eb365b43..c647fb8d18a 100644 --- a/ace/Signal.i +++ b/ace/Signal.i @@ -79,7 +79,7 @@ ACE_INLINE int ACE_Sig_Set::is_member (int signo) const { ACE_TRACE ("ACE_Sig_Set::is_member"); - return ACE_OS::sigismember (ACE_const_cast (sigset_t *, &this->sigset_), signo); + return ACE_OS::sigismember (const_cast<sigset_t *> (&this->sigset_), signo); } ACE_INLINE diff --git a/ace/Stats.cpp b/ace/Stats.cpp index f1c0038e375..74bbe672862 100644 --- a/ace/Stats.cpp +++ b/ace/Stats.cpp @@ -291,8 +291,8 @@ ACE_Stats::quotient (const ACE_UINT64 dividend, ACE_Stats_Value "ient) { // The whole part of the division comes from simple integer division. - quotient.whole (ACE_static_cast (ACE_UINT32, - divisor == 0 ? 0 : dividend / divisor)); + quotient.whole (static_cast<ACE_UINT32> (divisor == 0 + ? 0 : dividend / divisor)); if (quotient.precision () > 0 || divisor == 0) { @@ -305,8 +305,8 @@ ACE_Stats::quotient (const ACE_UINT64 dividend, // 10^precision/2 / 10^precision // = ((dividend % divisor) * 10^precision + divisor) / // divisor - quotient.fractional (ACE_static_cast (ACE_UINT32, - dividend % divisor * field / divisor)); + quotient.fractional (static_cast<ACE_UINT32> ( + dividend % divisor * field / divisor)); } else { @@ -592,8 +592,7 @@ ACE_Throughput_Stats::dump_throughput (const ACE_TCHAR *msg, # if defined ACE_LACKS_LONGLONG_T elapsed_time / sf; # else /* ! ACE_LACKS_LONGLONG_T */ - ACE_static_cast (double, - ACE_UINT64_DBLCAST_ADAPTER(elapsed_time / sf)); + static_cast<double> (ACE_UINT64_DBLCAST_ADAPTER (elapsed_time / sf)); # endif /* ! ACE_LACKS_LONGLONG_T */ seconds /= ACE_HR_SCALE_CONVERSION; diff --git a/ace/Strategies_T.cpp b/ace/Strategies_T.cpp index 947857a4dc4..43ffd037bb9 100644 --- a/ace/Strategies_T.cpp +++ b/ace/Strategies_T.cpp @@ -991,7 +991,7 @@ template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> ACE_Recyclable_St ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::recycle_state (const void *recycling_act) const { // Const cast. - SELF *fake_this = ACE_const_cast (SELF *, this); + SELF *fake_this = const_cast<SELF *> (this); // Synchronization is required here. ACE_GUARD_RETURN (MUTEX, ace_mon, *fake_this->lock_, ACE_RECYCLABLE_UNKNOWN); diff --git a/ace/String_Base.cpp b/ace/String_Base.cpp index a1c5afbc2c0..4da945be530 100644 --- a/ace/String_Base.cpp +++ b/ace/String_Base.cpp @@ -166,10 +166,10 @@ ACE_String_Base<CHAR>::operator+= (const ACE_String_Base<CHAR> &s) template <class CHAR> u_long ACE_String_Base<CHAR>::hash (void) const { - return ACE::hash_pjw ((ACE_reinterpret_cast (char *, - ACE_const_cast (CHAR *, - this->rep_))), - this->len_ * sizeof (CHAR)); + return + ACE::hash_pjw (reinterpret_cast<char *> ( + const_cast<CHAR *> (this->rep_)), + this->len_ * sizeof (CHAR)); } template <class CHAR> void diff --git a/ace/String_Base.i b/ace/String_Base.i index 7f0bded8193..e54080f70b6 100644 --- a/ace/String_Base.i +++ b/ace/String_Base.i @@ -232,7 +232,7 @@ ACE_String_Base<CHAR>::compare (const ACE_String_Base<CHAR> &s) const smaller_length * sizeof (CHAR)); if (!result) - result = ACE_static_cast (int, (this->len_ - s.len_)); + result = static_cast<int> (this->len_ - s.len_); return result; } @@ -315,8 +315,8 @@ ACE_String_Base<CHAR>::strstr (const ACE_String_Base<CHAR> &s) const template <class CHAR> ACE_INLINE ssize_t ACE_String_Base<CHAR>::rfind (CHAR c, ssize_t pos) const { - if (pos == npos || pos > ACE_static_cast (ssize_t, this->len_)) - pos = ACE_static_cast (ssize_t, this->len_); + if (pos == npos || pos > static_cast<ssize_t> (this->len_)) + pos = static_cast<ssize_t> (this->len_); for (ssize_t i = pos - 1; i >= 0; i--) if (this->rep_[i] == c) diff --git a/ace/Svc_Conf.h b/ace/Svc_Conf.h index d19dd5f47a5..1e6a8ad0b13 100644 --- a/ace/Svc_Conf.h +++ b/ace/Svc_Conf.h @@ -135,7 +135,7 @@ public: #define ACE_YYPARSE_PARAM ace_svc_conf_parameter #define ACE_YYLEX_PARAM ACE_YYPARSE_PARAM -#define ACE_SVC_CONF_PARAM (ACE_static_cast (ACE_Svc_Conf_Param *, ACE_YYLEX_PARAM)) +#define ACE_SVC_CONF_PARAM (static_cast<ACE_Svc_Conf_Param *> (ACE_YYLEX_PARAM)) // The following definition for the ACE_YYSTYPE must occur before // ACE_YY_DECL is declared since ACE_YY_DECL expands to function diff --git a/ace/Task.cpp b/ace/Task.cpp index 4afcab34f4f..a774e724ba0 100644 --- a/ace/Task.cpp +++ b/ace/Task.cpp @@ -204,9 +204,9 @@ ACE_Task_Base::svc_run (void *args) ACE_THR_FUNC_RETURN status; #if (defined (__BORLANDC__) && (__BORLANDC__ < 0x570)) || defined (__MINGW32__) || (defined (_MSC_VER) && (_MSC_VER <= 1400)) // Some compilers complain about reinterpret_cast from int to unsigned long... - status = ACE_static_cast (ACE_THR_FUNC_RETURN, svc_status); + status = static_cast<ACE_THR_FUNC_RETURN> (svc_status); #else - status = ACE_reinterpret_cast (ACE_THR_FUNC_RETURN, svc_status); + status = reinterpret_cast<ACE_THR_FUNC_RETURN> (svc_status); #endif /* (__BORLANDC__ < 0x570) || __MINGW32__ || _MSC_VER <= 1400 */ // If we changed this zero change the other if in OS.cpp Thread_Adapter::invoke diff --git a/ace/Thread_Adapter.cpp b/ace/Thread_Adapter.cpp index 2bd1348a00e..8b1abafa302 100644 --- a/ace/Thread_Adapter.cpp +++ b/ace/Thread_Adapter.cpp @@ -97,8 +97,7 @@ ACE_THR_FUNC_RETURN ACE_Thread_Adapter::invoke_i (void) { // Extract the arguments. - ACE_THR_FUNC func = ACE_reinterpret_cast (ACE_THR_FUNC, - this->user_func_); + ACE_THR_FUNC func = reinterpret_cast<ACE_THR_FUNC> (this->user_func_); void *arg = this->arg_; #if defined (ACE_WIN32) && defined (ACE_HAS_MFC) && (ACE_HAS_MFC != 0) @@ -167,8 +166,8 @@ ACE_Thread_Adapter::invoke_i (void) // Task::svc_run to 0. #if 0 // Call the <Task->close> hook. - if (func == ACE_reinterpret_cast (ACE_THR_FUNC_INTERNAL, - ACE_Task_Base::svc_run)) + if (func == reinterpret_cast<ACE_THR_FUNC_INTERNAL> ( + ACE_Task_Base::svc_run)) { ACE_Task_Base *task_ptr = (ACE_Task_Base *) arg; ACE_Thread_Manager *thr_mgr_ptr = task_ptr->thr_mgr (); diff --git a/ace/Thread_Manager.i b/ace/Thread_Manager.i index 5f3f9f714cb..8c2c7243a5f 100644 --- a/ace/Thread_Manager.i +++ b/ace/Thread_Manager.i @@ -185,8 +185,7 @@ ACE_INLINE ACE_Thread_Descriptor * ACE_Thread_Descriptor::get_next (void) const { ACE_TRACE ("ACE_Thread_Descriptor::get_next"); - return ACE_static_cast (ACE_Thread_Descriptor * ACE_CAST_CONST, - this->next_); + return static_cast<ACE_Thread_Descriptor * ACE_CAST_CONST> (this->next_); } // Reset this thread descriptor diff --git a/ace/Time_Value.inl b/ace/Time_Value.inl index 6ef09b57788..cc15c9a17fa 100644 --- a/ace/Time_Value.inl +++ b/ace/Time_Value.inl @@ -56,7 +56,7 @@ ACE_Time_Value::set (const timespec_t &tv) { // ACE_OS_TRACE ("ACE_Time_Value::set"); #if ! defined(ACE_HAS_BROKEN_TIMESPEC_MEMBERS) - this->tv_.tv_sec = ACE_static_cast (long, tv.tv_sec); + this->tv_.tv_sec = static_cast<long> (tv.tv_sec); // Convert nanoseconds into microseconds. this->tv_.tv_usec = tv.tv_nsec / 1000; #else diff --git a/ace/Typed_SV_Message_Queue.i b/ace/Typed_SV_Message_Queue.i index afbea9c455d..aad60fd2055 100644 --- a/ace/Typed_SV_Message_Queue.i +++ b/ace/Typed_SV_Message_Queue.i @@ -5,9 +5,9 @@ #include "ace/SV_Message_Queue.h" -template <class T> ACE_INLINE int -ACE_Typed_SV_Message_Queue<T>::open (key_t external_id, - int create, +template <class T> ACE_INLINE int +ACE_Typed_SV_Message_Queue<T>::open (key_t external_id, + int create, int perms) { ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::open"); @@ -16,7 +16,7 @@ ACE_Typed_SV_Message_Queue<T>::open (key_t external_id, // What does it mean to close a message queue?! -template <class T> ACE_INLINE int +template <class T> ACE_INLINE int ACE_Typed_SV_Message_Queue<T>::close (void) { ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::close"); @@ -24,16 +24,16 @@ ACE_Typed_SV_Message_Queue<T>::close (void) } template <class T> ACE_INLINE int -ACE_Typed_SV_Message_Queue<T>::recv (ACE_Typed_SV_Message<T> &mb, +ACE_Typed_SV_Message_Queue<T>::recv (ACE_Typed_SV_Message<T> &mb, int mflags) { ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::recv"); - int length = this->message_queue_.recv (ACE_reinterpret_cast (ACE_SV_Message &, - mb), - mb.max_size (), - mb.type (), - mflags); + int length = + this->message_queue_.recv (reinterpret_cast<ACE_SV_Message &> (mb), + mb.max_size (), + mb.type (), + mflags); if (length != -1) mb.length (length); @@ -41,16 +41,16 @@ ACE_Typed_SV_Message_Queue<T>::recv (ACE_Typed_SV_Message<T> &mb, } template <class T> ACE_INLINE int -ACE_Typed_SV_Message_Queue<T>::send (const ACE_Typed_SV_Message<T> &mb, +ACE_Typed_SV_Message_Queue<T>::send (const ACE_Typed_SV_Message<T> &mb, int mflags) { ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::send"); - return this->message_queue_. - send (ACE_reinterpret_cast (ACE_SV_Message &, - ACE_const_cast (ACE_Typed_SV_Message<T> &, - mb)), - mb.length (), - mflags); + return + this->message_queue_.send ( + reinterpret_cast<ACE_SV_Message &> ( + const_cast<ACE_Typed_SV_Message<T> &> (mb)), + mb.length (), + mflags); } template <class T> ACE_INLINE int @@ -62,7 +62,7 @@ ACE_Typed_SV_Message_Queue<T>::remove (void) } template <class T> ACE_INLINE int -ACE_Typed_SV_Message_Queue<T>::control (int option, +ACE_Typed_SV_Message_Queue<T>::control (int option, void *arg) { ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::control"); diff --git a/ace/ace_wchar.inl b/ace/ace_wchar.inl index 8d0a96743b8..f1aa325452a 100644 --- a/ace/ace_wchar.inl +++ b/ace/ace_wchar.inl @@ -58,8 +58,8 @@ ACE_Wide_To_Ascii::convert (const wchar_t *wstr) # else /* ACE_WIN32 */ for (int i = 0; i < len; i++) { - wchar_t *t = ACE_const_cast (wchar_t *, wstr); - str[i] = ACE_static_cast (char, *(t + i)); + wchar_t *t = const_cast <wchar_t *> (wstr); + str[i] = static_cast<char> (*(t + i)); } # endif /* ACE_WIN32 */ return str; @@ -106,8 +106,8 @@ ACE_Ascii_To_Wide::convert (const char *str) # else /* ACE_WIN32 */ for (int i = 0; i < len; i++) { - char *t = ACE_const_cast (char *, str); - wstr[i] = ACE_static_cast (wchar_t, *(t + i)); + char *t = const_cast<char *> (str); + wstr[i] = static_cast<wchar_t> (*(t + i)); } # endif /* ACE_WIN32 */ return wstr; |