diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-04-08 10:28:24 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2016-04-08 10:28:24 +0200 |
commit | b5440b50f23982e7459a66b46ad41f176f67e308 (patch) | |
tree | d4e4e50e5a5ae84df442c1e4d2345539943692aa /src/tools | |
parent | 7477c86107ac0f5d344b380b38118c3a90f994a7 (diff) | |
parent | a4b8485cd38a9c33cdcf1b97633fa65b7230643b (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.7v5.7.0-beta1
Conflicts:
src/activeqt/container/qaxwidget.h
Change-Id: Ic6e7267fc71e3ace14e75b392ad3f7cac0df41a1
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/idc/main.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/tools/idc/main.cpp b/src/tools/idc/main.cpp index 3a02f8c..60ec1e4 100644 --- a/src/tools/idc/main.cpp +++ b/src/tools/idc/main.cpp @@ -69,7 +69,7 @@ static bool prependPath() return false; *ptr++ = L';'; const wchar_t pathVariable[] = L"PATH"; - if (!GetEnvironmentVariable(pathVariable, ptr, maxEnvironmentSize - (ptr - buffer)) + if (!GetEnvironmentVariable(pathVariable, ptr, DWORD(maxEnvironmentSize - (ptr - buffer))) || !SetEnvironmentVariable(pathVariable, buffer)) { return false; } @@ -81,9 +81,9 @@ static QString errorString(DWORD errorCode) wchar_t *resultW = 0; FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, NULL, errorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPWSTR)&resultW, 0, NULL); + reinterpret_cast<LPWSTR>(&resultW), 0, NULL); const QString result = QString::fromWCharArray(resultW); - LocalFree((HLOCAL)resultW); + LocalFree(resultW); return result; } @@ -141,13 +141,14 @@ static bool runWithQtInEnvironment(const QString &cmd) static bool attachTypeLibrary(const QString &applicationName, int resource, const QByteArray &data, QString *errorMessage) { - HANDLE hExe = BeginUpdateResource((const wchar_t *)applicationName.utf16(), false); + HANDLE hExe = BeginUpdateResource(reinterpret_cast<const wchar_t *>(applicationName.utf16()), false); if (hExe == 0) { if (errorMessage) *errorMessage = QString::fromLatin1("Failed to attach type library to binary %1 - could not open file.").arg(applicationName); return false; } - if (!UpdateResource(hExe, L"TYPELIB", MAKEINTRESOURCE(resource), 0, (void*)data.data(), data.count())) { + if (!UpdateResource(hExe, L"TYPELIB", MAKEINTRESOURCE(resource), 0, + const_cast<char *>(data.data()), DWORD(data.count()))) { EndUpdateResource(hExe, true); if (errorMessage) *errorMessage = QString::fromLatin1("Failed to attach type library to binary %1 - could not update file.").arg(applicationName); @@ -176,10 +177,10 @@ static bool attachTypeLibrary(const QString &applicationName, int resource, cons static HMODULE loadLibraryQt(const QString &input) { if (QSysInfo::windowsVersion() < QSysInfo::WV_VISTA) - return LoadLibrary((const wchar_t *)input.utf16()); // fallback for Windows XP and older + return LoadLibrary(reinterpret_cast<const wchar_t *>(input.utf16())); // fallback for Windows XP and older // Load DLL with the folder containing the DLL temporarily added to the search path when loading dependencies - return LoadLibraryEx((const wchar_t *)input.utf16(), NULL, + return LoadLibraryEx(reinterpret_cast<const wchar_t *>(input.utf16()), NULL, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); } @@ -195,7 +196,7 @@ static bool registerServer(const QString &input) return false; } typedef HRESULT(__stdcall* RegServerProc)(); - RegServerProc DllRegisterServer = (RegServerProc)GetProcAddress(hdll, "DllRegisterServer"); + RegServerProc DllRegisterServer = reinterpret_cast<RegServerProc>(GetProcAddress(hdll, "DllRegisterServer")); if (!DllRegisterServer) { fprintf(stderr, "Library file %s doesn't appear to be a COM library\n", qPrintable(input)); return false; @@ -217,7 +218,7 @@ static bool unregisterServer(const QString &input) return false; } typedef HRESULT(__stdcall* RegServerProc)(); - RegServerProc DllUnregisterServer = (RegServerProc)GetProcAddress(hdll, "DllUnregisterServer"); + RegServerProc DllUnregisterServer = reinterpret_cast<RegServerProc>(GetProcAddress(hdll, "DllUnregisterServer")); if (!DllUnregisterServer) { fprintf(stderr, "Library file %s doesn't appear to be a COM library\n", qPrintable(input)); return false; @@ -241,7 +242,7 @@ static HRESULT dumpIdl(const QString &input, const QString &idlfile, const QStri return 3; } typedef HRESULT(__stdcall* DumpIDLProc)(const QString&, const QString&); - DumpIDLProc DumpIDL = (DumpIDLProc)GetProcAddress(hdll, "DumpIDL"); + DumpIDLProc DumpIDL = reinterpret_cast<DumpIDLProc>(GetProcAddress(hdll, "DumpIDL")); if (!DumpIDL) { fprintf(stderr, "Couldn't resolve 'DumpIDL' symbol in %s\n", qPrintable(input)); return 3; |