From 54398c1583f18ef9daf1a9227691b14c3b7f4212 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 22 Mar 2022 22:32:55 +0200 Subject: 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 Reviewed-by: Kieran Bingham Reviewed-by: Umang Jain --- test/camera/buffer_import.cpp | 3 ++- test/camera/camera_reconfigure.cpp | 3 ++- test/camera/capture.cpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'test/camera') diff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp index c504ea09..92884004 100644 --- a/test/camera/buffer_import.cpp +++ b/test/camera/buffer_import.cpp @@ -25,6 +25,7 @@ #include "test.h" using namespace libcamera; +using namespace std::chrono_literals; namespace { @@ -135,7 +136,7 @@ protected: EventDispatcher *dispatcher = Thread::current()->eventDispatcher(); Timer timer; - timer.start(1000); + timer.start(1000ms); while (timer.isRunning()) dispatcher->processEvents(); diff --git a/test/camera/camera_reconfigure.cpp b/test/camera/camera_reconfigure.cpp index 0fd8ab70..f6076baa 100644 --- a/test/camera/camera_reconfigure.cpp +++ b/test/camera/camera_reconfigure.cpp @@ -23,6 +23,7 @@ using namespace libcamera; using namespace std; +using namespace std::chrono_literals; namespace { @@ -117,7 +118,7 @@ private: EventDispatcher *dispatcher = Thread::current()->eventDispatcher(); Timer timer; - timer.start(100); + timer.start(100ms); while (timer.isRunning()) dispatcher->processEvents(); diff --git a/test/camera/capture.cpp b/test/camera/capture.cpp index f3824f95..de824083 100644 --- a/test/camera/capture.cpp +++ b/test/camera/capture.cpp @@ -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(); -- cgit v1.2.1