diff --git a/ACE/ace/ACE.cpp b/ACE/ace/ACE.cpp index 5d0cc449cd6d3..4de2e0e09f1cb 100644 --- a/ACE/ace/ACE.cpp +++ b/ACE/ace/ACE.cpp @@ -2205,8 +2205,8 @@ ACE::handle_ready (ACE_HANDLE handle, // Wait for data or for the timeout to elapse. int select_width = 0; #if !defined (ACE_WIN32) - select_width = int (handle) + 1; -# endif /* ACE_WIN32 */ + select_width = handle + 1; +#endif /* ACE_WIN32 */ int result = ACE_OS::select (select_width, read_ready ? handle_set.fdset () : 0, // read_fds. write_ready ? handle_set.fdset () : 0, // write_fds. diff --git a/ACE/ace/SSL/SSL_Context.cpp b/ACE/ace/SSL/SSL_Context.cpp index 325c9cd7f6fc8..fa4b89fb2a0ba 100644 --- a/ACE/ace/SSL/SSL_Context.cpp +++ b/ACE/ace/SSL/SSL_Context.cpp @@ -784,7 +784,6 @@ ACE_SSL_Context::dh_params (const char *file_name, { // Swiped from Rescorla's examples and the OpenSSL s_server.c app - DH * ret = nullptr; BIO * bio = nullptr; if ((bio = ::BIO_new_file (this->dh_params_.file_name (), "r")) == nullptr) @@ -793,7 +792,7 @@ ACE_SSL_Context::dh_params (const char *file_name, return -1; } - ret = PEM_read_bio_DHparams (bio, nullptr, nullptr, nullptr); + DH * ret = PEM_read_bio_DHparams (bio, nullptr, nullptr, nullptr); BIO_free (bio); if (ret == nullptr) diff --git a/ACE/ace/SSL/SSL_SOCK_Acceptor.cpp b/ACE/ace/SSL/SSL_SOCK_Acceptor.cpp index ea76866855de8..fb33235e92752 100644 --- a/ACE/ace/SSL/SSL_SOCK_Acceptor.cpp +++ b/ACE/ace/SSL/SSL_SOCK_Acceptor.cpp @@ -130,7 +130,11 @@ ACE_SSL_SOCK_Acceptor::ssl_accept (ACE_SSL_SOCK_Stream &new_stream, { // Must have at least one handle to wait for at this point. ACE_ASSERT (rd_handle.num_set() == 1 || wr_handle.num_set () == 1); - status = ACE::select (int (handle) + 1, + int select_width = 0; +#if !defined (ACE_WIN32) + select_width = handle + 1; +#endif /* ACE_WIN32 */ + status = ACE::select (select_width, &rd_handle, &wr_handle, nullptr, diff --git a/ACE/ace/SSL/SSL_SOCK_Connector.cpp b/ACE/ace/SSL/SSL_SOCK_Connector.cpp index 19e69a5e25357..924fbe693decf 100644 --- a/ACE/ace/SSL/SSL_SOCK_Connector.cpp +++ b/ACE/ace/SSL/SSL_SOCK_Connector.cpp @@ -152,7 +152,11 @@ ACE_SSL_SOCK_Connector::ssl_connect (ACE_SSL_SOCK_Stream &new_stream, ACE_ASSERT (rd_handle.num_set () == 1 || wr_handle.num_set () == 1); // Block indefinitely if timeout pointer is zero. - status = ACE::select (int (handle) + 1, + int select_width = 0; +#if !defined (ACE_WIN32) + select_width = handle + 1; +#endif /* ACE_WIN32 */ + status = ACE::select (select_width, &rd_handle, &wr_handle, nullptr, diff --git a/ACE/ace/SSL/SSL_SOCK_Stream.cpp b/ACE/ace/SSL/SSL_SOCK_Stream.cpp index f242f548d09a9..c9a6a067f7977 100644 --- a/ACE/ace/SSL/SSL_SOCK_Stream.cpp +++ b/ACE/ace/SSL/SSL_SOCK_Stream.cpp @@ -127,9 +127,14 @@ ACE_SSL_SOCK_Stream::recvv (iovec *io_vec, io_vec->iov_base = nullptr; + int select_width = 0; +#if !defined (ACE_WIN32) + select_width = this->get_handle () + 1; +#endif /* ACE_WIN32 */ + // Check the status of the current socket. switch ( - ACE_OS::select (int (this->get_handle ()) + 1, + ACE_OS::select (select_width, handle_set, nullptr, nullptr, diff --git a/ACE/ace/SSL/SSL_SOCK_Stream.inl b/ACE/ace/SSL/SSL_SOCK_Stream.inl index 619fce516869e..099a8bfaf6f9f 100644 --- a/ACE/ace/SSL/SSL_SOCK_Stream.inl +++ b/ACE/ace/SSL/SSL_SOCK_Stream.inl @@ -14,7 +14,11 @@ ACE_SSL_SOCK_Stream::set_handle (ACE_HANDLE fd) } else { - (void) ::SSL_set_fd (this->ssl_, (int) fd); +#if defined (ACE_WIN32) + (void) ::SSL_set_fd (this->ssl_, static_cast((intptr_t)fd)); +#else + (void) ::SSL_set_fd (this->ssl_, fd); +#endif this->ACE_SSL_SOCK::set_handle (fd); this->stream_.set_handle (fd); } diff --git a/ACE/examples/C++NPv2/AC_Client_Logging_Daemon.cpp b/ACE/examples/C++NPv2/AC_Client_Logging_Daemon.cpp index 2ca3e6e97bf34..134aa6d833e74 100644 --- a/ACE/examples/C++NPv2/AC_Client_Logging_Daemon.cpp +++ b/ACE/examples/C++NPv2/AC_Client_Logging_Daemon.cpp @@ -348,8 +348,7 @@ int AC_CLD_Connector::connect_svc_handler #if defined (ACE_WIN32) // ACE_WIN32 is the only platform where ACE_HANDLE is not an int. // See ace/config-lite.h for the typedefs. - SSL_set_fd (ssl_, - reinterpret_cast (svc_handler->get_handle ())); + SSL_set_fd (ssl_, static_cast ((intptr_t)svc_handler->get_handle ())); #else SSL_set_fd (ssl_, svc_handler->get_handle ()); #endif /* ACE_WIN32 */ diff --git a/ACE/examples/C++NPv2/AIO_Client_Logging_Daemon.cpp b/ACE/examples/C++NPv2/AIO_Client_Logging_Daemon.cpp index 054aa03f0d284..d03979749678d 100644 --- a/ACE/examples/C++NPv2/AIO_Client_Logging_Daemon.cpp +++ b/ACE/examples/C++NPv2/AIO_Client_Logging_Daemon.cpp @@ -259,7 +259,7 @@ int AIO_CLD_Connector::validate_connection #if defined (ACE_WIN32) // ACE_WIN32 is the only platform where ACE_HANDLE is not an int. // See ace/config-lite.h for the typedefs. - SSL_set_fd (ssl_, reinterpret_cast (result.connect_handle ())); + SSL_set_fd (ssl_, static_cast ((intptr_t)result.connect_handle ())); #else SSL_set_fd (ssl_, result.connect_handle ()); #endif /* ACE_WIN32 */ diff --git a/ACE/examples/C++NPv2/TPC_Logging_Server.cpp b/ACE/examples/C++NPv2/TPC_Logging_Server.cpp index e314a8de33fbf..ff741cb559b57 100644 --- a/ACE/examples/C++NPv2/TPC_Logging_Server.cpp +++ b/ACE/examples/C++NPv2/TPC_Logging_Server.cpp @@ -82,7 +82,7 @@ int TPC_Logging_Acceptor::accept_svc_handler #if defined (ACE_WIN32) // ACE_WIN32 is the only platform where ACE_HANDLE is not an int. // See ace/config-lite.h for the typedefs. - SSL_set_fd (ssl_, reinterpret_cast (sh->get_handle ())); + SSL_set_fd (ssl_, static_cast ((intptr_t)sh->get_handle ())); #else SSL_set_fd (ssl_, sh->get_handle ()); #endif /* ACE_WIN32 */ diff --git a/ACE/examples/IPC_SAP/SSL_SAP/SSL-server-fancy.cpp b/ACE/examples/IPC_SAP/SSL_SAP/SSL-server-fancy.cpp index e0a0c87b0f9fc..e47b1d912ee1f 100644 --- a/ACE/examples/IPC_SAP/SSL_SAP/SSL-server-fancy.cpp +++ b/ACE/examples/IPC_SAP/SSL_SAP/SSL-server-fancy.cpp @@ -552,8 +552,12 @@ Handler_Factory::handle_events () ACE_Time_Value timeout (ACE_DEFAULT_TIMEOUT); fd_set temp = handles; + int select_width = 0; +#if !defined (ACE_WIN32) + select_width = this->oneway_acceptor_.get_handle () + 1; +#endif /* ACE_WIN32 */ int result = - ACE_OS::select (int (this->oneway_acceptor_.get_handle ()) + 1, + ACE_OS::select (select_width, (fd_set *) &temp, 0, 0, diff --git a/ACE/examples/IPC_SAP/SSL_SAP/SSL-server-simple.cpp b/ACE/examples/IPC_SAP/SSL_SAP/SSL-server-simple.cpp index b6cae2fe044ab..9065a6fb74fdb 100644 --- a/ACE/examples/IPC_SAP/SSL_SAP/SSL-server-simple.cpp +++ b/ACE/examples/IPC_SAP/SSL_SAP/SSL-server-simple.cpp @@ -293,9 +293,14 @@ run_event_loop (u_short port) ACE_Time_Value timeout (ACE_DEFAULT_TIMEOUT); ACE_Handle_Set temp = handle_set; - int maxfd = int(oneway_acceptor.get_handle ()); - if (maxfd < int(twoway_acceptor.get_handle ())) - maxfd = int(twoway_acceptor.get_handle ()); + int maxfd = 0; +#if !defined (ACE_WIN32) + maxfd = oneway_acceptor.get_handle (); + if (maxfd < twoway_acceptor.get_handle ()) + { + maxfd = twoway_acceptor.get_handle (); + } +# endif /* ACE_WIN32 */ int result = ACE_OS::select (maxfd + 1, (fd_set *) temp, 0, diff --git a/ACE/examples/IPC_SAP/SSL_SAP/SSL-server.cpp b/ACE/examples/IPC_SAP/SSL_SAP/SSL-server.cpp index 012ac569d993c..9b1caa01d7d20 100644 --- a/ACE/examples/IPC_SAP/SSL_SAP/SSL-server.cpp +++ b/ACE/examples/IPC_SAP/SSL_SAP/SSL-server.cpp @@ -328,11 +328,11 @@ run_event_loop (u_short port) ACE_Time_Value timeout (ACE_DEFAULT_TIMEOUT); ACE_Handle_Set temp = handle_set; - int result = ACE_OS::select (int (oneway_acceptor.get_handle ()) + 1, - (fd_set *) temp, - 0, - 0, - timeout); + int select_width = 0; +#if !defined (ACE_WIN32) + select_width = oneway_acceptor.get_handle () + 1; +#endif /* ACE_WIN32 */ + int const result = ACE_OS::select (select_width, (fd_set *) temp, 0, 0, timeout); if (result == -1) ACE_ERROR ((LM_ERROR, "(%P|%t) %p\n", diff --git a/ACE/protocols/ace/INet/SSL_Proxy_Connector.cpp b/ACE/protocols/ace/INet/SSL_Proxy_Connector.cpp index 91e42445763b2..dccea02c4d6ba 100644 --- a/ACE/protocols/ace/INet/SSL_Proxy_Connector.cpp +++ b/ACE/protocols/ace/INet/SSL_Proxy_Connector.cpp @@ -148,7 +148,11 @@ namespace ACE ACE_ASSERT (rd_handle.num_set () == 1 || wr_handle.num_set () == 1); // Block indefinitely if timeout pointer is zero. - status = ACE::select (int (handle) + 1, + int select_width = 0; +#if !defined (ACE_WIN32) + select_width = handle + 1; +#endif /* ACE_WIN32 */ + status = ACE::select (select_width, &rd_handle, &wr_handle, 0,