*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
-29
View File
@@ -1,18 +1,12 @@
// $Id: SOCK.cpp 80826 2008-03-04 14:51:23Z wotte $
#include "ace/SOCK.h"
#include "ace/Log_Msg.h"
#if !defined (__ACE_INLINE__)
#include "ace/SOCK.inl"
#endif /* __ACE_INLINE__ */
ACE_RCSID(ace, SOCK, "$Id: SOCK.cpp 80826 2008-03-04 14:51:23Z wotte $")
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE(ACE_SOCK)
void
ACE_SOCK::dump (void) const
{
@@ -20,59 +14,46 @@ ACE_SOCK::dump (void) const
ACE_TRACE ("ACE_SOCK::dump");
#endif /* ACE_HAS_DUMP */
}
ACE_SOCK::ACE_SOCK (void)
{
// ACE_TRACE ("ACE_SOCK::ACE_SOCK");
}
// Returns information about the remote peer endpoint (if there is
// one).
int
ACE_SOCK::get_remote_addr (ACE_Addr &sa) const
{
ACE_TRACE ("ACE_SOCK::get_remote_addr");
int len = sa.get_size ();
sockaddr *addr = reinterpret_cast<sockaddr *> (sa.get_addr ());
if (ACE_OS::getpeername (this->get_handle (),
addr,
&len) == -1)
return -1;
sa.set_size (len);
sa.set_type (addr->sa_family);
return 0;
}
int
ACE_SOCK::get_local_addr (ACE_Addr &sa) const
{
ACE_TRACE ("ACE_SOCK::get_local_addr");
int len = sa.get_size ();
sockaddr *addr = reinterpret_cast<sockaddr *> (sa.get_addr ());
if (ACE_OS::getsockname (this->get_handle (),
addr,
&len) == -1)
return -1;
sa.set_type (addr->sa_family);
sa.set_size (len);
return 0;
}
// Close down a ACE_SOCK.
int
ACE_SOCK::close (void)
{
ACE_TRACE ("ACE_SOCK::close");
int result = 0;
if (this->get_handle () != ACE_INVALID_HANDLE)
{
result = ACE_OS::closesocket (this->get_handle ());
@@ -80,7 +61,6 @@ ACE_SOCK::close (void)
}
return result;
}
int
ACE_SOCK::open (int type,
int protocol_family,
@@ -89,11 +69,9 @@ ACE_SOCK::open (int type,
{
ACE_TRACE ("ACE_SOCK::open");
int one = 1;
this->set_handle (ACE_OS::socket (protocol_family,
type,
protocol));
if (this->get_handle () == ACE_INVALID_HANDLE)
return -1;
else if (protocol_family != PF_UNIX
@@ -108,10 +86,8 @@ ACE_SOCK::open (int type,
}
return 0;
}
// General purpose constructor for performing server ACE_SOCK
// creation.
ACE_SOCK::ACE_SOCK (int type,
int protocol_family,
int protocol,
@@ -126,7 +102,6 @@ ACE_SOCK::ACE_SOCK (int type,
ACE_TEXT ("%p\n"),
ACE_TEXT ("ACE_SOCK::ACE_SOCK")));
}
int
ACE_SOCK::open (int type,
int protocol_family,
@@ -137,7 +112,6 @@ ACE_SOCK::open (int type,
int reuse_addr)
{
ACE_TRACE ("ACE_SOCK::open");
this->set_handle (ACE_OS::socket (protocol_family,
type,
protocol,
@@ -145,7 +119,6 @@ ACE_SOCK::open (int type,
g,
flags));
int one = 1;
if (this->get_handle () == ACE_INVALID_HANDLE)
return -1;
else if (reuse_addr
@@ -160,7 +133,6 @@ ACE_SOCK::open (int type,
else
return 0;
}
ACE_SOCK::ACE_SOCK (int type,
int protocol_family,
int protocol,
@@ -181,6 +153,5 @@ ACE_SOCK::ACE_SOCK (int type,
ACE_TEXT ("%p\n"),
ACE_TEXT ("ACE_SOCK::ACE_SOCK")));
}
ACE_END_VERSIONED_NAMESPACE_DECL