diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-08-29 08:31:08 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-08-30 06:26:44 +0000 |
commit | 64e6441d9c017663df134b1b02324295e0450baf (patch) | |
tree | d89cb4bed3fcfddacdc6896c36e0d1bfddc35034 /src/corelib/plugin/qlibrary_win.cpp | |
parent | f9431f5632ca577a099bd4063f1412cff81f5f8d (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/corelib/plugin/qlibrary_win.cpp')
-rw-r--r-- | src/corelib/plugin/qlibrary_win.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/plugin/qlibrary_win.cpp b/src/corelib/plugin/qlibrary_win.cpp index 9368e53b3f..05a93d467e 100644 --- a/src/corelib/plugin/qlibrary_win.cpp +++ b/src/corelib/plugin/qlibrary_win.cpp @@ -97,10 +97,10 @@ bool QLibraryPrivate::load_sys() for (const QString &attempt : qAsConst(attempts)) { #ifndef Q_OS_WINRT - pHnd = LoadLibrary((wchar_t*)QDir::toNativeSeparators(attempt).utf16()); + pHnd = LoadLibrary(reinterpret_cast<const wchar_t*>(QDir::toNativeSeparators(attempt).utf16())); #else // Q_OS_WINRT QString path = QDir::toNativeSeparators(QDir::current().relativeFilePath(attempt)); - pHnd = LoadPackagedLibrary((LPCWSTR)path.utf16(), 0); + pHnd = LoadPackagedLibrary(reinterpret_cast<LPCWSTR>(path.utf16()), 0); if (pHnd) qualifiedFileName = attempt; #endif // !Q_OS_WINRT |