QtConcurrent - how do I verify - "all the ducks in the row "? revised
-
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.
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