libcamera: base: timer: Drop start() overload with int argument

The start(unsigned int msec) overload is error-prone, as the argument
unit can easily be mistaken in callers. Drop it and update all callers
to use the start(std::chrono::milliseconds) overload instead.

The callers now need to use std::chrono_literals. The using statement
could be added to timer.h for convenience, but "using" is discouraged in
header files to avoid namespace pollution. Update the callers instead,
and while at it, sort the "using" statements alphabetically in tests.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
This commit is contained in:
Laurent Pinchart 2022-03-22 22:32:55 +02:00
parent 074fa98ac4
commit 54398c1583
19 changed files with 67 additions and 61 deletions

View file

@ -18,6 +18,7 @@
using namespace libcamera;
using namespace std;
using namespace std::chrono_literals;
namespace {
@ -137,7 +138,7 @@ protected:
EventDispatcher *dispatcher = Thread::current()->eventDispatcher();
Timer timer;
timer.start(1000);
timer.start(1000ms);
while (timer.isRunning())
dispatcher->processEvents();