Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. QtConcurrent - how do I verify - "all the ducks in the row "? revised

QtConcurrent - how do I verify - "all the ducks in the row "? revised

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionc++
21 Posts 3 Posters 8 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Lost User

    Here is "semifinal " version of WORKING code

       //int status = hci\_inquiry(adapter\_id, inquiry\_length,
        //max\_devices, NULL, &inq\_inf,flags );
        int status = 10;
        qDebug() << "Status " << QString::number(status);
        time->start();
        status =       hci\_inquiry(
                    dev\_id,
                    len,
                    max\_rsp,
                    NULL,
                    &ii,
                    flags);
        time->start();
        // run QtConcurent
        QFuture future = QtConcurrent::run(
                    std::bind(
                        hci\_inquiry,
                        dev\_id,
                        len,
                        max\_rsp,
                        lap,     //NULL,
                        &ii,
                        flags)
                    );
       //TOK 
       future.waitForFinished();  // test only need QTFutureWatcher
       qDebug() <<"hci\_inquiry elapsed time  " <elapsed());
       qDebug() <<"hci\_inquiry result  " <
    

    I STILL do not understand why "plain function : usage " works with "lap" as NULL and QtConcurent usage DOES NOT. As I said before - I am not so sure I have only one version of hci_inquiry....

    The be truthful - I need to get back to source code and try to build my own description for the hci_inquiry code.

    It has been educational so far....

    PS by semifinal - I need to "move" the QT version to its own object / library.

    K Offline
    K Offline
    k5054
    wrote on last edited by
    #21

    Try using nullptr instead of NULL. NULL is defined as a macro, often the equivalent of #define NULL ((void *)0). That was fine for C, but C++ has stricter rules about converting to/from NULL pointers, so you should use nullptr, particularly when you want to pass a null pointer to a function.

    Keep Calm and Carry On

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups