summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowsservices.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2016-02-18 13:13:49 +0100
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2016-02-19 11:11:08 +0000
commitb20548f9999d8c111268f3f2287c0801c6c5cbb0 (patch)
treee3e2aafabf3e1df13ee825dacd62712b437e51f8 /src/plugins/platforms/windows/qwindowsservices.cpp
parent342c909b340cb1bfbb95480fc79dcea21a470c83 (diff)
Windows QPA: Fix warnings as shown by Qt Creator's Clang based code model.
Code except font, accessibility and file qwindowswindow.cpp. Task-number: QTBUG-50804 Change-Id: I40848264f9fa16eea00cf70d7be009c484c49e92 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
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 cc697ba7e4..ae63ac46ae 100644
--- a/src/plugins/platforms/windows/qwindowsservices.cpp
+++ b/src/plugins/platforms/windows/qwindowsservices.cpp
@@ -53,7 +53,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)));
@@ -91,7 +94,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);
@@ -134,7 +137,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;
}