aboutsummaryrefslogtreecommitdiffstats
path: root/common/network/Socket.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2024-04-02 16:13:23 +0200
committerPierre Ossman <ossman@cendio.se>2024-06-24 13:42:54 +0200
commit139f0e8a4b81fe3dcd9476ec5ee16ea5e74af901 (patch)
tree8d06ede9e14516516a44c5ed710058003088eec2 /common/network/Socket.cxx
parent45198e5235f4b724277665b242cf855a0ff4518b (diff)
downloadtigervnc-139f0e8a4b81fe3dcd9476ec5ee16ea5e74af901.tar.gz
tigervnc-139f0e8a4b81fe3dcd9476ec5ee16ea5e74af901.zip
Use nullptr in all C++ code
It's more readable than 0, and a bit safer than NULL, so let's try to follow modern norms.
Diffstat (limited to 'common/network/Socket.cxx')
-rw-r--r--common/network/Socket.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/common/network/Socket.cxx b/common/network/Socket.cxx
index 78484f51..971a7170 100644
--- a/common/network/Socket.cxx
+++ b/common/network/Socket.cxx
@@ -71,7 +71,7 @@ bool network::isSocketListening(int sock)
}
Socket::Socket(int fd)
- : instream(0), outstream(0),
+ : instream(nullptr), outstream(nullptr),
isShutdown_(false), queryConnection(false)
{
initSockets();
@@ -79,7 +79,7 @@ Socket::Socket(int fd)
}
Socket::Socket()
- : instream(0), outstream(0),
+ : instream(nullptr), outstream(nullptr),
isShutdown_(false), queryConnection(false)
{
initSockets();
@@ -129,13 +129,13 @@ void Socket::setFd(int fd)
}
SocketListener::SocketListener(int fd)
- : fd(fd), filter(0)
+ : fd(fd), filter(nullptr)
{
initSockets();
}
SocketListener::SocketListener()
- : fd(-1), filter(0)
+ : fd(-1), filter(nullptr)
{
initSockets();
}
@@ -160,14 +160,14 @@ Socket* SocketListener::accept() {
int new_sock = -1;
// Accept an incoming connection
- if ((new_sock = ::accept(fd, 0, 0)) < 0)
+ if ((new_sock = ::accept(fd, nullptr, nullptr)) < 0)
throw SocketException("unable to accept new connection", errorNumber);
// Create the socket object & check connection is allowed
Socket* s = createSocket(new_sock);
if (filter && !filter->verifyConnection(s)) {
delete s;
- return NULL;
+ return nullptr;
}
return s;