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:
@@ -14,8 +14,9 @@
|
||||
|
||||
#include "test.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace libcamera;
|
||||
using namespace std;
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
class TimeoutHandler : public Object
|
||||
{
|
||||
@@ -24,13 +25,13 @@ public:
|
||||
: timer_(this), timeout_(false)
|
||||
{
|
||||
timer_.timeout.connect(this, &TimeoutHandler::timeoutHandler);
|
||||
timer_.start(100);
|
||||
timer_.start(100ms);
|
||||
}
|
||||
|
||||
void restart()
|
||||
{
|
||||
timeout_ = false;
|
||||
timer_.start(100);
|
||||
timer_.start(100ms);
|
||||
}
|
||||
|
||||
bool timeout() const
|
||||
|
||||
Reference in New Issue
Block a user