Ticket #60889: qt59-qtconnectivity-fix.diff

File qt59-qtconnectivity-fix.diff, 14.4 KB (added by DanielO (Daniel O'Connor), 4 years ago)

Patch to fix build

  • qtconnectivity-opensource-src-5.9.9/src/bluetooth/osx/osxbtledeviceinquiry.mm

    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  
    139139
    140140- (void)dealloc
    141141{
    142     if (manager != NULL) {
     142    if (manager) {
    143143        [manager setDelegate:nil];
    144144        if (internalState == InquiryActive)
    145145            [manager stopScan];
  • qtconnectivity-opensource-src-5.9.9/src/bluetooth/osx/osxbtperipheralmanager.mm

    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  
    313313- (void)startAdvertising
    314314{
    315315    state = PeripheralState::waitingForPowerOn;
    316     if (manager != NULL)
     316    if (manager)
    317317        [manager setDelegate:nil];
    318318    manager.reset([[CBPeripheralManager alloc] initWithDelegate:self
    319319                   queue:OSXBluetooth::qt_LE_queue()]);
     
    378378
    379379- (void) addServicesToPeripheral
    380380{
    381     Q_ASSERT(manager != NULL);
     381    Q_ASSERT(manager);
    382382
    383383    if (nextServiceToAdd < services.size())
    384384        [manager addService:services[nextServiceToAdd++]];
  • qtconnectivity-opensource-src-5.9.9/src/bluetooth/qbluetoothdevicediscoveryagent_osx.mm

    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  
    181181
    182182QBluetoothDeviceDiscoveryAgentPrivate::~QBluetoothDeviceDiscoveryAgentPrivate()
    183183{
    184     if (inquiryLE != NULL && agentState != NonActive) {
     184    if (inquiryLE && agentState != NonActive) {
    185185        // We want the LE scan to stop as soon as possible.
    186186        if (dispatch_queue_t leQueue = OSXBluetooth::qt_LE_queue()) {
    187187            // Local variable to be retained ...
     
    195195
    196196bool QBluetoothDeviceDiscoveryAgentPrivate::isValid() const
    197197{
    198     return hostController != NULL && [hostController powerState] == kBluetoothHCIPowerStateON;
     198    return hostController && [hostController powerState] == kBluetoothHCIPowerStateON;
    199199}
    200200
    201201bool QBluetoothDeviceDiscoveryAgentPrivate::isActive() const
     
    292292
    293293    // Check queue and create scanner:
    294294    inquiryLE.reset([[LEDeviceInquiryObjC alloc] initWithNotifier:notifier.data()]);
    295     if (inquiryLE != NULL)
     295    if (inquiryLE)
    296296        notifier.take(); // Whatever happens next, inquiryLE is already the owner ...
    297297
    298298    dispatch_queue_t leQueue(qt_LE_queue());
  • qtconnectivity-opensource-src-5.9.9/src/bluetooth/qbluetoothlocaldevice_osx.mm

    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  
    149149
    150150bool QBluetoothLocalDevicePrivate::isValid() const
    151151{
    152     return hostController != NULL;
     152    return hostController;
    153153}
    154154
    155155void QBluetoothLocalDevicePrivate::requestPairing(const QBluetoothAddress &address, Pairing pairing)
  • qtconnectivity-opensource-src-5.9.9/src/bluetooth/qbluetoothserver_osx.mm

    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  
    142142
    143143void QBluetoothServerPrivate::openNotify(IOBluetoothRFCOMMChannel *channel)
    144144{
    145     Q_ASSERT_X(listener != NULL, Q_FUNC_INFO, "invalid listener (nil)");
     145    Q_ASSERT_X(listener, Q_FUNC_INFO, "invalid listener (nil)");
    146146    Q_ASSERT_X(channel, Q_FUNC_INFO, "invalid channel (nil)");
    147147    Q_ASSERT_X(q_ptr, Q_FUNC_INFO, "invalid q_ptr (null)");
    148148
     
    154154
    155155void QBluetoothServerPrivate::openNotify(IOBluetoothL2CAPChannel *channel)
    156156{
    157     Q_ASSERT_X(listener != NULL, Q_FUNC_INFO, "invalid listener (nil)");
     157    Q_ASSERT_X(listener, Q_FUNC_INFO, "invalid listener (nil)");
    158158    Q_ASSERT_X(channel, Q_FUNC_INFO, "invalid channel (nil)");
    159159    Q_ASSERT_X(q_ptr, Q_FUNC_INFO, "invalid q_ptr (null)");
    160160
     
    293293
    294294    OSXBluetooth::qt_test_iobluetooth_runloop();
    295295
    296     if (d_ptr->listener != NULL) {
     296    if (d_ptr->listener) {
    297297        qCWarning(QT_BT_OSX) << "already in listen mode, close server first";
    298298        return false;
    299299    }
  • qtconnectivity-opensource-src-5.9.9/src/bluetooth/qbluetoothserviceinfo_osx.mm

    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  
    172172    if (!registered)
    173173        return false;
    174174
    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");
    176176
    177177    [serviceRecord removeServiceRecord];
    178178
  • qtconnectivity-opensource-src-5.9.9/src/bluetooth/qbluetoothsocket_osx.mm

    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  
    103103
    104104    if (socketType == QBluetoothServiceInfo::RfcommProtocol) {
    105105        rfcommChannel.reset([[ObjCRFCOMMChannel alloc] initWithDelegate:this]);
    106         if (rfcommChannel != NULL)
     106        if (rfcommChannel)
    107107            status = [rfcommChannel connectAsyncToDevice:address withChannelID:port];
    108108        else
    109109            status = kIOReturnNoMemory;
    110110    } else if (socketType == QBluetoothServiceInfo::L2capProtocol) {
    111111        l2capChannel.reset([[ObjCL2CAPChannel alloc] initWithDelegate:this]);
    112         if (l2capChannel != NULL)
     112        if (l2capChannel)
    113113            status = [l2capChannel connectAsyncToDevice:address withPSM:port];
    114114        else
    115115            status = kIOReturnNoMemory;
     
    183183
    184184    NSString *nsName = nil;
    185185    if (socketType == QBluetoothServiceInfo::RfcommProtocol) {
    186         if (rfcommChannel != NULL)
     186        if (rfcommChannel)
    187187            nsName = [rfcommChannel peerName];
    188188    } else if (socketType == QBluetoothServiceInfo::L2capProtocol) {
    189         if (l2capChannel != NULL)
     189        if (l2capChannel)
    190190            nsName = [l2capChannel peerName];
    191191    }
    192192
     
    200200{
    201201    BluetoothDeviceAddress addr = {};
    202202    if (socketType == QBluetoothServiceInfo::RfcommProtocol) {
    203         if (rfcommChannel != NULL)
     203        if (rfcommChannel)
    204204            addr = [rfcommChannel peerAddress];
    205205    } else if (socketType == QBluetoothServiceInfo::L2capProtocol) {
    206         if (l2capChannel != NULL)
     206        if (l2capChannel)
    207207            addr = [l2capChannel peerAddress];
    208208    }
    209209
     
    213213quint16 QBluetoothSocketPrivate::peerPort() const
    214214{
    215215    if (socketType == QBluetoothServiceInfo::RfcommProtocol) {
    216         if (rfcommChannel != NULL)
     216        if (rfcommChannel)
    217217            return [rfcommChannel getChannelID];
    218218    } else if (socketType == QBluetoothServiceInfo::L2capProtocol) {
    219         if (l2capChannel != NULL)
     219        if (l2capChannel)
    220220            return [l2capChannel getPSM];
    221221    }
    222222
     
    233233    Q_ASSERT_X(socketType == QBluetoothServiceInfo::L2capProtocol
    234234               || socketType == QBluetoothServiceInfo::RfcommProtocol,
    235235               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,
    237237               "invalid socket (no open channel)");
    238238    Q_ASSERT_X(q_ptr, Q_FUNC_INFO, "invalid q_ptr (null)");
    239239
     
    277277
    278278    openMode = QIODevice::ReadWrite;
    279279    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.
    281281        q_ptr->setOpenMode(QIODevice::ReadWrite);
    282282        state = QBluetoothSocket::ConnectedState;
    283283        socketType = QBluetoothServiceInfo::RfcommProtocol;
    284284    }
    285285
    286     return rfcommChannel != NULL;
     286    return rfcommChannel;
    287287}
    288288
    289289bool QBluetoothSocketPrivate::setChannel(IOBluetoothL2CAPChannel *channel)
     
    301301
    302302    openMode = QIODevice::ReadWrite;
    303303    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.
    305305        q_ptr->setOpenMode(QIODevice::ReadWrite);
    306306        state = QBluetoothSocket::ConnectedState;
    307307        socketType = QBluetoothServiceInfo::L2capProtocol;
    308308    }
    309309
    310     return l2capChannel != NULL;
     310    return l2capChannel;
    311311}
    312312
    313313
  • qtconnectivity-opensource-src-5.9.9/src/bluetooth/qbluetoothtransferreply_osx.mm

    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  
    136136    // The OBEX session will be closed then. If
    137137    // somehow IOBluetooth/OBEX still has a reference to our
    138138    // session, it will not call any of delegate's callbacks.
    139     if (session != NULL)
     139    if (session)
    140140        [session closeSession];
    141141}
    142142
    143143bool QBluetoothTransferReplyOSXPrivate::isActive() const
    144144{
    145     return agent || (session != NULL && [session hasActiveRequest]);
     145    return agent || (session && [session hasActiveRequest]);
    146146}
    147147
    148148bool QBluetoothTransferReplyOSXPrivate::startOPP(const QBluetoothAddress &device)
     
    218218void QBluetoothTransferReplyOSXPrivate::sendPut()
    219219{
    220220    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)");
    222222    Q_ASSERT_X([session isConnected], Q_FUNC_INFO, "not connected");
    223223    Q_ASSERT_X(![session hasActiveRequest], Q_FUNC_INFO,
    224224               "session already has an active request");
     
    268268    Q_UNUSED(errorCode)
    269269    Q_UNUSED(response)
    270270
    271     if (session != NULL) {
     271    if (session) {
    272272        setReplyError(QBluetoothTransferReply::SessionError,
    273273                      QCoreApplication::translate(TRANSFER_REPLY, TR_CONNECT_FAILED));
    274274    } else {
  • qtconnectivity-opensource-src-5.9.9/src/bluetooth/qlowenergycontroller_osx.mm

    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  
    200200#ifdef Q_OS_TVOS
    201201    return centralManager;
    202202#else
    203     return centralManager != NULL || peripheralManager != NULL;
     203    return centralManager || peripheralManager;
    204204#endif
    205205}
    206206