diff -ur /tmp/qtconnectivity-opensource-src-5.9.9/src/bluetooth/osx/osxbtledeviceinquiry.mm /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt59/qt59-qtconnectivity/work/qtconnectivity-opensource-src-5.9.9/src/bluetooth/osx/osxbtledeviceinquiry.mm
old
|
new
|
|
139 | 139 | |
140 | 140 | - (void)dealloc |
141 | 141 | { |
142 | | if (manager != NULL) { |
| 142 | if (manager) { |
143 | 143 | [manager setDelegate:nil]; |
144 | 144 | if (internalState == InquiryActive) |
145 | 145 | [manager stopScan]; |
diff -ur /tmp/qtconnectivity-opensource-src-5.9.9/src/bluetooth/osx/osxbtperipheralmanager.mm /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt59/qt59-qtconnectivity/work/qtconnectivity-opensource-src-5.9.9/src/bluetooth/osx/osxbtperipheralmanager.mm
old
|
new
|
|
313 | 313 | - (void)startAdvertising |
314 | 314 | { |
315 | 315 | state = PeripheralState::waitingForPowerOn; |
316 | | if (manager != NULL) |
| 316 | if (manager) |
317 | 317 | [manager setDelegate:nil]; |
318 | 318 | manager.reset([[CBPeripheralManager alloc] initWithDelegate:self |
319 | 319 | queue:OSXBluetooth::qt_LE_queue()]); |
… |
… |
|
378 | 378 | |
379 | 379 | - (void) addServicesToPeripheral |
380 | 380 | { |
381 | | Q_ASSERT(manager != NULL); |
| 381 | Q_ASSERT(manager); |
382 | 382 | |
383 | 383 | if (nextServiceToAdd < services.size()) |
384 | 384 | [manager addService:services[nextServiceToAdd++]]; |
diff -ur /tmp/qtconnectivity-opensource-src-5.9.9/src/bluetooth/qbluetoothdevicediscoveryagent_osx.mm /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt59/qt59-qtconnectivity/work/qtconnectivity-opensource-src-5.9.9/src/bluetooth/qbluetoothdevicediscoveryagent_osx.mm
old
|
new
|
|
181 | 181 | |
182 | 182 | QBluetoothDeviceDiscoveryAgentPrivate::~QBluetoothDeviceDiscoveryAgentPrivate() |
183 | 183 | { |
184 | | if (inquiryLE != NULL && agentState != NonActive) { |
| 184 | if (inquiryLE && agentState != NonActive) { |
185 | 185 | // We want the LE scan to stop as soon as possible. |
186 | 186 | if (dispatch_queue_t leQueue = OSXBluetooth::qt_LE_queue()) { |
187 | 187 | // Local variable to be retained ... |
… |
… |
|
195 | 195 | |
196 | 196 | bool QBluetoothDeviceDiscoveryAgentPrivate::isValid() const |
197 | 197 | { |
198 | | return hostController != NULL && [hostController powerState] == kBluetoothHCIPowerStateON; |
| 198 | return hostController && [hostController powerState] == kBluetoothHCIPowerStateON; |
199 | 199 | } |
200 | 200 | |
201 | 201 | bool QBluetoothDeviceDiscoveryAgentPrivate::isActive() const |
… |
… |
|
292 | 292 | |
293 | 293 | // Check queue and create scanner: |
294 | 294 | inquiryLE.reset([[LEDeviceInquiryObjC alloc] initWithNotifier:notifier.data()]); |
295 | | if (inquiryLE != NULL) |
| 295 | if (inquiryLE) |
296 | 296 | notifier.take(); // Whatever happens next, inquiryLE is already the owner ... |
297 | 297 | |
298 | 298 | dispatch_queue_t leQueue(qt_LE_queue()); |
diff -ur /tmp/qtconnectivity-opensource-src-5.9.9/src/bluetooth/qbluetoothlocaldevice_osx.mm /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt59/qt59-qtconnectivity/work/qtconnectivity-opensource-src-5.9.9/src/bluetooth/qbluetoothlocaldevice_osx.mm
old
|
new
|
|
149 | 149 | |
150 | 150 | bool QBluetoothLocalDevicePrivate::isValid() const |
151 | 151 | { |
152 | | return hostController != NULL; |
| 152 | return hostController; |
153 | 153 | } |
154 | 154 | |
155 | 155 | void QBluetoothLocalDevicePrivate::requestPairing(const QBluetoothAddress &address, Pairing pairing) |
diff -ur /tmp/qtconnectivity-opensource-src-5.9.9/src/bluetooth/qbluetoothserver_osx.mm /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt59/qt59-qtconnectivity/work/qtconnectivity-opensource-src-5.9.9/src/bluetooth/qbluetoothserver_osx.mm
old
|
new
|
|
142 | 142 | |
143 | 143 | void QBluetoothServerPrivate::openNotify(IOBluetoothRFCOMMChannel *channel) |
144 | 144 | { |
145 | | Q_ASSERT_X(listener != NULL, Q_FUNC_INFO, "invalid listener (nil)"); |
| 145 | Q_ASSERT_X(listener, Q_FUNC_INFO, "invalid listener (nil)"); |
146 | 146 | Q_ASSERT_X(channel, Q_FUNC_INFO, "invalid channel (nil)"); |
147 | 147 | Q_ASSERT_X(q_ptr, Q_FUNC_INFO, "invalid q_ptr (null)"); |
148 | 148 | |
… |
… |
|
154 | 154 | |
155 | 155 | void QBluetoothServerPrivate::openNotify(IOBluetoothL2CAPChannel *channel) |
156 | 156 | { |
157 | | Q_ASSERT_X(listener != NULL, Q_FUNC_INFO, "invalid listener (nil)"); |
| 157 | Q_ASSERT_X(listener, Q_FUNC_INFO, "invalid listener (nil)"); |
158 | 158 | Q_ASSERT_X(channel, Q_FUNC_INFO, "invalid channel (nil)"); |
159 | 159 | Q_ASSERT_X(q_ptr, Q_FUNC_INFO, "invalid q_ptr (null)"); |
160 | 160 | |
… |
… |
|
293 | 293 | |
294 | 294 | OSXBluetooth::qt_test_iobluetooth_runloop(); |
295 | 295 | |
296 | | if (d_ptr->listener != NULL) { |
| 296 | if (d_ptr->listener) { |
297 | 297 | qCWarning(QT_BT_OSX) << "already in listen mode, close server first"; |
298 | 298 | return false; |
299 | 299 | } |
diff -ur /tmp/qtconnectivity-opensource-src-5.9.9/src/bluetooth/qbluetoothserviceinfo_osx.mm /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt59/qt59-qtconnectivity/work/qtconnectivity-opensource-src-5.9.9/src/bluetooth/qbluetoothserviceinfo_osx.mm
old
|
new
|
|
172 | 172 | if (!registered) |
173 | 173 | return false; |
174 | 174 | |
175 | | Q_ASSERT_X(serviceRecord != NULL, Q_FUNC_INFO, "service registered, but serviceRecord is nil"); |
| 175 | Q_ASSERT_X(serviceRecord, Q_FUNC_INFO, "service registered, but serviceRecord is nil"); |
176 | 176 | |
177 | 177 | [serviceRecord removeServiceRecord]; |
178 | 178 | |
diff -ur /tmp/qtconnectivity-opensource-src-5.9.9/src/bluetooth/qbluetoothsocket_osx.mm /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt59/qt59-qtconnectivity/work/qtconnectivity-opensource-src-5.9.9/src/bluetooth/qbluetoothsocket_osx.mm
old
|
new
|
|
103 | 103 | |
104 | 104 | if (socketType == QBluetoothServiceInfo::RfcommProtocol) { |
105 | 105 | rfcommChannel.reset([[ObjCRFCOMMChannel alloc] initWithDelegate:this]); |
106 | | if (rfcommChannel != NULL) |
| 106 | if (rfcommChannel) |
107 | 107 | status = [rfcommChannel connectAsyncToDevice:address withChannelID:port]; |
108 | 108 | else |
109 | 109 | status = kIOReturnNoMemory; |
110 | 110 | } else if (socketType == QBluetoothServiceInfo::L2capProtocol) { |
111 | 111 | l2capChannel.reset([[ObjCL2CAPChannel alloc] initWithDelegate:this]); |
112 | | if (l2capChannel != NULL) |
| 112 | if (l2capChannel) |
113 | 113 | status = [l2capChannel connectAsyncToDevice:address withPSM:port]; |
114 | 114 | else |
115 | 115 | status = kIOReturnNoMemory; |
… |
… |
|
183 | 183 | |
184 | 184 | NSString *nsName = nil; |
185 | 185 | if (socketType == QBluetoothServiceInfo::RfcommProtocol) { |
186 | | if (rfcommChannel != NULL) |
| 186 | if (rfcommChannel) |
187 | 187 | nsName = [rfcommChannel peerName]; |
188 | 188 | } else if (socketType == QBluetoothServiceInfo::L2capProtocol) { |
189 | | if (l2capChannel != NULL) |
| 189 | if (l2capChannel) |
190 | 190 | nsName = [l2capChannel peerName]; |
191 | 191 | } |
192 | 192 | |
… |
… |
|
200 | 200 | { |
201 | 201 | BluetoothDeviceAddress addr = {}; |
202 | 202 | if (socketType == QBluetoothServiceInfo::RfcommProtocol) { |
203 | | if (rfcommChannel != NULL) |
| 203 | if (rfcommChannel) |
204 | 204 | addr = [rfcommChannel peerAddress]; |
205 | 205 | } else if (socketType == QBluetoothServiceInfo::L2capProtocol) { |
206 | | if (l2capChannel != NULL) |
| 206 | if (l2capChannel) |
207 | 207 | addr = [l2capChannel peerAddress]; |
208 | 208 | } |
209 | 209 | |
… |
… |
|
213 | 213 | quint16 QBluetoothSocketPrivate::peerPort() const |
214 | 214 | { |
215 | 215 | if (socketType == QBluetoothServiceInfo::RfcommProtocol) { |
216 | | if (rfcommChannel != NULL) |
| 216 | if (rfcommChannel) |
217 | 217 | return [rfcommChannel getChannelID]; |
218 | 218 | } else if (socketType == QBluetoothServiceInfo::L2capProtocol) { |
219 | | if (l2capChannel != NULL) |
| 219 | if (l2capChannel) |
220 | 220 | return [l2capChannel getPSM]; |
221 | 221 | } |
222 | 222 | |
… |
… |
|
233 | 233 | Q_ASSERT_X(socketType == QBluetoothServiceInfo::L2capProtocol |
234 | 234 | || socketType == QBluetoothServiceInfo::RfcommProtocol, |
235 | 235 | Q_FUNC_INFO, "invalid socket type"); |
236 | | Q_ASSERT_X(l2capChannel != NULL || rfcommChannel != NULL, Q_FUNC_INFO, |
| 236 | Q_ASSERT_X(l2capChannel || rfcommChannel, Q_FUNC_INFO, |
237 | 237 | "invalid socket (no open channel)"); |
238 | 238 | Q_ASSERT_X(q_ptr, Q_FUNC_INFO, "invalid q_ptr (null)"); |
239 | 239 | |
… |
… |
|
277 | 277 | |
278 | 278 | openMode = QIODevice::ReadWrite; |
279 | 279 | rfcommChannel.reset([[ObjCRFCOMMChannel alloc] initWithDelegate:this channel:channel]); |
280 | | if (rfcommChannel != NULL) {// We do not handle errors, up to an external user. |
| 280 | if (rfcommChannel) {// We do not handle errors, up to an external user. |
281 | 281 | q_ptr->setOpenMode(QIODevice::ReadWrite); |
282 | 282 | state = QBluetoothSocket::ConnectedState; |
283 | 283 | socketType = QBluetoothServiceInfo::RfcommProtocol; |
284 | 284 | } |
285 | 285 | |
286 | | return rfcommChannel != NULL; |
| 286 | return rfcommChannel; |
287 | 287 | } |
288 | 288 | |
289 | 289 | bool QBluetoothSocketPrivate::setChannel(IOBluetoothL2CAPChannel *channel) |
… |
… |
|
301 | 301 | |
302 | 302 | openMode = QIODevice::ReadWrite; |
303 | 303 | l2capChannel.reset([[ObjCL2CAPChannel alloc] initWithDelegate:this channel:channel]); |
304 | | if (l2capChannel != NULL) {// We do not handle errors, up to an external user. |
| 304 | if (l2capChannel) {// We do not handle errors, up to an external user. |
305 | 305 | q_ptr->setOpenMode(QIODevice::ReadWrite); |
306 | 306 | state = QBluetoothSocket::ConnectedState; |
307 | 307 | socketType = QBluetoothServiceInfo::L2capProtocol; |
308 | 308 | } |
309 | 309 | |
310 | | return l2capChannel != NULL; |
| 310 | return l2capChannel; |
311 | 311 | } |
312 | 312 | |
313 | 313 | |
diff -ur /tmp/qtconnectivity-opensource-src-5.9.9/src/bluetooth/qbluetoothtransferreply_osx.mm /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt59/qt59-qtconnectivity/work/qtconnectivity-opensource-src-5.9.9/src/bluetooth/qbluetoothtransferreply_osx.mm
old
|
new
|
|
136 | 136 | // The OBEX session will be closed then. If |
137 | 137 | // somehow IOBluetooth/OBEX still has a reference to our |
138 | 138 | // session, it will not call any of delegate's callbacks. |
139 | | if (session != NULL) |
| 139 | if (session) |
140 | 140 | [session closeSession]; |
141 | 141 | } |
142 | 142 | |
143 | 143 | bool QBluetoothTransferReplyOSXPrivate::isActive() const |
144 | 144 | { |
145 | | return agent || (session != NULL && [session hasActiveRequest]); |
| 145 | return agent || (session && [session hasActiveRequest]); |
146 | 146 | } |
147 | 147 | |
148 | 148 | bool QBluetoothTransferReplyOSXPrivate::startOPP(const QBluetoothAddress &device) |
… |
… |
|
218 | 218 | void QBluetoothTransferReplyOSXPrivate::sendPut() |
219 | 219 | { |
220 | 220 | Q_ASSERT_X(inputStream, Q_FUNC_INFO, "invalid input stream (null)"); |
221 | | Q_ASSERT_X(session != NULL, Q_FUNC_INFO, "invalid OBEX session (nil)"); |
| 221 | Q_ASSERT_X(session, Q_FUNC_INFO, "invalid OBEX session (nil)"); |
222 | 222 | Q_ASSERT_X([session isConnected], Q_FUNC_INFO, "not connected"); |
223 | 223 | Q_ASSERT_X(![session hasActiveRequest], Q_FUNC_INFO, |
224 | 224 | "session already has an active request"); |
… |
… |
|
268 | 268 | Q_UNUSED(errorCode) |
269 | 269 | Q_UNUSED(response) |
270 | 270 | |
271 | | if (session != NULL) { |
| 271 | if (session) { |
272 | 272 | setReplyError(QBluetoothTransferReply::SessionError, |
273 | 273 | QCoreApplication::translate(TRANSFER_REPLY, TR_CONNECT_FAILED)); |
274 | 274 | } else { |
diff -ur /tmp/qtconnectivity-opensource-src-5.9.9/src/bluetooth/qlowenergycontroller_osx.mm /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt59/qt59-qtconnectivity/work/qtconnectivity-opensource-src-5.9.9/src/bluetooth/qlowenergycontroller_osx.mm
old
|
new
|
|
200 | 200 | #ifdef Q_OS_TVOS |
201 | 201 | return centralManager; |
202 | 202 | #else |
203 | | return centralManager != NULL || peripheralManager != NULL; |
| 203 | return centralManager || peripheralManager; |
204 | 204 | #endif |
205 | 205 | } |
206 | 206 | |