diff options
author | Eric Lemanissier <eric.lemanissier@gmail.com> | 2018-06-19 13:02:39 +0200 |
---|---|---|
committer | Eric Lemanissier <eric.lemanissier@gmail.com> | 2018-06-21 07:38:59 +0000 |
commit | 62efb446b56bc489c998f90e307aa12e72cb6b8e (patch) | |
tree | e52e3255677737858bbdb3836e4554de77a9fd41 /src/bluetooth/qbluetoothservicediscoveryagent_win.cpp | |
parent | 3a90cf6d46dc6f34ccedb7f02515573d1db4704a (diff) |
win32: modernize qbluetooth*discoveryagent
arguments pass by ref
NULL and 0 replaced with nullptr
::ZeroMemory replaced by default initialization
range based for loop
Change-Id: I393806f19155ee31e4ebe7f33ce22e9d14eafe40
Reviewed-by: Lubomir I. Ivanov <neolit123@gmail.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/bluetooth/qbluetoothservicediscoveryagent_win.cpp')
-rw-r--r-- | src/bluetooth/qbluetoothservicediscoveryagent_win.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_win.cpp b/src/bluetooth/qbluetoothservicediscoveryagent_win.cpp index 8ee0f663..35ab558e 100644 --- a/src/bluetooth/qbluetoothservicediscoveryagent_win.cpp +++ b/src/bluetooth/qbluetoothservicediscoveryagent_win.cpp @@ -345,8 +345,7 @@ static FindServiceResult findFirstService(HANDLE hSearch, const QBluetoothAddres GUID protocol = L2CAP_PROTOCOL_UUID; //Search for L2CAP and RFCOMM services - WSAQUERYSET serviceQuery; - ::ZeroMemory(&serviceQuery, sizeof(serviceQuery)); + WSAQUERYSET serviceQuery = {0}; serviceQuery.dwSize = sizeof(WSAQUERYSET); //As specified by the windows documentation serviceQuery.lpServiceClassId = &protocol; //The protocal of the service what is being queried serviceQuery.dwNameSpace = NS_BTH; //As specified by the windows documentation @@ -417,7 +416,7 @@ void QBluetoothServiceDiscoveryAgentPrivate::stop() pendingStop = true; } -void QBluetoothServiceDiscoveryAgentPrivate::_q_nextSdpScan(QVariant input) +void QBluetoothServiceDiscoveryAgentPrivate::_q_nextSdpScan(const QVariant &input) { Q_Q(QBluetoothServiceDiscoveryAgent); auto result = input.value<FindServiceResult>(); @@ -456,7 +455,7 @@ void QBluetoothServiceDiscoveryAgentPrivate::_q_nextSdpScan(QVariant input) } } -void ThreadWorkerFind::findFirst(const QVariant data) +void ThreadWorkerFind::findFirst(const QVariant &data) { auto args = data.value<FindServiceArguments>(); FindServiceResult result = findFirstService(args.hSearch, args.address); @@ -464,7 +463,7 @@ void ThreadWorkerFind::findFirst(const QVariant data) emit findFinished(QVariant::fromValue(result)); } - void ThreadWorkerFind::findNext(const QVariant data) + void ThreadWorkerFind::findNext(const QVariant &data) { auto args = data.value<FindServiceArguments>(); FindServiceResult result = findNextService(args.hSearch, args.systemError); |