*Massive cleanup (\n\n -> \n, *\n -> \n, cleanup for(...) to for (...), and some other cleanups by hand)

*Fix a possible crash in Spell::DoAllEffectOnTarget

--HG--
branch : trunk
This commit is contained in:
maximius
2009-10-17 15:35:07 -07:00
parent f21f47005d
commit 26b5e033ff
2257 changed files with 750 additions and 103852 deletions
-31
View File
@@ -1,18 +1,14 @@
// -*- C++ -*-
//
// $Id: SPIPE_Stream.inl 80826 2008-03-04 14:51:23Z wotte $
#include "ace/OS_NS_sys_uio.h"
#include "ace/OS_NS_errno.h"
#include "ace/OS_NS_unistd.h"
#if defined (ACE_WIN32)
#include "ace/OS_NS_sys_socket.h"
#endif
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// Create an ACE_SPIPE_Stream.
ACE_INLINE int
ACE_SPIPE_Stream::get_remote_addr (ACE_SPIPE_Addr &remote_sap) const
{
@@ -20,85 +16,71 @@ ACE_SPIPE_Stream::get_remote_addr (ACE_SPIPE_Addr &remote_sap) const
remote_sap = this->remote_addr_;
return 0;
}
// Send exactly N bytes from BUF to this socket. Keeping trying until
// this many bytes are sent.
ACE_INLINE ssize_t
ACE_SPIPE_Stream::send_n (const void *buf, size_t n) const
{
ACE_TRACE ("ACE_SPIPE_Stream::send_n");
return ACE::write_n (this->get_handle (), buf, n);
}
// Receive exactly N bytes from this socket into BUF. Keep trying
// until this many bytes are received.
ACE_INLINE ssize_t
ACE_SPIPE_Stream::recv_n (void *buf, size_t n) const
{
ACE_TRACE ("ACE_SPIPE_Stream::recv_n");
return ACE::read_n (this->get_handle (), buf, n);
}
ACE_INLINE ssize_t
ACE_SPIPE_Stream::send (const void *buf, size_t n) const
{
ACE_TRACE ("ACE_SPIPE_Stream::send");
return ACE_OS::write (this->get_handle (), (const char *) buf, n);
}
ACE_INLINE ssize_t
ACE_SPIPE_Stream::recv (void *buf, size_t n) const
{
ACE_TRACE ("ACE_SPIPE_Stream::recv");
return ACE_OS::read (this->get_handle (), (char *) buf, n);
}
ACE_INLINE ssize_t
ACE_SPIPE_Stream::send (const ACE_Str_Buf *cntl, const ACE_Str_Buf *data, int flags) const
{
ACE_TRACE ("ACE_SPIPE_Stream::send");
return ACE_OS::putmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, flags);
}
ACE_INLINE ssize_t
ACE_SPIPE_Stream::recv (ACE_Str_Buf *cntl, ACE_Str_Buf *data, int *flags) const
{
ACE_TRACE ("ACE_SPIPE_Stream::recv");
return ACE_OS::getmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, flags);
}
ACE_INLINE ssize_t
ACE_SPIPE_Stream::send (const ACE_Str_Buf *cntl, const ACE_Str_Buf *data, int band, int flags) const
{
ACE_TRACE ("ACE_SPIPE_Stream::send");
return ACE_OS::putpmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, band, flags);
}
ACE_INLINE ssize_t
ACE_SPIPE_Stream::recv (ACE_Str_Buf *cntl, ACE_Str_Buf *data, int *band, int *flags) const
{
ACE_TRACE ("ACE_SPIPE_Stream::recv");
return ACE_OS::getpmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, band, flags);
}
ACE_INLINE ssize_t
ACE_SPIPE_Stream::send (const iovec iov[], int n) const
{
ACE_TRACE ("ACE_SPIPE_Stream::send");
return ACE_OS::writev (this->get_handle (), iov, n);
}
ACE_INLINE ssize_t
ACE_SPIPE_Stream::recv (iovec iov[], int n) const
{
ACE_TRACE ("ACE_SPIPE_Stream::recv");
return ACE_OS::readv (this->get_handle (), iov, n);
}
// This routine sends an open file descriptor to this socket.
ACE_INLINE int
ACE_SPIPE_Stream::send_handle (ACE_HANDLE handle) const
{
@@ -143,16 +125,13 @@ ACE_SPIPE_Stream::send_handle (ACE_HANDLE handle) const
ACE_NOTSUP_RETURN (-1);
#endif /* ACE_HAS_STREAM_PIPES */
}
// This file receives an open file descriptor from this socket.
ACE_INLINE int
ACE_SPIPE_Stream::recv_handle (ACE_HANDLE &handle) const
{
ACE_TRACE ("ACE_SPIPE_Stream::recv_handle");
#if defined (ACE_HAS_STREAM_PIPES)
strrecvfd recvfd;
if (ACE_OS::ioctl (this->get_handle (), I_RECVFD, (void *) &recvfd) == -1)
return -1;
else
@@ -199,10 +178,8 @@ ACE_SPIPE_Stream::recv_handle (ACE_HANDLE &handle) const
ACE_NOTSUP_RETURN (-1);
#endif /* ACE_HAS_STREAM_PIPES */
}
// This file receives an open file descriptor from this socket and
// also passes back the information about the address...
ACE_INLINE int
ACE_SPIPE_Stream::recv_handle (strrecvfd &recvfd) const
{
@@ -214,7 +191,6 @@ ACE_SPIPE_Stream::recv_handle (strrecvfd &recvfd) const
ACE_NOTSUP_RETURN (-1);
#endif /* ACE_HAS_STREAM_PIPES */
}
ACE_INLINE ssize_t
ACE_SPIPE_Stream::send (const void *buf, size_t n,
ACE_OVERLAPPED *overlapped) const
@@ -224,7 +200,6 @@ ACE_SPIPE_Stream::send (const void *buf, size_t n,
(const char *) buf, n,
overlapped);
}
ACE_INLINE ssize_t
ACE_SPIPE_Stream::recv (void *buf, size_t n,
ACE_OVERLAPPED *overlapped) const
@@ -234,7 +209,6 @@ ACE_SPIPE_Stream::recv (void *buf, size_t n,
(char *) buf, n,
overlapped);
}
ACE_INLINE ssize_t
ACE_SPIPE_Stream::sendv_n (const iovec iov[],
int n) const
@@ -244,9 +218,7 @@ ACE_SPIPE_Stream::sendv_n (const iovec iov[],
iov,
n);
}
// Recv an n byte message from the Stream.
ACE_INLINE ssize_t
ACE_SPIPE_Stream::recvv_n (iovec iov[],
int n) const
@@ -258,9 +230,7 @@ ACE_SPIPE_Stream::recvv_n (iovec iov[],
iov,
n);
}
// Send an <iovec> of size <n> to the Stream.
ACE_INLINE ssize_t
ACE_SPIPE_Stream::sendv (const iovec iov[],
int n) const
@@ -270,6 +240,5 @@ ACE_SPIPE_Stream::sendv (const iovec iov[],
iov,
n);
}
ACE_END_VERSIONED_NAMESPACE_DECL