summaryrefslogtreecommitdiffstats
path: root/src/network/socket/qlocalserver_win.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-08-29 08:31:08 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-08-30 06:26:44 +0000
commit64e6441d9c017663df134b1b02324295e0450baf (patch)
treed89cb4bed3fcfddacdc6896c36e0d1bfddc35034 /src/network/socket/qlocalserver_win.cpp
parentf9431f5632ca577a099bd4063f1412cff81f5f8d (diff)
Windows code: Fix clang-tidy warnings about C-style casts
Replace by reinterpret_cast or const_cast, respectively. Use auto when initializing a variable to fix Clang warnings about repeating the type name, do minor tidying along the way, and a few conversions of 0 or NULL to nullptr. Change-Id: Ieb271a87ddcf064f536e1ff05d23b1e688b1b56a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/network/socket/qlocalserver_win.cpp')
-rw-r--r--src/network/socket/qlocalserver_win.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/network/socket/qlocalserver_win.cpp b/src/network/socket/qlocalserver_win.cpp
index ced923ced1..2d71a7e730 100644
--- a/src/network/socket/qlocalserver_win.cpp
+++ b/src/network/socket/qlocalserver_win.cpp
@@ -89,7 +89,7 @@ bool QLocalServerPrivate::addListener()
DWORD dwBufferSize = 0;
GetTokenInformation(hToken, TokenUser, 0, 0, &dwBufferSize);
tokenUserBuffer.fill(0, dwBufferSize);
- PTOKEN_USER pTokenUser = (PTOKEN_USER)tokenUserBuffer.data();
+ auto pTokenUser = reinterpret_cast<PTOKEN_USER>(tokenUserBuffer.data());
if (!GetTokenInformation(hToken, TokenUser, pTokenUser, dwBufferSize, &dwBufferSize)) {
setError(QLatin1String("QLocalServerPrivate::addListener"));
CloseHandle(hToken);
@@ -99,7 +99,7 @@ bool QLocalServerPrivate::addListener()
dwBufferSize = 0;
GetTokenInformation(hToken, TokenPrimaryGroup, 0, 0, &dwBufferSize);
tokenGroupBuffer.fill(0, dwBufferSize);
- PTOKEN_PRIMARY_GROUP pTokenGroup = (PTOKEN_PRIMARY_GROUP)tokenGroupBuffer.data();
+ auto pTokenGroup = reinterpret_cast<PTOKEN_PRIMARY_GROUP>(tokenGroupBuffer.data());
if (!GetTokenInformation(hToken, TokenPrimaryGroup, pTokenGroup, dwBufferSize, &dwBufferSize)) {
setError(QLatin1String("QLocalServerPrivate::addListener"));
CloseHandle(hToken);
@@ -140,7 +140,7 @@ bool QLocalServerPrivate::addListener()
aclSize = (aclSize + (sizeof(DWORD) - 1)) & 0xfffffffc;
aclBuffer.fill(0, aclSize);
- PACL acl = (PACL)aclBuffer.data();
+ auto acl = reinterpret_cast<PACL>(aclBuffer.data());
InitializeAcl(acl, aclSize, ACL_REVISION_DS);
if (socketOptions & QLocalServer::UserAccessOption) {
@@ -176,7 +176,7 @@ bool QLocalServerPrivate::addListener()
}
listener.handle = CreateNamedPipe(
- (const wchar_t *)fullServerName.utf16(), // pipe name
+ reinterpret_cast<const wchar_t *>(fullServerName.utf16()), // pipe name
PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, // read/write access
PIPE_TYPE_BYTE | // byte type pipe
PIPE_READMODE_BYTE | // byte-read mode
@@ -299,7 +299,7 @@ void QLocalServerPrivate::_q_onNewConnection()
tryAgain = true;
// Make this the last thing so connected slots can wreak the least havoc
- q->incomingConnection((quintptr)handle);
+ q->incomingConnection(reinterpret_cast<quintptr>(handle));
} else {
if (GetLastError() != ERROR_IO_INCOMPLETE) {
q->close();