Commit ad7ad5cf authored by sgjesse@chromium.org's avatar sgjesse@chromium.org

Fixed lint errors.

The previous commit (r1349) resulted in a number of lint errors - extra whitespace and a missing explicit on a constructor in the test. These has been fixed.

TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/27089

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1351 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 1d843bfa
......@@ -647,9 +647,9 @@ class FreeBSDSocket : public Socket {
}
// Server initialization.
bool Bind (const int port);
bool Bind(const int port);
bool Listen(int backlog) const;
Socket* Accept () const;
Socket* Accept() const;
// Client initialization.
bool Connect(const char* host, const char* port);
......@@ -678,7 +678,7 @@ bool FreeBSDSocket::Bind(const int port) {
addr.sin_port = htons(port);
int status = bind(socket_,
reinterpret_cast<struct sockaddr *>(&addr),
sizeof (addr));
sizeof(addr));
return status == 0;
}
......@@ -723,7 +723,7 @@ bool FreeBSDSocket::Connect(const char* host, const char* port) {
if (status != 0) {
return false;
}
// Connect.
status = connect(socket_, result->ai_addr, result->ai_addrlen);
return status == 0;
......
......@@ -631,9 +631,9 @@ class LinuxSocket : public Socket {
}
// Server initialization.
bool Bind (const int port);
bool Bind(const int port);
bool Listen(int backlog) const;
Socket* Accept () const;
Socket* Accept() const;
// Client initialization.
bool Connect(const char* host, const char* port);
......@@ -662,7 +662,7 @@ bool LinuxSocket::Bind(const int port) {
addr.sin_port = htons(port);
int status = bind(socket_,
reinterpret_cast<struct sockaddr *>(&addr),
sizeof (addr));
sizeof(addr));
return status == 0;
}
......@@ -707,7 +707,7 @@ bool LinuxSocket::Connect(const char* host, const char* port) {
if (status != 0) {
return false;
}
// Connect.
status = connect(socket_, result->ai_addr, result->ai_addrlen);
return status == 0;
......
......@@ -598,9 +598,9 @@ class MacOSSocket : public Socket {
}
// Server initialization.
bool Bind (const int port);
bool Bind(const int port);
bool Listen(int backlog) const;
Socket* Accept () const;
Socket* Accept() const;
// Client initialization.
bool Connect(const char* host, const char* port);
......@@ -635,7 +635,7 @@ bool MacOSSocket::Bind(const int port) {
addr.sin_port = htons(port);
status = bind(socket_,
reinterpret_cast<struct sockaddr *>(&addr),
sizeof (addr));
sizeof(addr));
return status == 0;
}
......@@ -680,7 +680,7 @@ bool MacOSSocket::Connect(const char* host, const char* port) {
if (status != 0) {
return false;
}
// Connect.
status = connect(socket_, result->ai_addr, result->ai_addrlen);
return status == 0;
......
......@@ -1574,9 +1574,9 @@ class Win32Socket : public Socket {
}
// Server initialization.
bool Bind (const int port);
bool Bind(const int port);
bool Listen(int backlog) const;
Socket* Accept () const;
Socket* Accept() const;
// Client initialization.
bool Connect(const char* host, const char* port);
......@@ -1605,7 +1605,7 @@ bool Win32Socket::Bind(const int port) {
addr.sin_port = htons(port);
int status = bind(socket_,
reinterpret_cast<struct sockaddr *>(&addr),
sizeof (addr));
sizeof(addr));
return status == 0;
}
......@@ -1650,7 +1650,7 @@ bool Win32Socket::Connect(const char* host, const char* port) {
if (status != 0) {
return false;
}
// Connect.
status = connect(socket_, result->ai_addr, result->ai_addrlen);
return status == 0;
......
......@@ -428,7 +428,7 @@ class Socket {
virtual ~Socket() {}
// Server initialization.
virtual bool Bind (const int port) = 0;
virtual bool Bind(const int port) = 0;
virtual bool Listen(int backlog) const = 0;
virtual Socket* Accept() const = 0;
......
......@@ -13,9 +13,9 @@ static const char* kLocalhost = "localhost";
class SocketListenerThread : public Thread {
public:
SocketListenerThread(int data_size) : data_size_(data_size),
server_(NULL), client_(NULL),
listening_(OS::CreateSemaphore(0)) {
explicit SocketListenerThread(int data_size)
: data_size_(data_size), server_(NULL), client_(NULL),
listening_(OS::CreateSemaphore(0)) {
data_ = new char[data_size_];
}
~SocketListenerThread() {
......@@ -50,7 +50,7 @@ void SocketListenerThread::Run() {
ok = server_->Listen(1);
CHECK(ok);
listening_->Signal();
// Accept a connection.
client_ = server_->Accept();
CHECK(client_ != NULL);
......@@ -70,7 +70,7 @@ static void SendAndReceive(char *data, int len) {
SocketListenerThread* listener = new SocketListenerThread(len);
listener->Start();
listener->WaitForListening();
// Connect and write some data.
Socket* client = OS::CreateSocket();
CHECK(client != NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment