summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowsservices.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsservices.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowsservices.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/plugins/platforms/windows/qwindowsservices.cpp b/src/plugins/platforms/windows/qwindowsservices.cpp
index 2382be4e3c..3c99e3507e 100644
--- a/src/plugins/platforms/windows/qwindowsservices.cpp
+++ b/src/plugins/platforms/windows/qwindowsservices.cpp
@@ -59,7 +59,10 @@ static inline bool shellExecute(const QUrl &url)
#ifndef Q_OS_WINCE
const QString nativeFilePath =
url.isLocalFile() ? QDir::toNativeSeparators(url.toLocalFile()) : url.toString(QUrl::FullyEncoded);
- const quintptr result = (quintptr)ShellExecute(0, 0, (wchar_t*)nativeFilePath.utf16(), 0, 0, SW_SHOWNORMAL);
+ const quintptr result =
+ reinterpret_cast<quintptr>(ShellExecute(0, 0,
+ reinterpret_cast<const wchar_t *>(nativeFilePath.utf16()),
+ 0, 0, SW_SHOWNORMAL));
// ShellExecute returns a value greater than 32 if successful
if (result <= 32) {
qWarning("ShellExecute '%s' failed (error %s).", qPrintable(url.toString()), qPrintable(QString::number(result)));
@@ -97,7 +100,7 @@ static inline QString mailCommand()
if (debug)
qDebug() << __FUNCTION__ << "keyName=" << keyName;
command[0] = 0;
- if (!RegOpenKeyExW(HKEY_CLASSES_ROOT, (const wchar_t*)keyName.utf16(), 0, KEY_READ, &handle)) {
+ if (!RegOpenKeyExW(HKEY_CLASSES_ROOT, reinterpret_cast<const wchar_t*>(keyName.utf16()), 0, KEY_READ, &handle)) {
DWORD bufferSize = BufferSize;
RegQueryValueEx(handle, L"", 0, 0, reinterpret_cast<unsigned char*>(command), &bufferSize);
RegCloseKey(handle);
@@ -140,7 +143,8 @@ static inline bool launchMail(const QUrl &url)
STARTUPINFO si;
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
- if (!CreateProcess(NULL, (wchar_t*)command.utf16(), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
+ if (!CreateProcess(NULL, reinterpret_cast<wchar_t *>(const_cast<ushort *>(command.utf16())),
+ NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
qErrnoWarning("Unable to launch '%s'", qPrintable(command));
return false;
}