From f92951c7f1712338ed050d551d31c048c293eca2 Mon Sep 17 00:00:00 2001 From: Cervenka Dusan Date: Wed, 18 Oct 2023 14:19:01 +0200 Subject: [PATCH] Change requested by Michal P. and NXP company -- includes will not be sorted at all (not even in groups) -- Constructutor and inheritance will use AfterColon format style Signed-off-by: Cervenka Dusan --- .clang-format | 6 +- .../infra/erpc_arbitrated_client_manager.hpp | 6 +- erpc_c/infra/erpc_basic_codec.hpp | 5 +- erpc_c/infra/erpc_client_manager.h | 16 ++--- erpc_c/infra/erpc_codec.hpp | 7 +- erpc_c/infra/erpc_crc16.cpp | 10 +-- erpc_c/infra/erpc_framed_transport.cpp | 9 ++- erpc_c/infra/erpc_message_buffer.hpp | 26 ++----- erpc_c/infra/erpc_message_loggers.hpp | 7 +- erpc_c/infra/erpc_pre_post_action.h | 4 +- erpc_c/infra/erpc_server.hpp | 12 +--- erpc_c/infra/erpc_simple_server.hpp | 5 +- erpc_c/infra/erpc_transport_arbitrator.cpp | 16 ++--- erpc_c/port/erpc_threading.h | 6 +- erpc_c/port/erpc_threading_freertos.cpp | 27 ++----- erpc_c/port/erpc_threading_mbed.cpp | 24 ++----- erpc_c/port/erpc_threading_pthreads.cpp | 24 ++----- erpc_c/port/erpc_threading_threadx.cpp | 27 ++----- erpc_c/port/erpc_threading_win32.cpp | 28 ++------ erpc_c/port/erpc_threading_zephyr.cpp | 27 ++----- erpc_c/setup/erpc_setup_mbf_static.cpp | 3 +- .../transports/erpc_dspi_master_transport.cpp | 6 +- .../transports/erpc_dspi_slave_transport.cpp | 10 ++- .../transports/erpc_i2c_slave_transport.cpp | 10 ++- .../erpc_inter_thread_buffer_transport.hpp | 9 +-- erpc_c/transports/erpc_mu_transport.cpp | 21 ++---- .../transports/erpc_rpmsg_linux_transport.cpp | 6 +- .../erpc_rpmsg_lite_base_transport.hpp | 3 +- .../erpc_rpmsg_lite_rtos_transport.cpp | 11 +-- .../transports/erpc_rpmsg_lite_transport.cpp | 8 +-- .../erpc_rpmsg_tty_rtos_transport.cpp | 8 +-- erpc_c/transports/erpc_serial_transport.cpp | 6 +- .../transports/erpc_spi_master_transport.cpp | 6 +- .../transports/erpc_spi_slave_transport.cpp | 10 ++- .../erpc_spidev_master_transport.cpp | 6 +- erpc_c/transports/erpc_tcp_transport.cpp | 18 ++--- .../transports/erpc_uart_cmsis_transport.cpp | 8 +-- erpc_c/transports/erpc_usb_cdc_transport.cpp | 14 ++-- erpcgen/src/AstNode.cpp | 4 +- erpcgen/src/AstNode.hpp | 18 +---- erpcgen/src/AstWalker.hpp | 5 +- erpcgen/src/CGenerator.cpp | 3 +- erpcgen/src/ErpcLexer.cpp | 6 +- erpcgen/src/ErpcLexer.hpp | 10 +-- erpcgen/src/Generator.cpp | 7 +- erpcgen/src/InterfaceDefinition.cpp | 11 +-- erpcgen/src/Logging.hpp | 19 ++--- erpcgen/src/ParseErrors.hpp | 50 ++++--------- erpcgen/src/PythonGenerator.cpp | 6 +- erpcgen/src/SymbolScanner.hpp | 23 ++---- erpcgen/src/Token.cpp | 5 +- erpcgen/src/Token.hpp | 29 ++------ erpcgen/src/Value.hpp | 71 ++++--------------- erpcgen/src/erpcgen.cpp | 12 +--- erpcgen/src/options.cpp | 36 +++------- erpcgen/src/options.hpp | 14 +--- erpcgen/src/smart_ptr.hpp | 16 +---- erpcgen/src/types/AliasType.hpp | 10 +-- erpcgen/src/types/Annotation.hpp | 21 ++---- erpcgen/src/types/ArrayType.hpp | 6 +- erpcgen/src/types/BuiltinType.hpp | 5 +- erpcgen/src/types/ConstType.hpp | 6 +- erpcgen/src/types/DataType.hpp | 18 +---- erpcgen/src/types/EnumMember.hpp | 14 +--- erpcgen/src/types/EnumType.hpp | 10 +-- erpcgen/src/types/Function.hpp | 28 ++------ erpcgen/src/types/FunctionType.hpp | 11 +-- erpcgen/src/types/Group.hpp | 5 +- erpcgen/src/types/Interface.hpp | 7 +- erpcgen/src/types/ListType.hpp | 6 +- erpcgen/src/types/Program.hpp | 5 +- erpcgen/src/types/StructMember.hpp | 20 ++---- erpcgen/src/types/StructType.hpp | 10 +-- erpcgen/src/types/Symbol.hpp | 28 ++------ erpcgen/src/types/SymbolScope.hpp | 7 +- erpcgen/src/types/Type.cpp | 6 +- erpcgen/src/types/UnionCase.hpp | 21 ++---- erpcgen/src/types/UnionType.hpp | 14 ++-- erpcgen/src/types/VoidType.hpp | 5 +- erpcsniffer/src/Sniffer.hpp | 10 ++- erpcsniffer/src/erpcsniffer.cpp | 15 +--- 81 files changed, 272 insertions(+), 816 deletions(-) diff --git a/.clang-format b/.clang-format index 23f32636..6cec9388 100644 --- a/.clang-format +++ b/.clang-format @@ -37,8 +37,8 @@ AlignOperands: Align AllowShortCaseLabelsOnASingleLine: false AlwaysBreakAfterReturnType: None AlwaysBreakTemplateDeclarations: Yes -BreakInheritanceList: BeforeComma -BreakConstructorInitializers: BeforeComma +BreakInheritanceList: AfterColon +BreakConstructorInitializers: AfterColon CompactNamespaces: false ConstructorInitializerAllOnOneLineOrOnePerLine: false ConstructorInitializerIndentWidth: 0 @@ -46,7 +46,7 @@ Cpp11BracedListStyle: false FixNamespaceComments: true NamespaceIndentation: None PointerAlignment: Right -SortIncludes: CaseSensitive +SortIncludes: Never SortUsingDeclarations: Lexicographic SpacesInAngles: Never SpaceAfterCStyleCast: false diff --git a/erpc_c/infra/erpc_arbitrated_client_manager.hpp b/erpc_c/infra/erpc_arbitrated_client_manager.hpp index fa2e45a1..dc271345 100644 --- a/erpc_c/infra/erpc_arbitrated_client_manager.hpp +++ b/erpc_c/infra/erpc_arbitrated_client_manager.hpp @@ -45,11 +45,7 @@ class ArbitratedClientManager : public ClientManager * * This function initializes object attributes. */ - ArbitratedClientManager(void) - : ClientManager() - , m_arbitrator(NULL) - { - } + ArbitratedClientManager(void) : ClientManager(), m_arbitrator(NULL) {} /*! * @brief Sets the transport arbitrator instance. diff --git a/erpc_c/infra/erpc_basic_codec.hpp b/erpc_c/infra/erpc_basic_codec.hpp index 581f6c7c..6ea923b4 100644 --- a/erpc_c/infra/erpc_basic_codec.hpp +++ b/erpc_c/infra/erpc_basic_codec.hpp @@ -43,10 +43,7 @@ class BasicCodec : public Codec public: static const uint32_t kBasicCodecVersion; /*!< Codec version. */ - BasicCodec(void) - : Codec() - { - } + BasicCodec(void) : Codec() {} //! @name Encoding //@{ diff --git a/erpc_c/infra/erpc_client_manager.h b/erpc_c/infra/erpc_client_manager.h index 1a1dd801..5a45a67b 100644 --- a/erpc_c/infra/erpc_client_manager.h +++ b/erpc_c/infra/erpc_client_manager.h @@ -59,13 +59,11 @@ class ClientManager : public ClientServerCommon * * This function initializes object attributes. */ - ClientManager(void) - : ClientServerCommon() - , m_sequence(0) - , m_errorHandler(NULL) + ClientManager(void) : + ClientServerCommon(), m_sequence(0), m_errorHandler(NULL) #if ERPC_NESTED_CALLS - , m_server(NULL) - , m_serverThreadId(NULL) + , + m_server(NULL), m_serverThreadId(NULL) #endif { } @@ -193,10 +191,8 @@ class RequestContext * @param[in] codec Set in inout codec. * @param[in] isOneway Set information if codec is only oneway or bidirectional. */ - RequestContext(uint32_t sequence, Codec *codec, bool argIsOneway) - : m_sequence(sequence) - , m_codec(codec) - , m_oneway(argIsOneway) + RequestContext(uint32_t sequence, Codec *codec, bool argIsOneway) : + m_sequence(sequence), m_codec(codec), m_oneway(argIsOneway) { } diff --git a/erpc_c/infra/erpc_codec.hpp b/erpc_c/infra/erpc_codec.hpp index 02ac7395..046c57ee 100644 --- a/erpc_c/infra/erpc_codec.hpp +++ b/erpc_c/infra/erpc_codec.hpp @@ -58,12 +58,7 @@ class Codec * * This function initializes object attributes. */ - Codec(void) - : m_buffer() - , m_cursor() - , m_status(kErpcStatus_Success) - { - } + Codec(void) : m_buffer(), m_cursor(), m_status(kErpcStatus_Success) {} /*! * @brief Codec destructor diff --git a/erpc_c/infra/erpc_crc16.cpp b/erpc_c/infra/erpc_crc16.cpp index 8408a12e..ebaf498b 100644 --- a/erpc_c/infra/erpc_crc16.cpp +++ b/erpc_c/infra/erpc_crc16.cpp @@ -15,15 +15,9 @@ using namespace erpc; // Code //////////////////////////////////////////////////////////////////////////////// -Crc16::Crc16(uint32_t crcStart) -: m_crcStart(crcStart) -{ -} +Crc16::Crc16(uint32_t crcStart) : m_crcStart(crcStart) {} -Crc16::Crc16(void) -: m_crcStart(0xEF4A) -{ -} +Crc16::Crc16(void) : m_crcStart(0xEF4A) {} Crc16::~Crc16(void) {} diff --git a/erpc_c/infra/erpc_framed_transport.cpp b/erpc_c/infra/erpc_framed_transport.cpp index a27dfb05..ab107936 100644 --- a/erpc_c/infra/erpc_framed_transport.cpp +++ b/erpc_c/infra/erpc_framed_transport.cpp @@ -22,12 +22,11 @@ using namespace erpc; // Code //////////////////////////////////////////////////////////////////////////////// -FramedTransport::FramedTransport(void) -: Transport() -, m_crcImpl(NULL) +FramedTransport::FramedTransport(void) : +Transport(), m_crcImpl(NULL) #if !ERPC_THREADS_IS(NONE) -, m_sendLock() -, m_receiveLock() +, +m_sendLock(), m_receiveLock() #endif { } diff --git a/erpc_c/infra/erpc_message_buffer.hpp b/erpc_c/infra/erpc_message_buffer.hpp index bfd67edd..6cebc4c0 100644 --- a/erpc_c/infra/erpc_message_buffer.hpp +++ b/erpc_c/infra/erpc_message_buffer.hpp @@ -42,12 +42,7 @@ class MessageBuffer * * This function initializes object attributes. */ - MessageBuffer(void) - : m_buf(NULL) - , m_len(0) - , m_used(0) - { - } + MessageBuffer(void) : m_buf(NULL), m_len(0), m_used(0) {} /*! * @brief Constructor. @@ -57,12 +52,7 @@ class MessageBuffer * @param[in] buffer Pointer to buffer. * @param[in] length Length of buffer. */ - MessageBuffer(uint8_t *buffer, uint16_t length) - : m_buf(buffer) - , m_len(length) - , m_used(0) - { - } + MessageBuffer(uint8_t *buffer, uint16_t length) : m_buf(buffer), m_len(length), m_used(0) {} /*! * @brief This function set new buffer and his length. @@ -194,11 +184,7 @@ class MessageBuffer * * This function initializes object attributes. */ - Cursor(void) - : m_buffer(NULL) - , m_pos(NULL) - { - } + Cursor(void) : m_buffer(NULL), m_pos(NULL) {} /*! * @brief Constructor. @@ -207,11 +193,7 @@ class MessageBuffer * * @param[in] buffer MessageBuffer for sending/receiving. */ - explicit Cursor(MessageBuffer *buffer) - : m_buffer(buffer) - , m_pos(buffer->get()) - { - } + explicit Cursor(MessageBuffer *buffer) : m_buffer(buffer), m_pos(buffer->get()) {} /*! * @brief Set message buffer. diff --git a/erpc_c/infra/erpc_message_loggers.hpp b/erpc_c/infra/erpc_message_loggers.hpp index a060d163..d7e885dc 100644 --- a/erpc_c/infra/erpc_message_loggers.hpp +++ b/erpc_c/infra/erpc_message_loggers.hpp @@ -34,9 +34,7 @@ class MessageLogger /*! * @brief MessageLogger constructor. */ - explicit MessageLogger(Transport *transport) - : m_next(NULL) - , m_transport(transport){}; + explicit MessageLogger(Transport *transport) : m_next(NULL), m_transport(transport){}; /*! * @brief MessageLogger destructor @@ -80,8 +78,7 @@ class MessageLoggers /*! * @brief Constructor. */ - MessageLoggers(void) - : m_logger(NULL){}; + MessageLoggers(void) : m_logger(NULL){}; /*! * @brief Transport destructor diff --git a/erpc_c/infra/erpc_pre_post_action.h b/erpc_c/infra/erpc_pre_post_action.h index f38a0be9..3f8574e1 100644 --- a/erpc_c/infra/erpc_pre_post_action.h +++ b/erpc_c/infra/erpc_pre_post_action.h @@ -42,9 +42,7 @@ class PrePostAction /*! * @brief PrePostAction constructor. */ - PrePostAction(void) - : m_preCB(NULL) - , m_postCB(NULL){}; + PrePostAction(void) : m_preCB(NULL), m_postCB(NULL){}; /*! * @brief This function sets "before eRPC call start" callback function. diff --git a/erpc_c/infra/erpc_server.hpp b/erpc_c/infra/erpc_server.hpp index ea0ea203..477b8f14 100644 --- a/erpc_c/infra/erpc_server.hpp +++ b/erpc_c/infra/erpc_server.hpp @@ -44,11 +44,7 @@ class Service * * This function initializes object attributes. */ - Service(uint32_t serviceId) - : m_serviceId(serviceId) - , m_next(NULL) - { - } + Service(uint32_t serviceId) : m_serviceId(serviceId), m_next(NULL) {} /*! * @brief Service destructor @@ -107,11 +103,7 @@ class Server : public ClientServerCommon * * This function initializes object attributes. */ - Server(void) - : ClientServerCommon() - , m_firstService(NULL) - { - } + Server(void) : ClientServerCommon(), m_firstService(NULL) {} /*! * @brief Server destructor diff --git a/erpc_c/infra/erpc_simple_server.hpp b/erpc_c/infra/erpc_simple_server.hpp index 21083348..40143aeb 100644 --- a/erpc_c/infra/erpc_simple_server.hpp +++ b/erpc_c/infra/erpc_simple_server.hpp @@ -37,10 +37,7 @@ class SimpleServer : public Server * * This function initializes object attributes. */ - SimpleServer(void) - : m_isServerOn(true) - { - } + SimpleServer(void) : m_isServerOn(true) {} /*! * @brief Run server in infinite loop. diff --git a/erpc_c/infra/erpc_transport_arbitrator.cpp b/erpc_c/infra/erpc_transport_arbitrator.cpp index beaca7ad..1552302d 100644 --- a/erpc_c/infra/erpc_transport_arbitrator.cpp +++ b/erpc_c/infra/erpc_transport_arbitrator.cpp @@ -28,13 +28,8 @@ using namespace erpc; ERPC_MANUALLY_CONSTRUCTED_ARRAY_STATIC(TransportArbitrator::PendingClientInfo, s_pendingClientInfoArray, ERPC_CLIENTS_THREADS_AMOUNT); -TransportArbitrator::TransportArbitrator(void) -: Transport() -, m_sharedTransport(NULL) -, m_codec(NULL) -, m_clientList(NULL) -, m_clientFreeList(NULL) -, m_clientListMutex() +TransportArbitrator::TransportArbitrator(void) : +Transport(), m_sharedTransport(NULL), m_codec(NULL), m_clientList(NULL), m_clientFreeList(NULL), m_clientListMutex() { } @@ -253,11 +248,8 @@ void TransportArbitrator::freeClientList(PendingClientInfo *list) } } -TransportArbitrator::PendingClientInfo::PendingClientInfo(void) -: m_request(NULL) -, m_sem(0) -, m_isValid(false) -, m_next(NULL) +TransportArbitrator::PendingClientInfo::PendingClientInfo(void) : +m_request(NULL), m_sem(0), m_isValid(false), m_next(NULL) { } diff --git a/erpc_c/port/erpc_threading.h b/erpc_c/port/erpc_threading.h index 1f3d66ad..3441b95c 100644 --- a/erpc_c/port/erpc_threading.h +++ b/erpc_c/port/erpc_threading.h @@ -349,11 +349,7 @@ class Mutex * * @param[in] mutex to lock. */ - Guard(Mutex &mutex) - : m_mutex(mutex) - { - (void)m_mutex.lock(); - } + Guard(Mutex &mutex) : m_mutex(mutex) { (void)m_mutex.lock(); } /*! * @brief Destructor. */ diff --git a/erpc_c/port/erpc_threading_freertos.cpp b/erpc_c/port/erpc_threading_freertos.cpp index faa76e39..e694596e 100644 --- a/erpc_c/port/erpc_threading_freertos.cpp +++ b/erpc_c/port/erpc_threading_freertos.cpp @@ -26,26 +26,15 @@ Thread *Thread::s_first = NULL; // Code //////////////////////////////////////////////////////////////////////////////// -Thread::Thread(const char *name) -: m_name(name) -, m_entry(0) -, m_arg(0) -, m_stackSize(0) -, m_priority(0) -, m_task(0) -, m_next(0) +Thread::Thread(const char *name) : +m_name(name), m_entry(0), m_arg(0), m_stackSize(0), m_priority(0), m_task(0), m_next(0) { } Thread::Thread(thread_entry_t entry, uint32_t priority, uint32_t stackSize, const char *name, - thread_stack_pointer stackPtr) -: m_name(name) -, m_entry(entry) -, m_arg(0) -, m_stackSize(stackSize) -, m_priority(priority) -, m_task(0) -, m_next(0) + thread_stack_pointer stackPtr) : +m_name(name), +m_entry(entry), m_arg(0), m_stackSize(stackSize), m_priority(priority), m_task(0), m_next(0) { } @@ -201,8 +190,7 @@ void Thread::threadEntryPointStub(void *arg) #endif // INCLUDE_vTaskDelete } -Mutex::Mutex(void) -: m_mutex(0) +Mutex::Mutex(void) : m_mutex(0) { #if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC m_mutex = xSemaphoreCreateRecursiveMutexStatic(&m_staticQueue); @@ -234,8 +222,7 @@ bool Mutex::unlock(void) return (pdTRUE == xSemaphoreGiveRecursive(m_mutex) ? true : false); } -Semaphore::Semaphore(int count) -: m_sem(0) +Semaphore::Semaphore(int count) : m_sem(0) { // Set max count to highest signed int. #if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC diff --git a/erpc_c/port/erpc_threading_mbed.cpp b/erpc_c/port/erpc_threading_mbed.cpp index 9f537a9a..ca59756c 100644 --- a/erpc_c/port/erpc_threading_mbed.cpp +++ b/erpc_c/port/erpc_threading_mbed.cpp @@ -28,26 +28,15 @@ Thread *Thread::s_first = NULL; // Code //////////////////////////////////////////////////////////////////////////////// -Thread::Thread(const char *name) -: m_name(name) -, m_entry(0) -, m_arg(0) -, m_stackSize(0) -, m_priority(0) -, m_thread(NULL) -, m_next(NULL) +Thread::Thread(const char *name) : +m_name(name), m_entry(0), m_arg(0), m_stackSize(0), m_priority(0), m_thread(NULL), m_next(NULL) { } Thread::Thread(thread_entry_t entry, uint32_t priority, uint32_t stackSize, const char *name, - thread_stack_pointer stackPtr) -: m_name(name) -, m_entry(entry) -, m_arg(0) -, m_stackSize(stackSize) -, m_priority(priority) -, m_thread(NULL) -, m_next(NULL) + thread_stack_pointer stackPtr) : +m_name(name), +m_entry(entry), m_arg(0), m_stackSize(stackSize), m_priority(priority), m_thread(NULL), m_next(NULL) { } @@ -198,8 +187,7 @@ bool Mutex::unlock(void) return m_mutex->unlock(); } -Semaphore::Semaphore(int count) -: m_count(count) +Semaphore::Semaphore(int count) : m_count(count) { m_sem = new rtos::Semaphore(m_count); } diff --git a/erpc_c/port/erpc_threading_pthreads.cpp b/erpc_c/port/erpc_threading_pthreads.cpp index 18ba49d3..418cbf4e 100644 --- a/erpc_c/port/erpc_threading_pthreads.cpp +++ b/erpc_c/port/erpc_threading_pthreads.cpp @@ -34,24 +34,12 @@ const uint32_t sToUs = 1000000; // Code //////////////////////////////////////////////////////////////////////////////// -Thread::Thread(const char *name) -: m_name(name) -, m_entry(0) -, m_arg(0) -, m_stackSize(0) -, m_priority(0) -, m_thread(0) -{ -} +Thread::Thread(const char *name) : m_name(name), m_entry(0), m_arg(0), m_stackSize(0), m_priority(0), m_thread(0) {} Thread::Thread(thread_entry_t entry, uint32_t priority, uint32_t stackSize, const char *name, - thread_stack_pointer stackPtr) -: m_name(name) -, m_entry(entry) -, m_arg(0) -, m_stackSize(stackSize) -, m_priority(priority) -, m_thread(0) + thread_stack_pointer stackPtr) : +m_name(name), +m_entry(entry), m_arg(0), m_stackSize(stackSize), m_priority(priority), m_thread(0) { } @@ -163,9 +151,7 @@ bool Mutex::unlock(void) return pthread_mutex_unlock(&m_mutex) == 0; } -Semaphore::Semaphore(int count) -: m_count(count) -, m_mutex() +Semaphore::Semaphore(int count) : m_count(count), m_mutex() { pthread_cond_init(&m_cond, NULL); } diff --git a/erpc_c/port/erpc_threading_threadx.cpp b/erpc_c/port/erpc_threading_threadx.cpp index 2c4939ff..397749c7 100644 --- a/erpc_c/port/erpc_threading_threadx.cpp +++ b/erpc_c/port/erpc_threading_threadx.cpp @@ -31,26 +31,15 @@ static TX_BYTE_POOL tx_app_byte_pool; // Code //////////////////////////////////////////////////////////////////////////////// -Thread::Thread(const char *name) -: m_name(name) -, m_entry(0) -, m_arg(0) -, m_stackSize(0) -, m_priority(0) -, m_thread() -, m_next() +Thread::Thread(const char *name) : +m_name(name), m_entry(0), m_arg(0), m_stackSize(0), m_priority(0), m_thread(), m_next() { } Thread::Thread(thread_entry_t entry, uint32_t priority, uint32_t stackSize, const char *name, - thread_stack_pointer stackPtr) -: m_name(name) -, m_entry(entry) -, m_arg(0) -, m_stackSize(stackSize) -, m_priority(priority) -, m_thread() -, m_next() + thread_stack_pointer stackPtr) : +m_name(name), +m_entry(entry), m_arg(0), m_stackSize(stackSize), m_priority(priority), m_thread(), m_next() { } @@ -209,8 +198,7 @@ void Thread::threadEntryPointStub(ULONG arg) tx_interrupt_control(my_old_posture); } -Mutex::Mutex(void) -: m_mutex() +Mutex::Mutex(void) : m_mutex() { CHAR name[] = "erpc_mutex"; tx_mutex_create(&m_mutex, name, TX_INHERIT); @@ -239,8 +227,7 @@ bool Mutex::unlock(void) return (status == TX_SUCCESS); } -Semaphore::Semaphore(int count) -: m_sem() +Semaphore::Semaphore(int count) : m_sem() { CHAR name[] = "erpc_sem"; tx_semaphore_create(&m_sem, name, count); diff --git a/erpc_c/port/erpc_threading_win32.cpp b/erpc_c/port/erpc_threading_win32.cpp index 459c5b0a..7d13d5dd 100644 --- a/erpc_c/port/erpc_threading_win32.cpp +++ b/erpc_c/port/erpc_threading_win32.cpp @@ -29,28 +29,15 @@ CRITICAL_SECTION Thread::m_critical_section; // Code //////////////////////////////////////////////////////////////////////////////// -Thread::Thread(const char *name) -: m_name(name) -, m_entry(0) -, m_arg(0) -, m_stackSize(0) -, m_priority(0) -, m_thread(0) -, m_thrdaddr(0) -, m_next(0) +Thread::Thread(const char *name) : +m_name(name), m_entry(0), m_arg(0), m_stackSize(0), m_priority(0), m_thread(0), m_thrdaddr(0), m_next(0) { } Thread::Thread(thread_entry_t entry, uint32_t priority, uint32_t stackSize, const char *name, - thread_stack_pointer stackPtr) -: m_name(name) -, m_entry(entry) -, m_arg(0) -, m_stackSize(stackSize) -, m_priority(priority) -, m_thread(0) -, m_thrdaddr(0) -, m_next(0) + thread_stack_pointer stackPtr) : +m_name(name), +m_entry(entry), m_arg(0), m_stackSize(stackSize), m_priority(priority), m_thread(0), m_thrdaddr(0), m_next(0) { } @@ -172,10 +159,7 @@ bool Mutex::unlock(void) return ReleaseMutex(m_mutex); } -Semaphore::Semaphore(int count) -: m_count(count) -, m_sem() -, m_mutex() +Semaphore::Semaphore(int count) : m_count(count), m_sem(), m_mutex() { m_sem = CreateSemaphore(NULL, m_count, 1, ""); } diff --git a/erpc_c/port/erpc_threading_zephyr.cpp b/erpc_c/port/erpc_threading_zephyr.cpp index 24928cc3..e71c3c8c 100644 --- a/erpc_c/port/erpc_threading_zephyr.cpp +++ b/erpc_c/port/erpc_threading_zephyr.cpp @@ -17,26 +17,15 @@ using namespace erpc; // Code //////////////////////////////////////////////////////////////////////////////// -Thread::Thread(const char *name) -: m_name(name) -, m_entry(0) -, m_arg(0) -, m_stackSize(0) -, m_priority(0) -, m_thread(0) -, m_stack(0) +Thread::Thread(const char *name) : +m_name(name), m_entry(0), m_arg(0), m_stackSize(0), m_priority(0), m_thread(0), m_stack(0) { } Thread::Thread(thread_entry_t entry, uint32_t priority, uint32_t stackSize, const char *name, - thread_stack_pointer stackPtr) -: m_name(name) -, m_entry(entry) -, m_arg(0) -, m_stackSize(stackSize) -, m_priority(priority) -, m_thread(0) -, m_stack(0) + thread_stack_pointer stackPtr) : +m_name(name), +m_entry(entry), m_arg(0), m_stackSize(stackSize), m_priority(priority), m_thread(0), m_stack(0) { } @@ -92,8 +81,7 @@ void *Thread::threadEntryPointStub(void *arg1, void *arg2, void *arg3) k_thread_abort(k_current_get()); } -Mutex::Mutex(void) -: m_mutex(0) +Mutex::Mutex(void) : m_mutex(0) { k_mutex_init(&m_mutex); } @@ -116,8 +104,7 @@ bool Mutex::unlock(void) return true; } -Semaphore::Semaphore(int count) -: m_sem(0) +Semaphore::Semaphore(int count) : m_sem(0) { // Set max count to highest signed int. k_sem_init(&m_sem, count, 0x7fffffff); diff --git a/erpc_c/setup/erpc_setup_mbf_static.cpp b/erpc_c/setup/erpc_setup_mbf_static.cpp index 6f5abbd1..5a2b5dba 100644 --- a/erpc_c/setup/erpc_setup_mbf_static.cpp +++ b/erpc_c/setup/erpc_setup_mbf_static.cpp @@ -38,7 +38,8 @@ class StaticMessageBufferFactory : public MessageBufferFactory */ StaticMessageBufferFactory(void) #if !ERPC_THREADS_IS(NONE) - : m_semaphore(1) + : + m_semaphore(1) #endif { (void)memset(m_freeBufferBitmap, 0xff, sizeof(m_freeBufferBitmap)); diff --git a/erpc_c/transports/erpc_dspi_master_transport.cpp b/erpc_c/transports/erpc_dspi_master_transport.cpp index fa2abc8d..705407a4 100644 --- a/erpc_c/transports/erpc_dspi_master_transport.cpp +++ b/erpc_c/transports/erpc_dspi_master_transport.cpp @@ -100,10 +100,8 @@ static inline void DSpidevMasterTransport_WaitForSlaveReadyMarker(SPI_Type *spiB } #endif -DspiMasterTransport::DspiMasterTransport(SPI_Type *spiBaseAddr, uint32_t baudRate, uint32_t srcClock_Hz) -: m_spiBaseAddr(spiBaseAddr) -, m_baudRate(baudRate) -, m_srcClock_Hz(srcClock_Hz) +DspiMasterTransport::DspiMasterTransport(SPI_Type *spiBaseAddr, uint32_t baudRate, uint32_t srcClock_Hz) : +m_spiBaseAddr(spiBaseAddr), m_baudRate(baudRate), m_srcClock_Hz(srcClock_Hz) { } diff --git a/erpc_c/transports/erpc_dspi_slave_transport.cpp b/erpc_c/transports/erpc_dspi_slave_transport.cpp index b0f68a5b..86b0f076 100644 --- a/erpc_c/transports/erpc_dspi_slave_transport.cpp +++ b/erpc_c/transports/erpc_dspi_slave_transport.cpp @@ -94,13 +94,11 @@ static void DSPI_SlaveUserCallback(SPI_Type *base, dspi_slave_handle_t *handle, transport->transfer_cb(); } -DspiSlaveTransport::DspiSlaveTransport(SPI_Type *spiBaseAddr, uint32_t baudRate, uint32_t srcClock_Hz) -: m_spiBaseAddr(spiBaseAddr) -, m_baudRate(baudRate) -, m_srcClock_Hz(srcClock_Hz) -, m_isInited(false) +DspiSlaveTransport::DspiSlaveTransport(SPI_Type *spiBaseAddr, uint32_t baudRate, uint32_t srcClock_Hz) : +m_spiBaseAddr(spiBaseAddr), m_baudRate(baudRate), m_srcClock_Hz(srcClock_Hz), m_isInited(false) #if ERPC_THREADS -, m_txrxSemaphore() +, +m_txrxSemaphore() #endif { s_dspi_slave_instance = this; diff --git a/erpc_c/transports/erpc_i2c_slave_transport.cpp b/erpc_c/transports/erpc_i2c_slave_transport.cpp index 7fa3b52a..d69bc8a4 100644 --- a/erpc_c/transports/erpc_i2c_slave_transport.cpp +++ b/erpc_c/transports/erpc_i2c_slave_transport.cpp @@ -144,13 +144,11 @@ static void I2C_SlaveUserCallback(I2C_Type *base, volatile i2c_slave_transfer_t } } -I2cSlaveTransport::I2cSlaveTransport(I2C_Type *i2cBaseAddr, uint32_t baudRate, uint32_t srcClock_Hz) -: m_i2cBaseAddr(i2cBaseAddr) -, m_baudRate(baudRate) -, m_srcClock_Hz(srcClock_Hz) -, m_isInited(false) +I2cSlaveTransport::I2cSlaveTransport(I2C_Type *i2cBaseAddr, uint32_t baudRate, uint32_t srcClock_Hz) : +m_i2cBaseAddr(i2cBaseAddr), m_baudRate(baudRate), m_srcClock_Hz(srcClock_Hz), m_isInited(false) #if ERPC_THREADS -, m_txrxSemaphore() +, +m_txrxSemaphore() #endif { s_i2c_slave_instance = this; diff --git a/erpc_c/transports/erpc_inter_thread_buffer_transport.hpp b/erpc_c/transports/erpc_inter_thread_buffer_transport.hpp index 907a92f0..ced0ddc8 100644 --- a/erpc_c/transports/erpc_inter_thread_buffer_transport.hpp +++ b/erpc_c/transports/erpc_inter_thread_buffer_transport.hpp @@ -44,13 +44,8 @@ namespace erpc { class InterThreadBufferTransport : public Transport { public: - InterThreadBufferTransport(void) - : Transport() - , m_state(NULL) - , m_peer(NULL) - , m_inSem() - , m_outSem(1) - , m_inBuffer(NULL) + InterThreadBufferTransport(void) : + Transport(), m_state(NULL), m_peer(NULL), m_inSem(), m_outSem(1), m_inBuffer(NULL) { } virtual ~InterThreadBufferTransport(void); diff --git a/erpc_c/transports/erpc_mu_transport.cpp b/erpc_c/transports/erpc_mu_transport.cpp index d94c5119..0fb992a6 100644 --- a/erpc_c/transports/erpc_mu_transport.cpp +++ b/erpc_c/transports/erpc_mu_transport.cpp @@ -76,22 +76,15 @@ void MUTransport::mu_irq_callback(void) } #endif /* ERPC_TRANSPORT_MU_USE_MCMGR */ -MUTransport::MUTransport(void) -: Transport() -, m_newMessage(false) -, m_rxMsgSize(0) -, m_rxCntBytes(0) -, m_rxBuffer(NULL) -, m_txMsgSize(0) -, m_txCntBytes(0) -, m_txBuffer(NULL) +MUTransport::MUTransport(void) : +Transport(), m_newMessage(false), m_rxMsgSize(0), m_rxCntBytes(0), m_rxBuffer(NULL), m_txMsgSize(0), m_txCntBytes(0), +m_txBuffer(NULL) #if !ERPC_THREADS_IS(NONE) -, m_rxSemaphore() -, m_txSemaphore() -, m_sendLock() -, m_receiveLock() +, +m_rxSemaphore(), m_txSemaphore(), m_sendLock(), m_receiveLock() #endif -, m_muBase(NULL) +, +m_muBase(NULL) { s_mu_instance = this; } diff --git a/erpc_c/transports/erpc_rpmsg_linux_transport.cpp b/erpc_c/transports/erpc_rpmsg_linux_transport.cpp index 2b229429..17a756bb 100644 --- a/erpc_c/transports/erpc_rpmsg_linux_transport.cpp +++ b/erpc_c/transports/erpc_rpmsg_linux_transport.cpp @@ -17,10 +17,8 @@ using namespace erpc; // Code //////////////////////////////////////////////////////////////////////////////// -RPMsgLinuxTransport::RPMsgLinuxTransport(RPMsgEndpoint *endPoint, int16_t remote) -: Transport() -, m_endPoint(endPoint) -, m_remote(remote) +RPMsgLinuxTransport::RPMsgLinuxTransport(RPMsgEndpoint *endPoint, int16_t remote) : +Transport(), m_endPoint(endPoint), m_remote(remote) { } diff --git a/erpc_c/transports/erpc_rpmsg_lite_base_transport.hpp b/erpc_c/transports/erpc_rpmsg_lite_base_transport.hpp index 42253e12..985e0771 100644 --- a/erpc_c/transports/erpc_rpmsg_lite_base_transport.hpp +++ b/erpc_c/transports/erpc_rpmsg_lite_base_transport.hpp @@ -50,8 +50,7 @@ namespace erpc { class RPMsgBaseTransport : public Transport { public: - RPMsgBaseTransport(void) - : Transport(){}; + RPMsgBaseTransport(void) : Transport(){}; virtual ~RPMsgBaseTransport(void) {} diff --git a/erpc_c/transports/erpc_rpmsg_lite_rtos_transport.cpp b/erpc_c/transports/erpc_rpmsg_lite_rtos_transport.cpp index 89b48dd3..b60ecd97 100644 --- a/erpc_c/transports/erpc_rpmsg_lite_rtos_transport.cpp +++ b/erpc_c/transports/erpc_rpmsg_lite_rtos_transport.cpp @@ -28,14 +28,9 @@ struct rpmsg_lite_instance *RPMsgBaseTransport::s_rpmsg; // Code //////////////////////////////////////////////////////////////////////////////// -RPMsgRTOSTransport::RPMsgRTOSTransport(void) -: RPMsgBaseTransport() -, m_rdev(NULL) -, m_app_rp_chnl(NULL) -, m_dst_addr(0) -, m_rpmsg_queue(NULL) -, m_rpmsg_ept(NULL) -, m_crcImpl(NULL) +RPMsgRTOSTransport::RPMsgRTOSTransport(void) : +RPMsgBaseTransport(), m_rdev(NULL), m_app_rp_chnl(NULL), m_dst_addr(0), m_rpmsg_queue(NULL), m_rpmsg_ept(NULL), +m_crcImpl(NULL) { } diff --git a/erpc_c/transports/erpc_rpmsg_lite_transport.cpp b/erpc_c/transports/erpc_rpmsg_lite_transport.cpp index 3211bc75..12fdc97f 100644 --- a/erpc_c/transports/erpc_rpmsg_lite_transport.cpp +++ b/erpc_c/transports/erpc_rpmsg_lite_transport.cpp @@ -39,13 +39,7 @@ int32_t RPMsgTransport::rpmsg_read_cb(void *payload, uint32_t payload_len, uint3 return RL_HOLD; } -RPMsgTransport::RPMsgTransport(void) -: RPMsgBaseTransport() -, m_dst_addr(0) -, m_rpmsg_ept(NULL) -, m_crcImpl(NULL) -{ -} +RPMsgTransport::RPMsgTransport(void) : RPMsgBaseTransport(), m_dst_addr(0), m_rpmsg_ept(NULL), m_crcImpl(NULL) {} RPMsgTransport::~RPMsgTransport(void) { diff --git a/erpc_c/transports/erpc_rpmsg_tty_rtos_transport.cpp b/erpc_c/transports/erpc_rpmsg_tty_rtos_transport.cpp index 62272787..a5ad15a0 100644 --- a/erpc_c/transports/erpc_rpmsg_tty_rtos_transport.cpp +++ b/erpc_c/transports/erpc_rpmsg_tty_rtos_transport.cpp @@ -30,12 +30,8 @@ struct rpmsg_lite_instance *RPMsgBaseTransport::s_rpmsg; // Code //////////////////////////////////////////////////////////////////////////////// -RPMsgTTYRTOSTransport::RPMsgTTYRTOSTransport(void) -: RPMsgBaseTransport() -, m_dst_addr(0) -, m_rpmsg_queue(NULL) -, m_rpmsg_ept(NULL) -, m_crcImpl(NULL) +RPMsgTTYRTOSTransport::RPMsgTTYRTOSTransport(void) : +RPMsgBaseTransport(), m_dst_addr(0), m_rpmsg_queue(NULL), m_rpmsg_ept(NULL), m_crcImpl(NULL) { } diff --git a/erpc_c/transports/erpc_serial_transport.cpp b/erpc_c/transports/erpc_serial_transport.cpp index 80d9b45c..ea882eb7 100644 --- a/erpc_c/transports/erpc_serial_transport.cpp +++ b/erpc_c/transports/erpc_serial_transport.cpp @@ -32,10 +32,8 @@ using namespace erpc; // Code //////////////////////////////////////////////////////////////////////////////// -SerialTransport::SerialTransport(const char *portName, speed_t baudRate) -: m_serialHandle(0) -, m_portName(portName) -, m_baudRate(baudRate) +SerialTransport::SerialTransport(const char *portName, speed_t baudRate) : +m_serialHandle(0), m_portName(portName), m_baudRate(baudRate) { } diff --git a/erpc_c/transports/erpc_spi_master_transport.cpp b/erpc_c/transports/erpc_spi_master_transport.cpp index 20a216de..2fe79f6b 100644 --- a/erpc_c/transports/erpc_spi_master_transport.cpp +++ b/erpc_c/transports/erpc_spi_master_transport.cpp @@ -101,10 +101,8 @@ static inline void SpidevMasterTransport_WaitForSlaveReadyMarker(SPI_Type *spiBa } #endif -SpiMasterTransport::SpiMasterTransport(SPI_Type *spiBaseAddr, uint32_t baudRate, uint32_t srcClock_Hz) -: m_spiBaseAddr(spiBaseAddr) -, m_baudRate(baudRate) -, m_srcClock_Hz(srcClock_Hz) +SpiMasterTransport::SpiMasterTransport(SPI_Type *spiBaseAddr, uint32_t baudRate, uint32_t srcClock_Hz) : +m_spiBaseAddr(spiBaseAddr), m_baudRate(baudRate), m_srcClock_Hz(srcClock_Hz) { } diff --git a/erpc_c/transports/erpc_spi_slave_transport.cpp b/erpc_c/transports/erpc_spi_slave_transport.cpp index f4d034b2..34b9483c 100644 --- a/erpc_c/transports/erpc_spi_slave_transport.cpp +++ b/erpc_c/transports/erpc_spi_slave_transport.cpp @@ -112,13 +112,11 @@ static void SPI_SlaveUserCallback(SPI_Type *base, spi_slave_handle_t *handle, st transport->transfer_cb(); } -SpiSlaveTransport::SpiSlaveTransport(SPI_Type *spiBaseAddr, uint32_t baudRate, uint32_t srcClock_Hz) -: m_spiBaseAddr(spiBaseAddr) -, m_baudRate(baudRate) -, m_srcClock_Hz(srcClock_Hz) -, m_isInited(false) +SpiSlaveTransport::SpiSlaveTransport(SPI_Type *spiBaseAddr, uint32_t baudRate, uint32_t srcClock_Hz) : +m_spiBaseAddr(spiBaseAddr), m_baudRate(baudRate), m_srcClock_Hz(srcClock_Hz), m_isInited(false) #if ERPC_THREADS -, m_txrxSemaphore() +, +m_txrxSemaphore() #endif { s_spi_slave_instance = this; diff --git a/erpc_c/transports/erpc_spidev_master_transport.cpp b/erpc_c/transports/erpc_spidev_master_transport.cpp index 577634c4..511459e8 100644 --- a/erpc_c/transports/erpc_spidev_master_transport.cpp +++ b/erpc_c/transports/erpc_spidev_master_transport.cpp @@ -84,10 +84,8 @@ static inline void SpidevMasterTransport_WaitForSlaveReadyMarker(int spi_fd) } #endif -SpidevMasterTransport::SpidevMasterTransport(const char *spidev, uint32_t speed_Hz) -: m_spidevHandle(0) -, m_spidev(spidev) -, m_speed_Hz(speed_Hz) +SpidevMasterTransport::SpidevMasterTransport(const char *spidev, uint32_t speed_Hz) : +m_spidevHandle(0), m_spidev(spidev), m_speed_Hz(speed_Hz) { } diff --git a/erpc_c/transports/erpc_tcp_transport.cpp b/erpc_c/transports/erpc_tcp_transport.cpp index 59fac360..f2924b67 100644 --- a/erpc_c/transports/erpc_tcp_transport.cpp +++ b/erpc_c/transports/erpc_tcp_transport.cpp @@ -43,23 +43,13 @@ using namespace erpc; // Code //////////////////////////////////////////////////////////////////////////////// -TCPTransport::TCPTransport(bool isServer) -: m_isServer(isServer) -, m_host(NULL) -, m_port(0) -, m_socket(-1) -, m_serverThread(serverThreadStub) -, m_runServer(true) +TCPTransport::TCPTransport(bool isServer) : +m_isServer(isServer), m_host(NULL), m_port(0), m_socket(-1), m_serverThread(serverThreadStub), m_runServer(true) { } -TCPTransport::TCPTransport(const char *host, uint16_t port, bool isServer) -: m_isServer(isServer) -, m_host(host) -, m_port(port) -, m_socket(-1) -, m_serverThread(serverThreadStub) -, m_runServer(true) +TCPTransport::TCPTransport(const char *host, uint16_t port, bool isServer) : +m_isServer(isServer), m_host(host), m_port(port), m_socket(-1), m_serverThread(serverThreadStub), m_runServer(true) { } diff --git a/erpc_c/transports/erpc_uart_cmsis_transport.cpp b/erpc_c/transports/erpc_uart_cmsis_transport.cpp index 9eb344ab..dba431c6 100644 --- a/erpc_c/transports/erpc_uart_cmsis_transport.cpp +++ b/erpc_c/transports/erpc_uart_cmsis_transport.cpp @@ -26,11 +26,11 @@ static UartTransport *s_uart_instance = NULL; // Code //////////////////////////////////////////////////////////////////////////////// -UartTransport::UartTransport(ARM_DRIVER_USART *uartDrv) -: m_uartDrv(uartDrv) +UartTransport::UartTransport(ARM_DRIVER_USART *uartDrv) : +m_uartDrv(uartDrv) #if !ERPC_THREADS_IS(NONE) -, m_rxSemaphore() -, m_txSemaphore() +, +m_rxSemaphore(), m_txSemaphore() #endif { s_uart_instance = this; diff --git a/erpc_c/transports/erpc_usb_cdc_transport.cpp b/erpc_c/transports/erpc_usb_cdc_transport.cpp index a960077a..67bf3008 100644 --- a/erpc_c/transports/erpc_usb_cdc_transport.cpp +++ b/erpc_c/transports/erpc_usb_cdc_transport.cpp @@ -83,15 +83,13 @@ void UsbCdcTransport::rx_cb(void) UsbCdcTransport::UsbCdcTransport(serial_handle_t serialHandle, serial_manager_config_t *serialConfig, serial_port_usb_cdc_config_t *usbCdcConfig, uint8_t *usbRingBuffer, - uint32_t usbRingBufferLength) -: m_serialHandle(serialHandle) -, m_serialConfig(serialConfig) -, m_usbCdcConfig(usbCdcConfig) -, m_usbRingBuffer(usbRingBuffer) -, m_usbRingBufferLength(usbRingBufferLength) + uint32_t usbRingBufferLength) : +m_serialHandle(serialHandle), +m_serialConfig(serialConfig), m_usbCdcConfig(usbCdcConfig), m_usbRingBuffer(usbRingBuffer), +m_usbRingBufferLength(usbRingBufferLength) #if !ERPC_THREADS_IS(NONE) -, m_rxSemaphore() -, m_txSemaphore() +, +m_rxSemaphore(), m_txSemaphore() #endif { s_usbcdc_instance = this; diff --git a/erpcgen/src/AstNode.cpp b/erpcgen/src/AstNode.cpp index 39faeb03..05b868b7 100644 --- a/erpcgen/src/AstNode.cpp +++ b/erpcgen/src/AstNode.cpp @@ -22,9 +22,7 @@ using namespace std; // Code //////////////////////////////////////////////////////////////////////////////// -AstNode::AstNode(const AstNode &other) -: m_token(other.m_token) -, m_parent(other.m_parent) +AstNode::AstNode(const AstNode &other) : m_token(other.m_token), m_parent(other.m_parent) { // Clone children. for (auto it : other.m_children) diff --git a/erpcgen/src/AstNode.hpp b/erpcgen/src/AstNode.hpp index a2ed1878..e748e854 100644 --- a/erpcgen/src/AstNode.hpp +++ b/erpcgen/src/AstNode.hpp @@ -53,11 +53,7 @@ class AstNode * @see AstNode::AstNode(Token * token, AstNode * parent) * @see AstNode::AstNode(const AstNode & other) */ - explicit AstNode(const Token &token) - : m_token(token) - , m_parent(nullptr) - { - } + explicit AstNode(const Token &token) : m_token(token), m_parent(nullptr) {} /*! * @brief This function is constructor of AstNode class. @@ -71,11 +67,7 @@ class AstNode * @see AstNode::AstNode(Token * token) * @see AstNode::AstNode(const AstNode & other) */ - AstNode(Token &token, AstNode *parent) - : m_token(token) - , m_parent(parent) - { - } + AstNode(Token &token, AstNode *parent) : m_token(token), m_parent(parent) {} /*! * @brief This function is copy constructor of AstNode class. @@ -401,11 +393,7 @@ class AstPrinter * * @param[in] root Pointer to root node. */ - explicit AstPrinter(AstNode *root) - : m_root(root) - , m_depth(0) - { - } + explicit AstPrinter(AstNode *root) : m_root(root), m_depth(0) {} /*! * @brief This function call for dispatch function. diff --git a/erpcgen/src/AstWalker.hpp b/erpcgen/src/AstWalker.hpp index 4f4a7ddb..459225b5 100644 --- a/erpcgen/src/AstWalker.hpp +++ b/erpcgen/src/AstWalker.hpp @@ -53,10 +53,7 @@ class AstWalker * * @param[in] inputFile Parsed file name. */ - explicit AstWalker(const std::string &inputFile) - : m_fileName(inputFile) - { - } + explicit AstWalker(const std::string &inputFile) : m_fileName(inputFile) {} /*! * @brief destructor diff --git a/erpcgen/src/CGenerator.cpp b/erpcgen/src/CGenerator.cpp index 13a636a2..e06c4d2d 100644 --- a/erpcgen/src/CGenerator.cpp +++ b/erpcgen/src/CGenerator.cpp @@ -44,8 +44,7 @@ static uint8_t listCounter = 0; //////////////////////////////////////////////////////////////////////////////// // Code //////////////////////////////////////////////////////////////////////////////// -CGenerator::CGenerator(InterfaceDefinition *def) -: Generator(def, kC) +CGenerator::CGenerator(InterfaceDefinition *def) : Generator(def, kC) { /* Set copyright rules. */ if (m_def->hasProgramSymbol()) diff --git a/erpcgen/src/ErpcLexer.cpp b/erpcgen/src/ErpcLexer.cpp index 7e9dd4db..d3763b86 100644 --- a/erpcgen/src/ErpcLexer.cpp +++ b/erpcgen/src/ErpcLexer.cpp @@ -33,11 +33,7 @@ using namespace std; // Code //////////////////////////////////////////////////////////////////////////////// -ErpcLexer::ErpcLexer(const char *inputFile) -: m_value(nullptr) -, m_indents(0) -, m_currentFileInfo(NULL) -, m_idlCrc16(0) +ErpcLexer::ErpcLexer(const char *inputFile) : m_value(nullptr), m_indents(0), m_currentFileInfo(NULL), m_idlCrc16(0) { m_currentFileInfo = openFile(inputFile); yyrestart(m_currentFileInfo->m_savedFile.get()); // instead of yyFlexLexer(idlFile); diff --git a/erpcgen/src/ErpcLexer.hpp b/erpcgen/src/ErpcLexer.hpp index 42c0358f..e0f0a28a 100644 --- a/erpcgen/src/ErpcLexer.hpp +++ b/erpcgen/src/ErpcLexer.hpp @@ -60,13 +60,9 @@ class CurrentFileInfo * @param[in] fileName Name of analyzed file. * @param[in] currentFolderPath Path to folder of current file. */ - CurrentFileInfo(std::ifstream *savedFile, const std::string &fileName, const std::string ¤tFolderPath) - : m_savedFile(savedFile) - , m_previous(NULL) - , m_line(1) - , m_column(0) - , m_fileName(fileName) - , m_currentFolderPath(currentFolderPath) + CurrentFileInfo(std::ifstream *savedFile, const std::string &fileName, const std::string ¤tFolderPath) : + m_savedFile(savedFile), m_previous(NULL), m_line(1), m_column(0), m_fileName(fileName), + m_currentFolderPath(currentFolderPath) { } diff --git a/erpcgen/src/Generator.cpp b/erpcgen/src/Generator.cpp index 800d16c2..686b77e4 100644 --- a/erpcgen/src/Generator.cpp +++ b/erpcgen/src/Generator.cpp @@ -29,11 +29,8 @@ using namespace std; // Code //////////////////////////////////////////////////////////////////////////////// -Generator::Generator(InterfaceDefinition *def, generator_type_t generatorType) -: m_idlCrc16(def->getIdlCrc16()) -, m_def(def) -, m_globals(&(def->getGlobals())) -, m_generatorType(generatorType) +Generator::Generator(InterfaceDefinition *def, generator_type_t generatorType) : +m_idlCrc16(def->getIdlCrc16()), m_def(def), m_globals(&(def->getGlobals())), m_generatorType(generatorType) { string scopeName = "erpcShim"; string scopeNameC; diff --git a/erpcgen/src/InterfaceDefinition.cpp b/erpcgen/src/InterfaceDefinition.cpp index 7d1e268a..de079293 100644 --- a/erpcgen/src/InterfaceDefinition.cpp +++ b/erpcgen/src/InterfaceDefinition.cpp @@ -27,14 +27,9 @@ using namespace std; // Code //////////////////////////////////////////////////////////////////////////////// -InterfaceDefinition::InterfaceDefinition() -: m_ast(nullptr) -, m_globals() -, m_program(nullptr) -, m_programName("") -, m_outputFilename("") -, m_codec(kNotSpecified) -, m_idlCrc16(0) +InterfaceDefinition::InterfaceDefinition() : +m_ast(nullptr), m_globals(), m_program(nullptr), m_programName(""), m_outputFilename(""), m_codec(kNotSpecified), +m_idlCrc16(0) { init(); } diff --git a/erpcgen/src/Logging.hpp b/erpcgen/src/Logging.hpp index fab7a45a..3a27703e 100644 --- a/erpcgen/src/Logging.hpp +++ b/erpcgen/src/Logging.hpp @@ -62,11 +62,7 @@ class Logger public: //! \brief Default constructor. - Logger() - : m_filter(kInfo) - , m_level(kInfo) - { - } + Logger() : m_filter(kInfo), m_level(kInfo) {} //! \brief Destructor. virtual ~Logger() {} @@ -197,9 +193,7 @@ class Log //! //! Saves the current logging output level of the global logger, //! as managed by the Log class, and sets the new level to \a level. - explicit SetOutputLevel(Logger::log_level_t level) - : m_logger(Log::getLogger()) - , m_saved(Logger::kInfo) + explicit SetOutputLevel(Logger::log_level_t level) : m_logger(Log::getLogger()), m_saved(Logger::kInfo) { assert(m_logger); m_saved = m_logger->getOutputLevel(); @@ -210,9 +204,7 @@ class Log //! //! Saves the current logging output level of \a logger and sets //! the new level to \a level. - SetOutputLevel(Logger *logger, Logger::log_level_t level) - : m_logger(logger) - , m_saved(logger->getOutputLevel()) + SetOutputLevel(Logger *logger, Logger::log_level_t level) : m_logger(logger), m_saved(logger->getOutputLevel()) { assert(m_logger); m_logger->setOutputLevel(level); @@ -236,10 +228,7 @@ class StdoutLogger : public Logger { public: //! \brief Default constructor. - StdoutLogger(Logger::log_level_t stderrLevel = Logger::kWarning) - : m_stderrLevel(stderrLevel) - { - } + StdoutLogger(Logger::log_level_t stderrLevel = Logger::kWarning) : m_stderrLevel(stderrLevel) {} protected: //! Logs at and below this level get sent to stderr. diff --git a/erpcgen/src/ParseErrors.hpp b/erpcgen/src/ParseErrors.hpp index 07a26635..b89a250d 100644 --- a/erpcgen/src/ParseErrors.hpp +++ b/erpcgen/src/ParseErrors.hpp @@ -39,11 +39,7 @@ class erpc_error : public std::runtime_error * * @param[in] __arg Exception error message. */ - explicit erpc_error(const std::string &__arg) - : std::runtime_error(__arg) - , m_message(__arg) - { - } + explicit erpc_error(const std::string &__arg) : std::runtime_error(__arg), m_message(__arg) {} protected: std::string m_message; /*!< Error message. */ @@ -55,10 +51,8 @@ class erpc_error : public std::runtime_error * @param[in] __arg Exception error message. * @param[in] errorName Exception error name. */ - explicit erpc_error(const std::string &__arg, const std::string &errorName) - : std::runtime_error(__arg) - , m_message(__arg) - , m_errName(errorName) + explicit erpc_error(const std::string &__arg, const std::string &errorName) : + std::runtime_error(__arg), m_message(__arg), m_errName(errorName) { } }; @@ -74,10 +68,7 @@ class syntax_error : public erpc_error * * @param[in] __arg Exception error message. */ - explicit syntax_error(const std::string &__arg) - : erpc_error(__arg) - { - } + explicit syntax_error(const std::string &__arg) : erpc_error(__arg) {} }; /*! @@ -93,11 +84,10 @@ class syntax_error2 : public erpc_error * @param[in] loc Location of token. * @param[in] fileName File name where error occurred. */ - explicit syntax_error2(const std::string &__arg, token_loc_t loc, std::string &fileName) - : erpc_error(__arg, "syntax error") - , m_errLoc(loc) - , m_what(format_string("file %s:%d:%d: %s, %s", fileName.c_str(), m_errLoc.m_firstLine, m_errLoc.m_firstChar, - m_errName.c_str(), m_message.c_str())) + explicit syntax_error2(const std::string &__arg, token_loc_t loc, std::string &fileName) : + erpc_error(__arg, "syntax error"), m_errLoc(loc), + m_what(format_string("file %s:%d:%d: %s, %s", fileName.c_str(), m_errLoc.m_firstLine, m_errLoc.m_firstChar, + m_errName.c_str(), m_message.c_str())) { } @@ -108,11 +98,10 @@ class syntax_error2 : public erpc_error * @param[in] loc Location of token for which error occurred. * @param[in] fileName File name where error occurred. */ - explicit syntax_error2(const char *__arg, token_loc_t loc, std::string &fileName) - : erpc_error(std::string(__arg), "syntax error") - , m_errLoc(loc) - , m_what(format_string("file %s:%d:%d: %s, %s", fileName.c_str(), m_errLoc.m_firstLine, m_errLoc.m_firstChar, - m_errName.c_str(), m_message.c_str())) + explicit syntax_error2(const char *__arg, token_loc_t loc, std::string &fileName) : + erpc_error(std::string(__arg), "syntax error"), m_errLoc(loc), + m_what(format_string("file %s:%d:%d: %s, %s", fileName.c_str(), m_errLoc.m_firstLine, m_errLoc.m_firstChar, + m_errName.c_str(), m_message.c_str())) { } @@ -139,10 +128,7 @@ class lexical_error : public erpc_error * * @param[in] __arg Exception error message. */ - explicit lexical_error(const std::string &__arg) - : erpc_error(__arg) - { - } + explicit lexical_error(const std::string &__arg) : erpc_error(__arg) {} }; /*! @@ -156,10 +142,7 @@ class semantic_error : public erpc_error * * @param[in] __arg Exception error message. */ - explicit semantic_error(const std::string &__arg) - : erpc_error(__arg) - { - } + explicit semantic_error(const std::string &__arg) : erpc_error(__arg) {} }; /*! @@ -173,10 +156,7 @@ class internal_error : public erpc_error * * @param[in] __arg Exception error message. */ - explicit internal_error(const std::string &__arg) - : erpc_error(__arg) - { - } + explicit internal_error(const std::string &__arg) : erpc_error(__arg) {} }; /*! diff --git a/erpcgen/src/PythonGenerator.cpp b/erpcgen/src/PythonGenerator.cpp index b47a2fea..66715ae5 100644 --- a/erpcgen/src/PythonGenerator.cpp +++ b/erpcgen/src/PythonGenerator.cpp @@ -37,10 +37,8 @@ extern const char *const kPyGlobalInit; // Code //////////////////////////////////////////////////////////////////////////////// -PythonGenerator::PythonGenerator(InterfaceDefinition *def) -: Generator(def, kPython) -, m_suffixStrip("") -, m_suffixStripSize(0) +PythonGenerator::PythonGenerator(InterfaceDefinition *def) : +Generator(def, kPython), m_suffixStrip(""), m_suffixStripSize(0) { /* Set copyright rules. */ if (m_def->hasProgramSymbol()) diff --git a/erpcgen/src/SymbolScanner.hpp b/erpcgen/src/SymbolScanner.hpp index 7a2e32a9..3a351154 100644 --- a/erpcgen/src/SymbolScanner.hpp +++ b/erpcgen/src/SymbolScanner.hpp @@ -39,14 +39,9 @@ class SymbolScanner : public AstWalker * * @param[in] globals Global symbol scope variable. */ - explicit SymbolScanner(SymbolScope *globals) - : m_globals(globals) - , m_currentInterface(nullptr) - , m_currentStruct(nullptr) - , m_currentProgram(nullptr) - , m_currentEnum(nullptr) - , m_currentAlias(nullptr) - , m_currentUnion(nullptr) + explicit SymbolScanner(SymbolScope *globals) : + m_globals(globals), m_currentInterface(nullptr), m_currentStruct(nullptr), m_currentProgram(nullptr), + m_currentEnum(nullptr), m_currentAlias(nullptr), m_currentUnion(nullptr) { } @@ -58,15 +53,9 @@ class SymbolScanner : public AstWalker * @param[in] globals Global symbol scope variable. * @param[in] fileName name of IDL from which AST was built. */ - SymbolScanner(SymbolScope *globals, const std::string &fileName) - : AstWalker(fileName) - , m_globals(globals) - , m_currentInterface(nullptr) - , m_currentStruct(nullptr) - , m_currentProgram(nullptr) - , m_currentEnum(nullptr) - , m_currentAlias(nullptr) - , m_currentUnion(nullptr) + SymbolScanner(SymbolScope *globals, const std::string &fileName) : + AstWalker(fileName), m_globals(globals), m_currentInterface(nullptr), m_currentStruct(nullptr), + m_currentProgram(nullptr), m_currentEnum(nullptr), m_currentAlias(nullptr), m_currentUnion(nullptr) { } diff --git a/erpcgen/src/Token.cpp b/erpcgen/src/Token.cpp index 66becef8..634f5269 100644 --- a/erpcgen/src/Token.cpp +++ b/erpcgen/src/Token.cpp @@ -19,10 +19,7 @@ using namespace std; // Code //////////////////////////////////////////////////////////////////////////////// -Token::Token(const Token &other) -: m_token(other.m_token) -, m_value() -, m_location(other.m_location) +Token::Token(const Token &other) : m_token(other.m_token), m_value(), m_location(other.m_location) { if (other.m_value) { diff --git a/erpcgen/src/Token.hpp b/erpcgen/src/Token.hpp index 04b8be69..c1544c05 100644 --- a/erpcgen/src/Token.hpp +++ b/erpcgen/src/Token.hpp @@ -29,13 +29,7 @@ struct token_loc_t int m_lastLine; /*!< Ending line of the token. */ int m_lastChar; /*!< Ending character position on ending line. */ - token_loc_t() - : m_firstLine(0) - , m_firstChar(0) - , m_lastLine(0) - , m_lastChar(0) - { - } + token_loc_t() : m_firstLine(0), m_firstChar(0), m_lastLine(0), m_lastChar(0) {} /*! * @brief Default copy constructor. @@ -71,12 +65,7 @@ class Token * @see Token::Token(int token, Value * value, const token_loc_t & loc) * @see Token::Token(const Token & other) */ - explicit Token(int token) - : m_token(token) - , m_value() - , m_location() - { - } + explicit Token(int token) : m_token(token), m_value(), m_location() {} /*! * @brief Constructor. @@ -91,12 +80,7 @@ class Token * @see Token::Token(int token, Value * value, const token_loc_t & loc) * @see Token::Token(const Token & other) */ - Token(int token, Value *value) - : m_token(token) - , m_value(value) - , m_location() - { - } + Token(int token, Value *value) : m_token(token), m_value(value), m_location() {} /*! * @brief Constructor. @@ -112,12 +96,7 @@ class Token * @see Token::Token(int token, Value * value) * @see Token::Token(const Token & other) */ - Token(int token, Value *value, const token_loc_t &loc) - : m_token(token) - , m_value(value) - , m_location(loc) - { - } + Token(int token, Value *value, const token_loc_t &loc) : m_token(token), m_value(value), m_location(loc) {} /*! * @brief This function is copy constructor. diff --git a/erpcgen/src/Value.hpp b/erpcgen/src/Value.hpp index 7ac88972..65e1f41f 100644 --- a/erpcgen/src/Value.hpp +++ b/erpcgen/src/Value.hpp @@ -32,10 +32,7 @@ class Value * * @param[in] theType Value type. */ - Value(value_type_t theType) - : m_type(theType) - { - } + Value(value_type_t theType) : m_type(theType) {} /*! * @brief Destructor. @@ -99,22 +96,15 @@ class IntegerValue : public Value /*! * @brief Constructor. */ - explicit IntegerValue(int_type_t type = kSigned) - : Value(kIntegerValue) - , m_value(0) - , m_intType(type) - { - } + explicit IntegerValue(int_type_t type = kSigned) : Value(kIntegerValue), m_value(0), m_intType(type) {} /*! * @brief Constructor. * * @param[in] value IntegerValue value. */ - explicit IntegerValue(uint64_t value, int_type_t type = kSigned) - : Value(kIntegerValue) - , m_value(value) - , m_intType(type) + explicit IntegerValue(uint64_t value, int_type_t type = kSigned) : + Value(kIntegerValue), m_value(value), m_intType(type) { } @@ -123,10 +113,7 @@ class IntegerValue : public Value * * @param[in] other IntegerValue to copy. */ - IntegerValue(const IntegerValue &other) - : Value(other.getType()) - , m_value(other.m_value) - , m_intType(other.m_intType) + IntegerValue(const IntegerValue &other) : Value(other.getType()), m_value(other.m_value), m_intType(other.m_intType) { } @@ -219,44 +206,28 @@ class FloatValue : public Value /*! * @brief Constructor. */ - FloatValue() - : Value(kFloatValue) - , m_value(0.0) - { - } + FloatValue() : Value(kFloatValue), m_value(0.0) {} /*! * @brief Constructor. * * @param[in] value FloatValue value. */ - explicit FloatValue(double value) - : Value(kFloatValue) - , m_value(value) - { - } + explicit FloatValue(double value) : Value(kFloatValue), m_value(value) {} /*! * @brief Constructor. * * @param[in] value FloatValue value. */ - explicit FloatValue(float value) - : Value(kFloatValue) - , m_value(value) - { - } + explicit FloatValue(float value) : Value(kFloatValue), m_value(value) {} /*! * @brief Copy constructor. * * @param[in] other FloatValue to copy. */ - explicit FloatValue(const FloatValue &other) - : Value(kFloatValue) - , m_value(other.m_value) - { - } + explicit FloatValue(const FloatValue &other) : Value(kFloatValue), m_value(other.m_value) {} /*! * @brief Assign operator. @@ -361,44 +332,28 @@ class StringValue : public Value /*! * @brief Constructor. */ - StringValue() - : Value(kStringValue) - , m_value() - { - } + StringValue() : Value(kStringValue), m_value() {} /*! * @brief Constructor. * * @param[in] value StringValue value. */ - explicit StringValue(const std::string &value) - : Value(kStringValue) - , m_value(value) - { - } + explicit StringValue(const std::string &value) : Value(kStringValue), m_value(value) {} /*! * @brief Constructor. * * @param[in] value StringValue value. */ - explicit StringValue(const std::string *value) - : Value(kStringValue) - , m_value(*value) - { - } + explicit StringValue(const std::string *value) : Value(kStringValue), m_value(*value) {} /*! * @brief Copy constructor. * * @param[in] other StringValue to copy. */ - StringValue(const StringValue &other) - : Value(kStringValue) - , m_value(other.m_value) - { - } + StringValue(const StringValue &other) : Value(kStringValue), m_value(other.m_value) {} /*! * @brief Get StringValue type name. diff --git a/erpcgen/src/erpcgen.cpp b/erpcgen/src/erpcgen.cpp index 103a36d0..ba91e972 100644 --- a/erpcgen/src/erpcgen.cpp +++ b/erpcgen/src/erpcgen.cpp @@ -121,15 +121,9 @@ class erpcgenTool * * Creates the singleton logger instance. */ - erpcgenTool(int argc, char *argv[]) - : m_argc(argc) - , m_argv(argv) - , m_logger(0) - , m_verboseType(kWarning) - , m_outputFilePath(NULL) - , m_ErpcFile(NULL) - , m_outputLanguage(kCLanguage) - , m_codec(InterfaceDefinition::kNotSpecified) + erpcgenTool(int argc, char *argv[]) : + m_argc(argc), m_argv(argv), m_logger(0), m_verboseType(kWarning), m_outputFilePath(NULL), m_ErpcFile(NULL), + m_outputLanguage(kCLanguage), m_codec(InterfaceDefinition::kNotSpecified) { // create logger instance m_logger = new StdoutLogger(); diff --git a/erpcgen/src/options.cpp b/erpcgen/src/options.cpp index 07c231ec..c123cc84 100644 --- a/erpcgen/src/options.cpp +++ b/erpcgen/src/options.cpp @@ -74,10 +74,7 @@ static const char endl = '\n'; class ostream { public: - ostream(FILE *fileptr) - : fp(fileptr) - { - } + ostream(FILE *fileptr) : fp(fileptr) {} ostream &operator<<(char ch); @@ -159,12 +156,8 @@ void OptArgvIter::rewind(void) static const char WHITESPACE[] = " \t\n\r\v\f"; const char *OptStrTokIter::default_delims = WHITESPACE; -OptStrTokIter::OptStrTokIter(const char *tokens, const char *arg_delimiters) -: len(unsigned(strlen(tokens))) -, str(tokens) -, seps(arg_delimiters) -, cur(NULLSTR) -, tokstr(NULLSTR) +OptStrTokIter::OptStrTokIter(const char *tokens, const char *arg_delimiters) : +len(unsigned(strlen(tokens))), str(tokens), seps(arg_delimiters), cur(NULLSTR), tokstr(NULLSTR) { if (seps == NULL) seps = default_delims; @@ -220,9 +213,7 @@ enum const unsigned OptIstreamIter::MAX_LINE_LEN = 1024; // Constructor -OptIstreamIter::OptIstreamIter(istream &input) -: is(input) -, tok_iter(NULL) +OptIstreamIter::OptIstreamIter(istream &input) : is(input), tok_iter(NULL) { #ifdef USE_STDIO fprintf(stderr, "%s: Can't use OptIstreamIter class:\n", "OptIstreamIter::OptIstreamIter"); @@ -408,20 +399,14 @@ static kwdmatch_t kwdmatch(const char *src, const char *attempt, int len = 0) class OptionSpec { public: - OptionSpec(const char *decl = NULLSTR) - : hidden(0) - , spec(decl) + OptionSpec(const char *decl = NULLSTR) : hidden(0), spec(decl) { if (spec == NULL) spec = NULL_spec; CheckHidden(); } - OptionSpec(const OptionSpec &cp) - : hidden(cp.hidden) - , spec(cp.spec) - { - } + OptionSpec(const OptionSpec &cp) : hidden(cp.hidden), spec(cp.spec) {} // NOTE: use default destructor! @@ -642,13 +627,8 @@ unsigned OptionSpec::Format(char *buf, unsigned optctrls) const #define DIR_SEP_CHAR '/' #endif -Options::Options(const char *arg_name, const char *const optv[]) -: explicit_end(0) -, optctrls(DEFAULT) -, optvec(optv) -, nextchar(NULLSTR) -, listopt(NULLSTR) -, cmdname(arg_name) +Options::Options(const char *arg_name, const char *const optv[]) : +explicit_end(0), optctrls(DEFAULT), optvec(optv), nextchar(NULLSTR), listopt(NULLSTR), cmdname(arg_name) { const char *basename = ::strrchr(cmdname, DIR_SEP_CHAR); if (basename) diff --git a/erpcgen/src/options.hpp b/erpcgen/src/options.hpp index 371daca8..2bee7815 100644 --- a/erpcgen/src/options.hpp +++ b/erpcgen/src/options.hpp @@ -102,19 +102,9 @@ class OptArgvIter : public OptIterRwd const char *const *av; // arg vector public: - explicit OptArgvIter(const char *const argv[]) - : ndx(0) - , ac(-1) - , av(argv) - { - } + explicit OptArgvIter(const char *const argv[]) : ndx(0), ac(-1), av(argv) {} - OptArgvIter(int argc, const char *const argv[]) - : ndx(0) - , ac(argc) - , av(argv) - { - } + OptArgvIter(int argc, const char *const argv[]) : ndx(0), ac(argc), av(argv) {} virtual ~OptArgvIter(void); diff --git a/erpcgen/src/smart_ptr.hpp b/erpcgen/src/smart_ptr.hpp index 5b12a506..71918e9d 100644 --- a/erpcgen/src/smart_ptr.hpp +++ b/erpcgen/src/smart_ptr.hpp @@ -48,23 +48,13 @@ class smart_ptr typedef const T &const_ref_type; //! Default constructor. Initializes with no pointer set. - smart_ptr() - : _p(nullptr) - { - } + smart_ptr() : _p(nullptr) {} //! This constructor takes a pointer to the object to be deleted. - smart_ptr(ptr_type p) - : _p(p) - { - } + smart_ptr(ptr_type p) : _p(p) {} //! @brief Move copy constructor. - smart_ptr(smart_ptr &&other) - : _p(other._p) - { - other._p = nullptr; - } + smart_ptr(smart_ptr &&other) : _p(other._p) { other._p = nullptr; } //! @brief Move assignment operator. smart_ptr &operator=(smart_ptr &&other) diff --git a/erpcgen/src/types/AliasType.hpp b/erpcgen/src/types/AliasType.hpp index 6fc99285..49fda6dc 100644 --- a/erpcgen/src/types/AliasType.hpp +++ b/erpcgen/src/types/AliasType.hpp @@ -34,9 +34,7 @@ class AliasType : public DataType * @param[in] name Name. * @param[in] elementType Given data type. */ - AliasType(const std::string &name, DataType *elementType) - : DataType(name, kAliasType) - , m_elementType(elementType) + AliasType(const std::string &name, DataType *elementType) : DataType(name, kAliasType), m_elementType(elementType) { } @@ -48,11 +46,7 @@ class AliasType : public DataType * @param[in] tok Token, which contains name and location. * @param[in] elementType Given data type. */ - AliasType(const Token &tok, DataType *elementType) - : DataType(tok, kAliasType) - , m_elementType(elementType) - { - } + AliasType(const Token &tok, DataType *elementType) : DataType(tok, kAliasType), m_elementType(elementType) {} /*! * @brief This function return element data type. diff --git a/erpcgen/src/types/Annotation.hpp b/erpcgen/src/types/Annotation.hpp index 029b232f..f32cf022 100644 --- a/erpcgen/src/types/Annotation.hpp +++ b/erpcgen/src/types/Annotation.hpp @@ -44,11 +44,8 @@ class Annotation * @param[in] val Pointer to value. * @param[in] lang Programming language for which is annotation intended. */ - Annotation(const Token &token, Value *val, program_lang_t lang) - : m_name(token.getStringValue()) - , m_value(val) - , m_location(token.getLocation()) - , m_lang(lang) + Annotation(const Token &token, Value *val, program_lang_t lang) : + m_name(token.getStringValue()), m_value(val), m_location(token.getLocation()), m_lang(lang) { } @@ -59,11 +56,8 @@ class Annotation * * @param[in] token Token contains annotation name and location in parsed file. */ - explicit Annotation(const Token &token) - : m_name(token.getStringValue()) - , m_value(nullptr) - , m_location(token.getLocation()) - , m_lang(kAll) + explicit Annotation(const Token &token) : + m_name(token.getStringValue()), m_value(nullptr), m_location(token.getLocation()), m_lang(kAll) { } @@ -74,11 +68,8 @@ class Annotation * * @param[in] a Source annotation. */ - explicit Annotation(const Annotation &a) - : m_name(a.m_name) - , m_value(a.m_value) - , m_location(a.m_location) - , m_lang(a.m_lang) + explicit Annotation(const Annotation &a) : + m_name(a.m_name), m_value(a.m_value), m_location(a.m_location), m_lang(a.m_lang) { } diff --git a/erpcgen/src/types/ArrayType.hpp b/erpcgen/src/types/ArrayType.hpp index 13d105c4..bfabf4a0 100644 --- a/erpcgen/src/types/ArrayType.hpp +++ b/erpcgen/src/types/ArrayType.hpp @@ -34,10 +34,8 @@ class ArrayType : public DataType * @param[in] elementType Given data type. * @param[in] elementCount Given count. */ - ArrayType(DataType *elementType, uint32_t elementCount) - : DataType("(array)", kArrayType) - , m_elementType(elementType) - , m_elementCount(elementCount) + ArrayType(DataType *elementType, uint32_t elementCount) : + DataType("(array)", kArrayType), m_elementType(elementType), m_elementCount(elementCount) { } diff --git a/erpcgen/src/types/BuiltinType.hpp b/erpcgen/src/types/BuiltinType.hpp index 003c04ce..2c6c12a1 100644 --- a/erpcgen/src/types/BuiltinType.hpp +++ b/erpcgen/src/types/BuiltinType.hpp @@ -55,9 +55,8 @@ class BuiltinType : public DataType * @param[in] name Given name. * @param[in] builtinType Given builtin type. */ - BuiltinType(const std::string &name, _builtin_type builtinType) - : DataType(name, kBuiltinType) - , m_builtinType(builtinType) + BuiltinType(const std::string &name, _builtin_type builtinType) : + DataType(name, kBuiltinType), m_builtinType(builtinType) { } diff --git a/erpcgen/src/types/ConstType.hpp b/erpcgen/src/types/ConstType.hpp index 7b1988fa..1953b90d 100644 --- a/erpcgen/src/types/ConstType.hpp +++ b/erpcgen/src/types/ConstType.hpp @@ -36,10 +36,8 @@ class ConstType : public Symbol * @param[in] dataType Given data type.. * @param[in] value Given value. */ - ConstType(const Token &tok, DataType *dataType, Value *value) - : Symbol(kConstSymbol, tok) - , m_dataType(dataType) - , m_value(value) + ConstType(const Token &tok, DataType *dataType, Value *value) : + Symbol(kConstSymbol, tok), m_dataType(dataType), m_value(value) { } diff --git a/erpcgen/src/types/DataType.hpp b/erpcgen/src/types/DataType.hpp index 9cdfd55b..fdd2e209 100644 --- a/erpcgen/src/types/DataType.hpp +++ b/erpcgen/src/types/DataType.hpp @@ -49,11 +49,7 @@ class DataType : public Symbol * * @param[in] dataType Given data type. */ - explicit DataType(data_type_t dataType) - : Symbol(kTypenameSymbol) - , m_dataType(dataType) - { - } + explicit DataType(data_type_t dataType) : Symbol(kTypenameSymbol), m_dataType(dataType) {} /*! * @brief Constructor. @@ -63,11 +59,7 @@ class DataType : public Symbol * @param[in] dataType Given data type. * @param[in] name Given name for symbol. */ - DataType(const std::string &name, data_type_t dataType) - : Symbol(kTypenameSymbol, name) - , m_dataType(dataType) - { - } + DataType(const std::string &name, data_type_t dataType) : Symbol(kTypenameSymbol, name), m_dataType(dataType) {} /*! * @brief Constructor. * @@ -77,11 +69,7 @@ class DataType : public Symbol * @param[in] dataType Given data type. * @param[in] symbolType Given symbol type for symbol. */ - DataType(const Token &tok, data_type_t dataType) - : Symbol(kTypenameSymbol, tok) - , m_dataType(dataType) - { - } + DataType(const Token &tok, data_type_t dataType) : Symbol(kTypenameSymbol, tok), m_dataType(dataType) {} /*! * @brief This function returns data type. diff --git a/erpcgen/src/types/EnumMember.hpp b/erpcgen/src/types/EnumMember.hpp index ea8b0715..95ecaf6d 100644 --- a/erpcgen/src/types/EnumMember.hpp +++ b/erpcgen/src/types/EnumMember.hpp @@ -34,12 +34,7 @@ class EnumMember : public Symbol * @param[in] tok Token, which contains name and location. * @param[in] value Given value. */ - EnumMember(const Token &tok, uint32_t value) - : Symbol(kEnumMemberSymbol, tok) - , m_value(value) - , m_valueSet(true) - { - } + EnumMember(const Token &tok, uint32_t value) : Symbol(kEnumMemberSymbol, tok), m_value(value), m_valueSet(true) {} /*! * @brief Constructor. @@ -48,12 +43,7 @@ class EnumMember : public Symbol * * @param[in] tok Token, which contains name and location. */ - explicit EnumMember(const Token &tok) - : Symbol(kEnumMemberSymbol, tok) - , m_value(-1) - , m_valueSet(false) - { - } + explicit EnumMember(const Token &tok) : Symbol(kEnumMemberSymbol, tok), m_value(-1), m_valueSet(false) {} /*! * @brief This function set enum member value. diff --git a/erpcgen/src/types/EnumType.hpp b/erpcgen/src/types/EnumType.hpp index 91d0c932..d7ba836e 100644 --- a/erpcgen/src/types/EnumType.hpp +++ b/erpcgen/src/types/EnumType.hpp @@ -37,20 +37,14 @@ class EnumType : public DataType * * @param[in] tok Given token. */ - explicit EnumType(const Token &tok) - : DataType(tok, kEnumType) - { - } + explicit EnumType(const Token &tok) : DataType(tok, kEnumType) {} /*! * @brief Constructor. * * This function set DataType with default name. */ - EnumType() - : DataType("", kEnumType) - { - } + EnumType() : DataType("", kEnumType) {} /*! * @brief This function will add enum member to the enum. diff --git a/erpcgen/src/types/Function.hpp b/erpcgen/src/types/Function.hpp index bfa3d3b0..071108de 100644 --- a/erpcgen/src/types/Function.hpp +++ b/erpcgen/src/types/Function.hpp @@ -33,12 +33,7 @@ class FunctionBase /*! * @brief Constructor. */ - FunctionBase() - : m_parameters("(fn)") - , m_returnType(nullptr) - , m_isOneway(false) - { - } + FunctionBase() : m_parameters("(fn)"), m_returnType(nullptr), m_isOneway(false) {} virtual ~FunctionBase(){}; @@ -114,9 +109,7 @@ class FunctionType; * * The function's parameters are represented by a StructType object. */ -class Function -: public FunctionBase -, public Symbol +class Function : public FunctionBase, public Symbol { public: /*! @@ -127,12 +120,9 @@ class Function * @param[in] tok Given token. * @param[in] m_interface Parent interface. */ - Function(const Token &tok, Interface *interface) - : FunctionBase() - , Symbol(kFunctionSymbol, tok) - , m_uniqueId(++s_idCounter) - , m_interface(interface) - , m_functionType(nullptr) + Function(const Token &tok, Interface *interface) : + FunctionBase(), Symbol(kFunctionSymbol, tok), m_uniqueId(++s_idCounter), m_interface(interface), + m_functionType(nullptr) { } @@ -145,12 +135,8 @@ class Function * @param[in] m_interface Parent interface. * @param[in] uniqueId Given unique function id. */ - Function(const Token &tok, Interface *interface, uint32_t uniqueId) - : FunctionBase() - , Symbol(kFunctionSymbol, tok) - , m_uniqueId(uniqueId) - , m_interface(interface) - , m_functionType(nullptr) + Function(const Token &tok, Interface *interface, uint32_t uniqueId) : + FunctionBase(), Symbol(kFunctionSymbol, tok), m_uniqueId(uniqueId), m_interface(interface), m_functionType(nullptr) { s_idCounter = uniqueId; } diff --git a/erpcgen/src/types/FunctionType.hpp b/erpcgen/src/types/FunctionType.hpp index 96249ad2..f17068a6 100644 --- a/erpcgen/src/types/FunctionType.hpp +++ b/erpcgen/src/types/FunctionType.hpp @@ -28,9 +28,7 @@ namespace erpcgen { * * The function's parameters are represented by a StructType object. */ -class FunctionType -: public FunctionBase -, public DataType +class FunctionType : public FunctionBase, public DataType { public: typedef std::vector c_function_list_t; /*!< List type of callback functions. */ @@ -42,12 +40,7 @@ class FunctionType * * @param[in] tok Given token. */ - explicit FunctionType(const Token &tok) - : FunctionBase() - , DataType(tok, kFunctionType) - , m_callbackFuns() - { - } + explicit FunctionType(const Token &tok) : FunctionBase(), DataType(tok, kFunctionType), m_callbackFuns() {} /*! * @brief This function returns description about the interface function. diff --git a/erpcgen/src/types/Group.hpp b/erpcgen/src/types/Group.hpp index 3fa55378..241eaba3 100644 --- a/erpcgen/src/types/Group.hpp +++ b/erpcgen/src/types/Group.hpp @@ -38,10 +38,7 @@ class Group * * @param[in] name Group name. */ - explicit Group(const std::string &name) - : m_name(name) - { - } + explicit Group(const std::string &name) : m_name(name) {} /*! * @brief This function returns the group name. diff --git a/erpcgen/src/types/Interface.hpp b/erpcgen/src/types/Interface.hpp index 1dea8b36..0c1fecbc 100644 --- a/erpcgen/src/types/Interface.hpp +++ b/erpcgen/src/types/Interface.hpp @@ -38,12 +38,7 @@ class Interface : public Symbol * * @param[in] tok Given token. */ - explicit Interface(const Token &tok) - : Symbol(kInterfaceSymbol, tok) - , m_scope() - , m_uniqueId(s_idCounter++) - { - } + explicit Interface(const Token &tok) : Symbol(kInterfaceSymbol, tok), m_scope(), m_uniqueId(s_idCounter++) {} /*! * @brief This function will add function to the interface. diff --git a/erpcgen/src/types/ListType.hpp b/erpcgen/src/types/ListType.hpp index f564d7cd..fbd3e93f 100644 --- a/erpcgen/src/types/ListType.hpp +++ b/erpcgen/src/types/ListType.hpp @@ -33,10 +33,8 @@ class ListType : public DataType * * @param[in] elementType Given data type. */ - explicit ListType(DataType *elementType) - : DataType("(list)", kListType) - , m_elementType(elementType) - , m_lengthVariableName("") + explicit ListType(DataType *elementType) : + DataType("(list)", kListType), m_elementType(elementType), m_lengthVariableName("") { } diff --git a/erpcgen/src/types/Program.hpp b/erpcgen/src/types/Program.hpp index 990aed65..aec1818b 100644 --- a/erpcgen/src/types/Program.hpp +++ b/erpcgen/src/types/Program.hpp @@ -35,10 +35,7 @@ class Program : public Symbol * * @param[in] tok Given token. */ - explicit Program(const Token &tok) - : Symbol(kProgramSymbol, tok) - { - } + explicit Program(const Token &tok) : Symbol(kProgramSymbol, tok) {} }; } // namespace erpcgen diff --git a/erpcgen/src/types/StructMember.hpp b/erpcgen/src/types/StructMember.hpp index 576e74bd..c6bdf01c 100644 --- a/erpcgen/src/types/StructMember.hpp +++ b/erpcgen/src/types/StructMember.hpp @@ -46,13 +46,9 @@ class StructMember : public Symbol * @param[in] name Given name. * @param[in] dataType Given data type. */ - StructMember(const std::string &name, DataType *dataType) - : Symbol(kStructMemberSymbol, name) - , m_dataType(dataType) - , m_paramDirection() - , m_containList() - , m_containString() - , m_byref(false) + StructMember(const std::string &name, DataType *dataType) : + Symbol(kStructMemberSymbol, name), m_dataType(dataType), m_paramDirection(), m_containList(), m_containString(), + m_byref(false) { } @@ -64,13 +60,9 @@ class StructMember : public Symbol * @param[in] tok Given token. * @param[in] dataType Given data type. */ - StructMember(const Token &tok, DataType *dataType) - : Symbol(kStructMemberSymbol, tok) - , m_dataType(dataType) - , m_paramDirection() - , m_containList() - , m_containString() - , m_byref(false) + StructMember(const Token &tok, DataType *dataType) : + Symbol(kStructMemberSymbol, tok), m_dataType(dataType), m_paramDirection(), m_containList(), m_containString(), + m_byref(false) { } diff --git a/erpcgen/src/types/StructType.hpp b/erpcgen/src/types/StructType.hpp index 76b8d36e..0c396e33 100644 --- a/erpcgen/src/types/StructType.hpp +++ b/erpcgen/src/types/StructType.hpp @@ -38,10 +38,7 @@ class StructType : public DataType * * @param[in] name Given name. */ - explicit StructType(const std::string &name) - : DataType(name, kStructType) - { - } + explicit StructType(const std::string &name) : DataType(name, kStructType) {} /*! * @brief Constructor. @@ -50,10 +47,7 @@ class StructType : public DataType * * @param[in] tok Given token. */ - explicit StructType(const Token &tok) - : DataType(tok, kStructType) - { - } + explicit StructType(const Token &tok) : DataType(tok, kStructType) {} /*! * @brief This function will add struct member to the struct. diff --git a/erpcgen/src/types/Symbol.hpp b/erpcgen/src/types/Symbol.hpp index 6f854713..d32c83dc 100644 --- a/erpcgen/src/types/Symbol.hpp +++ b/erpcgen/src/types/Symbol.hpp @@ -50,13 +50,8 @@ class Symbol * * @param[in] symType Enum symbol type. */ - explicit Symbol(symbol_type_t symType) - : m_symbolType(symType) - , m_name() - , m_location() - , m_annotations() - , m_mlComment("") - , m_ilComment("") + explicit Symbol(symbol_type_t symType) : + m_symbolType(symType), m_name(), m_location(), m_annotations(), m_mlComment(""), m_ilComment("") { } @@ -68,13 +63,8 @@ class Symbol * @param[in] symType Enum symbol type. * @param[in] name Name for symbol. */ - Symbol(symbol_type_t symType, const std::string &name) - : m_symbolType(symType) - , m_name(name) - , m_location() - , m_annotations() - , m_mlComment("") - , m_ilComment("") + Symbol(symbol_type_t symType, const std::string &name) : + m_symbolType(symType), m_name(name), m_location(), m_annotations(), m_mlComment(""), m_ilComment("") { } @@ -86,13 +76,9 @@ class Symbol * @param[in] symType Enum symbol type. * @param[in] tok Token for symbol, which contains name and location. */ - Symbol(symbol_type_t symType, const Token &tok) - : m_symbolType(symType) - , m_name(tok.getStringValue()) - , m_location(tok.getLocation()) - , m_annotations() - , m_mlComment("") - , m_ilComment("") + Symbol(symbol_type_t symType, const Token &tok) : + m_symbolType(symType), m_name(tok.getStringValue()), m_location(tok.getLocation()), m_annotations(), + m_mlComment(""), m_ilComment("") { } diff --git a/erpcgen/src/types/SymbolScope.hpp b/erpcgen/src/types/SymbolScope.hpp index 93b3a145..617d1985 100644 --- a/erpcgen/src/types/SymbolScope.hpp +++ b/erpcgen/src/types/SymbolScope.hpp @@ -69,12 +69,7 @@ class SymbolScope /*! * @brief Constructor. */ - SymbolScope() - : m_symbolMap() - , m_symbolVector() - , m_parent(nullptr) - { - } + SymbolScope() : m_symbolMap(), m_symbolVector(), m_parent(nullptr) {} /*! * @brief Destructor. diff --git a/erpcgen/src/types/Type.cpp b/erpcgen/src/types/Type.cpp index 91eed826..f35eed0b 100644 --- a/erpcgen/src/types/Type.cpp +++ b/erpcgen/src/types/Type.cpp @@ -119,10 +119,8 @@ string Symbol::getAnnStringValue(const string &annName, Annotation::program_lang return (annVallue) ? annVallue->toString() : ""; } -SymbolScope::typed_iterator::typed_iterator(const vit &bv, const vit &ev, Symbol::symbol_type_t predicateType) -: m_vec(bv) -, m_endvec(ev) -, m_predicateType(predicateType) +SymbolScope::typed_iterator::typed_iterator(const vit &bv, const vit &ev, Symbol::symbol_type_t predicateType) : +m_vec(bv), m_endvec(ev), m_predicateType(predicateType) { // Advance to the first matching symbol. while (m_vec != m_endvec && (*m_vec)->getSymbolType() != m_predicateType) diff --git a/erpcgen/src/types/UnionCase.hpp b/erpcgen/src/types/UnionCase.hpp index dd924c8b..5269a345 100644 --- a/erpcgen/src/types/UnionCase.hpp +++ b/erpcgen/src/types/UnionCase.hpp @@ -35,11 +35,8 @@ class UnionCase : public Symbol * @param[in] caseName Given case name. * @param[in] caseValue Given case value. */ - UnionCase(const std::string &caseName, int32_t caseValue) - : Symbol(kUnionCaseMemberSymbol, caseName) - , m_caseName(caseName) - , m_caseValue(caseValue) - , m_containingUnion(nullptr) + UnionCase(const std::string &caseName, int32_t caseValue) : + Symbol(kUnionCaseMemberSymbol, caseName), m_caseName(caseName), m_caseValue(caseValue), m_containingUnion(nullptr) { } @@ -51,11 +48,8 @@ class UnionCase : public Symbol * * @param[in] caseValue Given case value. */ - explicit UnionCase(int32_t caseValue) - : Symbol(kUnionCaseMemberSymbol) - , m_caseName("") - , m_caseValue(caseValue) - , m_containingUnion(nullptr) + explicit UnionCase(int32_t caseValue) : + Symbol(kUnionCaseMemberSymbol), m_caseName(""), m_caseValue(caseValue), m_containingUnion(nullptr) { } @@ -67,11 +61,8 @@ class UnionCase : public Symbol * * @param[in] caseName Given case name. */ - explicit UnionCase(const std::string &caseName) - : Symbol(kUnionCaseMemberSymbol) - , m_caseName(caseName) - , m_caseValue(-1) - , m_containingUnion(nullptr) + explicit UnionCase(const std::string &caseName) : + Symbol(kUnionCaseMemberSymbol), m_caseName(caseName), m_caseValue(-1), m_containingUnion(nullptr) { } diff --git a/erpcgen/src/types/UnionType.hpp b/erpcgen/src/types/UnionType.hpp index e04d99de..1acfe32f 100644 --- a/erpcgen/src/types/UnionType.hpp +++ b/erpcgen/src/types/UnionType.hpp @@ -39,11 +39,8 @@ class UnionType : public DataType * @param[in] name Given name. * @param[in] discriminatorName Discriminator name. */ - UnionType(const std::string &name, const std::string &discriminatorName) - : DataType(name, kUnionType) - , m_discriminator(discriminatorName) - , m_members("(union)") - , m_parentStruct(nullptr) + UnionType(const std::string &name, const std::string &discriminatorName) : + DataType(name, kUnionType), m_discriminator(discriminatorName), m_members("(union)"), m_parentStruct(nullptr) { } @@ -56,11 +53,8 @@ class UnionType : public DataType * @param[in] tok Given token.. * @param[in] discriminatorName Discriminator name. */ - UnionType(const Token &tok, const std::string &discriminatorName) - : DataType(tok, kUnionType) - , m_discriminator(discriminatorName) - , m_members("(union)") - , m_parentStruct(nullptr) + UnionType(const Token &tok, const std::string &discriminatorName) : + DataType(tok, kUnionType), m_discriminator(discriminatorName), m_members("(union)"), m_parentStruct(nullptr) { } diff --git a/erpcgen/src/types/VoidType.hpp b/erpcgen/src/types/VoidType.hpp index 2ab9e5c6..febfb5ad 100644 --- a/erpcgen/src/types/VoidType.hpp +++ b/erpcgen/src/types/VoidType.hpp @@ -31,10 +31,7 @@ class VoidType : public DataType * * This function set name to "(void)". */ - VoidType() - : DataType("(void)", kVoidType) - { - } + VoidType() : DataType("(void)", kVoidType) {} /*! * @brief This function returns description about the void. diff --git a/erpcsniffer/src/Sniffer.hpp b/erpcsniffer/src/Sniffer.hpp index b61177d9..5d73f51b 100644 --- a/erpcsniffer/src/Sniffer.hpp +++ b/erpcsniffer/src/Sniffer.hpp @@ -37,12 +37,10 @@ class Sniffer * @param[in] quantity How much messages record. */ Sniffer(erpc::Transport *transport, erpcgen::InterfaceDefinition *def, const char *outputFilePath, - uint64_t quantity) - : m_transport(transport) - , m_interfaces(def->getGlobals().getSymbolsOfType(erpcgen::Symbol::kInterfaceSymbol)) - , m_outputFilePath(outputFilePath) - , m_quantity(quantity) - , m_codec(new erpc::BasicCodec()){}; + uint64_t quantity) : + m_transport(transport), + m_interfaces(def->getGlobals().getSymbolsOfType(erpcgen::Symbol::kInterfaceSymbol)), + m_outputFilePath(outputFilePath), m_quantity(quantity), m_codec(new erpc::BasicCodec()){}; /*! * @brief This function is destructor of Sniffer class. diff --git a/erpcsniffer/src/erpcsniffer.cpp b/erpcsniffer/src/erpcsniffer.cpp index 96024268..66900b62 100644 --- a/erpcsniffer/src/erpcsniffer.cpp +++ b/erpcsniffer/src/erpcsniffer.cpp @@ -133,18 +133,9 @@ class erpcsnifferTool * * Creates the singleton logger instance. */ - erpcsnifferTool(int argc, char *argv[]) - : m_argc(argc) - , m_argv(argv) - , m_logger(0) - , m_verboseType(kWarning) - , m_outputFilePath(NULL) - , m_ErpcFile(NULL) - , m_transport(kNoneTransport) - , m_quantity(10) - , m_baudrate(115200) - , m_port(NULL) - , m_host(NULL) + erpcsnifferTool(int argc, char *argv[]) : + m_argc(argc), m_argv(argv), m_logger(0), m_verboseType(kWarning), m_outputFilePath(NULL), m_ErpcFile(NULL), + m_transport(kNoneTransport), m_quantity(10), m_baudrate(115200), m_port(NULL), m_host(NULL) { // create logger instance m_logger = new StdoutLogger();