From 0d1984357f9bc8aac671e8907208a8581a1f42db Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 26 Jul 2018 16:11:31 +0200 Subject: [*] Convert old C-Style casts Primitive types now use type(x) instead of (type)x, pointers should use appropriate long versions --- src/client/vnc/vncthread.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/client/vnc/vncthread.cpp') diff --git a/src/client/vnc/vncthread.cpp b/src/client/vnc/vncthread.cpp index e399e9b..1a903d5 100644 --- a/src/client/vnc/vncthread.cpp +++ b/src/client/vnc/vncthread.cpp @@ -89,7 +89,7 @@ void VncThread::run() _client->frameBuffer = nullptr; // save this instance in vnc-struct for callbacks - rfbClientSetClientData(_client, 0, this); + rfbClientSetClientData(_client, nullptr, this); // start client if (rfbInitClient(_client, nullptr, nullptr)) { @@ -172,7 +172,7 @@ void VncThread::emitStarted() */ char* VncThread::passwdHandler(rfbClient *client) { - VncThread* t = (VncThread*)rfbClientGetClientData(client, 0); + VncThread* t = reinterpret_cast(rfbClientGetClientData(client, nullptr)); return strdup(t->_passwd.toUtf8()); } @@ -185,7 +185,7 @@ char* VncThread::passwdHandler(rfbClient *client) */ rfbBool VncThread::frameBufferHandler(rfbClient *client) { - VncThread *t = (VncThread*)rfbClientGetClientData(client, 0); + VncThread *t = reinterpret_cast(rfbClientGetClientData(client, nullptr)); const int width = client->width, height = client->height, depth = 32; const int size = width * height * (depth / 8); qDebug("[%s] Remote desktop: %ix%ix%i", t->metaObject()->className(), width, height, depth); @@ -201,7 +201,7 @@ rfbBool VncThread::frameBufferHandler(rfbClient *client) ::exit(1); } client->frameBuffer = t->_img->bits(); - memset(client->frameBuffer, '\0', (size_t)size); + memset(client->frameBuffer, '\0', size_t(size)); client->format.trueColour = 1; client->format.bitsPerPixel = depth; client->format.redShift = 16; -- cgit v1.2.3-55-g7522