From 25f77289d75d1a502ab0a5e6e3dc5f777475e348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Thu, 5 Oct 2023 11:46:23 +0200 Subject: [PATCH] polsih bracket --- src/simplified/xf/port/idf-qt/eventqueue.cpp | 23 +++++++------------- test-bench/test1/src/app/statemachine01.cpp | 15 +++++-------- test-bench/test1/src/app/testfactory01.cpp | 15 +++++-------- 3 files changed, 18 insertions(+), 35 deletions(-) diff --git a/src/simplified/xf/port/idf-qt/eventqueue.cpp b/src/simplified/xf/port/idf-qt/eventqueue.cpp index 2181b72..a59a8f7 100644 --- a/src/simplified/xf/port/idf-qt/eventqueue.cpp +++ b/src/simplified/xf/port/idf-qt/eventqueue.cpp @@ -7,23 +7,19 @@ #include #include "eventqueue.h" -XFEventQueue::XFEventQueue() -{ +XFEventQueue::XFEventQueue() { } -XFEventQueue::~XFEventQueue() -{ +XFEventQueue::~XFEventQueue() { newEvents_.wakeAll(); } -bool XFEventQueue::empty() const -{ +bool XFEventQueue::empty() const { return queue_.isEmpty(); } -bool XFEventQueue::push(const XFEvent * pEvent, bool fromISR) -{ - (void)fromISR; +bool XFEventQueue::push(const XFEvent * pEvent, bool fromISR) { + (void)fromISR; // Just for don't have the warning QMutexLocker locker(&mutex_); queue_.enqueue(pEvent); // Tell waiting thread(s) there is again an event present @@ -31,19 +27,16 @@ bool XFEventQueue::push(const XFEvent * pEvent, bool fromISR) return true; } -const XFEvent * XFEventQueue::front() -{ +const XFEvent * XFEventQueue::front() { return queue_.front(); } -void XFEventQueue::pop() -{ +void XFEventQueue::pop() { QMutexLocker locker(&mutex_); queue_.dequeue(); } -bool XFEventQueue::pend() -{ +bool XFEventQueue::pend() { QMutexLocker locker(&mutex_); // Wait for new events. Mutex needs to be in lock-state // prior to call wait()! diff --git a/test-bench/test1/src/app/statemachine01.cpp b/test-bench/test1/src/app/statemachine01.cpp index 56b3060..82801ce 100644 --- a/test-bench/test1/src/app/statemachine01.cpp +++ b/test-bench/test1/src/app/statemachine01.cpp @@ -10,26 +10,21 @@ */ StateMachine01::StateMachine01(int repeatInterval, string text) : repeatInterval_(repeatInterval), - text_(text) -{ + text_(text) { currentState_ = STATE_INITIAL; } -StateMachine01::~StateMachine01() -{ +StateMachine01::~StateMachine01() { } -XFEventStatus StateMachine01::processEvent() -{ +XFEventStatus StateMachine01::processEvent() { eEventStatus eventStatus = XFEventStatus::Unknown; - switch (currentState_) - { + switch (currentState_) { case STATE_INITIAL: { - if (getCurrentEvent()->getEventType() == XFEvent::Initial) - { + if (getCurrentEvent()->getEventType() == XFEvent::Initial) { GEN(XFDefaultTransition()); currentState_ = STATE_SAY_HELLO; diff --git a/test-bench/test1/src/app/testfactory01.cpp b/test-bench/test1/src/app/testfactory01.cpp index 43e389c..21d0085 100644 --- a/test-bench/test1/src/app/testfactory01.cpp +++ b/test-bench/test1/src/app/testfactory01.cpp @@ -2,31 +2,26 @@ #include "trace/trace.h" #include "testfactory01.h" -void Factory_initialize() -{ +void Factory_initialize() { TestFactory01::initialize(); } -void Factory_build() -{ +void Factory_build() { TestFactory01::build(); } StateMachine01 TestFactory01::task01_(1000, "Say Hello"); StateMachine01 TestFactory01::task02_(500, "Echo"); -TestFactory01::TestFactory01() -{ +TestFactory01::TestFactory01() { } // static -void TestFactory01::initialize() -{ +void TestFactory01::initialize() { } // static -void TestFactory01::build() -{ +void TestFactory01::build() { Trace::out("Starting test1..."); Trace::out("---------------------");