summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2002-07-22 21:03:37 +0000
committerSteve Huston <shuston@riverace.com>2002-07-22 21:03:37 +0000
commit5524925d82f66d235692199f4cb90f5db08d2c3d (patch)
tree818f8d23f8764dd530912ea45e486a912ff8ae24
parentb311cda8e44cd37088d74167afced02d493d8b65 (diff)
downloadATCD-5524925d82f66d235692199f4cb90f5db08d2c3d.tar.gz
ChangeLogTag:Mon Jul 22 16:39:21 2002 Steve Huston <shuston@riverace.com>
-rw-r--r--ChangeLog28
-rw-r--r--ChangeLogs/ChangeLog-03a28
-rw-r--r--ace/Acceptor.cpp6
-rw-r--r--ace/Connector.cpp2
-rw-r--r--ace/Message_Queue.cpp11
-rw-r--r--ace/Message_Queue.h8
-rw-r--r--ace/Message_Queue.i4
-rw-r--r--ace/Message_Queue_T.cpp2
-rw-r--r--ace/Message_Queue_T.h40
-rw-r--r--ace/Message_Queue_T.i4
-rw-r--r--ace/SOCK_IO.h4
-rw-r--r--ace/SOCK_IO.i8
-rw-r--r--ace/SOCK_Stream.h4
-rw-r--r--ace/SOCK_Stream.i4
-rw-r--r--tests/Conn_Test.cpp16
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 <shuston@riverace.com>
+
+ * 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 <coryan@atdesk.com>
* 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 <shuston@riverace.com>
+
+ * 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 <coryan@atdesk.com>
* 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<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::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 <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int
@@ -809,7 +809,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_OS::strlen (buf);
+ return ACE_static_cast (int, ACE_OS::strlen (buf));
}
template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int
@@ -1161,7 +1161,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_OS::strlen (buf);
+ return ACE_static_cast (int, ACE_OS::strlen (buf));
}
template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> 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<SVH, PR_CO_2>::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 <class SVH, PR_CO_1>
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_SYNCH_USE>::~ACE_Message_Queue (void)
template <ACE_SYNCH_DECL> int
ACE_Message_Queue<ACE_SYNCH_USE>::flush_i (void)
{
- size_t number_flushed = 0;
+ int number_flushed = 0;
// Remove all the <ACE_Message_Block>s in the <ACE_Message_Queue>
// and <release> 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<ACE_SYNCH_USE>::message_length (void)
return this->cur_length_;
}
-template <ACE_SYNCH_DECL> ACE_INLINE size_t
+template <ACE_SYNCH_DECL> ACE_INLINE int
ACE_Message_Queue<ACE_SYNCH_USE>::message_count (void)
{
ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::message_count");
@@ -277,7 +277,7 @@ ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::message_length (void)
return this->queue_.message_length ();
}
-template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> ACE_INLINE size_t
+template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL> ACE_INLINE int
ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::message_count (void)
{
ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::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 <iovec> of size <n> 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 <iovec> of size <n> 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 <iovec> of size <iovcnt> from the connected socket.
ssize_t recvv_n (iovec iov[],
- size_t iovcnt,
+ int iovcnt,
const ACE_Time_Value *timeout = 0,
size_t *bytes_transferred = 0) const;
@@ -122,7 +122,7 @@ public:
/// Send an <iovec> of size <iovcnt> to the connected socket.
ssize_t sendv_n (const iovec iov[],
- size_t iovcnt,
+ int iovcnt,
const ACE_Time_Value *timeout = 0,
size_t *bytes_transferred = 0) const;
diff --git a/ace/SOCK_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 <select> to
// avoid busy waiting.
- if (ACE_OS::select (int (new_stream.get_handle ()) + 1,
- handle_set) == -1)
+#if defined (ACE_WIN64)
+ int select_width = 0;
+#else
+ int select_width = int (new_stream.get_handle ()) + 1;
+#endif /* ACE_WIN64 */
+ if (ACE_OS::select (select_width, handle_set) == -1)
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("(%P|%t) %p\n"),
ACE_TEXT ("select")));
@@ -337,7 +341,7 @@ int
Svc_Handler::idle (u_long flags)
{
ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("(%P|%t) idling Svc_Handler %d with handle %d\n"),
+ ACE_TEXT ("(%P|%t) idling Svc_Handler %@ with handle %d\n"),
this,
this->peer ().get_handle ()));
return ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>::idle (flags);
@@ -678,7 +682,7 @@ spawn_processes (ACCEPTOR *acceptor,
if (ACE_OS::kill (children[i], SIGTERM) == -1)
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("(%P|%t) %p for %d\n"),
- children[i]));
+ ACE_TEXT ("kill"), children[i]));
pid_t child;