*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:
@@ -1,18 +1,12 @@
|
||||
// $Id: SPIPE_Stream.cpp 80826 2008-03-04 14:51:23Z wotte $
|
||||
|
||||
#include "ace/SPIPE_Stream.h"
|
||||
#include "ace/OS_Memory.h"
|
||||
|
||||
#if !defined (__ACE_INLINE__)
|
||||
#include "ace/SPIPE_Stream.inl"
|
||||
#endif /* __ACE_INLINE__ */
|
||||
|
||||
ACE_RCSID(ace, SPIPE_Stream, "$Id: SPIPE_Stream.cpp 80826 2008-03-04 14:51:23Z wotte $")
|
||||
|
||||
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
|
||||
|
||||
ACE_ALLOC_HOOK_DEFINE(ACE_SPIPE_Stream)
|
||||
|
||||
void
|
||||
ACE_SPIPE_Stream::dump (void) const
|
||||
{
|
||||
@@ -20,19 +14,15 @@ ACE_SPIPE_Stream::dump (void) const
|
||||
ACE_TRACE ("ACE_SPIPE_Stream::dump");
|
||||
#endif /* ACE_HAS_DUMP */
|
||||
}
|
||||
|
||||
// Simple-minded do nothing constructor.
|
||||
|
||||
ACE_SPIPE_Stream::ACE_SPIPE_Stream (void)
|
||||
{
|
||||
// ACE_TRACE ("ACE_SPIPE_Stream::ACE_SPIPE_Stream");
|
||||
}
|
||||
|
||||
// Send N char *ptrs and int lengths. Note that the char *'s precede
|
||||
// the ints (basically, an varargs version of writev). The count N is
|
||||
// the *total* number of trailing arguments, *not* a couple of the
|
||||
// number of tuple pairs!
|
||||
|
||||
ssize_t
|
||||
ACE_SPIPE_Stream::send (size_t n, ...) const
|
||||
{
|
||||
@@ -47,15 +37,12 @@ ACE_SPIPE_Stream::send (size_t n, ...) const
|
||||
iovec[total_tuples],
|
||||
-1);
|
||||
#endif /* !defined (ACE_HAS_ALLOCA) */
|
||||
|
||||
va_start (argp, n);
|
||||
|
||||
for (int i = 0; i < total_tuples; i++)
|
||||
{
|
||||
iovp[i].iov_base = va_arg (argp, char *);
|
||||
iovp[i].iov_len = va_arg (argp, int);
|
||||
}
|
||||
|
||||
ssize_t result = ACE_OS::writev (this->get_handle (), iovp, total_tuples);
|
||||
#if !defined (ACE_HAS_ALLOCA)
|
||||
delete [] iovp;
|
||||
@@ -63,13 +50,11 @@ ACE_SPIPE_Stream::send (size_t n, ...) const
|
||||
va_end (argp);
|
||||
return result;
|
||||
}
|
||||
|
||||
// This is basically an interface to ACE_OS::readv, that doesn't use
|
||||
// the struct iovec explicitly. The ... can be passed as an arbitrary
|
||||
// number of (char *ptr, int len) tuples. However, the count N is the
|
||||
// *total* number of trailing arguments, *not* a couple of the number
|
||||
// of tuple pairs!
|
||||
|
||||
ssize_t
|
||||
ACE_SPIPE_Stream::recv (size_t n, ...) const
|
||||
{
|
||||
@@ -84,15 +69,12 @@ ACE_SPIPE_Stream::recv (size_t n, ...) const
|
||||
iovec[total_tuples],
|
||||
-1);
|
||||
#endif /* !defined (ACE_HAS_ALLOCA) */
|
||||
|
||||
va_start (argp, n);
|
||||
|
||||
for (int i = 0; i < total_tuples; i++)
|
||||
{
|
||||
iovp[i].iov_base = va_arg (argp, char *);
|
||||
iovp[i].iov_len = va_arg (argp, int);
|
||||
}
|
||||
|
||||
ssize_t result = ACE_OS::readv (this->get_handle (), iovp, total_tuples);
|
||||
#if !defined (ACE_HAS_ALLOCA)
|
||||
delete [] iovp;
|
||||
@@ -100,6 +82,5 @@ ACE_SPIPE_Stream::recv (size_t n, ...) const
|
||||
va_end (argp);
|
||||
return result;
|
||||
}
|
||||
|
||||
ACE_END_VERSIONED_NAMESPACE_DECL
|
||||
|
||||
|
||||
Reference in New Issue
Block a user