1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-06-13 16:01:32 +03:00

Reformat all code to coding standard

This commit is contained in:
Andrew Hutchings
2017-10-26 17:18:17 +01:00
parent 4985f3456e
commit 01446d1e22
1296 changed files with 403852 additions and 353747 deletions

View File

@ -40,57 +40,58 @@ using namespace std;
#include "iosocket.h"
#undef IOSOCKET_DLLEXPORT
namespace messageqcpp {
namespace messageqcpp
{
IOSocket::IOSocket(Socket* socket) :
fSocket(socket), sockID(0)
fSocket(socket), sockID(0)
{
memset(&fSa, 0, sizeof(fSa));
memset(&fSa, 0, sizeof(fSa));
}
IOSocket::~IOSocket()
{
delete fSocket;
delete fSocket;
}
void IOSocket::doCopy(const IOSocket& rhs)
{
fSocket = rhs.fSocket->clone();
fSa = rhs.fSa;
sockID = rhs.sockID;
fSocket = rhs.fSocket->clone();
fSa = rhs.fSa;
sockID = rhs.sockID;
}
IOSocket::IOSocket(const IOSocket& rhs)
{
doCopy(rhs);
doCopy(rhs);
}
IOSocket& IOSocket::operator=(const IOSocket& rhs)
{
if (this != &rhs)
{
delete fSocket;
doCopy(rhs);
}
if (this != &rhs)
{
delete fSocket;
doCopy(rhs);
}
return *this;
return *this;
}
const string IOSocket::toString() const
{
#ifdef NOSSTREAM
return "IOSocket";
return "IOSocket";
#else
ostringstream oss;
char buf[INET_ADDRSTRLEN];
SocketParms sp = fSocket->socketParms();
const sockaddr_in* sinp = reinterpret_cast<const sockaddr_in*>(&fSa);
oss << "IOSocket: sd: " << sp.sd() <<
ostringstream oss;
char buf[INET_ADDRSTRLEN];
SocketParms sp = fSocket->socketParms();
const sockaddr_in* sinp = reinterpret_cast<const sockaddr_in*>(&fSa);
oss << "IOSocket: sd: " << sp.sd() <<
#ifndef _MSC_VER
" inet: " << inet_ntop(AF_INET, &sinp->sin_addr, buf, INET_ADDRSTRLEN) <<
" inet: " << inet_ntop(AF_INET, &sinp->sin_addr, buf, INET_ADDRSTRLEN) <<
#endif
" port: " << ntohs(sinp->sin_port);
return oss.str();
" port: " << ntohs(sinp->sin_port);
return oss.str();
#endif
}