summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2016-11-21 12:55:54 +0100
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2016-11-22 05:05:24 +0000
commite798d0b18acfb6756a614aec3e7b4bcb1ef5ff58 (patch)
tree93034b5aa0ca6088df8a37ccc6067ecca4d27150
parent3691f7ca0c7117f18ea38ca3950ee9a8a91a53c8 (diff)
qnativesocketengine_winrt - do not shadow a variable
We first hide identifier 'hr' and then later we check the one that was never correctly initialized. Task-number: QTBUG-57226 Change-Id: Ibbf1bb99aa752c2e4090caf4533dc5f5b71b5e41 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
-rw-r--r--src/network/socket/qnativesocketengine_winrt.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/network/socket/qnativesocketengine_winrt.cpp b/src/network/socket/qnativesocketengine_winrt.cpp
index 32fafc2cb0..934c8fe785 100644
--- a/src/network/socket/qnativesocketengine_winrt.cpp
+++ b/src/network/socket/qnativesocketengine_winrt.cpp
@@ -252,19 +252,18 @@ bool QNativeSocketEngine::initialize(qintptr socketDescriptor, QAbstractSocket::
// Start processing incoming data
if (d->socketType == QAbstractSocket::TcpSocket) {
- HRESULT hr;
- QEventDispatcherWinRT::runOnXamlThread([d, &hr, socket, this]() {
+ HRESULT hr = QEventDispatcherWinRT::runOnXamlThread([d, socket, this]() {
ComPtr<IBuffer> buffer;
HRESULT hr = g->bufferFactory->Create(READ_BUFFER_SIZE, &buffer);
- RETURN_OK_IF_FAILED("initialize(): Could not create buffer");
+ RETURN_HR_IF_FAILED("initialize(): Could not create buffer");
ComPtr<IInputStream> stream;
hr = socket->get_InputStream(&stream);
- RETURN_OK_IF_FAILED("initialize(): Could not obtain input stream");
+ RETURN_HR_IF_FAILED("initialize(): Could not obtain input stream");
hr = stream->ReadAsync(buffer.Get(), READ_BUFFER_SIZE, InputStreamOptions_Partial, d->readOp.GetAddressOf());
- RETURN_OK_IF_FAILED_WITH_ARGS("initialize(): Failed to read from the socket buffer (%s).",
+ RETURN_HR_IF_FAILED_WITH_ARGS("initialize(): Failed to read from the socket buffer (%s).",
socketDescription(this).constData());
hr = d->readOp->put_Completed(Callback<SocketReadCompletedHandler>(d, &QNativeSocketEnginePrivate::handleReadyRead).Get());
- RETURN_OK_IF_FAILED_WITH_ARGS("initialize(): Failed to set socket read callback (%s).",
+ RETURN_HR_IF_FAILED_WITH_ARGS("initialize(): Failed to set socket read callback (%s).",
socketDescription(this).constData());
return S_OK;
});