From 5524925d82f66d235692199f4cb90f5db08d2c3d Mon Sep 17 00:00:00 2001 From: Steve Huston Date: Mon, 22 Jul 2002 21:03:37 +0000 Subject: ChangeLogTag:Mon Jul 22 16:39:21 2002 Steve Huston --- ChangeLog | 28 ++++++++++++++++++++++++++++ ChangeLogs/ChangeLog-03a | 28 ++++++++++++++++++++++++++++ ace/Acceptor.cpp | 6 +++--- ace/Connector.cpp | 2 +- ace/Message_Queue.cpp | 11 ++++++----- ace/Message_Queue.h | 8 ++++---- ace/Message_Queue.i | 4 ++-- ace/Message_Queue_T.cpp | 2 +- ace/Message_Queue_T.h | 40 ++++++++++++++++++++-------------------- ace/Message_Queue_T.i | 4 ++-- ace/SOCK_IO.h | 4 ++-- ace/SOCK_IO.i | 8 ++++---- ace/SOCK_Stream.h | 4 ++-- ace/SOCK_Stream.i | 4 ++-- tests/Conn_Test.cpp | 16 ++++++++++------ 15 files changed, 115 insertions(+), 54 deletions(-) diff --git a/ChangeLog b/ChangeLog index ddea67fbb30..3c9d464aa46 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,31 @@ +Mon Jul 22 16:39:21 2002 Steve Huston + + * ace/Acceptor.cpp (info): + * ace/Connector.cpp (info): Cast return val to int. + + * ace/Message_Queue.h (message_count): + * ace/Message_Queue_T.{h cpp i} (message_count): Change return value + from size_t to int. Changed cur_count_ member (and accessors that + return it) from size_t to int. This is a compromise to unify the + length of arguments without changing the return types of all + methods that return a message count (all the enqueue/dequeue methods, + as well as a few others). + Changed a number of @arg to @param for doxygen. + + * ace/SOCK_IO.{h i} (recvv, sendv): + * ace/SOCK_Stream.{h i}(recvv_n, sendv_n): Changed iovcnt arg from + size_t to int. int, though sort of odd as a choice, is the + UNIX98 standard and more commonly implemented. Removes an arg + size mismatch between the SOCK_IO and ACE layers, restricting the + iovcnt range at the SOCK_IO layers to match the layer below. + Changed the recv and send iov-enabled, deprecated methods to cast + their size_t iovcnt args to int... these deprecated methods should + be removed after 5.3 is out. + + * tests/Conn_Test.cpp: Replaced %d with %@ when logging pointers. + Added missing string arg for a ACE_ERROR %p directive. Use a + int select_width instead of casting ACE_HANDLE for Win64. + Mon Jul 22 15:13:38 2002 Carlos O'Ryan * ace/Atomic_Op.h: diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a index ddea67fbb30..3c9d464aa46 100644 --- a/ChangeLogs/ChangeLog-03a +++ b/ChangeLogs/ChangeLog-03a @@ -1,3 +1,31 @@ +Mon Jul 22 16:39:21 2002 Steve Huston + + * ace/Acceptor.cpp (info): + * ace/Connector.cpp (info): Cast return val to int. + + * ace/Message_Queue.h (message_count): + * ace/Message_Queue_T.{h cpp i} (message_count): Change return value + from size_t to int. Changed cur_count_ member (and accessors that + return it) from size_t to int. This is a compromise to unify the + length of arguments without changing the return types of all + methods that return a message count (all the enqueue/dequeue methods, + as well as a few others). + Changed a number of @arg to @param for doxygen. + + * ace/SOCK_IO.{h i} (recvv, sendv): + * ace/SOCK_Stream.{h i}(recvv_n, sendv_n): Changed iovcnt arg from + size_t to int. int, though sort of odd as a choice, is the + UNIX98 standard and more commonly implemented. Removes an arg + size mismatch between the SOCK_IO and ACE layers, restricting the + iovcnt range at the SOCK_IO layers to match the layer below. + Changed the recv and send iov-enabled, deprecated methods to cast + their size_t iovcnt args to int... these deprecated methods should + be removed after 5.3 is out. + + * tests/Conn_Test.cpp: Replaced %d with %@ when logging pointers. + Added missing string arg for a ACE_ERROR %p directive. Use a + int select_width instead of casting ACE_HANDLE for Win64. + Mon Jul 22 15:13:38 2002 Carlos O'Ryan * ace/Atomic_Op.h: diff --git a/ace/Acceptor.cpp b/ace/Acceptor.cpp index 004d65628a0..4f9b270f97d 100644 --- a/ace/Acceptor.cpp +++ b/ace/Acceptor.cpp @@ -179,7 +179,7 @@ ACE_Acceptor::info (ACE_TCHAR **strp, return -1; else ACE_OS::strsncpy (*strp, buf, length); - return ACE_OS::strlen (buf); + return ACE_static_cast (int, ACE_OS::strlen (buf)); } template int @@ -809,7 +809,7 @@ ACE_Strategy_Acceptor::info (ACE_TCHAR **strp, return -1; else ACE_OS::strsncpy (*strp, buf, length); - return ACE_OS::strlen (buf); + return ACE_static_cast (int, ACE_OS::strlen (buf)); } template int @@ -1161,7 +1161,7 @@ ACE_Oneshot_Acceptor::info (ACE_TCHAR **strp, return -1; else ACE_OS::strsncpy (*strp, buf, length); - return ACE_OS::strlen (buf); + return ACE_static_cast (int, ACE_OS::strlen (buf)); } template int diff --git a/ace/Connector.cpp b/ace/Connector.cpp index c63ca5e53a4..7da336b8ed8 100644 --- a/ace/Connector.cpp +++ b/ace/Connector.cpp @@ -722,7 +722,7 @@ ACE_Connector::info (ACE_TCHAR **strp, size_t length) const return -1; else ACE_OS::strsncpy (*strp, buf, length); - return ACE_OS::strlen (buf); + return ACE_static_cast (int, ACE_OS::strlen (buf)); } template diff --git a/ace/Message_Queue.cpp b/ace/Message_Queue.cpp index 3453c8b29c1..a05fdc4d5c3 100644 --- a/ace/Message_Queue.cpp +++ b/ace/Message_Queue.cpp @@ -420,9 +420,9 @@ ACE_Message_Queue_NT::deactivate (void) // Get the number of shutdown messages necessary to wake up all // waiting threads. - - for (size_t cntr = this->cur_thrs_ - this->cur_count_; - cntr > 0; cntr++) + size_t cntr = + this->cur_thrs_ - ACE_static_cast (size_t, this->cur_count_); + while (cntr-- > 0) ::PostQueuedCompletionStatus (this->completion_port_, 0, this->state_, @@ -455,8 +455,9 @@ ACE_Message_Queue_NT::pulse (void) // Get the number of shutdown messages necessary to wake up all // waiting threads. - for (size_t cntr = this->cur_thrs_ - this->cur_count_; - cntr > 0; cntr++) + size_t cntr = + this->cur_thrs_ - ACE_static_cast (size_t, this->cur_count_); + while (cntr-- > 0) ::PostQueuedCompletionStatus (this->completion_port_, 0, this->state_, diff --git a/ace/Message_Queue.h b/ace/Message_Queue.h index 5768d9879cd..8a075339a1c 100644 --- a/ace/Message_Queue.h +++ b/ace/Message_Queue.h @@ -144,7 +144,7 @@ public: virtual size_t message_length (void) = 0; /// Number of total messages on the queue. - virtual size_t message_count (void) = 0; + virtual int message_count (void) = 0; /// New value of the number of total bytes on the queue, i.e., /// sum of the message block sizes. @@ -289,7 +289,7 @@ public: /** * Number of total messages on the queue. */ - virtual size_t message_count (void); + virtual int message_count (void); // = Manual changes to these stats (used when queued message blocks // change size or lengths). @@ -493,7 +493,7 @@ public: /** * Number of total messages on the queue. */ - virtual size_t message_count (void); + virtual int message_count (void); // = Manual changes to these stats (used when queued message blocks // change size or lengths). @@ -577,7 +577,7 @@ private: size_t cur_length_; /// Current number of messages in the queue. - size_t cur_count_; + int cur_count_; /** * Synchronizer. This should really be an ACE_Recursive_Thread_Mutex diff --git a/ace/Message_Queue.i b/ace/Message_Queue.i index f353a1a1cbe..17f5c02ee13 100644 --- a/ace/Message_Queue.i +++ b/ace/Message_Queue.i @@ -87,7 +87,7 @@ ACE_Message_Queue_Vx::message_length (void) ACE_NOTSUP_RETURN ((size_t) -1); } -ACE_INLINE size_t +ACE_INLINE int ACE_Message_Queue_Vx::message_count (void) { ACE_TRACE ("ACE_Message_Queue_Vx::message_count"); @@ -161,7 +161,7 @@ ACE_Message_Queue_NT::message_length (void) return this->cur_length_; } -ACE_INLINE size_t +ACE_INLINE int ACE_Message_Queue_NT::message_count (void) { ACE_TRACE ("ACE_Message_Queue_NT::message_count"); diff --git a/ace/Message_Queue_T.cpp b/ace/Message_Queue_T.cpp index e480a2c36a2..07e461a71da 100644 --- a/ace/Message_Queue_T.cpp +++ b/ace/Message_Queue_T.cpp @@ -510,7 +510,7 @@ ACE_Message_Queue::~ACE_Message_Queue (void) template int ACE_Message_Queue::flush_i (void) { - size_t number_flushed = 0; + int number_flushed = 0; // Remove all the s in the // and their memory. diff --git a/ace/Message_Queue_T.h b/ace/Message_Queue_T.h index 63c9831563a..f0e0d34a0f7 100644 --- a/ace/Message_Queue_T.h +++ b/ace/Message_Queue_T.h @@ -132,12 +132,12 @@ public: * Retrieve a poiner to the first ACE_Message_Block in the queue * without removing it. * - * @arg first_item Reference to an ACE_Message_Block * that will - * point to the first block on the queue. The block - * remains on the queue until this or another thread - * dequeues it. - * @arg timeout The absolute time the caller will wait until - * for a block to be queued. + * @param first_item Reference to an ACE_Message_Block * that will + * point to the first block on the queue. The block + * remains on the queue until this or another thread + * dequeues it. + * @param timeout The absolute time the caller will wait until + * for a block to be queued. * * @retval The number of ACE_Message_Blocks on the queue. * @return -1 on failure. errno holds the reason. If EWOULDBLOCK, @@ -153,11 +153,11 @@ public: * order is maintained when messages of the same priority are * inserted consecutively. * - * @arg new_item Pointer to an ACE_Message_Block that will be - * added to the queue. The block's @c msg_priority() - * method will be called to obtain the queueing priority. - * @arg timeout The absolute time the caller will wait until - * for the block to be queued. + * @param new_item Pointer to an ACE_Message_Block that will be + * added to the queue. The block's @c msg_priority() + * method will be called to obtain the queueing priority. + * @param timeout The absolute time the caller will wait until + * for the block to be queued. * * @retval The number of ACE_Message_Blocks on the queue after adding * the specified block. @@ -287,7 +287,7 @@ public: /** * Number of total messages on the queue. */ - virtual size_t message_count (void); + virtual int message_count (void); // = Manual changes to these stats (used when queued message blocks // change size or lengths). @@ -444,12 +444,12 @@ protected: * so they can wakeup and continue other processing. * No messages are removed from the queue. * - * @arg pulse If 0, the queue's state is changed to DEACTIVATED - * and any other operations called until the queue is - * reactivated will immediately return -1 with - * errno == ESHUTDOWN. - * If not zero, only the waiting threads are notified and - * the queue's state changes to PULSED. + * @param pulse If 0, the queue's state is changed to DEACTIVATED + * and any other operations called until the queue is + * reactivated will immediately return -1 with + * errno == ESHUTDOWN. + * If not zero, only the waiting threads are notified and + * the queue's state changes to PULSED. * * @retval The state of the queue before the call. */ @@ -493,7 +493,7 @@ protected: size_t cur_length_; /// Current number of messages in the queue. - size_t cur_count_; + int cur_count_; /// The notification strategy used when a new message is enqueued. ACE_Notification_Strategy *notification_strategy_; @@ -1107,7 +1107,7 @@ public: /** * Number of total messages on the queue. */ - virtual size_t message_count (void); + virtual int message_count (void); // = Manual changes to these stats (used when queued message blocks // change size or lengths). diff --git a/ace/Message_Queue_T.i b/ace/Message_Queue_T.i index d04fd9041a3..3cd1e3cd719 100644 --- a/ace/Message_Queue_T.i +++ b/ace/Message_Queue_T.i @@ -119,7 +119,7 @@ ACE_Message_Queue::message_length (void) return this->cur_length_; } -template ACE_INLINE size_t +template ACE_INLINE int ACE_Message_Queue::message_count (void) { ACE_TRACE ("ACE_Message_Queue::message_count"); @@ -277,7 +277,7 @@ ACE_Message_Queue_Ex::message_length (void) return this->queue_.message_length (); } -template ACE_INLINE size_t +template ACE_INLINE int ACE_Message_Queue_Ex::message_count (void) { ACE_TRACE ("ACE_Message_Queue_Ex::message_count"); diff --git a/ace/SOCK_IO.h b/ace/SOCK_IO.h index 77ba78471fb..67b4be8a5d8 100644 --- a/ace/SOCK_IO.h +++ b/ace/SOCK_IO.h @@ -69,7 +69,7 @@ public: /// Recv an of size from the connected socket. ssize_t recvv (iovec iov[], - size_t n, + int n, const ACE_Time_Value *timeout = 0) const; /// Same as above. Deprecated. @@ -114,7 +114,7 @@ public: /// Send an of size to the connected socket. ssize_t sendv (const iovec iov[], - size_t n, + int n, const ACE_Time_Value *timeout = 0) const; /// Same as above. Deprecated. diff --git a/ace/SOCK_IO.i b/ace/SOCK_IO.i index d46ca3c188f..f8f91016330 100644 --- a/ace/SOCK_IO.i +++ b/ace/SOCK_IO.i @@ -45,7 +45,7 @@ ACE_SOCK_IO::recv (void *buf, ASYS_INLINE ssize_t ACE_SOCK_IO::recvv (iovec iov[], - size_t n, + int n, const ACE_Time_Value *timeout) const { ACE_TRACE ("ACE_SOCK_IO::recvv"); @@ -62,7 +62,7 @@ ACE_SOCK_IO::recv (iovec iov[], { ACE_TRACE ("ACE_SOCK_IO::recv"); return this->recvv (iov, - n, + ACE_static_cast (int, n), timeout); } @@ -115,7 +115,7 @@ ACE_SOCK_IO::send (const void *buf, ASYS_INLINE ssize_t ACE_SOCK_IO::sendv (const iovec iov[], - size_t n, + int n, const ACE_Time_Value *timeout) const { ACE_TRACE ("ACE_SOCK_IO::sendv"); @@ -132,7 +132,7 @@ ACE_SOCK_IO::send (const iovec iov[], { ACE_TRACE ("ACE_SOCK_IO::send"); return this->sendv (iov, - n, + ACE_static_cast (int, n), timeout); } diff --git a/ace/SOCK_Stream.h b/ace/SOCK_Stream.h index f478702aaaa..4e671edae15 100644 --- a/ace/SOCK_Stream.h +++ b/ace/SOCK_Stream.h @@ -96,7 +96,7 @@ public: /// Receive an of size from the connected socket. ssize_t recvv_n (iovec iov[], - size_t iovcnt, + int iovcnt, const ACE_Time_Value *timeout = 0, size_t *bytes_transferred = 0) const; @@ -122,7 +122,7 @@ public: /// Send an of size to the connected socket. ssize_t sendv_n (const iovec iov[], - size_t iovcnt, + int iovcnt, const ACE_Time_Value *timeout = 0, size_t *bytes_transferred = 0) const; diff --git a/ace/SOCK_Stream.i b/ace/SOCK_Stream.i index 0684e069832..f13d0ca24ff 100644 --- a/ace/SOCK_Stream.i +++ b/ace/SOCK_Stream.i @@ -76,7 +76,7 @@ ACE_SOCK_Stream::recv_n (void *buf, ASYS_INLINE ssize_t ACE_SOCK_Stream::recvv_n (iovec iov[], - size_t n, + int n, const ACE_Time_Value *timeout, size_t *bytes_transferred) const { @@ -120,7 +120,7 @@ ACE_SOCK_Stream::send_n (const void *buf, ASYS_INLINE ssize_t ACE_SOCK_Stream::sendv_n (const iovec iov[], - size_t n, + int n, const ACE_Time_Value *timeout, size_t *bytes_transferred) const { diff --git a/tests/Conn_Test.cpp b/tests/Conn_Test.cpp index 6c450269fd6..61e18592314 100644 --- a/tests/Conn_Test.cpp +++ b/tests/Conn_Test.cpp @@ -221,7 +221,7 @@ int Svc_Handler::open (void *) { ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) opening Svc_Handler %d with handle %d\n"), + ACE_TEXT ("(%P|%t) opening Svc_Handler %@ with handle %d\n"), this, this->peer ().get_handle ())); // Enable non-blocking I/O. @@ -237,7 +237,7 @@ int Svc_Handler::recycle (void *) { ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) recycling Svc_Handler %d with handle %d\n"), + ACE_TEXT ("(%P|%t) recycling Svc_Handler %@ with handle %d\n"), this, this->peer ().get_handle ())); return 0; @@ -271,8 +271,12 @@ Svc_Handler::recv_data (void) { // Since we're in non-blocking mode we need to use