summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2017-03-30 10:15:28 +0100
committerMichael Meeks <michael.meeks@collabora.com>2017-03-30 23:44:48 +0100
commit0f5915b1a40d155770c66017161675cc013ec09c (patch)
treedec5f7a600a00fe159af6510b21a597fe2eef288 /net
parent8ece37e93bdbf902ef1efd6552dc4273bd0a61ac (diff)
Cleanup whitespace, return is not a function.
Diffstat (limited to 'net')
-rw-r--r--net/ServerSocket.hpp6
-rw-r--r--net/Socket.hpp6
-rw-r--r--net/SslSocket.hpp8
3 files changed, 8 insertions, 12 deletions
diff --git a/net/ServerSocket.hpp b/net/ServerSocket.hpp
index a0604e0b3..805430ea5 100644
--- a/net/ServerSocket.hpp
+++ b/net/ServerSocket.hpp
@@ -46,7 +46,7 @@ public:
::setsockopt(getFD(), SOL_SOCKET, SO_REUSEADDR, &reuseAddress, len);
const int rc = ::bind(getFD(), address.addr(), address.length());
- return (rc == 0);
+ return rc == 0;
}
/// Listen to incoming connections (Servers only).
@@ -55,7 +55,7 @@ public:
bool listen(const int backlog = 64)
{
const int rc = ::listen(getFD(), backlog);
- return (rc == 0);
+ return rc == 0;
}
/// Accepts an incoming connection (Servers only).
@@ -70,7 +70,7 @@ public:
try
{
// Create a socket object using the factory.
- return (rc != -1 ? _sockFactory->create(rc) : std::shared_ptr<Socket>(nullptr));
+ return rc != -1 ? _sockFactory->create(rc) : std::shared_ptr<Socket>(nullptr);
}
catch (const std::exception& ex)
{
diff --git a/net/Socket.hpp b/net/Socket.hpp
index 111b32df5..33e1091cf 100644
--- a/net/Socket.hpp
+++ b/net/Socket.hpp
@@ -129,7 +129,7 @@ public:
int size;
unsigned int len = sizeof(size);
const int rc = ::getsockopt(_fd, SOL_SOCKET, SO_SNDBUF, &size, &len);
- return (rc == 0 ? size : -1);
+ return rc == 0 ? size : -1;
}
/// Gets our fast cache of the socket buffer size
@@ -149,7 +149,7 @@ public:
{
constexpr unsigned int len = sizeof(size);
const int rc = ::setsockopt(_fd, SOL_SOCKET, SO_RCVBUF, &size, len);
- return (rc == 0);
+ return rc == 0;
}
/// Gets the actual receive buffer size in bytes, -1 on error.
@@ -158,7 +158,7 @@ public:
int size;
unsigned int len = sizeof(size);
const int rc = ::getsockopt(_fd, SOL_SOCKET, SO_RCVBUF, &size, &len);
- return (rc == 0 ? size : -1);
+ return rc == 0 ? size : -1;
}
/// Gets the error code.
diff --git a/net/SslSocket.hpp b/net/SslSocket.hpp
index ec732c1ad..52292c588 100644
--- a/net/SslSocket.hpp
+++ b/net/SslSocket.hpp
@@ -81,9 +81,7 @@ public:
const int rc = doHandshake();
if (rc <= 0)
- {
- return (rc != 0);
- }
+ return rc != 0;
// Default implementation.
return StreamSocket::readIncomingData();
@@ -168,9 +166,7 @@ private:
{
rc = handleSslState(rc);
if (rc <= 0)
- {
- return (rc != 0);
- }
+ return rc != 0;
}
_doHandshake = false;