summaryrefslogtreecommitdiffstats
path: root/src/network/kernel/qnetworkproxy_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/kernel/qnetworkproxy_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/kernel/qnetworkproxy_win.cpp')
-rw-r--r--src/network/kernel/qnetworkproxy_win.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/network/kernel/qnetworkproxy_win.cpp b/src/network/kernel/qnetworkproxy_win.cpp
index 949f9fe12b..e67faaf856 100644
--- a/src/network/kernel/qnetworkproxy_win.cpp
+++ b/src/network/kernel/qnetworkproxy_win.cpp
@@ -566,7 +566,7 @@ void QWindowsSystemProxy::init()
WINHTTP_AUTO_DETECT_TYPE_DNS_A;
} else {
autoProxyOptions.dwFlags = WINHTTP_AUTOPROXY_CONFIG_URL;
- autoProxyOptions.lpszAutoConfigUrl = (LPCWSTR)autoConfigUrl.utf16();
+ autoProxyOptions.lpszAutoConfigUrl = reinterpret_cast<LPCWSTR>(autoConfigUrl.utf16());
}
}
@@ -608,7 +608,7 @@ QList<QNetworkProxy> QNetworkProxyFactory::systemProxyForQuery(const QNetworkPro
}
bool getProxySucceeded = ptrWinHttpGetProxyForUrl(sp->hHttpSession,
- (LPCWSTR)urlQueryString.utf16(),
+ reinterpret_cast<LPCWSTR>(urlQueryString.utf16()),
&sp->autoProxyOptions,
&proxyInfo);
DWORD getProxyError = GetLastError();
@@ -623,9 +623,10 @@ QList<QNetworkProxy> QNetworkProxyFactory::systemProxyForQuery(const QNetworkPro
} else {
//pac file URL is specified as well, try using that
sp->autoProxyOptions.dwFlags = WINHTTP_AUTOPROXY_CONFIG_URL;
- sp->autoProxyOptions.lpszAutoConfigUrl = (LPCWSTR)sp->autoConfigUrl.utf16();
+ sp->autoProxyOptions.lpszAutoConfigUrl =
+ reinterpret_cast<LPCWSTR>(sp->autoConfigUrl.utf16());
getProxySucceeded = ptrWinHttpGetProxyForUrl(sp->hHttpSession,
- (LPCWSTR)urlQueryString.utf16(),
+ reinterpret_cast<LPCWSTR>(urlQueryString.utf16()),
&sp->autoProxyOptions,
&proxyInfo);
getProxyError = GetLastError();
@@ -638,7 +639,7 @@ QList<QNetworkProxy> QNetworkProxyFactory::systemProxyForQuery(const QNetworkPro
// But now we've to enable it (http://msdn.microsoft.com/en-us/library/aa383153%28v=VS.85%29.aspx)
sp->autoProxyOptions.fAutoLogonIfChallenged = TRUE;
getProxySucceeded = ptrWinHttpGetProxyForUrl(sp->hHttpSession,
- (LPCWSTR)urlQueryString.utf16(),
+ reinterpret_cast<LPCWSTR>(urlQueryString.utf16()),
&sp->autoProxyOptions,
&proxyInfo);
getProxyError = GetLastError();