From b6b0e71cc6381ecae66f39c7b5ffbfa4ea2ba04f Mon Sep 17 00:00:00 2001 From: TheSomeMan Date: Fri, 14 Oct 2022 21:09:14 +0700 Subject: [PATCH] Format source code using clang-format-14 (#30) --- .clang-format | 12 +- include/log.h | 6 +- include/mac_addr.h | 4 +- include/os_malloc.h | 12 +- include/os_mkgmtime.h | 2 +- include/os_mutex.h | 4 +- include/os_mutex_recursive.h | 4 +- include/os_sema.h | 4 +- include/os_signal.h | 34 +- include/os_str.h | 12 +- include/os_task.h | 88 ++-- include/os_time.h | 14 +- include/os_timer.h | 336 ++++++------- include/os_timer_sig.h | 60 +-- include/str_buf.h | 24 +- src/log_dump.c | 12 +- src/mac_addr.c | 10 +- src/os_malloc.c | 18 +- src/os_mkgmtime.c | 15 +- src/os_mutex.c | 4 +- src/os_mutex_recursive.c | 4 +- src/os_sema.c | 4 +- src/os_signal.c | 42 +- src/os_str.c | 16 +- src/os_task.c | 144 +++--- src/os_time.c | 10 +- src/os_timer.c | 440 +++++++++--------- src/os_timer_sig.c | 80 ++-- src/str_buf.c | 28 +- tests/common/esp_log_wrapper.cpp | 4 +- tests/common/include/TQueue.hpp | 10 +- tests/common/include/esp_err.h | 4 +- tests/common/include/esp_log.h | 2 +- tests/common/include/esp_log_wrapper.hpp | 8 +- tests/test_log_dump/test_log_dump.cpp | 14 +- tests/test_os_malloc/test_os_malloc.cpp | 12 +- tests/test_os_mutex/test_os_mutex.cpp | 56 +-- .../test_os_mutex_recursive.cpp | 54 +-- tests/test_os_sema/test_os_sema.cpp | 58 +-- .../test_os_signal_freertos.cpp | 76 +-- tests/test_os_str/test_os_str_to_int32.cpp | 36 +- tests/test_os_str/test_os_str_to_uint32.cpp | 22 +- tests/test_os_task/stubs.cpp | 24 +- tests/test_os_task/test_os_task.cpp | 4 +- tests/test_os_task/test_os_task.hpp | 4 +- tests/test_os_task/test_os_task_create.cpp | 6 +- .../test_os_task_create_finite.cpp | 6 +- ...os_task_create_finite_with_const_param.cpp | 6 +- ...st_os_task_create_finite_without_param.cpp | 4 +- .../test_os_task_create_static.cpp | 6 +- .../test_os_task_create_static_finite.cpp | 6 +- ..._create_static_finite_with_const_param.cpp | 6 +- ...ask_create_static_finite_without_param.cpp | 4 +- ...os_task_create_static_with_const_param.cpp | 8 +- ...st_os_task_create_static_without_param.cpp | 4 +- .../test_os_task_create_with_const_param.cpp | 10 +- .../test_os_task_create_without_param.cpp | 8 +- .../test_os_task_freertos.cpp | 60 +-- .../test_os_timer_freertos.cpp | 34 +- .../test_os_timer_sig_freertos.cpp | 32 +- tests/test_str_buf/test_str_buf.cpp | 24 +- 61 files changed, 1026 insertions(+), 1029 deletions(-) diff --git a/.clang-format b/.clang-format index f08d7ac..461d19b 100644 --- a/.clang-format +++ b/.clang-format @@ -1,11 +1,11 @@ -# use with clang-format v10 +# use with clang-format v14 # this code style is based on BARR-C:2018 (https://barrgroup.com/embedded-systems/books/embedded-c-coding-standard) Language: Cpp AccessModifierOffset: -4 AlignAfterOpenBracket: AlwaysBreak -AlignConsecutiveMacros: true -AlignConsecutiveAssignments: true -AlignConsecutiveDeclarations: true +AlignConsecutiveMacros: Consecutive +AlignConsecutiveAssignments: Consecutive +AlignConsecutiveDeclarations: Consecutive AlignEscapedNewlines: DontAlign AlignOperands: true AlignTrailingComments: true @@ -104,9 +104,9 @@ PenaltyBreakTemplateDeclaration: 10 PenaltyExcessCharacter: 1000000 #PenaltyReturnTypeOnItsOwnLine: 200 PenaltyReturnTypeOnItsOwnLine: 0 -PointerAlignment: Right +PointerAlignment: Left ReflowComments: true -SortIncludes: false +SortIncludes: Never SortUsingDeclarations: false SpaceAfterCStyleCast: false SpaceAfterLogicalNot: false diff --git a/include/log.h b/include/log.h index 6558202..bbda4ef 100644 --- a/include/log.h +++ b/include/log.h @@ -51,9 +51,9 @@ esp_log_timestamp(void); extern void log_print_dump( esp_log_level_t level, - const char * p_tag, - const char * p_log_prefix, - const uint8_t * p_buf, + const char* p_tag, + const char* p_log_prefix, + const uint8_t* p_buf, const uint32_t buf_size); #if LOG_LOCAL_LEVEL >= LOG_LEVEL_ERROR diff --git a/include/mac_addr.h b/include/mac_addr.h index 23b4a89..ffd9dec 100644 --- a/include/mac_addr.h +++ b/include/mac_addr.h @@ -37,10 +37,10 @@ typedef struct mac_address_str_t } void -mac_address_bin_init(mac_address_bin_t *p_mac, const uint8_t mac[MAC_ADDRESS_NUM_BYTES]); +mac_address_bin_init(mac_address_bin_t* p_mac, const uint8_t mac[MAC_ADDRESS_NUM_BYTES]); mac_address_str_t -mac_address_to_str(const mac_address_bin_t *p_mac); +mac_address_to_str(const mac_address_bin_t* p_mac); #ifdef __cplusplus } diff --git a/include/os_malloc.h b/include/os_malloc.h index a4b8611..ef938c2 100644 --- a/include/os_malloc.h +++ b/include/os_malloc.h @@ -23,7 +23,7 @@ extern "C" { */ ATTR_MALLOC ATTR_MALLOC_SIZE(1) -void * +void* os_malloc(const size_t size); /** @@ -35,7 +35,7 @@ os_malloc(const size_t size); */ ATTR_MALLOC ATTR_CALLOC_SIZE(1, 2) -void * +void* os_calloc(const size_t nmemb, const size_t size); /** @@ -50,7 +50,7 @@ os_calloc(const size_t nmemb, const size_t size); */ ATTR_WARN_UNUSED_RESULT bool -os_realloc_safe(void **const p_ptr, const size_t size); +os_realloc_safe(void** const p_ptr, const size_t size); /** * @brief This is a safer wrap for realloc, @@ -66,7 +66,7 @@ os_realloc_safe(void **const p_ptr, const size_t size); ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) bool -os_realloc_safe_and_clean(void **const p_ptr, const size_t size); +os_realloc_safe_and_clean(void** const p_ptr, const size_t size); /** * This is a wrap for 'free' - it deallocates a block of memory @@ -74,7 +74,7 @@ os_realloc_safe_and_clean(void **const p_ptr, const size_t size); * @param ptr - pointer to the memory block */ void -os_free_internal(void *ptr); +os_free_internal(void* ptr); /** * @brief os_free - is a wrap for 'free' which automatically sets pointer to NULL after the memory freeing. @@ -82,7 +82,7 @@ os_free_internal(void *ptr); #define os_free(ptr) \ do \ { \ - os_free_internal((void *)(ptr)); \ + os_free_internal((void*)(ptr)); \ ptr = NULL; \ } while (0) diff --git a/include/os_mkgmtime.h b/include/os_mkgmtime.h index aa01560..b30350b 100644 --- a/include/os_mkgmtime.h +++ b/include/os_mkgmtime.h @@ -29,7 +29,7 @@ extern "C" { * @return time_t - calendar time (or unix-time - seconds since the Epoch 1970) or (time_t)-1 if a error was detected. */ time_t -os_mkgmtime(struct tm *const p_tm_time_utc); +os_mkgmtime(struct tm* const p_tm_time_utc); #ifdef __cplusplus } diff --git a/include/os_mutex.h b/include/os_mutex.h index 20e45c9..59eb817 100644 --- a/include/os_mutex.h +++ b/include/os_mutex.h @@ -39,7 +39,7 @@ ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL os_mutex_t -os_mutex_create_static(os_mutex_static_t *const p_mutex_static); +os_mutex_create_static(os_mutex_static_t* const p_mutex_static); #endif /** @@ -49,7 +49,7 @@ os_mutex_create_static(os_mutex_static_t *const p_mutex_static); */ ATTR_NONNULL(1) void -os_mutex_delete(os_mutex_t *const ph_mutex); +os_mutex_delete(os_mutex_t* const ph_mutex); /** * @brief Lock the mutex (wait until it will be locked). diff --git a/include/os_mutex_recursive.h b/include/os_mutex_recursive.h index 1f758ba..32d53f1 100644 --- a/include/os_mutex_recursive.h +++ b/include/os_mutex_recursive.h @@ -39,7 +39,7 @@ ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL os_mutex_recursive_t -os_mutex_recursive_create_static(os_mutex_recursive_static_t *const p_mutex_static); +os_mutex_recursive_create_static(os_mutex_recursive_static_t* const p_mutex_static); #endif /** @@ -49,7 +49,7 @@ os_mutex_recursive_create_static(os_mutex_recursive_static_t *const p_mutex_stat */ ATTR_NONNULL(1) void -os_mutex_recursive_delete(os_mutex_recursive_t *const ph_mutex); +os_mutex_recursive_delete(os_mutex_recursive_t* const ph_mutex); /** * @brief Lock the mutex (wait until it will be locked). diff --git a/include/os_sema.h b/include/os_sema.h index 36cc9cf..1f19996 100644 --- a/include/os_sema.h +++ b/include/os_sema.h @@ -39,7 +39,7 @@ ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL os_sema_t -os_sema_create_static(os_sema_static_t *const p_sema_static); +os_sema_create_static(os_sema_static_t* const p_sema_static); #endif /** @@ -49,7 +49,7 @@ os_sema_create_static(os_sema_static_t *const p_sema_static); */ ATTR_NONNULL(1) void -os_sema_delete(os_sema_t *const ph_sema); +os_sema_delete(os_sema_t* const ph_sema); /** * @brief Wait until the semaphore is available and acquire it. diff --git a/include/os_signal.h b/include/os_signal.h index ac5eb57..72ec960 100644 --- a/include/os_signal.h +++ b/include/os_signal.h @@ -21,7 +21,7 @@ typedef struct os_signal_t os_signal_t; typedef struct os_signal_static_t { - void * stub1; + void* stub1; uint32_t stub2; bool stub3; } os_signal_static_t; @@ -75,7 +75,7 @@ typedef struct os_signal_bit_mask_t * @brief Create new os_signal_t object. * @return ptr to the instance of os_signal_t object. */ -os_signal_t * +os_signal_t* os_signal_create(void); /** @@ -85,8 +85,8 @@ os_signal_create(void); */ ATTR_RETURNS_NONNULL ATTR_NONNULL(1) -os_signal_t * -os_signal_create_static(os_signal_static_t *const p_signal_mem); +os_signal_t* +os_signal_create_static(os_signal_static_t* const p_signal_mem); /** * @brief Create os_signal_t object. @@ -96,31 +96,31 @@ os_signal_create_static(os_signal_static_t *const p_signal_mem); */ ATTR_NONNULL(1) void -os_signal_delete(os_signal_t **pp_signal); +os_signal_delete(os_signal_t** pp_signal); /** * @brief Register the current task in os_signal_t object. * @param true if the current task was registered successfully, false - if some other task was already registered. */ bool -os_signal_register_cur_thread(os_signal_t *const p_signal); +os_signal_register_cur_thread(os_signal_t* const p_signal); void -os_signal_unregister_cur_thread(os_signal_t *const p_signal); +os_signal_unregister_cur_thread(os_signal_t* const p_signal); /** * @brief Check if any task registered in os_signal_t object. * @param true if any task was registered. */ bool -os_signal_is_any_thread_registered(os_signal_t *const p_signal); +os_signal_is_any_thread_registered(os_signal_t* const p_signal); /** * @brief Check if the current task registered in os_signal_t object. * @param true if the current task was registered. */ bool -os_signal_is_current_thread_registered(os_signal_t *const p_signal); +os_signal_is_current_thread_registered(os_signal_t* const p_signal); /** * @brief Register a signal number to handle by os_signal_t. @@ -129,7 +129,7 @@ os_signal_is_current_thread_registered(os_signal_t *const p_signal); * @return true if success. */ bool -os_signal_add(os_signal_t *const p_signal, const os_signal_num_e sig_num); +os_signal_add(os_signal_t* const p_signal, const os_signal_num_e sig_num); /** * @brief Send the signal to the registered thread. @@ -138,7 +138,7 @@ os_signal_add(os_signal_t *const p_signal, const os_signal_num_e sig_num); * @return true if successful */ bool -os_signal_send(os_signal_t *const p_signal, const os_signal_num_e sig_num); +os_signal_send(os_signal_t* const p_signal, const os_signal_num_e sig_num); /** * @brief Wait for the calling task to receive one or more signals. @@ -151,10 +151,10 @@ os_signal_send(os_signal_t *const p_signal, const os_signal_num_e sig_num); ATTR_NONNULL(4) bool os_signal_wait_with_sig_mask( - os_signal_t *const p_signal, + os_signal_t* const p_signal, const os_signal_sig_mask_t expected_sig_mask, const os_delta_ticks_t timeout_ticks, - os_signal_events_t *const p_sig_events); + os_signal_events_t* const p_sig_events); /** * @brief Wait for the calling task to receive one or more signals withing the specified timeout. @@ -166,9 +166,9 @@ os_signal_wait_with_sig_mask( ATTR_NONNULL(3) bool os_signal_wait_with_timeout( - os_signal_t *const p_signal, + os_signal_t* const p_signal, const os_delta_ticks_t timeout_ticks, - os_signal_events_t *const p_sig_events); + os_signal_events_t* const p_sig_events); /** * @brief Wait infinitely for the calling task to receive one or more signals. @@ -178,11 +178,11 @@ os_signal_wait_with_timeout( */ ATTR_NONNULL(2) void -os_signal_wait(os_signal_t *const p_signal, os_signal_events_t *const p_sig_events); +os_signal_wait(os_signal_t* const p_signal, os_signal_events_t* const p_sig_events); ATTR_NONNULL(1) os_signal_num_e -os_signal_num_get_next(os_signal_events_t *const p_sig_events); +os_signal_num_get_next(os_signal_events_t* const p_sig_events); #ifdef __cplusplus } diff --git a/include/os_str.h b/include/os_str.h index 03ea448..00ae818 100644 --- a/include/os_str.h +++ b/include/os_str.h @@ -27,8 +27,8 @@ typedef int os_str2num_base_t; ATTR_NONNULL(1) uint32_t os_str_to_uint32_cptr( - const char *__restrict const p_str, - const char **__restrict const pp_end, + const char* __restrict const p_str, + const char** __restrict const pp_end, const os_str2num_base_t base); /** @@ -40,7 +40,7 @@ os_str_to_uint32_cptr( */ ATTR_NONNULL(1) uint32_t -os_str_to_uint32(char *__restrict const p_str, char **__restrict const pp_end, const os_str2num_base_t base); +os_str_to_uint32(char* __restrict const p_str, char** __restrict const pp_end, const os_str2num_base_t base); /** * @brief This is a wrapper for stdlib strtol which implements const-correctness and fixes portability issues (MISRA) @@ -52,8 +52,8 @@ os_str_to_uint32(char *__restrict const p_str, char **__restrict const pp_end, c ATTR_NONNULL(1) int32_t os_str_to_int32_cptr( - const char *__restrict const p_str, - const char **__restrict const pp_end, + const char* __restrict const p_str, + const char** __restrict const pp_end, const os_str2num_base_t base); /** @@ -65,7 +65,7 @@ os_str_to_int32_cptr( */ ATTR_NONNULL(1) int32_t -os_str_to_int32(char *__restrict const p_str, char **__restrict const pp_end, const os_str2num_base_t base); +os_str_to_int32(char* __restrict const p_str, char** __restrict const pp_end, const os_str2num_base_t base); #ifdef __cplusplus } diff --git a/include/os_task.h b/include/os_task.h index 0f3da8e..5ca7622 100644 --- a/include/os_task.h +++ b/include/os_task.h @@ -18,11 +18,11 @@ extern "C" { #endif -typedef ATTR_NORETURN void (*os_task_func_t)(void *p_param); -typedef ATTR_NORETURN void (*os_task_func_const_param_t)(const void *p_param); +typedef ATTR_NORETURN void (*os_task_func_t)(void* p_param); +typedef ATTR_NORETURN void (*os_task_func_const_param_t)(const void* p_param); typedef ATTR_NORETURN void (*os_task_func_without_param_t)(void); -typedef void (*os_task_finite_func_with_param_t)(void *p_param); -typedef void (*os_task_finite_func_with_const_param_t)(const void *p_param); +typedef void (*os_task_finite_func_with_param_t)(void* p_param); +typedef void (*os_task_finite_func_with_const_param_t)(const void* p_param); typedef void (*os_task_finite_func_without_param_t)(void); typedef UBaseType_t os_task_priority_t; typedef TaskHandle_t os_task_handle_t; @@ -44,11 +44,11 @@ ATTR_WARN_UNUSED_RESULT bool os_task_create( const os_task_func_t p_func, - const char *const p_name, + const char* const p_name, const uint32_t stack_depth, - void *const p_param, + void* const p_param, const os_task_priority_t priority, - os_task_handle_t *const ph_task); + os_task_handle_t* const ph_task); /** * Create a new task thread. @@ -65,11 +65,11 @@ ATTR_WARN_UNUSED_RESULT bool os_task_create_with_const_param( const os_task_func_const_param_t p_func, - const char *const p_name, + const char* const p_name, const uint32_t stack_depth, - const void *const p_param, + const void* const p_param, const os_task_priority_t priority, - os_task_handle_t *const ph_task); + os_task_handle_t* const ph_task); /** * Create a new task thread. @@ -85,10 +85,10 @@ ATTR_WARN_UNUSED_RESULT bool os_task_create_without_param( const os_task_func_without_param_t p_func, - const char *const p_name, + const char* const p_name, const uint32_t stack_depth, const os_task_priority_t priority, - os_task_handle_t *const ph_task); + os_task_handle_t* const ph_task); /** * Create a new task thread. @@ -104,9 +104,9 @@ ATTR_WARN_UNUSED_RESULT bool os_task_create_finite( const os_task_finite_func_with_param_t p_func, - const char *const p_name, + const char* const p_name, const uint32_t stack_depth, - void *const p_param, + void* const p_param, const os_task_priority_t priority); /** @@ -123,9 +123,9 @@ ATTR_WARN_UNUSED_RESULT bool os_task_create_finite_with_const_param( const os_task_finite_func_with_const_param_t p_func, - const char *const p_name, + const char* const p_name, const uint32_t stack_depth, - const void *const p_param, + const void* const p_param, const os_task_priority_t priority); /** @@ -141,7 +141,7 @@ ATTR_WARN_UNUSED_RESULT bool os_task_create_finite_without_param( const os_task_finite_func_without_param_t p_func, - const char *const p_name, + const char* const p_name, const uint32_t stack_depth, const os_task_priority_t priority); @@ -162,13 +162,13 @@ ATTR_WARN_UNUSED_RESULT bool os_task_create_static( const os_task_func_t p_func, - const char *const p_name, - os_task_stack_type_t *const p_stack_mem, + const char* const p_name, + os_task_stack_type_t* const p_stack_mem, const uint32_t stack_depth, - void *const p_param, + void* const p_param, const os_task_priority_t priority, - os_task_static_t *const p_task_mem, - os_task_handle_t *const ph_task); + os_task_static_t* const p_task_mem, + os_task_handle_t* const ph_task); /** * Create a new task thread without using memory allocation from the heap. @@ -187,13 +187,13 @@ ATTR_WARN_UNUSED_RESULT bool os_task_create_static_with_const_param( const os_task_func_const_param_t p_func, - const char *const p_name, - os_task_stack_type_t *const p_stack_mem, + const char* const p_name, + os_task_stack_type_t* const p_stack_mem, const uint32_t stack_depth, - const void *const p_param, + const void* const p_param, const os_task_priority_t priority, - os_task_static_t *const p_task_mem, - os_task_handle_t *const ph_task); + os_task_static_t* const p_task_mem, + os_task_handle_t* const ph_task); /** * Create a new task thread without using memory allocation from the heap. @@ -211,12 +211,12 @@ ATTR_WARN_UNUSED_RESULT bool os_task_create_static_without_param( const os_task_func_without_param_t p_func, - const char *const p_name, - os_task_stack_type_t *const p_stack_mem, + const char* const p_name, + os_task_stack_type_t* const p_stack_mem, const uint32_t stack_depth, const os_task_priority_t priority, - os_task_static_t *const p_task_mem, - os_task_handle_t *const ph_task); + os_task_static_t* const p_task_mem, + os_task_handle_t* const ph_task); /** * Create a new task thread without using memory allocation from the heap. @@ -234,12 +234,12 @@ ATTR_WARN_UNUSED_RESULT bool os_task_create_static_finite( const os_task_finite_func_with_param_t p_func, - const char *const p_name, - os_task_stack_type_t *const p_stack_mem, + const char* const p_name, + os_task_stack_type_t* const p_stack_mem, const uint32_t stack_depth, - void *const p_param, + void* const p_param, const os_task_priority_t priority, - os_task_static_t *const p_task_mem); + os_task_static_t* const p_task_mem); /** * Create a new task thread without using memory allocation from the heap. @@ -257,12 +257,12 @@ ATTR_WARN_UNUSED_RESULT bool os_task_create_static_finite_with_const_param( const os_task_finite_func_with_const_param_t p_func, - const char *const p_name, - os_task_stack_type_t *const p_stack_mem, + const char* const p_name, + os_task_stack_type_t* const p_stack_mem, const uint32_t stack_depth, - const void *const p_param, + const void* const p_param, const os_task_priority_t priority, - os_task_static_t *const p_task_mem); + os_task_static_t* const p_task_mem); /** * Create a new task thread without using memory allocation from the heap. @@ -279,11 +279,11 @@ ATTR_WARN_UNUSED_RESULT bool os_task_create_static_finite_without_param( const os_task_finite_func_without_param_t p_func, - const char *const p_name, - os_task_stack_type_t *const p_stack_mem, + const char* const p_name, + os_task_stack_type_t* const p_stack_mem, const uint32_t stack_depth, const os_task_priority_t priority, - os_task_static_t *const p_task_mem); + os_task_static_t* const p_task_mem); /** * Remove the task from the RTOS kernel's scheduler. @@ -292,14 +292,14 @@ os_task_create_static_finite_without_param( */ ATTR_NONNULL(1) void -os_task_delete(os_task_handle_t *const ph_task); +os_task_delete(os_task_handle_t* const ph_task); /** * Get task name for the current thread. * @return pointer to the string with the current task name. */ ATTR_WARN_UNUSED_RESULT -const char * +const char* os_task_get_name(void); /** diff --git a/include/os_time.h b/include/os_time.h index 65eff0e..2bb7a65 100644 --- a/include/os_time.h +++ b/include/os_time.h @@ -66,7 +66,7 @@ os_time_tm_mon_to_month(const int tm_mon) * @return os_time_month_e */ static inline os_time_month_e -os_time_get_tm_mon(const struct tm *const p_tm) +os_time_get_tm_mon(const struct tm* const p_tm) { return os_time_tm_mon_to_month(p_tm->tm_mon); } @@ -88,7 +88,7 @@ os_time_tm_wday_to_wday(const int tm_wday) * @return os_time_wday_e */ static inline os_time_wday_e -os_time_get_tm_wday(const struct tm *const p_tm) +os_time_get_tm_wday(const struct tm* const p_tm) { return os_time_tm_wday_to_wday(p_tm->tm_wday); } @@ -98,7 +98,7 @@ os_time_get_tm_wday(const struct tm *const p_tm) * @param month - month. * @return a string with a three-character abbreviation of the month. */ -const char * +const char* os_time_month_name_short(const os_time_month_e month); /** @@ -106,7 +106,7 @@ os_time_month_name_short(const os_time_month_e month); * @param month - month. * @return a string with a full name of the month. */ -const char * +const char* os_time_month_name_long(const os_time_month_e month); /** @@ -114,7 +114,7 @@ os_time_month_name_long(const os_time_month_e month); * @param day_of_the_week - day of the week. * @return a string with a two-character abbreviation of the day of the week. */ -const char * +const char* os_time_wday_name_short(const os_time_wday_e day_of_the_week); /** @@ -122,7 +122,7 @@ os_time_wday_name_short(const os_time_wday_e day_of_the_week); * @param day_of_the_week - day of the week. * @return a string with a three-character abbreviation of the day of the week. */ -const char * +const char* os_time_wday_name_mid(const os_time_wday_e day_of_the_week); /** @@ -130,7 +130,7 @@ os_time_wday_name_mid(const os_time_wday_e day_of_the_week); * @param day_of_the_week - day of the week. * @return a string with a full name of the day of the week. */ -const char * +const char* os_time_wday_name_long(const os_time_wday_e day_of_the_week); #ifdef __cplusplus diff --git a/include/os_timer.h b/include/os_timer.h index ff1efa7..767a745 100644 --- a/include/os_timer.h +++ b/include/os_timer.h @@ -34,9 +34,9 @@ typedef struct os_timer_one_shot_cptr_const_arg_t os_timer_one_shot_cptr_const typedef struct os_timer_periodic_static_obj_t { - void *stub1; - void *stub2; - void *stub3; + void* stub1; + void* stub2; + void* stub3; bool stub4; } os_timer_periodic_static_obj_t; @@ -48,9 +48,9 @@ typedef struct os_timer_periodic_static_t typedef struct os_timer_one_shot_static_obj_t { - void *stub1; - void *stub2; - void *stub3; + void* stub1; + void* stub2; + void* stub3; bool stub4; } os_timer_one_shot_static_obj_t; @@ -60,37 +60,37 @@ typedef struct os_timer_one_shot_static_t StaticTimer_t timer_mem; } os_timer_one_shot_static_t; -typedef void (*os_timer_callback_periodic_t)(os_timer_periodic_t *const p_timer, void *const p_arg); +typedef void (*os_timer_callback_periodic_t)(os_timer_periodic_t* const p_timer, void* const p_arg); -typedef void (*os_timer_callback_periodic_without_arg_t)(os_timer_periodic_without_arg_t *const p_timer); +typedef void (*os_timer_callback_periodic_without_arg_t)(os_timer_periodic_without_arg_t* const p_timer); typedef void ( - *os_timer_callback_periodic_const_arg_t)(os_timer_periodic_const_arg_t *const p_timer, const void *const p_arg); + *os_timer_callback_periodic_const_arg_t)(os_timer_periodic_const_arg_t* const p_timer, const void* const p_arg); -typedef void (*os_timer_callback_periodic_cptr_t)(const os_timer_periodic_cptr_t *const p_timer, void *const p_arg); +typedef void (*os_timer_callback_periodic_cptr_t)(const os_timer_periodic_cptr_t* const p_timer, void* const p_arg); typedef void (*os_timer_callback_periodic_cptr_without_arg_t)( - const os_timer_periodic_cptr_without_arg_t *const p_timer); + const os_timer_periodic_cptr_without_arg_t* const p_timer); typedef void (*os_timer_callback_periodic_cptr_const_arg_t)( - const os_timer_periodic_cptr_const_arg_t *const p_timer, - const void *const p_arg); + const os_timer_periodic_cptr_const_arg_t* const p_timer, + const void* const p_arg); -typedef void (*os_timer_callback_one_shot_t)(os_timer_one_shot_t *const p_timer, void *const p_arg); +typedef void (*os_timer_callback_one_shot_t)(os_timer_one_shot_t* const p_timer, void* const p_arg); -typedef void (*os_timer_callback_one_shot_without_arg_t)(os_timer_one_shot_without_arg_t *const p_timer); +typedef void (*os_timer_callback_one_shot_without_arg_t)(os_timer_one_shot_without_arg_t* const p_timer); typedef void ( - *os_timer_callback_one_shot_const_arg_t)(os_timer_one_shot_const_arg_t *const p_timer, const void *const p_arg); + *os_timer_callback_one_shot_const_arg_t)(os_timer_one_shot_const_arg_t* const p_timer, const void* const p_arg); -typedef void (*os_timer_callback_one_shot_cptr_t)(const os_timer_one_shot_cptr_t *const p_timer, void *const p_arg); +typedef void (*os_timer_callback_one_shot_cptr_t)(const os_timer_one_shot_cptr_t* const p_timer, void* const p_arg); typedef void (*os_timer_callback_one_shot_cptr_without_arg_t)( - const os_timer_one_shot_cptr_without_arg_t *const p_timer); + const os_timer_one_shot_cptr_without_arg_t* const p_timer); typedef void (*os_timer_callback_one_shot_cptr_const_arg_t)( - const os_timer_one_shot_cptr_const_arg_t *const p_timer, - const void *const p_arg); + const os_timer_one_shot_cptr_const_arg_t* const p_timer, + const void* const p_arg); /** * @brief Create a timer-object which will call specified callback-function periodically. @@ -101,50 +101,50 @@ typedef void (*os_timer_callback_one_shot_cptr_const_arg_t)( * @return ptr to the new os_timer_periodic_t instance. */ ATTR_WARN_UNUSED_RESULT -os_timer_periodic_t * +os_timer_periodic_t* os_timer_periodic_create( - const char *const p_timer_name, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_periodic_t p_cb_func, - void *const p_arg); + void* const p_arg); ATTR_WARN_UNUSED_RESULT -os_timer_periodic_without_arg_t * +os_timer_periodic_without_arg_t* os_timer_periodic_without_arg_create( - const char *const p_timer_name, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_periodic_without_arg_t p_cb_func); ATTR_WARN_UNUSED_RESULT -os_timer_periodic_const_arg_t * +os_timer_periodic_const_arg_t* os_timer_periodic_const_arg_create( - const char *const p_timer_name, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_periodic_const_arg_t p_cb_func, - const void *const p_arg); + const void* const p_arg); ATTR_WARN_UNUSED_RESULT -os_timer_periodic_cptr_t * +os_timer_periodic_cptr_t* os_timer_periodic_cptr_create( - const char *const p_timer_name, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_periodic_cptr_t p_cb_func, - void *const p_arg); + void* const p_arg); ATTR_WARN_UNUSED_RESULT -os_timer_periodic_cptr_without_arg_t * +os_timer_periodic_cptr_without_arg_t* os_timer_periodic_cptr_without_arg_create( - const char *const p_timer_name, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_periodic_cptr_without_arg_t p_cb_func); ATTR_WARN_UNUSED_RESULT -os_timer_periodic_cptr_const_arg_t * +os_timer_periodic_cptr_const_arg_t* os_timer_periodic_cptr_const_arg_create( - const char *const p_timer_name, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_periodic_cptr_const_arg_t p_cb_func, - const void *const p_arg); + const void* const p_arg); /** * @brief Create a timer-object using pre-allocated memory, which will call specified callback-function periodically. @@ -158,66 +158,66 @@ os_timer_periodic_cptr_const_arg_create( ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL -os_timer_periodic_t * +os_timer_periodic_t* os_timer_periodic_create_static( - os_timer_periodic_static_t *const p_mem, - const char *const p_timer_name, + os_timer_periodic_static_t* const p_mem, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_periodic_t p_cb_func, - void *const p_arg); + void* const p_arg); ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL -os_timer_periodic_without_arg_t * +os_timer_periodic_without_arg_t* os_timer_periodic_without_arg_create_static( - os_timer_periodic_static_t *const p_mem, - const char *const p_timer_name, + os_timer_periodic_static_t* const p_mem, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_periodic_without_arg_t p_cb_func); ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL -os_timer_periodic_const_arg_t * +os_timer_periodic_const_arg_t* os_timer_periodic_const_arg_create_static( - os_timer_periodic_static_t *const p_mem, - const char *const p_timer_name, + os_timer_periodic_static_t* const p_mem, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_periodic_const_arg_t p_cb_func, - const void *const p_arg); + const void* const p_arg); ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL -os_timer_periodic_cptr_t * +os_timer_periodic_cptr_t* os_timer_periodic_cptr_create_static( - os_timer_periodic_static_t *const p_mem, - const char *const p_timer_name, + os_timer_periodic_static_t* const p_mem, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_periodic_cptr_t p_cb_func, - void *const p_arg); + void* const p_arg); ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL -os_timer_periodic_cptr_without_arg_t * +os_timer_periodic_cptr_without_arg_t* os_timer_periodic_cptr_without_arg_create_static( - os_timer_periodic_static_t *const p_mem, - const char *const p_timer_name, + os_timer_periodic_static_t* const p_mem, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_periodic_cptr_without_arg_t p_cb_func); ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL -os_timer_periodic_cptr_const_arg_t * +os_timer_periodic_cptr_const_arg_t* os_timer_periodic_cptr_const_arg_create_static( - os_timer_periodic_static_t *const p_mem, - const char *const p_timer_name, + os_timer_periodic_static_t* const p_mem, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_periodic_cptr_const_arg_t p_cb_func, - const void *const p_arg); + const void* const p_arg); /** * @brief Create a timer-object which will call specified callback-function once. @@ -228,50 +228,50 @@ os_timer_periodic_cptr_const_arg_create_static( * @return ptr to the new os_timer_one_shot_t instance. */ ATTR_WARN_UNUSED_RESULT -os_timer_one_shot_t * +os_timer_one_shot_t* os_timer_one_shot_create( - const char *const p_timer_name, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_one_shot_t p_cb_func, - void *const p_arg); + void* const p_arg); ATTR_WARN_UNUSED_RESULT -os_timer_one_shot_without_arg_t * +os_timer_one_shot_without_arg_t* os_timer_one_shot_without_arg_create( - const char *const p_timer_name, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_one_shot_without_arg_t p_cb_func); ATTR_WARN_UNUSED_RESULT -os_timer_one_shot_const_arg_t * +os_timer_one_shot_const_arg_t* os_timer_one_shot_const_arg_create( - const char *const p_timer_name, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_one_shot_const_arg_t p_cb_func, - const void *const p_arg); + const void* const p_arg); ATTR_WARN_UNUSED_RESULT -os_timer_one_shot_cptr_t * +os_timer_one_shot_cptr_t* os_timer_one_shot_cptr_create( - const char *const p_timer_name, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_one_shot_cptr_t p_cb_func, - void *const p_arg); + void* const p_arg); ATTR_WARN_UNUSED_RESULT -os_timer_one_shot_cptr_without_arg_t * +os_timer_one_shot_cptr_without_arg_t* os_timer_one_shot_cptr_without_arg_create( - const char *const p_timer_name, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_one_shot_cptr_without_arg_t p_cb_func); ATTR_WARN_UNUSED_RESULT -os_timer_one_shot_cptr_const_arg_t * +os_timer_one_shot_cptr_const_arg_t* os_timer_one_shot_cptr_const_arg_create( - const char *const p_timer_name, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_one_shot_cptr_const_arg_t p_cb_func, - const void *const p_arg); + const void* const p_arg); /** * @brief Create a timer-object using pre-allocated memory, which will call specified callback-function once. @@ -285,66 +285,66 @@ os_timer_one_shot_cptr_const_arg_create( ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL -os_timer_one_shot_t * +os_timer_one_shot_t* os_timer_one_shot_create_static( - os_timer_one_shot_static_t *const p_mem, - const char *const p_timer_name, + os_timer_one_shot_static_t* const p_mem, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_one_shot_t p_cb_func, - void *const p_arg); + void* const p_arg); ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL -os_timer_one_shot_without_arg_t * +os_timer_one_shot_without_arg_t* os_timer_one_shot_without_arg_create_static( - os_timer_one_shot_static_t *const p_mem, - const char *const p_timer_name, + os_timer_one_shot_static_t* const p_mem, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_one_shot_without_arg_t p_cb_func); ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL -os_timer_one_shot_const_arg_t * +os_timer_one_shot_const_arg_t* os_timer_one_shot_const_arg_create_static( - os_timer_one_shot_static_t *const p_mem, - const char *const p_timer_name, + os_timer_one_shot_static_t* const p_mem, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_one_shot_const_arg_t p_cb_func, - const void *const p_arg); + const void* const p_arg); ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL -os_timer_one_shot_cptr_t * +os_timer_one_shot_cptr_t* os_timer_one_shot_cptr_create_static( - os_timer_one_shot_static_t *const p_mem, - const char *const p_timer_name, + os_timer_one_shot_static_t* const p_mem, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_one_shot_cptr_t p_cb_func, - void *const p_arg); + void* const p_arg); ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL -os_timer_one_shot_cptr_without_arg_t * +os_timer_one_shot_cptr_without_arg_t* os_timer_one_shot_cptr_without_arg_create_static( - os_timer_one_shot_static_t *const p_mem, - const char *const p_timer_name, + os_timer_one_shot_static_t* const p_mem, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_one_shot_cptr_without_arg_t p_cb_func); ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL -os_timer_one_shot_cptr_const_arg_t * +os_timer_one_shot_cptr_const_arg_t* os_timer_one_shot_cptr_const_arg_create_static( - os_timer_one_shot_static_t *const p_mem, - const char *const p_timer_name, + os_timer_one_shot_static_t* const p_mem, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_one_shot_cptr_const_arg_t p_cb_func, - const void *const p_arg); + const void* const p_arg); /** * @brief Check if the periodic timer is active. @@ -352,22 +352,22 @@ os_timer_one_shot_cptr_const_arg_create_static( * @return true if the timer is active. */ bool -os_timer_periodic_is_active(os_timer_periodic_t *const p_timer); +os_timer_periodic_is_active(os_timer_periodic_t* const p_timer); bool -os_timer_periodic_without_arg_is_active(os_timer_periodic_without_arg_t *const p_timer); +os_timer_periodic_without_arg_is_active(os_timer_periodic_without_arg_t* const p_timer); bool -os_timer_periodic_const_arg_is_active(os_timer_periodic_const_arg_t *const p_timer); +os_timer_periodic_const_arg_is_active(os_timer_periodic_const_arg_t* const p_timer); bool -os_timer_periodic_cptr_is_active(os_timer_periodic_cptr_t *const p_timer); +os_timer_periodic_cptr_is_active(os_timer_periodic_cptr_t* const p_timer); bool -os_timer_periodic_cptr_without_arg_is_active(os_timer_periodic_cptr_without_arg_t *const p_timer); +os_timer_periodic_cptr_without_arg_is_active(os_timer_periodic_cptr_without_arg_t* const p_timer); bool -os_timer_periodic_cptr_const_arg_is_active(os_timer_periodic_cptr_const_arg_t *const p_timer); +os_timer_periodic_cptr_const_arg_is_active(os_timer_periodic_cptr_const_arg_t* const p_timer); /** * @brief Check if the one-shot timer is active. @@ -375,22 +375,22 @@ os_timer_periodic_cptr_const_arg_is_active(os_timer_periodic_cptr_const_arg_t *c * @return true if the timer is active. */ bool -os_timer_one_shot_is_active(os_timer_one_shot_t *const p_timer); +os_timer_one_shot_is_active(os_timer_one_shot_t* const p_timer); bool -os_timer_one_shot_without_arg_is_active(os_timer_one_shot_without_arg_t *const p_timer); +os_timer_one_shot_without_arg_is_active(os_timer_one_shot_without_arg_t* const p_timer); bool -os_timer_one_shot_const_arg_is_active(os_timer_one_shot_const_arg_t *const p_timer); +os_timer_one_shot_const_arg_is_active(os_timer_one_shot_const_arg_t* const p_timer); bool -os_timer_one_shot_cptr_is_active(os_timer_one_shot_cptr_t *const p_timer); +os_timer_one_shot_cptr_is_active(os_timer_one_shot_cptr_t* const p_timer); bool -os_timer_one_shot_cptr_without_arg_is_active(os_timer_one_shot_cptr_without_arg_t *const p_timer); +os_timer_one_shot_cptr_without_arg_is_active(os_timer_one_shot_cptr_without_arg_t* const p_timer); bool -os_timer_one_shot_cptr_const_arg_is_active(os_timer_one_shot_cptr_const_arg_t *const p_timer); +os_timer_one_shot_cptr_const_arg_is_active(os_timer_one_shot_cptr_const_arg_t* const p_timer); /** * @brief Remove the periodic timer. @@ -399,27 +399,27 @@ os_timer_one_shot_cptr_const_arg_is_active(os_timer_one_shot_cptr_const_arg_t *c */ ATTR_NONNULL(1) void -os_timer_periodic_delete(os_timer_periodic_t **const p_p_timer); +os_timer_periodic_delete(os_timer_periodic_t** const p_p_timer); ATTR_NONNULL(1) void -os_timer_periodic_without_arg_delete(os_timer_periodic_without_arg_t **const p_p_timer); +os_timer_periodic_without_arg_delete(os_timer_periodic_without_arg_t** const p_p_timer); ATTR_NONNULL(1) void -os_timer_periodic_const_arg_delete(os_timer_periodic_const_arg_t **const p_p_timer); +os_timer_periodic_const_arg_delete(os_timer_periodic_const_arg_t** const p_p_timer); ATTR_NONNULL(1) void -os_timer_periodic_cptr_delete(os_timer_periodic_cptr_t **const p_p_timer); +os_timer_periodic_cptr_delete(os_timer_periodic_cptr_t** const p_p_timer); ATTR_NONNULL(1) void -os_timer_periodic_cptr_without_arg_delete(os_timer_periodic_cptr_without_arg_t **const p_p_timer); +os_timer_periodic_cptr_without_arg_delete(os_timer_periodic_cptr_without_arg_t** const p_p_timer); ATTR_NONNULL(1) void -os_timer_periodic_cptr_const_arg_delete(os_timer_periodic_cptr_const_arg_t **const p_p_timer); +os_timer_periodic_cptr_const_arg_delete(os_timer_periodic_cptr_const_arg_t** const p_p_timer); /** * @brief Remove the one-shot timer. @@ -428,142 +428,142 @@ os_timer_periodic_cptr_const_arg_delete(os_timer_periodic_cptr_const_arg_t **con */ ATTR_NONNULL(1) void -os_timer_one_shot_delete(os_timer_one_shot_t **const p_p_timer); +os_timer_one_shot_delete(os_timer_one_shot_t** const p_p_timer); ATTR_NONNULL(1) void -os_timer_one_shot_without_arg_delete(os_timer_one_shot_without_arg_t **const p_p_timer); +os_timer_one_shot_without_arg_delete(os_timer_one_shot_without_arg_t** const p_p_timer); ATTR_NONNULL(1) void -os_timer_one_shot_const_arg_delete(os_timer_one_shot_const_arg_t **const p_p_timer); +os_timer_one_shot_const_arg_delete(os_timer_one_shot_const_arg_t** const p_p_timer); ATTR_NONNULL(1) void -os_timer_one_shot_cptr_delete(os_timer_one_shot_cptr_t **const p_p_timer); +os_timer_one_shot_cptr_delete(os_timer_one_shot_cptr_t** const p_p_timer); ATTR_NONNULL(1) void -os_timer_one_shot_cptr_without_arg_delete(os_timer_one_shot_cptr_without_arg_t **const p_p_timer); +os_timer_one_shot_cptr_without_arg_delete(os_timer_one_shot_cptr_without_arg_t** const p_p_timer); ATTR_NONNULL(1) void -os_timer_one_shot_cptr_const_arg_delete(os_timer_one_shot_cptr_const_arg_t **const p_p_timer); +os_timer_one_shot_cptr_const_arg_delete(os_timer_one_shot_cptr_const_arg_t** const p_p_timer); /** * @brief Stop the periodic timer. * @param p_timer - ptr to the timer object instance. */ void -os_timer_periodic_stop(os_timer_periodic_t *const p_timer); +os_timer_periodic_stop(os_timer_periodic_t* const p_timer); void -os_timer_periodic_without_arg_stop(os_timer_periodic_without_arg_t *const p_timer); +os_timer_periodic_without_arg_stop(os_timer_periodic_without_arg_t* const p_timer); void -os_timer_periodic_const_arg_stop(os_timer_periodic_const_arg_t *const p_timer); +os_timer_periodic_const_arg_stop(os_timer_periodic_const_arg_t* const p_timer); void -os_timer_periodic_cptr_stop(os_timer_periodic_cptr_t *const p_timer); +os_timer_periodic_cptr_stop(os_timer_periodic_cptr_t* const p_timer); void -os_timer_periodic_cptr_without_arg_stop(os_timer_periodic_cptr_without_arg_t *const p_timer); +os_timer_periodic_cptr_without_arg_stop(os_timer_periodic_cptr_without_arg_t* const p_timer); void -os_timer_periodic_cptr_const_arg_stop(os_timer_periodic_cptr_const_arg_t *const p_timer); +os_timer_periodic_cptr_const_arg_stop(os_timer_periodic_cptr_const_arg_t* const p_timer); /** * @brief Stop the one-shot timer. * @param p_timer - ptr to the timer object instance. */ void -os_timer_one_shot_stop(os_timer_one_shot_t *const p_timer); +os_timer_one_shot_stop(os_timer_one_shot_t* const p_timer); void -os_timer_one_shot_without_arg_stop(os_timer_one_shot_without_arg_t *const p_timer); +os_timer_one_shot_without_arg_stop(os_timer_one_shot_without_arg_t* const p_timer); void -os_timer_one_shot_const_arg_stop(os_timer_one_shot_const_arg_t *const p_timer); +os_timer_one_shot_const_arg_stop(os_timer_one_shot_const_arg_t* const p_timer); void -os_timer_one_shot_cptr_stop(os_timer_one_shot_cptr_t *const p_timer); +os_timer_one_shot_cptr_stop(os_timer_one_shot_cptr_t* const p_timer); void -os_timer_one_shot_cptr_without_arg_stop(os_timer_one_shot_cptr_without_arg_t *const p_timer); +os_timer_one_shot_cptr_without_arg_stop(os_timer_one_shot_cptr_without_arg_t* const p_timer); void -os_timer_one_shot_cptr_const_arg_stop(os_timer_one_shot_cptr_const_arg_t *const p_timer); +os_timer_one_shot_cptr_const_arg_stop(os_timer_one_shot_cptr_const_arg_t* const p_timer); /** * @brief Start the periodic timer. * @param p_timer - ptr to the timer object instance. */ void -os_timer_periodic_start(os_timer_periodic_t *const p_timer); +os_timer_periodic_start(os_timer_periodic_t* const p_timer); void -os_timer_periodic_without_arg_start(os_timer_periodic_without_arg_t *const p_timer); +os_timer_periodic_without_arg_start(os_timer_periodic_without_arg_t* const p_timer); void -os_timer_periodic_const_arg_start(os_timer_periodic_const_arg_t *const p_timer); +os_timer_periodic_const_arg_start(os_timer_periodic_const_arg_t* const p_timer); void -os_timer_periodic_cptr_start(os_timer_periodic_cptr_t *const p_timer); +os_timer_periodic_cptr_start(os_timer_periodic_cptr_t* const p_timer); void -os_timer_periodic_cptr_without_arg_start(os_timer_periodic_cptr_without_arg_t *const p_timer); +os_timer_periodic_cptr_without_arg_start(os_timer_periodic_cptr_without_arg_t* const p_timer); void -os_timer_periodic_cptr_const_arg_start(os_timer_periodic_cptr_const_arg_t *const p_timer); +os_timer_periodic_cptr_const_arg_start(os_timer_periodic_cptr_const_arg_t* const p_timer); /** * @brief Start the one-shot timer. * @param p_timer - ptr to the timer object instance. */ void -os_timer_one_shot_start(os_timer_one_shot_t *const p_timer); +os_timer_one_shot_start(os_timer_one_shot_t* const p_timer); void -os_timer_one_shot_without_arg_start(os_timer_one_shot_without_arg_t *const p_timer); +os_timer_one_shot_without_arg_start(os_timer_one_shot_without_arg_t* const p_timer); void -os_timer_one_shot_const_arg_start(os_timer_one_shot_const_arg_t *const p_timer); +os_timer_one_shot_const_arg_start(os_timer_one_shot_const_arg_t* const p_timer); void -os_timer_one_shot_cptr_start(os_timer_one_shot_cptr_t *const p_timer); +os_timer_one_shot_cptr_start(os_timer_one_shot_cptr_t* const p_timer); void -os_timer_one_shot_cptr_without_arg_start(os_timer_one_shot_cptr_without_arg_t *const p_timer); +os_timer_one_shot_cptr_without_arg_start(os_timer_one_shot_cptr_without_arg_t* const p_timer); void -os_timer_one_shot_cptr_const_arg_start(os_timer_one_shot_cptr_const_arg_t *const p_timer); +os_timer_one_shot_cptr_const_arg_start(os_timer_one_shot_cptr_const_arg_t* const p_timer); /** * @brief Restart the periodic timer. * @param p_timer - ptr to the timer object instance. */ void -os_timer_periodic_restart(os_timer_periodic_t *const p_timer, const os_delta_ticks_t period_ticks); +os_timer_periodic_restart(os_timer_periodic_t* const p_timer, const os_delta_ticks_t period_ticks); void os_timer_periodic_without_arg_restart( - os_timer_periodic_without_arg_t *const p_timer, + os_timer_periodic_without_arg_t* const p_timer, const os_delta_ticks_t period_ticks); void -os_timer_periodic_const_arg_restart(os_timer_periodic_const_arg_t *const p_timer, const os_delta_ticks_t period_ticks); +os_timer_periodic_const_arg_restart(os_timer_periodic_const_arg_t* const p_timer, const os_delta_ticks_t period_ticks); void -os_timer_periodic_cptr_restart(os_timer_periodic_cptr_t *const p_timer, const os_delta_ticks_t period_ticks); +os_timer_periodic_cptr_restart(os_timer_periodic_cptr_t* const p_timer, const os_delta_ticks_t period_ticks); void os_timer_periodic_cptr_without_arg_restart( - os_timer_periodic_cptr_without_arg_t *const p_timer, + os_timer_periodic_cptr_without_arg_t* const p_timer, const os_delta_ticks_t period_ticks); void os_timer_periodic_cptr_const_arg_restart( - os_timer_periodic_cptr_const_arg_t *const p_timer, + os_timer_periodic_cptr_const_arg_t* const p_timer, const os_delta_ticks_t period_ticks); /** @@ -571,27 +571,27 @@ os_timer_periodic_cptr_const_arg_restart( * @param p_timer - ptr to the timer object instance. */ void -os_timer_one_shot_restart(os_timer_one_shot_t *const p_timer, const os_delta_ticks_t delay_ticks); +os_timer_one_shot_restart(os_timer_one_shot_t* const p_timer, const os_delta_ticks_t delay_ticks); void os_timer_one_shot_without_arg_restart( - os_timer_one_shot_without_arg_t *const p_timer, + os_timer_one_shot_without_arg_t* const p_timer, const os_delta_ticks_t delay_ticks); void -os_timer_one_shot_const_arg_restart(os_timer_one_shot_const_arg_t *const p_timer, const os_delta_ticks_t delay_ticks); +os_timer_one_shot_const_arg_restart(os_timer_one_shot_const_arg_t* const p_timer, const os_delta_ticks_t delay_ticks); void -os_timer_one_shot_cptr_restart(os_timer_one_shot_cptr_t *const p_timer, const os_delta_ticks_t delay_ticks); +os_timer_one_shot_cptr_restart(os_timer_one_shot_cptr_t* const p_timer, const os_delta_ticks_t delay_ticks); void os_timer_one_shot_cptr_without_arg_restart( - os_timer_one_shot_cptr_without_arg_t *const p_timer, + os_timer_one_shot_cptr_without_arg_t* const p_timer, const os_delta_ticks_t delay_ticks); void os_timer_one_shot_cptr_const_arg_restart( - os_timer_one_shot_cptr_const_arg_t *const p_timer, + os_timer_one_shot_cptr_const_arg_t* const p_timer, const os_delta_ticks_t delay_ticks); /** @@ -599,44 +599,44 @@ os_timer_one_shot_cptr_const_arg_restart( * @param p_timer - ptr to the timer object instance. */ void -os_timer_periodic_simulate(os_timer_periodic_t *const p_timer); +os_timer_periodic_simulate(os_timer_periodic_t* const p_timer); void -os_timer_periodic_without_arg_simulate(os_timer_periodic_without_arg_t *const p_timer); +os_timer_periodic_without_arg_simulate(os_timer_periodic_without_arg_t* const p_timer); void -os_timer_periodic_const_arg_simulate(os_timer_periodic_const_arg_t *const p_timer); +os_timer_periodic_const_arg_simulate(os_timer_periodic_const_arg_t* const p_timer); void -os_timer_periodic_cptr_simulate(os_timer_periodic_cptr_t *const p_timer); +os_timer_periodic_cptr_simulate(os_timer_periodic_cptr_t* const p_timer); void -os_timer_periodic_cptr_without_arg_simulate(os_timer_periodic_cptr_without_arg_t *const p_timer); +os_timer_periodic_cptr_without_arg_simulate(os_timer_periodic_cptr_without_arg_t* const p_timer); void -os_timer_periodic_cptr_const_arg_simulate(os_timer_periodic_cptr_const_arg_t *const p_timer); +os_timer_periodic_cptr_const_arg_simulate(os_timer_periodic_cptr_const_arg_t* const p_timer); /** * @brief Simulate the triggering of the one-shot timer - call the callback function. * @param p_timer - ptr to the timer object instance. */ void -os_timer_one_shot_simulate(os_timer_one_shot_t *const p_timer); +os_timer_one_shot_simulate(os_timer_one_shot_t* const p_timer); void -os_timer_one_shot_without_arg_simulate(os_timer_one_shot_without_arg_t *const p_timer); +os_timer_one_shot_without_arg_simulate(os_timer_one_shot_without_arg_t* const p_timer); void -os_timer_one_shot_const_arg_simulate(os_timer_one_shot_const_arg_t *const p_timer); +os_timer_one_shot_const_arg_simulate(os_timer_one_shot_const_arg_t* const p_timer); void -os_timer_one_shot_cptr_simulate(os_timer_one_shot_cptr_t *const p_timer); +os_timer_one_shot_cptr_simulate(os_timer_one_shot_cptr_t* const p_timer); void -os_timer_one_shot_cptr_without_arg_simulate(os_timer_one_shot_cptr_without_arg_t *const p_timer); +os_timer_one_shot_cptr_without_arg_simulate(os_timer_one_shot_cptr_without_arg_t* const p_timer); void -os_timer_one_shot_cptr_const_arg_simulate(os_timer_one_shot_cptr_const_arg_t *const p_timer); +os_timer_one_shot_cptr_const_arg_simulate(os_timer_one_shot_cptr_const_arg_t* const p_timer); #ifdef __cplusplus } diff --git a/include/os_timer_sig.h b/include/os_timer_sig.h index b79965b..ecb5665 100644 --- a/include/os_timer_sig.h +++ b/include/os_timer_sig.h @@ -22,8 +22,8 @@ typedef struct os_timer_sig_one_shot_t os_timer_sig_one_shot_t; typedef struct os_timer_sig_periodic_static_obj_t { - void * stub1; - void * stub2; + void* stub1; + void* stub2; os_signal_num_e stub3; bool stub4; bool stub5; @@ -37,8 +37,8 @@ typedef struct os_timer_sig_periodic_static_t typedef struct os_timer_sig_one_shot_static_obj_t { - void * stub1; - void * stub2; + void* stub1; + void* stub2; os_signal_num_e stub3; bool stub4; bool stub5; @@ -59,10 +59,10 @@ typedef struct os_timer_sig_one_shot_static_t * @return ptr to the new os_timer_sig_periodic_t instance. */ ATTR_WARN_UNUSED_RESULT -os_timer_sig_periodic_t * +os_timer_sig_periodic_t* os_timer_sig_periodic_create( - const char *const p_timer_name, - os_signal_t *const p_signal, + const char* const p_timer_name, + os_signal_t* const p_signal, const os_signal_num_e sig_num, const os_delta_ticks_t period_ticks); @@ -78,11 +78,11 @@ os_timer_sig_periodic_create( ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL -os_timer_sig_periodic_t * +os_timer_sig_periodic_t* os_timer_sig_periodic_create_static( - os_timer_sig_periodic_static_t *const p_timer_sig_mem, - const char *const p_timer_name, - os_signal_t *const p_signal, + os_timer_sig_periodic_static_t* const p_timer_sig_mem, + const char* const p_timer_name, + os_signal_t* const p_signal, const os_signal_num_e sig_num, const os_delta_ticks_t period_ticks); @@ -95,10 +95,10 @@ os_timer_sig_periodic_create_static( * @return ptr to the new os_timer_sig_one_shot_t instance. */ ATTR_WARN_UNUSED_RESULT -os_timer_sig_one_shot_t * +os_timer_sig_one_shot_t* os_timer_sig_one_shot_create( - const char *const p_timer_name, - os_signal_t *const p_signal, + const char* const p_timer_name, + os_signal_t* const p_signal, const os_signal_num_e sig_num, const os_delta_ticks_t period_ticks); @@ -114,11 +114,11 @@ os_timer_sig_one_shot_create( ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL -os_timer_sig_one_shot_t * +os_timer_sig_one_shot_t* os_timer_sig_one_shot_create_static( - os_timer_sig_one_shot_static_t *const p_timer_sig_mem, - const char *const p_timer_name, - os_signal_t *const p_signal, + os_timer_sig_one_shot_static_t* const p_timer_sig_mem, + const char* const p_timer_name, + os_signal_t* const p_signal, const os_signal_num_e sig_num, const os_delta_ticks_t period_ticks); @@ -129,7 +129,7 @@ os_timer_sig_one_shot_create_static( */ ATTR_NONNULL(1) void -os_timer_sig_periodic_delete(os_timer_sig_periodic_t **const pp_obj); +os_timer_sig_periodic_delete(os_timer_sig_periodic_t** const pp_obj); /** * @brief Delete the os_timer_sig_one_shot_t object instance. @@ -138,49 +138,49 @@ os_timer_sig_periodic_delete(os_timer_sig_periodic_t **const pp_obj); */ ATTR_NONNULL(1) void -os_timer_sig_one_shot_delete(os_timer_sig_one_shot_t **const pp_obj); +os_timer_sig_one_shot_delete(os_timer_sig_one_shot_t** const pp_obj); /** * @brief Activate the periodic timer to send the specified signal. * @param p_obj - ptr to the os_timer_sig_periodic_t object instance. */ void -os_timer_sig_periodic_start(os_timer_sig_periodic_t *const p_obj); +os_timer_sig_periodic_start(os_timer_sig_periodic_t* const p_obj); /** * @brief Activate the one-shot timer to send the specified signal. * @param p_obj - ptr to the os_timer_sig_one_shot_t object instance. */ void -os_timer_sig_one_shot_start(os_timer_sig_one_shot_t *const p_obj); +os_timer_sig_one_shot_start(os_timer_sig_one_shot_t* const p_obj); /** * @brief Restart the periodic timer which sends the specified signal. * @param p_obj - ptr to the os_timer_sig_periodic_t object instance. */ void -os_timer_sig_periodic_restart(os_timer_sig_periodic_t *const p_obj, const os_delta_ticks_t delay_ticks); +os_timer_sig_periodic_restart(os_timer_sig_periodic_t* const p_obj, const os_delta_ticks_t delay_ticks); /** * @brief Restart the one-shot timer which sends the specified signal. * @param p_obj - ptr to the os_timer_sig_one_shot_t object instance. */ void -os_timer_sig_one_shot_restart(os_timer_sig_one_shot_t *const p_obj, const os_delta_ticks_t delay_ticks); +os_timer_sig_one_shot_restart(os_timer_sig_one_shot_t* const p_obj, const os_delta_ticks_t delay_ticks); /** * @brief Stop the periodic timer which sends the specified signal. * @param p_obj - ptr to the os_timer_sig_periodic_t object instance. */ void -os_timer_sig_periodic_stop(os_timer_sig_periodic_t *const p_obj); +os_timer_sig_periodic_stop(os_timer_sig_periodic_t* const p_obj); /** * @brief Stop the one-shot timer which sends the specified signal. * @param p_obj - ptr to the os_timer_sig_one_shot_t object instance. */ void -os_timer_sig_one_shot_stop(os_timer_sig_one_shot_t *const p_obj); +os_timer_sig_one_shot_stop(os_timer_sig_one_shot_t* const p_obj); /** * @brief Check if the periodic timer is active. @@ -188,7 +188,7 @@ os_timer_sig_one_shot_stop(os_timer_sig_one_shot_t *const p_obj); * @return true if the timer is active. */ bool -os_timer_sig_periodic_is_active(os_timer_sig_periodic_t *const p_obj); +os_timer_sig_periodic_is_active(os_timer_sig_periodic_t* const p_obj); /** * @brief Check if the one-shot timer is active. @@ -196,21 +196,21 @@ os_timer_sig_periodic_is_active(os_timer_sig_periodic_t *const p_obj); * @return true if the timer is active. */ bool -os_timer_sig_one_shot_is_active(os_timer_sig_one_shot_t *const p_obj); +os_timer_sig_one_shot_is_active(os_timer_sig_one_shot_t* const p_obj); /** * @brief Simulate the triggering of the periodic timer - send the specified signal. * @param p_obj - ptr to the os_timer_sig_periodic_t object instance. */ void -os_timer_sig_periodic_simulate(os_timer_sig_periodic_t *const p_obj); +os_timer_sig_periodic_simulate(os_timer_sig_periodic_t* const p_obj); /** * @brief Simulate the triggering of the one-shot timer - send the specified signal. * @param p_obj - ptr to the os_timer_sig_one_shot_t object instance. */ void -os_timer_sig_one_shot_simulate(os_timer_sig_one_shot_t *const p_obj); +os_timer_sig_one_shot_simulate(os_timer_sig_one_shot_t* const p_obj); #ifdef __cplusplus } diff --git a/include/str_buf.h b/include/str_buf.h index d95d59c..7cff545 100644 --- a/include/str_buf.h +++ b/include/str_buf.h @@ -31,7 +31,7 @@ typedef size_t str_buf_size_t; typedef struct str_buf_t { - char * buf; + char* buf; str_buf_size_t size; str_buf_size_t idx; } str_buf_t; @@ -42,7 +42,7 @@ typedef struct str_buf_t */ ATTR_NONNULL(1) str_buf_t -str_buf_init(char *const p_buf, const str_buf_size_t buf_size); +str_buf_init(char* const p_buf, const str_buf_size_t buf_size); /** * Init str_buf_t object with NULL pointer to buffer. @@ -58,7 +58,7 @@ str_buf_init_null(void); */ ATTR_NONNULL(1) bool -str_buf_init_with_alloc(str_buf_t *const p_str_buf); +str_buf_init_with_alloc(str_buf_t* const p_str_buf); /** * Get the accumulated length of string. @@ -68,7 +68,7 @@ str_buf_init_with_alloc(str_buf_t *const p_str_buf); ATTR_NONNULL(1) ATTR_PURE str_buf_size_t -str_buf_get_len(const str_buf_t *const p_str_buf); +str_buf_get_len(const str_buf_t* const p_str_buf); /** * Check if buffer overflow occurred during last call to str_buf_vprintf or str_buf_printf. @@ -78,7 +78,7 @@ str_buf_get_len(const str_buf_t *const p_str_buf); ATTR_NONNULL(1) ATTR_PURE bool -str_buf_is_overflow(const str_buf_t *const p_str_buf); +str_buf_is_overflow(const str_buf_t* const p_str_buf); /** * Print string to buffer or calculate size of string if the p_str_buf->buf is NULL. @@ -89,7 +89,7 @@ str_buf_is_overflow(const str_buf_t *const p_str_buf); */ ATTR_NONNULL(1, 2) bool -str_buf_vprintf(str_buf_t *const p_str_buf, const char *const fmt, va_list args); +str_buf_vprintf(str_buf_t* const p_str_buf, const char* const fmt, va_list args); /** * Print string to buffer or calculate size of string if the p_str_buf->buf is NULL. @@ -101,7 +101,7 @@ str_buf_vprintf(str_buf_t *const p_str_buf, const char *const fmt, va_list args) ATTR_PRINTF(2, 3) ATTR_NONNULL(1, 2) bool -str_buf_printf(str_buf_t *const p_str_buf, const char *const fmt, ...); +str_buf_printf(str_buf_t* const p_str_buf, const char* const fmt, ...); /** * Allocate buffer for a new string and print it there. @@ -112,7 +112,7 @@ str_buf_printf(str_buf_t *const p_str_buf, const char *const fmt, ...); */ ATTR_NONNULL(1) str_buf_t -str_buf_vprintf_with_alloc(const char *const fmt, va_list args); +str_buf_vprintf_with_alloc(const char* const fmt, va_list args); /** * Allocate buffer for a new string and print it there. @@ -124,7 +124,7 @@ str_buf_vprintf_with_alloc(const char *const fmt, va_list args); ATTR_PRINTF(1, 2) ATTR_NONNULL(1) str_buf_t -str_buf_printf_with_alloc(const char *const fmt, ...); +str_buf_printf_with_alloc(const char* const fmt, ...); /** * Convert binary buffer to a hex-string. @@ -134,7 +134,7 @@ str_buf_printf_with_alloc(const char *const fmt, ...); */ ATTR_NONNULL(1, 2) bool -str_buf_bin_to_hex(str_buf_t *const p_str_buf, const uint8_t *const p_input_buf, const size_t input_buf_size); +str_buf_bin_to_hex(str_buf_t* const p_str_buf, const uint8_t* const p_input_buf, const size_t input_buf_size); /** * Allocate buffer for a new string and convert binary buffer to hex-string there. @@ -144,7 +144,7 @@ str_buf_bin_to_hex(str_buf_t *const p_str_buf, const uint8_t *const p_input_buf, */ ATTR_NONNULL(1) str_buf_t -str_buf_bin_to_hex_with_alloc(const uint8_t *const p_input_buf, const size_t input_buf_size); +str_buf_bin_to_hex_with_alloc(const uint8_t* const p_input_buf, const size_t input_buf_size); /** * Free the buffer to which the str_buf_t object points to. @@ -152,7 +152,7 @@ str_buf_bin_to_hex_with_alloc(const uint8_t *const p_input_buf, const size_t inp */ ATTR_NONNULL(1) void -str_buf_free_buf(str_buf_t *const p_str_buf); +str_buf_free_buf(str_buf_t* const p_str_buf); #ifdef __cplusplus } diff --git a/src/log_dump.c b/src/log_dump.c index 1c57377..6d6a612 100644 --- a/src/log_dump.c +++ b/src/log_dump.c @@ -20,13 +20,13 @@ #define LOG_DUMP_BYTES_PER_LINE (16U) static void -print_ascii_char(str_buf_t *p_str_buf, const char ch) +print_ascii_char(str_buf_t* p_str_buf, const char ch) { str_buf_printf(p_str_buf, "%c", (char)(isprint((int)(unsigned char)ch) ? ch : '.')); } static void -print_bytes(str_buf_t *p_str_buf, const uint8_t *p_buf, const size_t buf_size) +print_bytes(str_buf_t* p_str_buf, const uint8_t* p_buf, const size_t buf_size) { for (size_t j = 0; j < buf_size; ++j, p_buf++) { @@ -35,7 +35,7 @@ print_bytes(str_buf_t *p_str_buf, const uint8_t *p_buf, const size_t buf_size) } static void -print_chars(str_buf_t *p_str_buf, const uint8_t *p_buf, const size_t buf_size) +print_chars(str_buf_t* p_str_buf, const uint8_t* p_buf, const size_t buf_size) { for (size_t j = 0; j < buf_size; j++) { @@ -46,9 +46,9 @@ print_chars(str_buf_t *p_str_buf, const uint8_t *p_buf, const size_t buf_size) void log_print_dump( esp_log_level_t level, - const char * p_tag, - const char * p_log_prefix, - const uint8_t * p_buf, + const char* p_tag, + const char* p_log_prefix, + const uint8_t* p_buf, const uint32_t buf_size) { char log_dump_line_buf[LOG_DUMP_LINE_BUF]; diff --git a/src/mac_addr.c b/src/mac_addr.c index f58909d..9aa0a69 100644 --- a/src/mac_addr.c +++ b/src/mac_addr.c @@ -10,7 +10,7 @@ #include "str_buf.h" void -mac_address_bin_init(mac_address_bin_t *p_mac, const uint8_t mac[MAC_ADDRESS_NUM_BYTES]) +mac_address_bin_init(mac_address_bin_t* p_mac, const uint8_t mac[MAC_ADDRESS_NUM_BYTES]) { _Static_assert( MAC_ADDRESS_NUM_BYTES == sizeof(p_mac->mac), @@ -19,13 +19,13 @@ mac_address_bin_init(mac_address_bin_t *p_mac, const uint8_t mac[MAC_ADDRESS_NUM } mac_address_str_t -mac_address_to_str(const mac_address_bin_t *p_mac) +mac_address_to_str(const mac_address_bin_t* p_mac) { mac_address_str_t mac_str = { 0 }; str_buf_t str_buf = { - .buf = mac_str.str_buf, - .size = sizeof(mac_str.str_buf), - .idx = 0, + .buf = mac_str.str_buf, + .size = sizeof(mac_str.str_buf), + .idx = 0, }; for (size_t i = 0; i < sizeof(p_mac->mac); ++i) { diff --git a/src/os_malloc.c b/src/os_malloc.c index bf6c28c..3932108 100644 --- a/src/os_malloc.c +++ b/src/os_malloc.c @@ -10,14 +10,14 @@ ATTR_MALLOC ATTR_MALLOC_SIZE(1) -void * +void* os_malloc(const size_t size) { return malloc(size); } void -os_free_internal(void *ptr) +os_free_internal(void* ptr) { if (NULL != ptr) { @@ -27,7 +27,7 @@ os_free_internal(void *ptr) ATTR_MALLOC ATTR_CALLOC_SIZE(1, 2) -void * +void* os_calloc(const size_t nmemb, const size_t size) { return calloc(nmemb, size); @@ -36,10 +36,10 @@ os_calloc(const size_t nmemb, const size_t size) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) bool -os_realloc_safe(void **const p_ptr, const size_t size) +os_realloc_safe(void** const p_ptr, const size_t size) { - void *ptr = *p_ptr; - void *p_new_ptr = realloc(ptr, size); + void* ptr = *p_ptr; + void* p_new_ptr = realloc(ptr, size); if (NULL == p_new_ptr) { return false; @@ -51,10 +51,10 @@ os_realloc_safe(void **const p_ptr, const size_t size) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) bool -os_realloc_safe_and_clean(void **const p_ptr, const size_t size) +os_realloc_safe_and_clean(void** const p_ptr, const size_t size) { - void *ptr = *p_ptr; - void *p_new_ptr = realloc(ptr, size); + void* ptr = *p_ptr; + void* p_new_ptr = realloc(ptr, size); if (NULL == p_new_ptr) { os_free(*p_ptr); diff --git a/src/os_mkgmtime.c b/src/os_mkgmtime.c index 13458f9..b60f3fd 100644 --- a/src/os_mkgmtime.c +++ b/src/os_mkgmtime.c @@ -45,7 +45,7 @@ check_is_leap_year(const uint16_t year) } static uint16_t -calc_elapsed_years_since_1900(struct tm *const p_tm_time_utc) +calc_elapsed_years_since_1900(struct tm* const p_tm_time_utc) { if ((p_tm_time_utc->tm_year < (OS_TIME_EPOCH_REL_BASE_YEAR - 1)) || (p_tm_time_utc->tm_year > (OS_TIME_EPOCH_REL_MAX_YEAR + 1))) @@ -74,7 +74,7 @@ calc_elapsed_years_since_1900(struct tm *const p_tm_time_utc) } time_t -os_mkgmtime(struct tm *const p_tm_time_utc) +os_mkgmtime(struct tm* const p_tm_time_utc) { const uint16_t num_of_elapsed_years_since_1900 = calc_elapsed_years_since_1900(p_tm_time_utc); if ((uint16_t)(-1) == num_of_elapsed_years_since_1900) @@ -93,13 +93,10 @@ os_mkgmtime(struct tm *const p_tm_time_utc) * Calculate elapsed days since base date (midnight, 1970-01-01, UTC) * 365 days for each elapsed year since 1970, plus one more day for each elapsed leap year. */ - const int32_t num_days_elapsed_since_1970_till_cur_month = (int32_t)( - num_of_elapsed_years_since_1900 - - OS_TIME_EPOCH_REL_BASE_YEAR) - * OS_TIME_NUM_DAYS_PER_YEAR - + ((num_of_elapsed_years_since_1900 - 1) / 4) - - OS_TIME_NUM_LEAP_YEARS_IN_RANGE_1900_1970 - + days_elapsed_minus_one_since_year_to_month; + const int32_t num_days_elapsed_since_1970_till_cur_month + = (int32_t)(num_of_elapsed_years_since_1900 - OS_TIME_EPOCH_REL_BASE_YEAR) * OS_TIME_NUM_DAYS_PER_YEAR + + ((num_of_elapsed_years_since_1900 - 1) / 4) - OS_TIME_NUM_LEAP_YEARS_IN_RANGE_1900_1970 + + days_elapsed_minus_one_since_year_to_month; const int32_t num_days_elapsed_since_1970 = num_days_elapsed_since_1970_till_cur_month + p_tm_time_utc->tm_mday; if (num_days_elapsed_since_1970 < 0) diff --git a/src/os_mutex.c b/src/os_mutex.c index de6ea97..e3b4ac2 100644 --- a/src/os_mutex.c +++ b/src/os_mutex.c @@ -21,7 +21,7 @@ ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL os_mutex_t -os_mutex_create_static(os_mutex_static_t *const p_mutex_static) +os_mutex_create_static(os_mutex_static_t* const p_mutex_static) { SemaphoreHandle_t h_mutex = xSemaphoreCreateMutexStatic(p_mutex_static); return h_mutex; @@ -30,7 +30,7 @@ os_mutex_create_static(os_mutex_static_t *const p_mutex_static) ATTR_NONNULL(1) void -os_mutex_delete(os_mutex_t *const ph_mutex) +os_mutex_delete(os_mutex_t* const ph_mutex) { if (NULL != *ph_mutex) { diff --git a/src/os_mutex_recursive.c b/src/os_mutex_recursive.c index 5c4e132..a725840 100644 --- a/src/os_mutex_recursive.c +++ b/src/os_mutex_recursive.c @@ -21,7 +21,7 @@ ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL os_mutex_recursive_t -os_mutex_recursive_create_static(os_mutex_recursive_static_t *const p_mutex_static) +os_mutex_recursive_create_static(os_mutex_recursive_static_t* const p_mutex_static) { SemaphoreHandle_t h_mutex = xSemaphoreCreateRecursiveMutexStatic(p_mutex_static); return h_mutex; @@ -30,7 +30,7 @@ os_mutex_recursive_create_static(os_mutex_recursive_static_t *const p_mutex_stat ATTR_NONNULL(1) void -os_mutex_recursive_delete(os_mutex_recursive_t *const ph_mutex) +os_mutex_recursive_delete(os_mutex_recursive_t* const ph_mutex) { if (NULL != *ph_mutex) { diff --git a/src/os_sema.c b/src/os_sema.c index f23abf5..bccfe03 100644 --- a/src/os_sema.c +++ b/src/os_sema.c @@ -21,7 +21,7 @@ ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL os_sema_t -os_sema_create_static(os_sema_static_t *const p_sema_static) +os_sema_create_static(os_sema_static_t* const p_sema_static) { SemaphoreHandle_t h_sema = xSemaphoreCreateBinaryStatic(p_sema_static); return h_sema; @@ -30,7 +30,7 @@ os_sema_create_static(os_sema_static_t *const p_sema_static) ATTR_NONNULL(1) void -os_sema_delete(os_sema_t *const ph_sema) +os_sema_delete(os_sema_t* const ph_sema) { if (NULL != *ph_sema) { diff --git a/src/os_signal.c b/src/os_signal.c index bf4e0f8..3fc4e81 100644 --- a/src/os_signal.c +++ b/src/os_signal.c @@ -22,8 +22,8 @@ struct os_signal_t _Static_assert(sizeof(os_signal_t) == sizeof(os_signal_static_t), "os_signal_t != os_signal_static_t"); ATTR_NONNULL(1) -static os_signal_t * -os_signal_init(os_signal_t *const p_signal, const bool is_static) +static os_signal_t* +os_signal_init(os_signal_t* const p_signal, const bool is_static) { p_signal->task_handle = NULL; p_signal->sig_mask = 0x0U; @@ -31,10 +31,10 @@ os_signal_init(os_signal_t *const p_signal, const bool is_static) return p_signal; } -os_signal_t * +os_signal_t* os_signal_create(void) { - os_signal_t *const p_signal = os_calloc(1, sizeof(*p_signal)); + os_signal_t* const p_signal = os_calloc(1, sizeof(*p_signal)); if (NULL == p_signal) { return NULL; @@ -45,19 +45,19 @@ os_signal_create(void) ATTR_RETURNS_NONNULL ATTR_NONNULL(1) -os_signal_t * -os_signal_create_static(os_signal_static_t *const p_signal_mem) +os_signal_t* +os_signal_create_static(os_signal_static_t* const p_signal_mem) { - os_signal_t *const p_signal = (os_signal_t *)p_signal_mem; + os_signal_t* const p_signal = (os_signal_t*)p_signal_mem; const bool is_static = true; return os_signal_init(p_signal, is_static); } ATTR_NONNULL(1) void -os_signal_delete(os_signal_t **const pp_signal) +os_signal_delete(os_signal_t** const pp_signal) { - os_signal_t *p_signal = *pp_signal; + os_signal_t* p_signal = *pp_signal; p_signal->task_handle = NULL; p_signal->sig_mask = 0x0U; *pp_signal = NULL; @@ -68,7 +68,7 @@ os_signal_delete(os_signal_t **const pp_signal) } bool -os_signal_register_cur_thread(os_signal_t *const p_signal) +os_signal_register_cur_thread(os_signal_t* const p_signal) { if (NULL == p_signal) { @@ -83,7 +83,7 @@ os_signal_register_cur_thread(os_signal_t *const p_signal) } void -os_signal_unregister_cur_thread(os_signal_t *const p_signal) +os_signal_unregister_cur_thread(os_signal_t* const p_signal) { if (NULL == p_signal) { @@ -93,7 +93,7 @@ os_signal_unregister_cur_thread(os_signal_t *const p_signal) } bool -os_signal_is_any_thread_registered(os_signal_t *const p_signal) +os_signal_is_any_thread_registered(os_signal_t* const p_signal) { if (NULL == p_signal) { @@ -107,7 +107,7 @@ os_signal_is_any_thread_registered(os_signal_t *const p_signal) } bool -os_signal_is_current_thread_registered(os_signal_t *const p_signal) +os_signal_is_current_thread_registered(os_signal_t* const p_signal) { if (NULL == p_signal) { @@ -137,7 +137,7 @@ os_signal_is_valid_sig_num(const os_signal_num_e sig_num) } bool -os_signal_add(os_signal_t *const p_signal, const os_signal_num_e sig_num) +os_signal_add(os_signal_t* const p_signal, const os_signal_num_e sig_num) { if (NULL == p_signal) { @@ -157,7 +157,7 @@ os_signal_add(os_signal_t *const p_signal, const os_signal_num_e sig_num) } bool -os_signal_send(os_signal_t *const p_signal, const os_signal_num_e sig_num) +os_signal_send(os_signal_t* const p_signal, const os_signal_num_e sig_num) { if (NULL == p_signal) { @@ -200,10 +200,10 @@ os_signal_send(os_signal_t *const p_signal, const os_signal_num_e sig_num) ATTR_NONNULL(4) bool os_signal_wait_with_sig_mask( - os_signal_t *const p_signal, + os_signal_t* const p_signal, const os_signal_sig_mask_t expected_sig_mask, const os_delta_ticks_t timeout_ticks, - os_signal_events_t *const p_sig_events) + os_signal_events_t* const p_sig_events) { if (NULL == p_signal) { @@ -233,23 +233,23 @@ os_signal_wait_with_sig_mask( ATTR_NONNULL(3) bool os_signal_wait_with_timeout( - os_signal_t *const p_signal, + os_signal_t* const p_signal, const os_delta_ticks_t timeout_ticks, - os_signal_events_t *const p_sig_events) + os_signal_events_t* const p_sig_events) { return os_signal_wait_with_sig_mask(p_signal, p_signal->sig_mask, timeout_ticks, p_sig_events); } ATTR_NONNULL(2) void -os_signal_wait(os_signal_t *const p_signal, os_signal_events_t *const p_sig_events) +os_signal_wait(os_signal_t* const p_signal, os_signal_events_t* const p_sig_events) { os_signal_wait_with_timeout(p_signal, OS_DELTA_TICKS_INFINITE, p_sig_events); } ATTR_NONNULL(1) os_signal_num_e -os_signal_num_get_next(os_signal_events_t *const p_sig_events) +os_signal_num_get_next(os_signal_events_t* const p_sig_events) { if (0 == p_sig_events->sig_mask) { diff --git a/src/os_str.c b/src/os_str.c index ff9bb1e..9151f43 100644 --- a/src/os_str.c +++ b/src/os_str.c @@ -14,11 +14,11 @@ typedef long os_strtol_result_t; ATTR_NONNULL(1) uint32_t os_str_to_uint32_cptr( - const char *__restrict const p_str, - const char **__restrict const pp_end, + const char* __restrict const p_str, + const char** __restrict const pp_end, const os_str2num_base_t base) { - os_strtoul_result_t result = strtoul(p_str, (char **)pp_end, base); + os_strtoul_result_t result = strtoul(p_str, (char**)pp_end, base); if (result >= UINT32_MAX) { return UINT32_MAX; @@ -28,7 +28,7 @@ os_str_to_uint32_cptr( ATTR_NONNULL(1) uint32_t -os_str_to_uint32(char *__restrict const p_str, char **__restrict const pp_end, const os_str2num_base_t base) +os_str_to_uint32(char* __restrict const p_str, char** __restrict const pp_end, const os_str2num_base_t base) { os_strtoul_result_t result = strtoul(p_str, pp_end, base); if (result >= UINT32_MAX) @@ -41,11 +41,11 @@ os_str_to_uint32(char *__restrict const p_str, char **__restrict const pp_end, c ATTR_NONNULL(1) int32_t os_str_to_int32_cptr( - const char *__restrict const p_str, - const char **__restrict const pp_end, + const char* __restrict const p_str, + const char** __restrict const pp_end, const os_str2num_base_t base) { - os_strtol_result_t result = strtol(p_str, (char **)pp_end, base); + os_strtol_result_t result = strtol(p_str, (char**)pp_end, base); if (result >= INT32_MAX) { return INT32_MAX; @@ -59,7 +59,7 @@ os_str_to_int32_cptr( ATTR_NONNULL(1) int32_t -os_str_to_int32(char *__restrict const p_str, char **__restrict const pp_end, const os_str2num_base_t base) +os_str_to_int32(char* __restrict const p_str, char** __restrict const pp_end, const os_str2num_base_t base) { os_strtol_result_t result = strtol(p_str, pp_end, base); if (result >= INT32_MAX) diff --git a/src/os_task.c b/src/os_task.c index dbe1477..4a966dc 100644 --- a/src/os_task.c +++ b/src/os_task.c @@ -15,26 +15,26 @@ typedef struct os_task_arg_finite_with_param_t { os_task_finite_func_with_param_t p_func; - void * p_arg; + void* p_arg; } os_task_arg_finite_with_param_t; typedef struct os_task_arg_finite_with_const_param_t { os_task_finite_func_with_const_param_t p_func; - const void * p_arg; + const void* p_arg; } os_task_arg_finite_with_const_param_t; -static const char *TAG = "os_task"; +static const char* TAG = "os_task"; ATTR_NONNULL(1, 6) static bool os_task_create_internal( const os_task_func_t p_func, - const char *const p_name, + const char* const p_name, const uint32_t stack_depth, - void *const p_param, + void* const p_param, const os_task_priority_t priority, - os_task_handle_t *const ph_task) + os_task_handle_t* const ph_task) { LOG_INFO("Start thread '%s' with priority %d, stack size %u bytes", p_name, priority, stack_depth); if (pdPASS != xTaskCreate(p_func, p_name, stack_depth, p_param, priority, ph_task)) @@ -50,11 +50,11 @@ ATTR_WARN_UNUSED_RESULT bool os_task_create( const os_task_func_t p_func, - const char *const p_name, + const char* const p_name, const uint32_t stack_depth, - void *const p_param, + void* const p_param, const os_task_priority_t priority, - os_task_handle_t *const ph_task) + os_task_handle_t* const ph_task) { return os_task_create_internal(p_func, p_name, stack_depth, p_param, priority, ph_task); } @@ -64,19 +64,19 @@ ATTR_WARN_UNUSED_RESULT bool os_task_create_with_const_param( const os_task_func_const_param_t p_func, - const char *const p_name, + const char* const p_name, const uint32_t stack_depth, - const void *const p_param, + const void* const p_param, const os_task_priority_t priority, - os_task_handle_t *const ph_task) + os_task_handle_t* const ph_task) { - return os_task_create_internal((os_task_func_t)p_func, p_name, stack_depth, (void *)p_param, priority, ph_task); + return os_task_create_internal((os_task_func_t)p_func, p_name, stack_depth, (void*)p_param, priority, ph_task); } ATTR_NORETURN ATTR_NONNULL(1) static void -os_task_thread_func_wrapper_without_param(void *p_arg) +os_task_thread_func_wrapper_without_param(void* p_arg) { os_task_func_without_param_t p_func = p_arg; p_func(); @@ -88,16 +88,16 @@ ATTR_WARN_UNUSED_RESULT bool os_task_create_without_param( const os_task_func_without_param_t p_func, - const char *const p_name, + const char* const p_name, const uint32_t stack_depth, const os_task_priority_t priority, - os_task_handle_t *const ph_task) + os_task_handle_t* const ph_task) { return os_task_create_internal( &os_task_thread_func_wrapper_without_param, p_name, stack_depth, - (void *)p_func, + (void*)p_func, priority, ph_task); } @@ -105,9 +105,9 @@ os_task_create_without_param( ATTR_NORETURN ATTR_NONNULL(1) static void -os_task_thread_func_wrapper_finite_with_param(void *p_arg) +os_task_thread_func_wrapper_finite_with_param(void* p_arg) { - const os_task_arg_finite_with_param_t *p_param = p_arg; + const os_task_arg_finite_with_param_t* p_param = p_arg; p_arg = NULL; p_param->p_func(p_param->p_arg); os_free(p_param); @@ -120,12 +120,12 @@ ATTR_WARN_UNUSED_RESULT bool os_task_create_finite( const os_task_finite_func_with_param_t p_func, - const char *const p_name, + const char* const p_name, const uint32_t stack_depth, - void *const p_param, + void* const p_param, const os_task_priority_t priority) { - os_task_arg_finite_with_param_t *const p_arg = os_calloc(1, sizeof(*p_arg)); + os_task_arg_finite_with_param_t* const p_arg = os_calloc(1, sizeof(*p_arg)); if (NULL == p_arg) { return false; @@ -138,7 +138,7 @@ os_task_create_finite( &os_task_thread_func_wrapper_finite_with_param, p_name, stack_depth, - (void *)p_arg, + (void*)p_arg, priority, &h_task); } @@ -146,9 +146,9 @@ os_task_create_finite( ATTR_NORETURN ATTR_NONNULL(1) static void -os_task_thread_func_wrapper_finite_with_const_param(void *p_arg) +os_task_thread_func_wrapper_finite_with_const_param(void* p_arg) { - const os_task_arg_finite_with_const_param_t *p_param = p_arg; + const os_task_arg_finite_with_const_param_t* p_param = p_arg; p_arg = NULL; p_param->p_func(p_param->p_arg); os_free(p_param); @@ -161,12 +161,12 @@ ATTR_WARN_UNUSED_RESULT bool os_task_create_finite_with_const_param( const os_task_finite_func_with_const_param_t p_func, - const char *const p_name, + const char* const p_name, const uint32_t stack_depth, - const void *const p_param, + const void* const p_param, const os_task_priority_t priority) { - os_task_arg_finite_with_const_param_t *const p_arg = os_calloc(1, sizeof(*p_arg)); + os_task_arg_finite_with_const_param_t* const p_arg = os_calloc(1, sizeof(*p_arg)); if (NULL == p_arg) { return false; @@ -179,7 +179,7 @@ os_task_create_finite_with_const_param( &os_task_thread_func_wrapper_finite_with_const_param, p_name, stack_depth, - (void *)p_arg, + (void*)p_arg, priority, &h_task); } @@ -187,7 +187,7 @@ os_task_create_finite_with_const_param( ATTR_NORETURN ATTR_NONNULL(1) static void -os_task_thread_func_wrapper_finite_without_param(void *p_arg) +os_task_thread_func_wrapper_finite_without_param(void* p_arg) { const os_task_finite_func_without_param_t p_func = p_arg; p_arg = NULL; @@ -201,7 +201,7 @@ ATTR_WARN_UNUSED_RESULT bool os_task_create_finite_without_param( const os_task_finite_func_without_param_t p_func, - const char *const p_name, + const char* const p_name, const uint32_t stack_depth, const os_task_priority_t priority) { @@ -210,7 +210,7 @@ os_task_create_finite_without_param( &os_task_thread_func_wrapper_finite_without_param, p_name, stack_depth, - (void *)p_func, + (void*)p_func, priority, &h_task); } @@ -219,13 +219,13 @@ ATTR_NONNULL(1, 3, 7, 8) static bool os_task_create_static_internal( const os_task_func_t p_func, - const char *const p_name, - os_task_stack_type_t *const p_stack_mem, + const char* const p_name, + os_task_stack_type_t* const p_stack_mem, const uint32_t stack_depth, - void *const p_param, + void* const p_param, const os_task_priority_t priority, - os_task_static_t *const p_task_mem, - os_task_handle_t *const ph_task) + os_task_static_t* const p_task_mem, + os_task_handle_t* const ph_task) { LOG_INFO("Start thread(static) '%s' with priority %d, stack size %u bytes", p_name, priority, stack_depth); *ph_task = xTaskCreateStatic(p_func, p_name, stack_depth, p_param, priority, p_stack_mem, p_task_mem); @@ -242,13 +242,13 @@ ATTR_WARN_UNUSED_RESULT bool os_task_create_static( const os_task_func_t p_func, - const char *const p_name, - os_task_stack_type_t *const p_stack_mem, + const char* const p_name, + os_task_stack_type_t* const p_stack_mem, const uint32_t stack_depth, - void *const p_param, + void* const p_param, const os_task_priority_t priority, - os_task_static_t *const p_task_mem, - os_task_handle_t *const ph_task) + os_task_static_t* const p_task_mem, + os_task_handle_t* const ph_task) { return os_task_create_static_internal( p_func, @@ -266,20 +266,20 @@ ATTR_WARN_UNUSED_RESULT bool os_task_create_static_with_const_param( const os_task_func_const_param_t p_func, - const char *const p_name, - os_task_stack_type_t *const p_stack_mem, + const char* const p_name, + os_task_stack_type_t* const p_stack_mem, const uint32_t stack_depth, - const void *const p_param, + const void* const p_param, const os_task_priority_t priority, - os_task_static_t *const p_task_mem, - os_task_handle_t *const ph_task) + os_task_static_t* const p_task_mem, + os_task_handle_t* const ph_task) { return os_task_create_static_internal( (os_task_func_t)p_func, p_name, p_stack_mem, stack_depth, - (void *)p_param, + (void*)p_param, priority, p_task_mem, ph_task); @@ -290,19 +290,19 @@ ATTR_WARN_UNUSED_RESULT bool os_task_create_static_without_param( const os_task_func_without_param_t p_func, - const char *const p_name, - os_task_stack_type_t *const p_stack_mem, + const char* const p_name, + os_task_stack_type_t* const p_stack_mem, const uint32_t stack_depth, const os_task_priority_t priority, - os_task_static_t *const p_task_mem, - os_task_handle_t *const ph_task) + os_task_static_t* const p_task_mem, + os_task_handle_t* const ph_task) { return os_task_create_static_internal( &os_task_thread_func_wrapper_without_param, p_name, p_stack_mem, stack_depth, - (void *)p_func, + (void*)p_func, priority, p_task_mem, ph_task); @@ -313,14 +313,14 @@ ATTR_WARN_UNUSED_RESULT bool os_task_create_static_finite( const os_task_finite_func_with_param_t p_func, - const char *const p_name, - os_task_stack_type_t *const p_stack_mem, + const char* const p_name, + os_task_stack_type_t* const p_stack_mem, const uint32_t stack_depth, - void *const p_param, + void* const p_param, const os_task_priority_t priority, - os_task_static_t *const p_task_mem) + os_task_static_t* const p_task_mem) { - os_task_arg_finite_with_param_t *p_arg = os_calloc(1, sizeof(*p_arg)); + os_task_arg_finite_with_param_t* p_arg = os_calloc(1, sizeof(*p_arg)); if (NULL == p_arg) { return false; @@ -334,7 +334,7 @@ os_task_create_static_finite( p_name, p_stack_mem, stack_depth, - (void *)p_arg, + (void*)p_arg, priority, p_task_mem, &h_task); @@ -345,14 +345,14 @@ ATTR_WARN_UNUSED_RESULT bool os_task_create_static_finite_with_const_param( const os_task_finite_func_with_const_param_t p_func, - const char *const p_name, - os_task_stack_type_t *const p_stack_mem, + const char* const p_name, + os_task_stack_type_t* const p_stack_mem, const uint32_t stack_depth, - const void *const p_param, + const void* const p_param, const os_task_priority_t priority, - os_task_static_t *const p_task_mem) + os_task_static_t* const p_task_mem) { - os_task_arg_finite_with_const_param_t *p_arg = os_calloc(1, sizeof(*p_arg)); + os_task_arg_finite_with_const_param_t* p_arg = os_calloc(1, sizeof(*p_arg)); if (NULL == p_arg) { return false; @@ -366,7 +366,7 @@ os_task_create_static_finite_with_const_param( p_name, p_stack_mem, stack_depth, - (void *)p_arg, + (void*)p_arg, priority, p_task_mem, &h_task); @@ -377,11 +377,11 @@ ATTR_WARN_UNUSED_RESULT bool os_task_create_static_finite_without_param( const os_task_finite_func_without_param_t p_func, - const char *const p_name, - os_task_stack_type_t *const p_stack_mem, + const char* const p_name, + os_task_stack_type_t* const p_stack_mem, const uint32_t stack_depth, const os_task_priority_t priority, - os_task_static_t *const p_task_mem) + os_task_static_t* const p_task_mem) { os_task_handle_t h_task = NULL; return os_task_create_static_internal( @@ -389,7 +389,7 @@ os_task_create_static_finite_without_param( p_name, p_stack_mem, stack_depth, - (void *)p_func, + (void*)p_func, priority, p_task_mem, &h_task); @@ -397,17 +397,17 @@ os_task_create_static_finite_without_param( ATTR_NONNULL(1) void -os_task_delete(os_task_handle_t *const ph_task) +os_task_delete(os_task_handle_t* const ph_task) { vTaskDelete(*ph_task); *ph_task = NULL; } ATTR_WARN_UNUSED_RESULT -const char * +const char* os_task_get_name(void) { - const char *task_name = pcTaskGetTaskName(NULL); + const char* task_name = pcTaskGetTaskName(NULL); if (NULL == task_name) { task_name = "???"; diff --git a/src/os_time.c b/src/os_time.c index 119075d..6dfa3c9 100644 --- a/src/os_time.c +++ b/src/os_time.c @@ -13,7 +13,7 @@ os_time_get(void) return time(NULL); } -const char * +const char* os_time_month_name_short(const os_time_month_e month) { switch (month) @@ -47,7 +47,7 @@ os_time_month_name_short(const os_time_month_e month) } } -const char * +const char* os_time_month_name_long(const os_time_month_e month) { switch (month) @@ -81,7 +81,7 @@ os_time_month_name_long(const os_time_month_e month) } } -const char * +const char* os_time_wday_name_short(const os_time_wday_e day_of_the_week) { switch (day_of_the_week) @@ -105,7 +105,7 @@ os_time_wday_name_short(const os_time_wday_e day_of_the_week) } } -const char * +const char* os_time_wday_name_mid(const os_time_wday_e day_of_the_week) { switch (day_of_the_week) @@ -129,7 +129,7 @@ os_time_wday_name_mid(const os_time_wday_e day_of_the_week) } } -const char * +const char* os_time_wday_name_long(const os_time_wday_e day_of_the_week) { switch (day_of_the_week) diff --git a/src/os_timer.c b/src/os_timer.c index ed17c23..ed09a5a 100644 --- a/src/os_timer.c +++ b/src/os_timer.c @@ -17,7 +17,7 @@ struct os_timer_periodic_t { TimerHandle_t h_timer; os_timer_callback_periodic_t cb_func; - void * p_arg; + void* p_arg; bool is_static; }; @@ -25,7 +25,7 @@ struct os_timer_periodic_without_arg_t { TimerHandle_t h_timer; os_timer_callback_periodic_without_arg_t cb_func; - void * p_stub; + void* p_stub; bool is_static; }; @@ -33,7 +33,7 @@ struct os_timer_periodic_const_arg_t { TimerHandle_t h_timer; os_timer_callback_periodic_const_arg_t cb_func; - const void * p_arg; + const void* p_arg; bool is_static; }; @@ -41,7 +41,7 @@ struct os_timer_periodic_cptr_t { TimerHandle_t h_timer; os_timer_callback_periodic_cptr_t cb_func; - void * p_arg; + void* p_arg; bool is_static; }; @@ -49,7 +49,7 @@ struct os_timer_periodic_cptr_without_arg_t { TimerHandle_t h_timer; os_timer_callback_periodic_cptr_without_arg_t cb_func; - void * p_stub; + void* p_stub; bool is_static; }; @@ -57,7 +57,7 @@ struct os_timer_periodic_cptr_const_arg_t { TimerHandle_t h_timer; os_timer_callback_periodic_cptr_const_arg_t cb_func; - const void * p_arg; + const void* p_arg; bool is_static; }; @@ -69,7 +69,7 @@ struct os_timer_one_shot_t { TimerHandle_t h_timer; os_timer_callback_one_shot_t cb_func; - void * p_arg; + void* p_arg; bool is_static; }; @@ -77,7 +77,7 @@ struct os_timer_one_shot_without_arg_t { TimerHandle_t h_timer; os_timer_callback_one_shot_without_arg_t cb_func; - void * p_stub; + void* p_stub; bool is_static; }; @@ -85,7 +85,7 @@ struct os_timer_one_shot_const_arg_t { TimerHandle_t h_timer; os_timer_callback_one_shot_const_arg_t cb_func; - const void * p_arg; + const void* p_arg; bool is_static; }; @@ -93,7 +93,7 @@ struct os_timer_one_shot_cptr_t { TimerHandle_t h_timer; os_timer_callback_one_shot_cptr_t cb_func; - void * p_arg; + void* p_arg; bool is_static; }; @@ -101,7 +101,7 @@ struct os_timer_one_shot_cptr_without_arg_t { TimerHandle_t h_timer; os_timer_callback_one_shot_cptr_without_arg_t cb_func; - void * p_stub; + void* p_stub; bool is_static; }; @@ -109,7 +109,7 @@ struct os_timer_one_shot_cptr_const_arg_t { TimerHandle_t h_timer; os_timer_callback_one_shot_cptr_const_arg_t cb_func; - const void * p_arg; + const void* p_arg; bool is_static; }; @@ -140,7 +140,7 @@ _Static_assert( static void os_timer_callback_periodic(TimerHandle_t h_timer) { - os_timer_periodic_t *p_timer = pvTimerGetTimerID(h_timer); + os_timer_periodic_t* p_timer = pvTimerGetTimerID(h_timer); if (NULL == p_timer) { // in case if os_timer_delete was called, but it has not been handled yet @@ -152,7 +152,7 @@ os_timer_callback_periodic(TimerHandle_t h_timer) static void os_timer_callback_periodic_without_arg(TimerHandle_t h_timer) { - os_timer_periodic_without_arg_t *p_timer = pvTimerGetTimerID(h_timer); + os_timer_periodic_without_arg_t* p_timer = pvTimerGetTimerID(h_timer); if (NULL == p_timer) { // in case if os_timer_delete was called, but it has not been handled yet @@ -164,7 +164,7 @@ os_timer_callback_periodic_without_arg(TimerHandle_t h_timer) static void os_timer_callback_periodic_const_arg(TimerHandle_t h_timer) { - os_timer_periodic_const_arg_t *p_timer = pvTimerGetTimerID(h_timer); + os_timer_periodic_const_arg_t* p_timer = pvTimerGetTimerID(h_timer); if (NULL == p_timer) { // in case if os_timer_delete was called, but it has not been handled yet @@ -176,7 +176,7 @@ os_timer_callback_periodic_const_arg(TimerHandle_t h_timer) static void os_timer_callback_periodic_cptr(TimerHandle_t h_timer) { - os_timer_periodic_cptr_t *p_timer = pvTimerGetTimerID(h_timer); + os_timer_periodic_cptr_t* p_timer = pvTimerGetTimerID(h_timer); if (NULL == p_timer) { // in case if os_timer_delete was called, but it has not been handled yet @@ -188,7 +188,7 @@ os_timer_callback_periodic_cptr(TimerHandle_t h_timer) static void os_timer_callback_periodic_cptr_without_arg(TimerHandle_t h_timer) { - os_timer_periodic_cptr_without_arg_t *p_timer = pvTimerGetTimerID(h_timer); + os_timer_periodic_cptr_without_arg_t* p_timer = pvTimerGetTimerID(h_timer); if (NULL == p_timer) { // in case if os_timer_delete was called, but it has not been handled yet @@ -200,7 +200,7 @@ os_timer_callback_periodic_cptr_without_arg(TimerHandle_t h_timer) static void os_timer_callback_periodic_cptr_const_arg(TimerHandle_t h_timer) { - os_timer_periodic_cptr_const_arg_t *p_timer = pvTimerGetTimerID(h_timer); + os_timer_periodic_cptr_const_arg_t* p_timer = pvTimerGetTimerID(h_timer); if (NULL == p_timer) { // in case if os_timer_delete was called, but it has not been handled yet @@ -212,7 +212,7 @@ os_timer_callback_periodic_cptr_const_arg(TimerHandle_t h_timer) static void os_timer_callback_one_shot(TimerHandle_t h_timer) { - os_timer_one_shot_t *p_timer = pvTimerGetTimerID(h_timer); + os_timer_one_shot_t* p_timer = pvTimerGetTimerID(h_timer); if (NULL == p_timer) { // in case if os_timer_delete was called, but it has not been handled yet @@ -224,7 +224,7 @@ os_timer_callback_one_shot(TimerHandle_t h_timer) static void os_timer_callback_one_shot_without_arg(TimerHandle_t h_timer) { - os_timer_one_shot_without_arg_t *p_timer = pvTimerGetTimerID(h_timer); + os_timer_one_shot_without_arg_t* p_timer = pvTimerGetTimerID(h_timer); if (NULL == p_timer) { // in case if os_timer_delete was called, but it has not been handled yet @@ -236,7 +236,7 @@ os_timer_callback_one_shot_without_arg(TimerHandle_t h_timer) static void os_timer_callback_one_shot_const_arg(TimerHandle_t h_timer) { - os_timer_one_shot_const_arg_t *p_timer = pvTimerGetTimerID(h_timer); + os_timer_one_shot_const_arg_t* p_timer = pvTimerGetTimerID(h_timer); if (NULL == p_timer) { // in case if os_timer_delete was called, but it has not been handled yet @@ -248,7 +248,7 @@ os_timer_callback_one_shot_const_arg(TimerHandle_t h_timer) static void os_timer_callback_one_shot_cptr(TimerHandle_t h_timer) { - os_timer_one_shot_cptr_t *p_timer = pvTimerGetTimerID(h_timer); + os_timer_one_shot_cptr_t* p_timer = pvTimerGetTimerID(h_timer); if (NULL == p_timer) { // in case if os_timer_delete was called, but it has not been handled yet @@ -260,7 +260,7 @@ os_timer_callback_one_shot_cptr(TimerHandle_t h_timer) static void os_timer_callback_one_shot_cptr_without_arg(TimerHandle_t h_timer) { - os_timer_one_shot_cptr_without_arg_t *p_timer = pvTimerGetTimerID(h_timer); + os_timer_one_shot_cptr_without_arg_t* p_timer = pvTimerGetTimerID(h_timer); if (NULL == p_timer) { // in case if os_timer_delete was called, but it has not been handled yet @@ -272,7 +272,7 @@ os_timer_callback_one_shot_cptr_without_arg(TimerHandle_t h_timer) static void os_timer_callback_one_shot_cptr_const_arg(TimerHandle_t h_timer) { - os_timer_one_shot_cptr_const_arg_t *p_timer = pvTimerGetTimerID(h_timer); + os_timer_one_shot_cptr_const_arg_t* p_timer = pvTimerGetTimerID(h_timer); if (NULL == p_timer) { // in case if os_timer_delete was called, but it has not been handled yet @@ -282,14 +282,14 @@ os_timer_callback_one_shot_cptr_const_arg(TimerHandle_t h_timer) } ATTR_WARN_UNUSED_RESULT -os_timer_periodic_t * +os_timer_periodic_t* os_timer_periodic_create( - const char *const p_timer_name, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_periodic_t p_cb_func, - void *const p_arg) + void* const p_arg) { - os_timer_periodic_t *p_timer = os_calloc(1, sizeof(*p_timer)); + os_timer_periodic_t* p_timer = os_calloc(1, sizeof(*p_timer)); if (NULL == p_timer) { return NULL; @@ -307,13 +307,13 @@ os_timer_periodic_create( } ATTR_WARN_UNUSED_RESULT -os_timer_periodic_without_arg_t * +os_timer_periodic_without_arg_t* os_timer_periodic_without_arg_create( - const char *const p_timer_name, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_periodic_without_arg_t p_cb_func) { - os_timer_periodic_without_arg_t *p_timer = os_calloc(1, sizeof(*p_timer)); + os_timer_periodic_without_arg_t* p_timer = os_calloc(1, sizeof(*p_timer)); if (NULL == p_timer) { return NULL; @@ -335,14 +335,14 @@ os_timer_periodic_without_arg_create( } ATTR_WARN_UNUSED_RESULT -os_timer_periodic_const_arg_t * +os_timer_periodic_const_arg_t* os_timer_periodic_const_arg_create( - const char *const p_timer_name, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_periodic_const_arg_t p_cb_func, - const void *const p_arg) + const void* const p_arg) { - os_timer_periodic_const_arg_t *p_timer = os_calloc(1, sizeof(*p_timer)); + os_timer_periodic_const_arg_t* p_timer = os_calloc(1, sizeof(*p_timer)); if (NULL == p_timer) { return NULL; @@ -360,14 +360,14 @@ os_timer_periodic_const_arg_create( } ATTR_WARN_UNUSED_RESULT -os_timer_periodic_cptr_t * +os_timer_periodic_cptr_t* os_timer_periodic_cptr_create( - const char *const p_timer_name, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_periodic_cptr_t p_cb_func, - void *const p_arg) + void* const p_arg) { - os_timer_periodic_cptr_t *p_timer = os_calloc(1, sizeof(*p_timer)); + os_timer_periodic_cptr_t* p_timer = os_calloc(1, sizeof(*p_timer)); if (NULL == p_timer) { return NULL; @@ -385,13 +385,13 @@ os_timer_periodic_cptr_create( } ATTR_WARN_UNUSED_RESULT -os_timer_periodic_cptr_without_arg_t * +os_timer_periodic_cptr_without_arg_t* os_timer_periodic_cptr_without_arg_create( - const char *const p_timer_name, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_periodic_cptr_without_arg_t p_cb_func) { - os_timer_periodic_cptr_without_arg_t *p_timer = os_calloc(1, sizeof(*p_timer)); + os_timer_periodic_cptr_without_arg_t* p_timer = os_calloc(1, sizeof(*p_timer)); if (NULL == p_timer) { return NULL; @@ -413,14 +413,14 @@ os_timer_periodic_cptr_without_arg_create( } ATTR_WARN_UNUSED_RESULT -os_timer_periodic_cptr_const_arg_t * +os_timer_periodic_cptr_const_arg_t* os_timer_periodic_cptr_const_arg_create( - const char *const p_timer_name, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_periodic_cptr_const_arg_t p_cb_func, - const void *const p_arg) + const void* const p_arg) { - os_timer_periodic_cptr_const_arg_t *p_timer = os_calloc(1, sizeof(*p_timer)); + os_timer_periodic_cptr_const_arg_t* p_timer = os_calloc(1, sizeof(*p_timer)); if (NULL == p_timer) { return NULL; @@ -445,15 +445,15 @@ os_timer_periodic_cptr_const_arg_create( ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL -os_timer_periodic_t * +os_timer_periodic_t* os_timer_periodic_create_static( - os_timer_periodic_static_t *const p_mem, - const char *const p_timer_name, + os_timer_periodic_static_t* const p_mem, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_periodic_t p_cb_func, - void *const p_arg) + void* const p_arg) { - os_timer_periodic_t *const p_timer = (os_timer_periodic_t *)&p_mem->obj_mem; + os_timer_periodic_t* const p_timer = (os_timer_periodic_t*)&p_mem->obj_mem; p_timer->cb_func = p_cb_func; p_timer->p_arg = p_arg; p_timer->is_static = true; @@ -470,14 +470,14 @@ os_timer_periodic_create_static( ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL -os_timer_periodic_without_arg_t * +os_timer_periodic_without_arg_t* os_timer_periodic_without_arg_create_static( - os_timer_periodic_static_t *const p_mem, - const char *const p_timer_name, + os_timer_periodic_static_t* const p_mem, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_periodic_without_arg_t p_cb_func) { - os_timer_periodic_without_arg_t *const p_timer = (os_timer_periodic_without_arg_t *)&p_mem->obj_mem; + os_timer_periodic_without_arg_t* const p_timer = (os_timer_periodic_without_arg_t*)&p_mem->obj_mem; p_timer->cb_func = p_cb_func; p_timer->is_static = true; p_timer->h_timer = xTimerCreateStatic( @@ -493,15 +493,15 @@ os_timer_periodic_without_arg_create_static( ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL -os_timer_periodic_const_arg_t * +os_timer_periodic_const_arg_t* os_timer_periodic_const_arg_create_static( - os_timer_periodic_static_t *const p_mem, - const char *const p_timer_name, + os_timer_periodic_static_t* const p_mem, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_periodic_const_arg_t p_cb_func, - const void *const p_arg) + const void* const p_arg) { - os_timer_periodic_const_arg_t *const p_timer = (os_timer_periodic_const_arg_t *)&p_mem->obj_mem; + os_timer_periodic_const_arg_t* const p_timer = (os_timer_periodic_const_arg_t*)&p_mem->obj_mem; p_timer->cb_func = p_cb_func; p_timer->p_arg = p_arg; p_timer->is_static = true; @@ -518,15 +518,15 @@ os_timer_periodic_const_arg_create_static( ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL -os_timer_periodic_cptr_t * +os_timer_periodic_cptr_t* os_timer_periodic_cptr_create_static( - os_timer_periodic_static_t *const p_mem, - const char *const p_timer_name, + os_timer_periodic_static_t* const p_mem, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_periodic_cptr_t p_cb_func, - void *const p_arg) + void* const p_arg) { - os_timer_periodic_cptr_t *const p_timer = (os_timer_periodic_cptr_t *)&p_mem->obj_mem; + os_timer_periodic_cptr_t* const p_timer = (os_timer_periodic_cptr_t*)&p_mem->obj_mem; p_timer->cb_func = p_cb_func; p_timer->p_arg = p_arg; p_timer->is_static = true; @@ -543,14 +543,14 @@ os_timer_periodic_cptr_create_static( ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL -os_timer_periodic_cptr_without_arg_t * +os_timer_periodic_cptr_without_arg_t* os_timer_periodic_cptr_without_arg_create_static( - os_timer_periodic_static_t *const p_mem, - const char *const p_timer_name, + os_timer_periodic_static_t* const p_mem, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_periodic_cptr_without_arg_t p_cb_func) { - os_timer_periodic_cptr_without_arg_t *const p_timer = (os_timer_periodic_cptr_without_arg_t *)&p_mem->obj_mem; + os_timer_periodic_cptr_without_arg_t* const p_timer = (os_timer_periodic_cptr_without_arg_t*)&p_mem->obj_mem; p_timer->cb_func = p_cb_func; p_timer->is_static = true; p_timer->h_timer = xTimerCreateStatic( @@ -566,15 +566,15 @@ os_timer_periodic_cptr_without_arg_create_static( ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL -os_timer_periodic_cptr_const_arg_t * +os_timer_periodic_cptr_const_arg_t* os_timer_periodic_cptr_const_arg_create_static( - os_timer_periodic_static_t *const p_mem, - const char *const p_timer_name, + os_timer_periodic_static_t* const p_mem, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_periodic_cptr_const_arg_t p_cb_func, - const void *const p_arg) + const void* const p_arg) { - os_timer_periodic_cptr_const_arg_t *const p_timer = (os_timer_periodic_cptr_const_arg_t *)&p_mem->obj_mem; + os_timer_periodic_cptr_const_arg_t* const p_timer = (os_timer_periodic_cptr_const_arg_t*)&p_mem->obj_mem; p_timer->cb_func = p_cb_func; p_timer->p_arg = p_arg; p_timer->is_static = true; @@ -589,14 +589,14 @@ os_timer_periodic_cptr_const_arg_create_static( } ATTR_WARN_UNUSED_RESULT -os_timer_one_shot_t * +os_timer_one_shot_t* os_timer_one_shot_create( - const char *const p_timer_name, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_one_shot_t p_cb_func, - void *const p_arg) + void* const p_arg) { - os_timer_one_shot_t *p_timer = os_calloc(1, sizeof(*p_timer)); + os_timer_one_shot_t* p_timer = os_calloc(1, sizeof(*p_timer)); if (NULL == p_timer) { return NULL; @@ -614,13 +614,13 @@ os_timer_one_shot_create( } ATTR_WARN_UNUSED_RESULT -os_timer_one_shot_without_arg_t * +os_timer_one_shot_without_arg_t* os_timer_one_shot_without_arg_create( - const char *const p_timer_name, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_one_shot_without_arg_t p_cb_func) { - os_timer_one_shot_without_arg_t *p_timer = os_calloc(1, sizeof(*p_timer)); + os_timer_one_shot_without_arg_t* p_timer = os_calloc(1, sizeof(*p_timer)); if (NULL == p_timer) { return NULL; @@ -642,14 +642,14 @@ os_timer_one_shot_without_arg_create( } ATTR_WARN_UNUSED_RESULT -os_timer_one_shot_const_arg_t * +os_timer_one_shot_const_arg_t* os_timer_one_shot_const_arg_create( - const char *const p_timer_name, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_one_shot_const_arg_t p_cb_func, - const void *const p_arg) + const void* const p_arg) { - os_timer_one_shot_const_arg_t *p_timer = os_calloc(1, sizeof(*p_timer)); + os_timer_one_shot_const_arg_t* p_timer = os_calloc(1, sizeof(*p_timer)); if (NULL == p_timer) { return NULL; @@ -672,14 +672,14 @@ os_timer_one_shot_const_arg_create( } ATTR_WARN_UNUSED_RESULT -os_timer_one_shot_cptr_t * +os_timer_one_shot_cptr_t* os_timer_one_shot_cptr_create( - const char *const p_timer_name, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_one_shot_cptr_t p_cb_func, - void *const p_arg) + void* const p_arg) { - os_timer_one_shot_cptr_t *p_timer = os_calloc(1, sizeof(*p_timer)); + os_timer_one_shot_cptr_t* p_timer = os_calloc(1, sizeof(*p_timer)); if (NULL == p_timer) { return NULL; @@ -697,13 +697,13 @@ os_timer_one_shot_cptr_create( } ATTR_WARN_UNUSED_RESULT -os_timer_one_shot_cptr_without_arg_t * +os_timer_one_shot_cptr_without_arg_t* os_timer_one_shot_cptr_without_arg_create( - const char *const p_timer_name, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_one_shot_cptr_without_arg_t p_cb_func) { - os_timer_one_shot_cptr_without_arg_t *p_timer = os_calloc(1, sizeof(*p_timer)); + os_timer_one_shot_cptr_without_arg_t* p_timer = os_calloc(1, sizeof(*p_timer)); if (NULL == p_timer) { return NULL; @@ -725,14 +725,14 @@ os_timer_one_shot_cptr_without_arg_create( } ATTR_WARN_UNUSED_RESULT -os_timer_one_shot_cptr_const_arg_t * +os_timer_one_shot_cptr_const_arg_t* os_timer_one_shot_cptr_const_arg_create( - const char *const p_timer_name, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_one_shot_cptr_const_arg_t p_cb_func, - const void *const p_arg) + const void* const p_arg) { - os_timer_one_shot_cptr_const_arg_t *p_timer = os_calloc(1, sizeof(*p_timer)); + os_timer_one_shot_cptr_const_arg_t* p_timer = os_calloc(1, sizeof(*p_timer)); if (NULL == p_timer) { return NULL; @@ -757,15 +757,15 @@ os_timer_one_shot_cptr_const_arg_create( ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL -os_timer_one_shot_t * +os_timer_one_shot_t* os_timer_one_shot_create_static( - os_timer_one_shot_static_t *const p_mem, - const char *const p_timer_name, + os_timer_one_shot_static_t* const p_mem, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_one_shot_t p_cb_func, - void *const p_arg) + void* const p_arg) { - os_timer_one_shot_t *const p_timer = (os_timer_one_shot_t *)&p_mem->obj_mem; + os_timer_one_shot_t* const p_timer = (os_timer_one_shot_t*)&p_mem->obj_mem; p_timer->cb_func = p_cb_func; p_timer->p_arg = p_arg; p_timer->is_static = true; @@ -782,14 +782,14 @@ os_timer_one_shot_create_static( ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL -os_timer_one_shot_without_arg_t * +os_timer_one_shot_without_arg_t* os_timer_one_shot_without_arg_create_static( - os_timer_one_shot_static_t *const p_mem, - const char *const p_timer_name, + os_timer_one_shot_static_t* const p_mem, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_one_shot_without_arg_t p_cb_func) { - os_timer_one_shot_without_arg_t *const p_timer = (os_timer_one_shot_without_arg_t *)&p_mem->obj_mem; + os_timer_one_shot_without_arg_t* const p_timer = (os_timer_one_shot_without_arg_t*)&p_mem->obj_mem; p_timer->cb_func = p_cb_func; p_timer->is_static = true; p_timer->h_timer = xTimerCreateStatic( @@ -805,15 +805,15 @@ os_timer_one_shot_without_arg_create_static( ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL -os_timer_one_shot_const_arg_t * +os_timer_one_shot_const_arg_t* os_timer_one_shot_const_arg_create_static( - os_timer_one_shot_static_t *const p_mem, - const char *const p_timer_name, + os_timer_one_shot_static_t* const p_mem, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_one_shot_const_arg_t p_cb_func, - const void *const p_arg) + const void* const p_arg) { - os_timer_one_shot_const_arg_t *const p_timer = (os_timer_one_shot_const_arg_t *)&p_mem->obj_mem; + os_timer_one_shot_const_arg_t* const p_timer = (os_timer_one_shot_const_arg_t*)&p_mem->obj_mem; p_timer->cb_func = p_cb_func; p_timer->p_arg = p_arg; p_timer->is_static = true; @@ -830,15 +830,15 @@ os_timer_one_shot_const_arg_create_static( ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL -os_timer_one_shot_cptr_t * +os_timer_one_shot_cptr_t* os_timer_one_shot_cptr_create_static( - os_timer_one_shot_static_t *const p_mem, - const char *const p_timer_name, + os_timer_one_shot_static_t* const p_mem, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_one_shot_cptr_t p_cb_func, - void *const p_arg) + void* const p_arg) { - os_timer_one_shot_cptr_t *const p_timer = (os_timer_one_shot_cptr_t *)&p_mem->obj_mem; + os_timer_one_shot_cptr_t* const p_timer = (os_timer_one_shot_cptr_t*)&p_mem->obj_mem; p_timer->cb_func = p_cb_func; p_timer->p_arg = p_arg; p_timer->is_static = true; @@ -855,14 +855,14 @@ os_timer_one_shot_cptr_create_static( ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL -os_timer_one_shot_cptr_without_arg_t * +os_timer_one_shot_cptr_without_arg_t* os_timer_one_shot_cptr_without_arg_create_static( - os_timer_one_shot_static_t *const p_mem, - const char *const p_timer_name, + os_timer_one_shot_static_t* const p_mem, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_one_shot_cptr_without_arg_t p_cb_func) { - os_timer_one_shot_cptr_without_arg_t *const p_timer = (os_timer_one_shot_cptr_without_arg_t *)&p_mem->obj_mem; + os_timer_one_shot_cptr_without_arg_t* const p_timer = (os_timer_one_shot_cptr_without_arg_t*)&p_mem->obj_mem; p_timer->cb_func = p_cb_func; p_timer->is_static = true; p_timer->h_timer = xTimerCreateStatic( @@ -878,15 +878,15 @@ os_timer_one_shot_cptr_without_arg_create_static( ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL -os_timer_one_shot_cptr_const_arg_t * +os_timer_one_shot_cptr_const_arg_t* os_timer_one_shot_cptr_const_arg_create_static( - os_timer_one_shot_static_t *const p_mem, - const char *const p_timer_name, + os_timer_one_shot_static_t* const p_mem, + const char* const p_timer_name, const os_delta_ticks_t period_ticks, const os_timer_callback_one_shot_cptr_const_arg_t p_cb_func, - const void *const p_arg) + const void* const p_arg) { - os_timer_one_shot_cptr_const_arg_t *const p_timer = (os_timer_one_shot_cptr_const_arg_t *)&p_mem->obj_mem; + os_timer_one_shot_cptr_const_arg_t* const p_timer = (os_timer_one_shot_cptr_const_arg_t*)&p_mem->obj_mem; p_timer->cb_func = p_cb_func; p_timer->p_arg = p_arg; p_timer->is_static = true; @@ -901,7 +901,7 @@ os_timer_one_shot_cptr_const_arg_create_static( } bool -os_timer_periodic_is_active(os_timer_periodic_t *const p_timer) +os_timer_periodic_is_active(os_timer_periodic_t* const p_timer) { if (NULL == p_timer) { @@ -915,7 +915,7 @@ os_timer_periodic_is_active(os_timer_periodic_t *const p_timer) } bool -os_timer_periodic_without_arg_is_active(os_timer_periodic_without_arg_t *const p_timer) +os_timer_periodic_without_arg_is_active(os_timer_periodic_without_arg_t* const p_timer) { if (NULL == p_timer) { @@ -929,7 +929,7 @@ os_timer_periodic_without_arg_is_active(os_timer_periodic_without_arg_t *const p } bool -os_timer_periodic_const_arg_is_active(os_timer_periodic_const_arg_t *const p_timer) +os_timer_periodic_const_arg_is_active(os_timer_periodic_const_arg_t* const p_timer) { if (NULL == p_timer) { @@ -943,7 +943,7 @@ os_timer_periodic_const_arg_is_active(os_timer_periodic_const_arg_t *const p_tim } bool -os_timer_periodic_cptr_is_active(os_timer_periodic_cptr_t *const p_timer) +os_timer_periodic_cptr_is_active(os_timer_periodic_cptr_t* const p_timer) { if (NULL == p_timer) { @@ -957,7 +957,7 @@ os_timer_periodic_cptr_is_active(os_timer_periodic_cptr_t *const p_timer) } bool -os_timer_periodic_cptr_without_arg_is_active(os_timer_periodic_cptr_without_arg_t *const p_timer) +os_timer_periodic_cptr_without_arg_is_active(os_timer_periodic_cptr_without_arg_t* const p_timer) { if (NULL == p_timer) { @@ -971,7 +971,7 @@ os_timer_periodic_cptr_without_arg_is_active(os_timer_periodic_cptr_without_arg_ } bool -os_timer_periodic_cptr_const_arg_is_active(os_timer_periodic_cptr_const_arg_t *const p_timer) +os_timer_periodic_cptr_const_arg_is_active(os_timer_periodic_cptr_const_arg_t* const p_timer) { if (NULL == p_timer) { @@ -985,7 +985,7 @@ os_timer_periodic_cptr_const_arg_is_active(os_timer_periodic_cptr_const_arg_t *c } bool -os_timer_one_shot_is_active(os_timer_one_shot_t *const p_timer) +os_timer_one_shot_is_active(os_timer_one_shot_t* const p_timer) { if (NULL == p_timer) { @@ -999,7 +999,7 @@ os_timer_one_shot_is_active(os_timer_one_shot_t *const p_timer) } bool -os_timer_one_shot_without_arg_is_active(os_timer_one_shot_without_arg_t *const p_timer) +os_timer_one_shot_without_arg_is_active(os_timer_one_shot_without_arg_t* const p_timer) { if (NULL == p_timer) { @@ -1013,7 +1013,7 @@ os_timer_one_shot_without_arg_is_active(os_timer_one_shot_without_arg_t *const p } bool -os_timer_one_shot_const_arg_is_active(os_timer_one_shot_const_arg_t *const p_timer) +os_timer_one_shot_const_arg_is_active(os_timer_one_shot_const_arg_t* const p_timer) { if (NULL == p_timer) { @@ -1027,7 +1027,7 @@ os_timer_one_shot_const_arg_is_active(os_timer_one_shot_const_arg_t *const p_tim } bool -os_timer_one_shot_cptr_is_active(os_timer_one_shot_cptr_t *const p_timer) +os_timer_one_shot_cptr_is_active(os_timer_one_shot_cptr_t* const p_timer) { if (NULL == p_timer) { @@ -1041,7 +1041,7 @@ os_timer_one_shot_cptr_is_active(os_timer_one_shot_cptr_t *const p_timer) } bool -os_timer_one_shot_cptr_without_arg_is_active(os_timer_one_shot_cptr_without_arg_t *const p_timer) +os_timer_one_shot_cptr_without_arg_is_active(os_timer_one_shot_cptr_without_arg_t* const p_timer) { if (NULL == p_timer) { @@ -1055,7 +1055,7 @@ os_timer_one_shot_cptr_without_arg_is_active(os_timer_one_shot_cptr_without_arg_ } bool -os_timer_one_shot_cptr_const_arg_is_active(os_timer_one_shot_cptr_const_arg_t *const p_timer) +os_timer_one_shot_cptr_const_arg_is_active(os_timer_one_shot_cptr_const_arg_t* const p_timer) { if (NULL == p_timer) { @@ -1070,9 +1070,9 @@ os_timer_one_shot_cptr_const_arg_is_active(os_timer_one_shot_cptr_const_arg_t *c ATTR_NONNULL(1) void -os_timer_periodic_delete(os_timer_periodic_t **const p_p_timer) +os_timer_periodic_delete(os_timer_periodic_t** const p_p_timer) { - os_timer_periodic_t *p_timer = *p_p_timer; + os_timer_periodic_t* p_timer = *p_p_timer; *p_p_timer = NULL; if (NULL == p_timer) { @@ -1092,9 +1092,9 @@ os_timer_periodic_delete(os_timer_periodic_t **const p_p_timer) ATTR_NONNULL(1) void -os_timer_periodic_without_arg_delete(os_timer_periodic_without_arg_t **const p_p_timer) +os_timer_periodic_without_arg_delete(os_timer_periodic_without_arg_t** const p_p_timer) { - os_timer_periodic_without_arg_t *p_timer = *p_p_timer; + os_timer_periodic_without_arg_t* p_timer = *p_p_timer; *p_p_timer = NULL; if (NULL == p_timer) { @@ -1114,9 +1114,9 @@ os_timer_periodic_without_arg_delete(os_timer_periodic_without_arg_t **const p_p ATTR_NONNULL(1) void -os_timer_periodic_const_arg_delete(os_timer_periodic_const_arg_t **const p_p_timer) +os_timer_periodic_const_arg_delete(os_timer_periodic_const_arg_t** const p_p_timer) { - os_timer_periodic_const_arg_t *p_timer = *p_p_timer; + os_timer_periodic_const_arg_t* p_timer = *p_p_timer; *p_p_timer = NULL; if (NULL == p_timer) { @@ -1136,9 +1136,9 @@ os_timer_periodic_const_arg_delete(os_timer_periodic_const_arg_t **const p_p_tim ATTR_NONNULL(1) void -os_timer_periodic_cptr_delete(os_timer_periodic_cptr_t **const p_p_timer) +os_timer_periodic_cptr_delete(os_timer_periodic_cptr_t** const p_p_timer) { - os_timer_periodic_cptr_t *p_timer = *p_p_timer; + os_timer_periodic_cptr_t* p_timer = *p_p_timer; *p_p_timer = NULL; if (NULL == p_timer) { @@ -1158,9 +1158,9 @@ os_timer_periodic_cptr_delete(os_timer_periodic_cptr_t **const p_p_timer) ATTR_NONNULL(1) void -os_timer_periodic_cptr_without_arg_delete(os_timer_periodic_cptr_without_arg_t **const p_p_timer) +os_timer_periodic_cptr_without_arg_delete(os_timer_periodic_cptr_without_arg_t** const p_p_timer) { - os_timer_periodic_cptr_without_arg_t *p_timer = *p_p_timer; + os_timer_periodic_cptr_without_arg_t* p_timer = *p_p_timer; *p_p_timer = NULL; if (NULL == p_timer) { @@ -1180,9 +1180,9 @@ os_timer_periodic_cptr_without_arg_delete(os_timer_periodic_cptr_without_arg_t * ATTR_NONNULL(1) void -os_timer_periodic_cptr_const_arg_delete(os_timer_periodic_cptr_const_arg_t **const p_p_timer) +os_timer_periodic_cptr_const_arg_delete(os_timer_periodic_cptr_const_arg_t** const p_p_timer) { - os_timer_periodic_cptr_const_arg_t *p_timer = *p_p_timer; + os_timer_periodic_cptr_const_arg_t* p_timer = *p_p_timer; *p_p_timer = NULL; if (NULL == p_timer) { @@ -1202,9 +1202,9 @@ os_timer_periodic_cptr_const_arg_delete(os_timer_periodic_cptr_const_arg_t **con ATTR_NONNULL(1) void -os_timer_one_shot_delete(os_timer_one_shot_t **const p_p_timer) +os_timer_one_shot_delete(os_timer_one_shot_t** const p_p_timer) { - os_timer_one_shot_t *p_timer = *p_p_timer; + os_timer_one_shot_t* p_timer = *p_p_timer; *p_p_timer = NULL; if (NULL == p_timer) { @@ -1224,9 +1224,9 @@ os_timer_one_shot_delete(os_timer_one_shot_t **const p_p_timer) ATTR_NONNULL(1) void -os_timer_one_shot_without_arg_delete(os_timer_one_shot_without_arg_t **const p_p_timer) +os_timer_one_shot_without_arg_delete(os_timer_one_shot_without_arg_t** const p_p_timer) { - os_timer_one_shot_without_arg_t *p_timer = *p_p_timer; + os_timer_one_shot_without_arg_t* p_timer = *p_p_timer; *p_p_timer = NULL; if (NULL == p_timer) { @@ -1246,9 +1246,9 @@ os_timer_one_shot_without_arg_delete(os_timer_one_shot_without_arg_t **const p_p ATTR_NONNULL(1) void -os_timer_one_shot_const_arg_delete(os_timer_one_shot_const_arg_t **const p_p_timer) +os_timer_one_shot_const_arg_delete(os_timer_one_shot_const_arg_t** const p_p_timer) { - os_timer_one_shot_const_arg_t *p_timer = *p_p_timer; + os_timer_one_shot_const_arg_t* p_timer = *p_p_timer; *p_p_timer = NULL; if (NULL == p_timer) { @@ -1268,9 +1268,9 @@ os_timer_one_shot_const_arg_delete(os_timer_one_shot_const_arg_t **const p_p_tim ATTR_NONNULL(1) void -os_timer_one_shot_cptr_delete(os_timer_one_shot_cptr_t **const p_p_timer) +os_timer_one_shot_cptr_delete(os_timer_one_shot_cptr_t** const p_p_timer) { - os_timer_one_shot_cptr_t *p_timer = *p_p_timer; + os_timer_one_shot_cptr_t* p_timer = *p_p_timer; *p_p_timer = NULL; if (NULL == p_timer) { @@ -1290,9 +1290,9 @@ os_timer_one_shot_cptr_delete(os_timer_one_shot_cptr_t **const p_p_timer) ATTR_NONNULL(1) void -os_timer_one_shot_cptr_without_arg_delete(os_timer_one_shot_cptr_without_arg_t **const p_p_timer) +os_timer_one_shot_cptr_without_arg_delete(os_timer_one_shot_cptr_without_arg_t** const p_p_timer) { - os_timer_one_shot_cptr_without_arg_t *p_timer = *p_p_timer; + os_timer_one_shot_cptr_without_arg_t* p_timer = *p_p_timer; *p_p_timer = NULL; if (NULL == p_timer) { @@ -1312,9 +1312,9 @@ os_timer_one_shot_cptr_without_arg_delete(os_timer_one_shot_cptr_without_arg_t * ATTR_NONNULL(1) void -os_timer_one_shot_cptr_const_arg_delete(os_timer_one_shot_cptr_const_arg_t **const p_p_timer) +os_timer_one_shot_cptr_const_arg_delete(os_timer_one_shot_cptr_const_arg_t** const p_p_timer) { - os_timer_one_shot_cptr_const_arg_t *p_timer = *p_p_timer; + os_timer_one_shot_cptr_const_arg_t* p_timer = *p_p_timer; *p_p_timer = NULL; if (NULL == p_timer) { @@ -1333,7 +1333,7 @@ os_timer_one_shot_cptr_const_arg_delete(os_timer_one_shot_cptr_const_arg_t **con } void -os_timer_periodic_stop(os_timer_periodic_t *const p_timer) +os_timer_periodic_stop(os_timer_periodic_t* const p_timer) { if (NULL == p_timer) { @@ -1346,7 +1346,7 @@ os_timer_periodic_stop(os_timer_periodic_t *const p_timer) } void -os_timer_periodic_without_arg_stop(os_timer_periodic_without_arg_t *const p_timer) +os_timer_periodic_without_arg_stop(os_timer_periodic_without_arg_t* const p_timer) { if (NULL == p_timer) { @@ -1359,7 +1359,7 @@ os_timer_periodic_without_arg_stop(os_timer_periodic_without_arg_t *const p_time } void -os_timer_periodic_const_arg_stop(os_timer_periodic_const_arg_t *const p_timer) +os_timer_periodic_const_arg_stop(os_timer_periodic_const_arg_t* const p_timer) { if (NULL == p_timer) { @@ -1372,7 +1372,7 @@ os_timer_periodic_const_arg_stop(os_timer_periodic_const_arg_t *const p_timer) } void -os_timer_periodic_cptr_stop(os_timer_periodic_cptr_t *const p_timer) +os_timer_periodic_cptr_stop(os_timer_periodic_cptr_t* const p_timer) { if (NULL == p_timer) { @@ -1385,7 +1385,7 @@ os_timer_periodic_cptr_stop(os_timer_periodic_cptr_t *const p_timer) } void -os_timer_periodic_cptr_without_arg_stop(os_timer_periodic_cptr_without_arg_t *const p_timer) +os_timer_periodic_cptr_without_arg_stop(os_timer_periodic_cptr_without_arg_t* const p_timer) { if (NULL == p_timer) { @@ -1398,7 +1398,7 @@ os_timer_periodic_cptr_without_arg_stop(os_timer_periodic_cptr_without_arg_t *co } void -os_timer_periodic_cptr_const_arg_stop(os_timer_periodic_cptr_const_arg_t *const p_timer) +os_timer_periodic_cptr_const_arg_stop(os_timer_periodic_cptr_const_arg_t* const p_timer) { if (NULL == p_timer) { @@ -1411,7 +1411,7 @@ os_timer_periodic_cptr_const_arg_stop(os_timer_periodic_cptr_const_arg_t *const } void -os_timer_one_shot_stop(os_timer_one_shot_t *const p_timer) +os_timer_one_shot_stop(os_timer_one_shot_t* const p_timer) { if (NULL == p_timer) { @@ -1424,7 +1424,7 @@ os_timer_one_shot_stop(os_timer_one_shot_t *const p_timer) } void -os_timer_one_shot_without_arg_stop(os_timer_one_shot_without_arg_t *const p_timer) +os_timer_one_shot_without_arg_stop(os_timer_one_shot_without_arg_t* const p_timer) { if (NULL == p_timer) { @@ -1437,7 +1437,7 @@ os_timer_one_shot_without_arg_stop(os_timer_one_shot_without_arg_t *const p_time } void -os_timer_one_shot_const_arg_stop(os_timer_one_shot_const_arg_t *const p_timer) +os_timer_one_shot_const_arg_stop(os_timer_one_shot_const_arg_t* const p_timer) { if (NULL == p_timer) { @@ -1450,7 +1450,7 @@ os_timer_one_shot_const_arg_stop(os_timer_one_shot_const_arg_t *const p_timer) } void -os_timer_one_shot_cptr_stop(os_timer_one_shot_cptr_t *const p_timer) +os_timer_one_shot_cptr_stop(os_timer_one_shot_cptr_t* const p_timer) { if (NULL == p_timer) { @@ -1463,7 +1463,7 @@ os_timer_one_shot_cptr_stop(os_timer_one_shot_cptr_t *const p_timer) } void -os_timer_one_shot_cptr_without_arg_stop(os_timer_one_shot_cptr_without_arg_t *const p_timer) +os_timer_one_shot_cptr_without_arg_stop(os_timer_one_shot_cptr_without_arg_t* const p_timer) { if (NULL == p_timer) { @@ -1476,7 +1476,7 @@ os_timer_one_shot_cptr_without_arg_stop(os_timer_one_shot_cptr_without_arg_t *co } void -os_timer_one_shot_cptr_const_arg_stop(os_timer_one_shot_cptr_const_arg_t *const p_timer) +os_timer_one_shot_cptr_const_arg_stop(os_timer_one_shot_cptr_const_arg_t* const p_timer) { if (NULL == p_timer) { @@ -1489,7 +1489,7 @@ os_timer_one_shot_cptr_const_arg_stop(os_timer_one_shot_cptr_const_arg_t *const } void -os_timer_periodic_start(os_timer_periodic_t *const p_timer) +os_timer_periodic_start(os_timer_periodic_t* const p_timer) { if (NULL == p_timer) { @@ -1506,7 +1506,7 @@ os_timer_periodic_start(os_timer_periodic_t *const p_timer) } void -os_timer_periodic_without_arg_start(os_timer_periodic_without_arg_t *const p_timer) +os_timer_periodic_without_arg_start(os_timer_periodic_without_arg_t* const p_timer) { if (NULL == p_timer) { @@ -1523,7 +1523,7 @@ os_timer_periodic_without_arg_start(os_timer_periodic_without_arg_t *const p_tim } void -os_timer_periodic_const_arg_start(os_timer_periodic_const_arg_t *const p_timer) +os_timer_periodic_const_arg_start(os_timer_periodic_const_arg_t* const p_timer) { if (NULL == p_timer) { @@ -1540,7 +1540,7 @@ os_timer_periodic_const_arg_start(os_timer_periodic_const_arg_t *const p_timer) } void -os_timer_periodic_cptr_start(os_timer_periodic_cptr_t *const p_timer) +os_timer_periodic_cptr_start(os_timer_periodic_cptr_t* const p_timer) { if (NULL == p_timer) { @@ -1557,7 +1557,7 @@ os_timer_periodic_cptr_start(os_timer_periodic_cptr_t *const p_timer) } void -os_timer_periodic_cptr_without_arg_start(os_timer_periodic_cptr_without_arg_t *const p_timer) +os_timer_periodic_cptr_without_arg_start(os_timer_periodic_cptr_without_arg_t* const p_timer) { if (NULL == p_timer) { @@ -1574,7 +1574,7 @@ os_timer_periodic_cptr_without_arg_start(os_timer_periodic_cptr_without_arg_t *c } void -os_timer_periodic_cptr_const_arg_start(os_timer_periodic_cptr_const_arg_t *const p_timer) +os_timer_periodic_cptr_const_arg_start(os_timer_periodic_cptr_const_arg_t* const p_timer) { if (NULL == p_timer) { @@ -1591,7 +1591,7 @@ os_timer_periodic_cptr_const_arg_start(os_timer_periodic_cptr_const_arg_t *const } void -os_timer_one_shot_start(os_timer_one_shot_t *const p_timer) +os_timer_one_shot_start(os_timer_one_shot_t* const p_timer) { if (NULL == p_timer) { @@ -1608,7 +1608,7 @@ os_timer_one_shot_start(os_timer_one_shot_t *const p_timer) } void -os_timer_one_shot_without_arg_start(os_timer_one_shot_without_arg_t *const p_timer) +os_timer_one_shot_without_arg_start(os_timer_one_shot_without_arg_t* const p_timer) { if (NULL == p_timer) { @@ -1625,7 +1625,7 @@ os_timer_one_shot_without_arg_start(os_timer_one_shot_without_arg_t *const p_tim } void -os_timer_one_shot_const_arg_start(os_timer_one_shot_const_arg_t *const p_timer) +os_timer_one_shot_const_arg_start(os_timer_one_shot_const_arg_t* const p_timer) { if (NULL == p_timer) { @@ -1642,7 +1642,7 @@ os_timer_one_shot_const_arg_start(os_timer_one_shot_const_arg_t *const p_timer) } void -os_timer_one_shot_cptr_start(os_timer_one_shot_cptr_t *const p_timer) +os_timer_one_shot_cptr_start(os_timer_one_shot_cptr_t* const p_timer) { if (NULL == p_timer) { @@ -1659,7 +1659,7 @@ os_timer_one_shot_cptr_start(os_timer_one_shot_cptr_t *const p_timer) } void -os_timer_one_shot_cptr_without_arg_start(os_timer_one_shot_cptr_without_arg_t *const p_timer) +os_timer_one_shot_cptr_without_arg_start(os_timer_one_shot_cptr_without_arg_t* const p_timer) { if (NULL == p_timer) { @@ -1676,7 +1676,7 @@ os_timer_one_shot_cptr_without_arg_start(os_timer_one_shot_cptr_without_arg_t *c } void -os_timer_one_shot_cptr_const_arg_start(os_timer_one_shot_cptr_const_arg_t *const p_timer) +os_timer_one_shot_cptr_const_arg_start(os_timer_one_shot_cptr_const_arg_t* const p_timer) { if (NULL == p_timer) { @@ -1693,7 +1693,7 @@ os_timer_one_shot_cptr_const_arg_start(os_timer_one_shot_cptr_const_arg_t *const } static void -os_timer_periodic_set_period(os_timer_periodic_t *const p_timer, const os_delta_ticks_t delta_ticks) +os_timer_periodic_set_period(os_timer_periodic_t* const p_timer, const os_delta_ticks_t delta_ticks) { if (NULL == p_timer) { @@ -1707,7 +1707,7 @@ os_timer_periodic_set_period(os_timer_periodic_t *const p_timer, const os_delta_ static void os_timer_periodic_without_arg_set_period( - os_timer_periodic_without_arg_t *const p_timer, + os_timer_periodic_without_arg_t* const p_timer, const os_delta_ticks_t delta_ticks) { if (NULL == p_timer) @@ -1721,7 +1721,7 @@ os_timer_periodic_without_arg_set_period( } static void -os_timer_periodic_const_arg_set_period(os_timer_periodic_const_arg_t *const p_timer, const os_delta_ticks_t delta_ticks) +os_timer_periodic_const_arg_set_period(os_timer_periodic_const_arg_t* const p_timer, const os_delta_ticks_t delta_ticks) { if (NULL == p_timer) { @@ -1734,7 +1734,7 @@ os_timer_periodic_const_arg_set_period(os_timer_periodic_const_arg_t *const p_ti } static void -os_timer_periodic_cptr_set_period(os_timer_periodic_cptr_t *const p_timer, const os_delta_ticks_t delta_ticks) +os_timer_periodic_cptr_set_period(os_timer_periodic_cptr_t* const p_timer, const os_delta_ticks_t delta_ticks) { if (NULL == p_timer) { @@ -1748,7 +1748,7 @@ os_timer_periodic_cptr_set_period(os_timer_periodic_cptr_t *const p_timer, const static void os_timer_periodic_cptr_without_arg_set_period( - os_timer_periodic_cptr_without_arg_t *const p_timer, + os_timer_periodic_cptr_without_arg_t* const p_timer, const os_delta_ticks_t delta_ticks) { if (NULL == p_timer) @@ -1763,7 +1763,7 @@ os_timer_periodic_cptr_without_arg_set_period( static void os_timer_periodic_cptr_const_arg_set_period( - os_timer_periodic_cptr_const_arg_t *const p_timer, + os_timer_periodic_cptr_const_arg_t* const p_timer, const os_delta_ticks_t delta_ticks) { if (NULL == p_timer) @@ -1777,7 +1777,7 @@ os_timer_periodic_cptr_const_arg_set_period( } static void -os_timer_one_shot_set_period(os_timer_one_shot_t *const p_timer, const os_delta_ticks_t delta_ticks) +os_timer_one_shot_set_period(os_timer_one_shot_t* const p_timer, const os_delta_ticks_t delta_ticks) { if (NULL == p_timer) { @@ -1791,7 +1791,7 @@ os_timer_one_shot_set_period(os_timer_one_shot_t *const p_timer, const os_delta_ static void os_timer_one_shot_without_arg_set_period( - os_timer_one_shot_without_arg_t *const p_timer, + os_timer_one_shot_without_arg_t* const p_timer, const os_delta_ticks_t delta_ticks) { if (NULL == p_timer) @@ -1805,7 +1805,7 @@ os_timer_one_shot_without_arg_set_period( } static void -os_timer_one_shot_const_arg_set_period(os_timer_one_shot_const_arg_t *const p_timer, const os_delta_ticks_t delta_ticks) +os_timer_one_shot_const_arg_set_period(os_timer_one_shot_const_arg_t* const p_timer, const os_delta_ticks_t delta_ticks) { if (NULL == p_timer) { @@ -1818,7 +1818,7 @@ os_timer_one_shot_const_arg_set_period(os_timer_one_shot_const_arg_t *const p_ti } static void -os_timer_one_shot_cptr_set_period(os_timer_one_shot_cptr_t *const p_timer, const os_delta_ticks_t delta_ticks) +os_timer_one_shot_cptr_set_period(os_timer_one_shot_cptr_t* const p_timer, const os_delta_ticks_t delta_ticks) { if (NULL == p_timer) { @@ -1832,7 +1832,7 @@ os_timer_one_shot_cptr_set_period(os_timer_one_shot_cptr_t *const p_timer, const static void os_timer_one_shot_cptr_without_arg_set_period( - os_timer_one_shot_cptr_without_arg_t *const p_timer, + os_timer_one_shot_cptr_without_arg_t* const p_timer, const os_delta_ticks_t delta_ticks) { if (NULL == p_timer) @@ -1847,7 +1847,7 @@ os_timer_one_shot_cptr_without_arg_set_period( static void os_timer_one_shot_cptr_const_arg_set_period( - os_timer_one_shot_cptr_const_arg_t *const p_timer, + os_timer_one_shot_cptr_const_arg_t* const p_timer, const os_delta_ticks_t delta_ticks) { if (NULL == p_timer) @@ -1861,7 +1861,7 @@ os_timer_one_shot_cptr_const_arg_set_period( } void -os_timer_periodic_restart(os_timer_periodic_t *const p_timer, const os_delta_ticks_t period_ticks) +os_timer_periodic_restart(os_timer_periodic_t* const p_timer, const os_delta_ticks_t period_ticks) { if (NULL == p_timer) { @@ -1873,7 +1873,7 @@ os_timer_periodic_restart(os_timer_periodic_t *const p_timer, const os_delta_tic void os_timer_periodic_without_arg_restart( - os_timer_periodic_without_arg_t *const p_timer, + os_timer_periodic_without_arg_t* const p_timer, const os_delta_ticks_t period_ticks) { if (NULL == p_timer) @@ -1885,7 +1885,7 @@ os_timer_periodic_without_arg_restart( } void -os_timer_periodic_const_arg_restart(os_timer_periodic_const_arg_t *const p_timer, const os_delta_ticks_t period_ticks) +os_timer_periodic_const_arg_restart(os_timer_periodic_const_arg_t* const p_timer, const os_delta_ticks_t period_ticks) { if (NULL == p_timer) { @@ -1896,7 +1896,7 @@ os_timer_periodic_const_arg_restart(os_timer_periodic_const_arg_t *const p_timer } void -os_timer_periodic_cptr_restart(os_timer_periodic_cptr_t *const p_timer, const os_delta_ticks_t period_ticks) +os_timer_periodic_cptr_restart(os_timer_periodic_cptr_t* const p_timer, const os_delta_ticks_t period_ticks) { if (NULL == p_timer) { @@ -1908,7 +1908,7 @@ os_timer_periodic_cptr_restart(os_timer_periodic_cptr_t *const p_timer, const os void os_timer_periodic_cptr_without_arg_restart( - os_timer_periodic_cptr_without_arg_t *const p_timer, + os_timer_periodic_cptr_without_arg_t* const p_timer, const os_delta_ticks_t period_ticks) { if (NULL == p_timer) @@ -1921,7 +1921,7 @@ os_timer_periodic_cptr_without_arg_restart( void os_timer_periodic_cptr_const_arg_restart( - os_timer_periodic_cptr_const_arg_t *const p_timer, + os_timer_periodic_cptr_const_arg_t* const p_timer, const os_delta_ticks_t period_ticks) { if (NULL == p_timer) @@ -1933,7 +1933,7 @@ os_timer_periodic_cptr_const_arg_restart( } void -os_timer_one_shot_restart(os_timer_one_shot_t *const p_timer, const os_delta_ticks_t delay_ticks) +os_timer_one_shot_restart(os_timer_one_shot_t* const p_timer, const os_delta_ticks_t delay_ticks) { if (NULL == p_timer) { @@ -1945,7 +1945,7 @@ os_timer_one_shot_restart(os_timer_one_shot_t *const p_timer, const os_delta_tic void os_timer_one_shot_without_arg_restart( - os_timer_one_shot_without_arg_t *const p_timer, + os_timer_one_shot_without_arg_t* const p_timer, const os_delta_ticks_t delay_ticks) { if (NULL == p_timer) @@ -1957,7 +1957,7 @@ os_timer_one_shot_without_arg_restart( } void -os_timer_one_shot_const_arg_restart(os_timer_one_shot_const_arg_t *const p_timer, const os_delta_ticks_t delay_ticks) +os_timer_one_shot_const_arg_restart(os_timer_one_shot_const_arg_t* const p_timer, const os_delta_ticks_t delay_ticks) { if (NULL == p_timer) { @@ -1968,7 +1968,7 @@ os_timer_one_shot_const_arg_restart(os_timer_one_shot_const_arg_t *const p_timer } void -os_timer_one_shot_cptr_restart(os_timer_one_shot_cptr_t *const p_timer, const os_delta_ticks_t delay_ticks) +os_timer_one_shot_cptr_restart(os_timer_one_shot_cptr_t* const p_timer, const os_delta_ticks_t delay_ticks) { if (NULL == p_timer) { @@ -1980,7 +1980,7 @@ os_timer_one_shot_cptr_restart(os_timer_one_shot_cptr_t *const p_timer, const os void os_timer_one_shot_cptr_without_arg_restart( - os_timer_one_shot_cptr_without_arg_t *const p_timer, + os_timer_one_shot_cptr_without_arg_t* const p_timer, const os_delta_ticks_t delay_ticks) { if (NULL == p_timer) @@ -1993,7 +1993,7 @@ os_timer_one_shot_cptr_without_arg_restart( void os_timer_one_shot_cptr_const_arg_restart( - os_timer_one_shot_cptr_const_arg_t *const p_timer, + os_timer_one_shot_cptr_const_arg_t* const p_timer, const os_delta_ticks_t delay_ticks) { if (NULL == p_timer) @@ -2005,7 +2005,7 @@ os_timer_one_shot_cptr_const_arg_restart( } void -os_timer_periodic_simulate(os_timer_periodic_t *const p_timer) +os_timer_periodic_simulate(os_timer_periodic_t* const p_timer) { if (NULL == p_timer) { @@ -2015,7 +2015,7 @@ os_timer_periodic_simulate(os_timer_periodic_t *const p_timer) } void -os_timer_periodic_without_arg_simulate(os_timer_periodic_without_arg_t *const p_timer) +os_timer_periodic_without_arg_simulate(os_timer_periodic_without_arg_t* const p_timer) { if (NULL == p_timer) { @@ -2025,7 +2025,7 @@ os_timer_periodic_without_arg_simulate(os_timer_periodic_without_arg_t *const p_ } void -os_timer_periodic_const_arg_simulate(os_timer_periodic_const_arg_t *const p_timer) +os_timer_periodic_const_arg_simulate(os_timer_periodic_const_arg_t* const p_timer) { if (NULL == p_timer) { @@ -2035,7 +2035,7 @@ os_timer_periodic_const_arg_simulate(os_timer_periodic_const_arg_t *const p_time } void -os_timer_periodic_cptr_simulate(os_timer_periodic_cptr_t *const p_timer) +os_timer_periodic_cptr_simulate(os_timer_periodic_cptr_t* const p_timer) { if (NULL == p_timer) { @@ -2045,7 +2045,7 @@ os_timer_periodic_cptr_simulate(os_timer_periodic_cptr_t *const p_timer) } void -os_timer_periodic_cptr_without_arg_simulate(os_timer_periodic_cptr_without_arg_t *const p_timer) +os_timer_periodic_cptr_without_arg_simulate(os_timer_periodic_cptr_without_arg_t* const p_timer) { if (NULL == p_timer) { @@ -2055,7 +2055,7 @@ os_timer_periodic_cptr_without_arg_simulate(os_timer_periodic_cptr_without_arg_t } void -os_timer_periodic_cptr_const_arg_simulate(os_timer_periodic_cptr_const_arg_t *const p_timer) +os_timer_periodic_cptr_const_arg_simulate(os_timer_periodic_cptr_const_arg_t* const p_timer) { if (NULL == p_timer) { @@ -2065,7 +2065,7 @@ os_timer_periodic_cptr_const_arg_simulate(os_timer_periodic_cptr_const_arg_t *co } void -os_timer_one_shot_simulate(os_timer_one_shot_t *const p_timer) +os_timer_one_shot_simulate(os_timer_one_shot_t* const p_timer) { if (NULL == p_timer) { @@ -2075,7 +2075,7 @@ os_timer_one_shot_simulate(os_timer_one_shot_t *const p_timer) } void -os_timer_one_shot_without_arg_simulate(os_timer_one_shot_without_arg_t *const p_timer) +os_timer_one_shot_without_arg_simulate(os_timer_one_shot_without_arg_t* const p_timer) { if (NULL == p_timer) { @@ -2085,7 +2085,7 @@ os_timer_one_shot_without_arg_simulate(os_timer_one_shot_without_arg_t *const p_ } void -os_timer_one_shot_const_arg_simulate(os_timer_one_shot_const_arg_t *const p_timer) +os_timer_one_shot_const_arg_simulate(os_timer_one_shot_const_arg_t* const p_timer) { if (NULL == p_timer) { @@ -2095,7 +2095,7 @@ os_timer_one_shot_const_arg_simulate(os_timer_one_shot_const_arg_t *const p_time } void -os_timer_one_shot_cptr_simulate(os_timer_one_shot_cptr_t *const p_timer) +os_timer_one_shot_cptr_simulate(os_timer_one_shot_cptr_t* const p_timer) { if (NULL == p_timer) { @@ -2105,7 +2105,7 @@ os_timer_one_shot_cptr_simulate(os_timer_one_shot_cptr_t *const p_timer) } void -os_timer_one_shot_cptr_without_arg_simulate(os_timer_one_shot_cptr_without_arg_t *const p_timer) +os_timer_one_shot_cptr_without_arg_simulate(os_timer_one_shot_cptr_without_arg_t* const p_timer) { if (NULL == p_timer) { @@ -2115,7 +2115,7 @@ os_timer_one_shot_cptr_without_arg_simulate(os_timer_one_shot_cptr_without_arg_t } void -os_timer_one_shot_cptr_const_arg_simulate(os_timer_one_shot_cptr_const_arg_t *const p_timer) +os_timer_one_shot_cptr_const_arg_simulate(os_timer_one_shot_cptr_const_arg_t* const p_timer) { if (NULL == p_timer) { diff --git a/src/os_timer_sig.c b/src/os_timer_sig.c index 4b5bab6..268a962 100644 --- a/src/os_timer_sig.c +++ b/src/os_timer_sig.c @@ -14,8 +14,8 @@ struct os_timer_sig_periodic_t { - os_timer_periodic_t *p_timer; - os_signal_t * p_signal; + os_timer_periodic_t* p_timer; + os_signal_t* p_signal; os_signal_num_e sig_num; bool is_static; volatile bool is_active; @@ -27,8 +27,8 @@ _Static_assert( struct os_timer_sig_one_shot_t { - os_timer_one_shot_t *p_timer; - os_signal_t * p_signal; + os_timer_one_shot_t* p_timer; + os_signal_t* p_signal; os_signal_num_e sig_num; bool is_static; volatile bool is_active; @@ -39,13 +39,13 @@ _Static_assert( "os_timer_sig_one_shot_t != os_timer_sig_one_shot_static_t"); static void -os_timer_sig_cb_periodic(ATTR_UNUSED os_timer_periodic_t *p_timer, void *p_arg) +os_timer_sig_cb_periodic(ATTR_UNUSED os_timer_periodic_t* p_timer, void* p_arg) { if (NULL == p_arg) { return; } - os_timer_sig_periodic_t *p_obj = p_arg; + os_timer_sig_periodic_t* p_obj = p_arg; if (p_obj->is_active) { os_signal_send(p_obj->p_signal, p_obj->sig_num); @@ -53,13 +53,13 @@ os_timer_sig_cb_periodic(ATTR_UNUSED os_timer_periodic_t *p_timer, void *p_arg) } static void -os_timer_sig_cb_one_shot(ATTR_UNUSED os_timer_one_shot_t *p_timer, void *p_arg) +os_timer_sig_cb_one_shot(ATTR_UNUSED os_timer_one_shot_t* p_timer, void* p_arg) { if (NULL == p_arg) { return; } - os_timer_sig_one_shot_t *p_obj = p_arg; + os_timer_sig_one_shot_t* p_obj = p_arg; if (p_obj->is_active) { p_obj->is_active = false; @@ -68,14 +68,14 @@ os_timer_sig_cb_one_shot(ATTR_UNUSED os_timer_one_shot_t *p_timer, void *p_arg) } ATTR_WARN_UNUSED_RESULT -os_timer_sig_periodic_t * +os_timer_sig_periodic_t* os_timer_sig_periodic_create( - const char *const p_timer_name, - os_signal_t *const p_signal, + const char* const p_timer_name, + os_signal_t* const p_signal, const os_signal_num_e sig_num, const os_delta_ticks_t period_ticks) { - os_timer_sig_periodic_t *p_obj = os_calloc(1, sizeof(*p_obj)); + os_timer_sig_periodic_t* p_obj = os_calloc(1, sizeof(*p_obj)); if (NULL == p_obj) { return NULL; @@ -96,15 +96,15 @@ os_timer_sig_periodic_create( ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL -os_timer_sig_periodic_t * +os_timer_sig_periodic_t* os_timer_sig_periodic_create_static( - os_timer_sig_periodic_static_t *const p_timer_sig_mem, - const char *const p_timer_name, - os_signal_t *const p_signal, + os_timer_sig_periodic_static_t* const p_timer_sig_mem, + const char* const p_timer_name, + os_signal_t* const p_signal, const os_signal_num_e sig_num, const os_delta_ticks_t period_ticks) { - os_timer_sig_periodic_t *const p_obj = (os_timer_sig_periodic_t *)&p_timer_sig_mem->obj_mem; + os_timer_sig_periodic_t* const p_obj = (os_timer_sig_periodic_t*)&p_timer_sig_mem->obj_mem; p_obj->p_signal = p_signal; p_obj->sig_num = sig_num; @@ -121,14 +121,14 @@ os_timer_sig_periodic_create_static( } ATTR_WARN_UNUSED_RESULT -os_timer_sig_one_shot_t * +os_timer_sig_one_shot_t* os_timer_sig_one_shot_create( - const char *const p_timer_name, - os_signal_t *const p_signal, + const char* const p_timer_name, + os_signal_t* const p_signal, const os_signal_num_e sig_num, const os_delta_ticks_t period_ticks) { - os_timer_sig_one_shot_t *p_obj = os_calloc(1, sizeof(*p_obj)); + os_timer_sig_one_shot_t* p_obj = os_calloc(1, sizeof(*p_obj)); if (NULL == p_obj) { return NULL; @@ -149,15 +149,15 @@ os_timer_sig_one_shot_create( ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_RETURNS_NONNULL -os_timer_sig_one_shot_t * +os_timer_sig_one_shot_t* os_timer_sig_one_shot_create_static( - os_timer_sig_one_shot_static_t *const p_timer_sig_mem, - const char *const p_timer_name, - os_signal_t *const p_signal, + os_timer_sig_one_shot_static_t* const p_timer_sig_mem, + const char* const p_timer_name, + os_signal_t* const p_signal, const os_signal_num_e sig_num, const os_delta_ticks_t period_ticks) { - os_timer_sig_one_shot_t *const p_obj = (os_timer_sig_one_shot_t *)&p_timer_sig_mem->obj_mem; + os_timer_sig_one_shot_t* const p_obj = (os_timer_sig_one_shot_t*)&p_timer_sig_mem->obj_mem; p_obj->p_signal = p_signal; p_obj->sig_num = sig_num; @@ -175,9 +175,9 @@ os_timer_sig_one_shot_create_static( ATTR_NONNULL(1) void -os_timer_sig_periodic_delete(os_timer_sig_periodic_t **const pp_obj) +os_timer_sig_periodic_delete(os_timer_sig_periodic_t** const pp_obj) { - os_timer_sig_periodic_t *p_obj = *pp_obj; + os_timer_sig_periodic_t* p_obj = *pp_obj; *pp_obj = NULL; if (NULL == p_obj) { @@ -198,9 +198,9 @@ os_timer_sig_periodic_delete(os_timer_sig_periodic_t **const pp_obj) ATTR_NONNULL(1) void -os_timer_sig_one_shot_delete(os_timer_sig_one_shot_t **const pp_obj) +os_timer_sig_one_shot_delete(os_timer_sig_one_shot_t** const pp_obj) { - os_timer_sig_one_shot_t *p_obj = *pp_obj; + os_timer_sig_one_shot_t* p_obj = *pp_obj; *pp_obj = NULL; if (NULL == p_obj) { @@ -220,7 +220,7 @@ os_timer_sig_one_shot_delete(os_timer_sig_one_shot_t **const pp_obj) } void -os_timer_sig_periodic_start(os_timer_sig_periodic_t *const p_obj) +os_timer_sig_periodic_start(os_timer_sig_periodic_t* const p_obj) { if (NULL == p_obj) { @@ -231,7 +231,7 @@ os_timer_sig_periodic_start(os_timer_sig_periodic_t *const p_obj) } void -os_timer_sig_one_shot_start(os_timer_sig_one_shot_t *const p_obj) +os_timer_sig_one_shot_start(os_timer_sig_one_shot_t* const p_obj) { if (NULL == p_obj) { @@ -242,7 +242,7 @@ os_timer_sig_one_shot_start(os_timer_sig_one_shot_t *const p_obj) } void -os_timer_sig_periodic_restart(os_timer_sig_periodic_t *const p_obj, const os_delta_ticks_t delay_ticks) +os_timer_sig_periodic_restart(os_timer_sig_periodic_t* const p_obj, const os_delta_ticks_t delay_ticks) { if (NULL == p_obj) { @@ -253,7 +253,7 @@ os_timer_sig_periodic_restart(os_timer_sig_periodic_t *const p_obj, const os_del } void -os_timer_sig_one_shot_restart(os_timer_sig_one_shot_t *const p_obj, const os_delta_ticks_t delay_ticks) +os_timer_sig_one_shot_restart(os_timer_sig_one_shot_t* const p_obj, const os_delta_ticks_t delay_ticks) { if (NULL == p_obj) { @@ -264,7 +264,7 @@ os_timer_sig_one_shot_restart(os_timer_sig_one_shot_t *const p_obj, const os_del } void -os_timer_sig_periodic_stop(os_timer_sig_periodic_t *const p_obj) +os_timer_sig_periodic_stop(os_timer_sig_periodic_t* const p_obj) { if (NULL == p_obj) { @@ -275,7 +275,7 @@ os_timer_sig_periodic_stop(os_timer_sig_periodic_t *const p_obj) } void -os_timer_sig_one_shot_stop(os_timer_sig_one_shot_t *const p_obj) +os_timer_sig_one_shot_stop(os_timer_sig_one_shot_t* const p_obj) { if (NULL == p_obj) { @@ -286,7 +286,7 @@ os_timer_sig_one_shot_stop(os_timer_sig_one_shot_t *const p_obj) } bool -os_timer_sig_periodic_is_active(os_timer_sig_periodic_t *const p_obj) +os_timer_sig_periodic_is_active(os_timer_sig_periodic_t* const p_obj) { if (NULL == p_obj) { @@ -296,7 +296,7 @@ os_timer_sig_periodic_is_active(os_timer_sig_periodic_t *const p_obj) } bool -os_timer_sig_one_shot_is_active(os_timer_sig_one_shot_t *const p_obj) +os_timer_sig_one_shot_is_active(os_timer_sig_one_shot_t* const p_obj) { if (NULL == p_obj) { @@ -306,7 +306,7 @@ os_timer_sig_one_shot_is_active(os_timer_sig_one_shot_t *const p_obj) } void -os_timer_sig_periodic_simulate(os_timer_sig_periodic_t *const p_obj) +os_timer_sig_periodic_simulate(os_timer_sig_periodic_t* const p_obj) { if (NULL == p_obj) { @@ -316,7 +316,7 @@ os_timer_sig_periodic_simulate(os_timer_sig_periodic_t *const p_obj) } void -os_timer_sig_one_shot_simulate(os_timer_sig_one_shot_t *const p_obj) +os_timer_sig_one_shot_simulate(os_timer_sig_one_shot_t* const p_obj) { if (NULL == p_obj) { diff --git a/src/str_buf.c b/src/str_buf.c index da23551..a1df9ff 100644 --- a/src/str_buf.c +++ b/src/str_buf.c @@ -12,7 +12,7 @@ ATTR_NONNULL(1) str_buf_t -str_buf_init(char *const p_buf, const str_buf_size_t buf_size) +str_buf_init(char* const p_buf, const str_buf_size_t buf_size) { const str_buf_t str_buf = STR_BUF_INIT(p_buf, buf_size); return str_buf; @@ -27,10 +27,10 @@ str_buf_init_null(void) ATTR_NONNULL(1) bool -str_buf_init_with_alloc(str_buf_t *const p_str_buf) +str_buf_init_with_alloc(str_buf_t* const p_str_buf) { const size_t buf_size = str_buf_get_len(p_str_buf) + 1; - char * p_buf = os_malloc(buf_size); + char* p_buf = os_malloc(buf_size); if (NULL == p_buf) { return false; @@ -42,7 +42,7 @@ str_buf_init_with_alloc(str_buf_t *const p_str_buf) ATTR_NONNULL(1) ATTR_PURE str_buf_size_t -str_buf_get_len(const str_buf_t *const p_str_buf) +str_buf_get_len(const str_buf_t* const p_str_buf) { return p_str_buf->idx; } @@ -50,7 +50,7 @@ str_buf_get_len(const str_buf_t *const p_str_buf) ATTR_NONNULL(1) ATTR_PURE bool -str_buf_is_overflow(const str_buf_t *const p_str_buf) +str_buf_is_overflow(const str_buf_t* const p_str_buf) { if (0 == p_str_buf->size) { @@ -65,7 +65,7 @@ str_buf_is_overflow(const str_buf_t *const p_str_buf) ATTR_NONNULL(1, 2) bool -str_buf_vprintf(str_buf_t *const p_str_buf, const char *const fmt, va_list args) +str_buf_vprintf(str_buf_t* const p_str_buf, const char* const fmt, va_list args) { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wnonnull-compare" @@ -96,7 +96,7 @@ str_buf_vprintf(str_buf_t *const p_str_buf, const char *const fmt, va_list args) return false; } #pragma GCC diagnostic pop - char * p_buf = (NULL != p_str_buf->buf) ? &p_str_buf->buf[p_str_buf->idx] : NULL; + char* p_buf = (NULL != p_str_buf->buf) ? &p_str_buf->buf[p_str_buf->idx] : NULL; const size_t max_len = (0 != p_str_buf->size) ? (p_str_buf->size - p_str_buf->idx) : 0; const int len = vsnprintf(p_buf, max_len, fmt, args); @@ -120,7 +120,7 @@ str_buf_vprintf(str_buf_t *const p_str_buf, const char *const fmt, va_list args) ATTR_PRINTF(2, 3) ATTR_NONNULL(1, 2) bool -str_buf_printf(str_buf_t *const p_str_buf, const char *const fmt, ...) +str_buf_printf(str_buf_t* const p_str_buf, const char* const fmt, ...) { va_list args; va_start(args, fmt); @@ -131,7 +131,7 @@ str_buf_printf(str_buf_t *const p_str_buf, const char *const fmt, ...) ATTR_NONNULL(1) str_buf_t -str_buf_vprintf_with_alloc(const char *const fmt, va_list args) +str_buf_vprintf_with_alloc(const char* const fmt, va_list args) { str_buf_t str_buf = str_buf_init_null(); va_list args2; @@ -153,7 +153,7 @@ str_buf_vprintf_with_alloc(const char *const fmt, va_list args) ATTR_PRINTF(1, 2) ATTR_NONNULL(1) str_buf_t -str_buf_printf_with_alloc(const char *const fmt, ...) +str_buf_printf_with_alloc(const char* const fmt, ...) { va_list args; va_start(args, fmt); @@ -164,7 +164,7 @@ str_buf_printf_with_alloc(const char *const fmt, ...) ATTR_NONNULL(1, 2) bool -str_buf_bin_to_hex(str_buf_t *const p_str_buf, const uint8_t *const p_input_buf, const size_t input_buf_size) +str_buf_bin_to_hex(str_buf_t* const p_str_buf, const uint8_t* const p_input_buf, const size_t input_buf_size) { static const char hex[] = "0123456789abcdef"; #pragma GCC diagnostic push @@ -196,7 +196,7 @@ str_buf_bin_to_hex(str_buf_t *const p_str_buf, const uint8_t *const p_input_buf, return false; } #pragma GCC diagnostic pop - char * p_buf = (NULL != p_str_buf->buf) ? &p_str_buf->buf[p_str_buf->idx] : NULL; + char* p_buf = (NULL != p_str_buf->buf) ? &p_str_buf->buf[p_str_buf->idx] : NULL; const size_t max_len = (0 != p_str_buf->size) ? (p_str_buf->size - p_str_buf->idx) : 0; bool flag_overflow = false; @@ -240,7 +240,7 @@ str_buf_bin_to_hex(str_buf_t *const p_str_buf, const uint8_t *const p_input_buf, ATTR_NONNULL(1) str_buf_t -str_buf_bin_to_hex_with_alloc(const uint8_t *const p_input_buf, const size_t input_buf_size) +str_buf_bin_to_hex_with_alloc(const uint8_t* const p_input_buf, const size_t input_buf_size) { str_buf_t str_buf = str_buf_init_null(); const bool res = str_buf_bin_to_hex(&str_buf, p_input_buf, input_buf_size); @@ -258,7 +258,7 @@ str_buf_bin_to_hex_with_alloc(const uint8_t *const p_input_buf, const size_t inp ATTR_NONNULL(1) void -str_buf_free_buf(str_buf_t *const p_str_buf) +str_buf_free_buf(str_buf_t* const p_str_buf) { os_free(p_str_buf->buf); p_str_buf->size = 0; diff --git a/tests/common/esp_log_wrapper.cpp b/tests/common/esp_log_wrapper.cpp index c50b8dd..54ddd07 100644 --- a/tests/common/esp_log_wrapper.cpp +++ b/tests/common/esp_log_wrapper.cpp @@ -11,7 +11,7 @@ #include "TQueue.hpp" #include "esp_log_wrapper.hpp" -static TQueue *gp_esp_log_queue; +static TQueue* gp_esp_log_queue; void esp_log_wrapper_init() @@ -30,7 +30,7 @@ esp_log_wrapper_deinit() } void -esp_log_write(esp_log_level_t level, const char *tag, const char *fmt, ...) +esp_log_write(esp_log_level_t level, const char* tag, const char* fmt, ...) { va_list args; va_start(args, fmt); diff --git a/tests/common/include/TQueue.hpp b/tests/common/include/TQueue.hpp index b449529..ebb5752 100644 --- a/tests/common/include/TQueue.hpp +++ b/tests/common/include/TQueue.hpp @@ -48,7 +48,7 @@ class TQueue } void - pop(T &item) + pop(T& item) { std::unique_lock mlock(mutex_); while (queue_.empty()) @@ -60,7 +60,7 @@ class TQueue } void - push(const T &item) + push(const T& item) { std::unique_lock mlock(mutex_); handled_ = false; @@ -70,7 +70,7 @@ class TQueue } void - push(T &&item) + push(T&& item) { std::unique_lock mlock(mutex_); handled_ = false; @@ -80,7 +80,7 @@ class TQueue } void - push_and_wait(const T &item) + push_and_wait(const T& item) { std::unique_lock mlock(mutex_); handled_ = false; @@ -91,7 +91,7 @@ class TQueue } void - push_and_wait(T &&item) + push_and_wait(T&& item) { std::unique_lock mlock(mutex_); handled_ = false; diff --git a/tests/common/include/esp_err.h b/tests/common/include/esp_err.h index 74b6cc4..f38bad6 100644 --- a/tests/common/include/esp_err.h +++ b/tests/common/include/esp_err.h @@ -58,11 +58,11 @@ typedef int32_t esp_err_t; * @param code esp_err_t error code * @return string error message */ -const char * +const char* esp_err_to_name(esp_err_t code); static inline void -strlcpy(char *dst, const char *src, const size_t len) +strlcpy(char* dst, const char* src, const size_t len) { strncpy(dst, src, len); } diff --git a/tests/common/include/esp_log.h b/tests/common/include/esp_log.h index 8729549..a8cf693 100644 --- a/tests/common/include/esp_log.h +++ b/tests/common/include/esp_log.h @@ -27,7 +27,7 @@ typedef enum } esp_log_level_t; void -esp_log_write(esp_log_level_t level, const char *tag, const char *fmt, ...); +esp_log_write(esp_log_level_t level, const char* tag, const char* fmt, ...); static inline uint32_t esp_log_timestamp(void) diff --git a/tests/common/include/esp_log_wrapper.hpp b/tests/common/include/esp_log_wrapper.hpp index feb9a03..3678a46 100644 --- a/tests/common/include/esp_log_wrapper.hpp +++ b/tests/common/include/esp_log_wrapper.hpp @@ -33,12 +33,12 @@ class LogRecord { private: void - init_message(const char *fmt, va_list args) + init_message(const char* fmt, va_list args) { va_list args2; va_copy(args2, args); const int len = vsnprintf(nullptr, 0, fmt, args); - char * buf { new char[len + 1] {} }; + char* buf { new char[len + 1] {} }; vsnprintf(buf, len + 1, fmt, args2); va_end(args2); this->message = string(buf); @@ -148,14 +148,14 @@ class LogRecord string message; LogRecordParsed parsed; - LogRecord(esp_log_level_t level, const char *tag, const char *fmt, va_list args) + LogRecord(esp_log_level_t level, const char* tag, const char* fmt, va_list args) : level(level) , tag(string(tag)) { this->init_message(fmt, args); } - LogRecord(esp_log_level_t level, const char *tag, const char *fmt, ...) + LogRecord(esp_log_level_t level, const char* tag, const char* fmt, ...) : level(level) , tag(string(tag)) { diff --git a/tests/test_log_dump/test_log_dump.cpp b/tests/test_log_dump/test_log_dump.cpp index 1209839..772218d 100644 --- a/tests/test_log_dump/test_log_dump.cpp +++ b/tests/test_log_dump/test_log_dump.cpp @@ -12,14 +12,14 @@ #define LOG_LOCAL_LEVEL LOG_LEVEL_VERBOSE #include "log.h" -static const char *TAG = "test"; +static const char* TAG = "test"; using namespace std; /*** Google-test class implementation *********************************************************************************/ class TestLogDump; -static TestLogDump *g_pTestClass; +static TestLogDump* g_pTestClass; class TestLogDump : public ::testing::Test { @@ -58,28 +58,28 @@ TestLogDump::~TestLogDump() = default; extern "C" { -void * +void* os_malloc(size_t size) { if (g_pTestClass->m_flag_malloc_fail) { return nullptr; } - void *p_buf = malloc(size); + void* p_buf = malloc(size); return p_buf; } void -os_free_internal(void *p_buf) +os_free_internal(void* p_buf) { free(p_buf); } -const char * +const char* os_task_get_name(void) { static const char g_task_name[] = "thread_name"; - return const_cast(g_task_name); + return const_cast(g_task_name); } os_task_priority_t diff --git a/tests/test_os_malloc/test_os_malloc.cpp b/tests/test_os_malloc/test_os_malloc.cpp index de92921..49b458f 100644 --- a/tests/test_os_malloc/test_os_malloc.cpp +++ b/tests/test_os_malloc/test_os_malloc.cpp @@ -46,7 +46,7 @@ TestOsMalloc::~TestOsMalloc() = default; TEST_F(TestOsMalloc, test_os_malloc_os_free) // NOLINT { - void *ptr = os_malloc(1000); + void* ptr = os_malloc(1000); ASSERT_NE(nullptr, ptr); os_free(ptr); ASSERT_EQ(nullptr, ptr); @@ -54,7 +54,7 @@ TEST_F(TestOsMalloc, test_os_malloc_os_free) // NOLINT TEST_F(TestOsMalloc, test_os_calloc) // NOLINT { - void *ptr = os_calloc(sizeof(uint32_t), 1000); + void* ptr = os_calloc(sizeof(uint32_t), 1000); ASSERT_NE(nullptr, ptr); os_free(ptr); ASSERT_EQ(nullptr, ptr); @@ -62,12 +62,12 @@ TEST_F(TestOsMalloc, test_os_calloc) // NOLINT TEST_F(TestOsMalloc, test_os_realloc) // NOLINT { - void *ptr = os_malloc(4); + void* ptr = os_malloc(4); ASSERT_NE(nullptr, ptr); - void *ptr2 = os_malloc(4); + void* ptr2 = os_malloc(4); ASSERT_NE(nullptr, ptr2); - const void *const saved_ptr = ptr; - ASSERT_TRUE(os_realloc_safe((void **)&ptr, 1 * 1024)); + const void* const saved_ptr = ptr; + ASSERT_TRUE(os_realloc_safe((void**)&ptr, 1 * 1024)); ASSERT_NE(nullptr, ptr); ASSERT_NE(saved_ptr, ptr); os_free(ptr); diff --git a/tests/test_os_mutex/test_os_mutex.cpp b/tests/test_os_mutex/test_os_mutex.cpp index 947b05e..1b449bb 100644 --- a/tests/test_os_mutex/test_os_mutex.cpp +++ b/tests/test_os_mutex/test_os_mutex.cpp @@ -18,7 +18,7 @@ using namespace std; * *********************************************************************************/ class TestOsMutex; -static TestOsMutex *g_pTestClass; +static TestOsMutex* g_pTestClass; extern "C" { @@ -48,7 +48,7 @@ class TestOsMutex : public ::testing::Test void SetUp() override { - for (auto &mutex : this->arrOfMutexes) + for (auto& mutex : this->arrOfMutexes) { #if ((configSUPPORT_STATIC_ALLOCATION == 1) && (configSUPPORT_DYNAMIC_ALLOCATION == 1)) mutex.isStaticallyAllocated = false; @@ -89,7 +89,7 @@ TestOsMutex::~TestOsMutex() = default; extern "C" { -char * +char* pcTaskGetName(TaskHandle_t xTaskToQuery) { assert(nullptr == xTaskToQuery); @@ -97,18 +97,18 @@ pcTaskGetName(TaskHandle_t xTaskToQuery) { return nullptr; } - return const_cast(g_pTestClass->m_taskName.c_str()); + return const_cast(g_pTestClass->m_taskName.c_str()); } static void -prvInitialiseMutex(struct QueueDefinition *p_mutex, const bool isStaticallyAllocated) +prvInitialiseMutex(struct QueueDefinition* p_mutex, const bool isStaticallyAllocated) { p_mutex->isUsed = true; p_mutex->isStaticallyAllocated = isStaticallyAllocated; } static void -prvDeinitialiseMutex(struct QueueDefinition *p_mutex) +prvDeinitialiseMutex(struct QueueDefinition* p_mutex) { p_mutex->isUsed = false; } @@ -117,10 +117,10 @@ QueueHandle_t xQueueCreateMutex(const uint8_t ucQueueType) { assert(queueQUEUE_TYPE_MUTEX == ucQueueType); - struct QueueDefinition *p_mutex = std::find_if( + struct QueueDefinition* p_mutex = std::find_if( std::begin(g_pTestClass->arrOfMutexes), std::end(g_pTestClass->arrOfMutexes), - [&](const struct QueueDefinition &x) { return !x.isUsed; }); + [&](const struct QueueDefinition& x) { return !x.isUsed; }); if (std::end(g_pTestClass->arrOfMutexes) == p_mutex) { return nullptr; @@ -130,11 +130,11 @@ xQueueCreateMutex(const uint8_t ucQueueType) } QueueHandle_t -xQueueCreateMutexStatic(const uint8_t ucQueueType, StaticQueue_t *pxStaticQueue) +xQueueCreateMutexStatic(const uint8_t ucQueueType, StaticQueue_t* pxStaticQueue) { assert(queueQUEUE_TYPE_MUTEX == ucQueueType); assert(nullptr != pxStaticQueue); - auto *p_mutex = reinterpret_cast(pxStaticQueue); + auto* p_mutex = reinterpret_cast(pxStaticQueue); prvInitialiseMutex(p_mutex, true); return p_mutex; } @@ -142,13 +142,13 @@ xQueueCreateMutexStatic(const uint8_t ucQueueType, StaticQueue_t *pxStaticQueue) void vQueueDelete(QueueHandle_t xQueue) { - auto *p_mutex = reinterpret_cast(xQueue); + auto* p_mutex = reinterpret_cast(xQueue); if (!p_mutex->isStaticallyAllocated) { - struct QueueDefinition *p_mutex2 = std::find_if( + struct QueueDefinition* p_mutex2 = std::find_if( std::begin(g_pTestClass->arrOfMutexes), std::end(g_pTestClass->arrOfMutexes), - [&](const struct QueueDefinition &x) { return &x == xQueue; }); + [&](const struct QueueDefinition& x) { return &x == xQueue; }); assert(std::end(g_pTestClass->arrOfMutexes) != p_mutex2); assert(p_mutex == p_mutex2); } @@ -160,14 +160,14 @@ xQueueSemaphoreTake(QueueHandle_t xQueue, TickType_t xTicksToWait) { (void)xTicksToWait; - auto *p_mutex = reinterpret_cast(xQueue); + auto* p_mutex = reinterpret_cast(xQueue); if (!p_mutex->isStaticallyAllocated) { - struct QueueDefinition *p_mutex2 = std::find_if( + struct QueueDefinition* p_mutex2 = std::find_if( std::begin(g_pTestClass->arrOfMutexes), std::end(g_pTestClass->arrOfMutexes), - [&](const struct QueueDefinition &x) { return &x == xQueue; }); + [&](const struct QueueDefinition& x) { return &x == xQueue; }); assert(std::end(g_pTestClass->arrOfMutexes) != p_mutex2); assert(p_mutex == p_mutex2); } @@ -184,7 +184,7 @@ xQueueSemaphoreTake(QueueHandle_t xQueue, TickType_t xTicksToWait) BaseType_t xQueueGenericSend( QueueHandle_t xQueue, - const void *const pvItemToQueue, + const void* const pvItemToQueue, TickType_t xTicksToWait, const BaseType_t xCopyPosition) { @@ -192,14 +192,14 @@ xQueueGenericSend( assert(semGIVE_BLOCK_TIME == xTicksToWait); assert(queueSEND_TO_BACK == xCopyPosition); - auto *p_mutex = reinterpret_cast(xQueue); + auto* p_mutex = reinterpret_cast(xQueue); if (!p_mutex->isStaticallyAllocated) { - struct QueueDefinition *p_mutex2 = std::find_if( + struct QueueDefinition* p_mutex2 = std::find_if( std::begin(g_pTestClass->arrOfMutexes), std::end(g_pTestClass->arrOfMutexes), - [&](const struct QueueDefinition &x) { return &x == xQueue; }); + [&](const struct QueueDefinition& x) { return &x == xQueue; }); assert(std::end(g_pTestClass->arrOfMutexes) != p_mutex2); assert(p_mutex == p_mutex2); } @@ -252,7 +252,7 @@ TEST_F(TestOsMutex, os_mutex_create_delete_static_only) // NOLINT { static StaticSemaphore_t static_sema1; os_mutex_t h_mutex1 = os_mutex_create_static(&static_sema1); - ASSERT_EQ(reinterpret_cast(&static_sema1), reinterpret_cast(h_mutex1)); + ASSERT_EQ(reinterpret_cast(&static_sema1), reinterpret_cast(h_mutex1)); os_mutex_delete(&h_mutex1); ASSERT_EQ(nullptr, h_mutex1); @@ -267,13 +267,13 @@ TEST_F(TestOsMutex, os_mutex_create_delete_static_and_dynamic) // NOLINT ASSERT_EQ(&this->arrOfMutexes[0], h_mutex_dyn1); os_mutex_t h_mutex_sta1 = os_mutex_create_static(&static_sema1); - ASSERT_EQ(reinterpret_cast(&static_sema1), reinterpret_cast(h_mutex_sta1)); + ASSERT_EQ(reinterpret_cast(&static_sema1), reinterpret_cast(h_mutex_sta1)); os_mutex_t h_mutex_dyn2 = os_mutex_create(); ASSERT_EQ(&this->arrOfMutexes[1], h_mutex_dyn2); os_mutex_t h_mutex_sta2 = os_mutex_create_static(&static_sema2); - ASSERT_EQ(reinterpret_cast(&static_sema2), reinterpret_cast(h_mutex_sta2)); + ASSERT_EQ(reinterpret_cast(&static_sema2), reinterpret_cast(h_mutex_sta2)); os_mutex_t h_mutex_dyn3 = os_mutex_create(); ASSERT_EQ(nullptr, h_mutex_dyn3); @@ -304,7 +304,7 @@ TEST_F(TestOsMutex, os_mutex_create_delete_static_and_dynamic) // NOLINT TEST_F(TestOsMutex, os_mutex_lock_unlock) // NOLINT { os_mutex_t h_mutex = os_mutex_create(); - struct QueueDefinition *p_mutex = &this->arrOfMutexes[0]; + struct QueueDefinition* p_mutex = &this->arrOfMutexes[0]; ASSERT_EQ(p_mutex, h_mutex); ASSERT_FALSE(p_mutex->isLocked); @@ -323,8 +323,8 @@ TEST_F(TestOsMutex, os_mutex_lock_unlock_static) // NOLINT { static StaticSemaphore_t static_sema1; os_mutex_t h_mutex = os_mutex_create_static(&static_sema1); - ASSERT_EQ(reinterpret_cast(&static_sema1), reinterpret_cast(h_mutex)); - struct QueueDefinition *p_mutex = h_mutex; + ASSERT_EQ(reinterpret_cast(&static_sema1), reinterpret_cast(h_mutex)); + struct QueueDefinition* p_mutex = h_mutex; ASSERT_FALSE(p_mutex->isLocked); os_mutex_lock(h_mutex); @@ -341,7 +341,7 @@ TEST_F(TestOsMutex, os_mutex_lock_unlock_static) // NOLINT TEST_F(TestOsMutex, os_mutex_try_lock_unlock) // NOLINT { os_mutex_t h_mutex = os_mutex_create(); - struct QueueDefinition *p_mutex = &this->arrOfMutexes[0]; + struct QueueDefinition* p_mutex = &this->arrOfMutexes[0]; ASSERT_EQ(p_mutex, h_mutex); ASSERT_FALSE(p_mutex->isLocked); @@ -361,7 +361,7 @@ TEST_F(TestOsMutex, os_mutex_try_lock_unlock) // NOLINT TEST_F(TestOsMutex, os_mutex_lock_with_timeout_unlock) // NOLINT { os_mutex_t h_mutex = os_mutex_create(); - struct QueueDefinition *p_mutex = &this->arrOfMutexes[0]; + struct QueueDefinition* p_mutex = &this->arrOfMutexes[0]; ASSERT_EQ(p_mutex, h_mutex); ASSERT_FALSE(p_mutex->isLocked); diff --git a/tests/test_os_mutex_recursive/test_os_mutex_recursive.cpp b/tests/test_os_mutex_recursive/test_os_mutex_recursive.cpp index ae12e3f..575c10c 100644 --- a/tests/test_os_mutex_recursive/test_os_mutex_recursive.cpp +++ b/tests/test_os_mutex_recursive/test_os_mutex_recursive.cpp @@ -18,7 +18,7 @@ using namespace std; * *********************************************************************************/ class TestOsMutexRecursive; -static TestOsMutexRecursive *g_pTestClass; +static TestOsMutexRecursive* g_pTestClass; extern "C" { @@ -48,7 +48,7 @@ class TestOsMutexRecursive : public ::testing::Test void SetUp() override { - for (auto &mutex : this->arrOfMutexes) + for (auto& mutex : this->arrOfMutexes) { #if ((configSUPPORT_STATIC_ALLOCATION == 1) && (configSUPPORT_DYNAMIC_ALLOCATION == 1)) mutex.isStaticallyAllocated = false; @@ -89,7 +89,7 @@ TestOsMutexRecursive::~TestOsMutexRecursive() = default; extern "C" { -char * +char* pcTaskGetName(TaskHandle_t xTaskToQuery) { assert(nullptr == xTaskToQuery); @@ -97,18 +97,18 @@ pcTaskGetName(TaskHandle_t xTaskToQuery) { return nullptr; } - return const_cast(g_pTestClass->m_taskName.c_str()); + return const_cast(g_pTestClass->m_taskName.c_str()); } static void -prvInitialiseMutex(struct QueueDefinition *p_mutex, const bool isStaticallyAllocated) +prvInitialiseMutex(struct QueueDefinition* p_mutex, const bool isStaticallyAllocated) { p_mutex->isUsed = true; p_mutex->isStaticallyAllocated = isStaticallyAllocated; } static void -prvDeinitialiseMutex(struct QueueDefinition *p_mutex) +prvDeinitialiseMutex(struct QueueDefinition* p_mutex) { p_mutex->isUsed = false; } @@ -117,10 +117,10 @@ QueueHandle_t xQueueCreateMutex(const uint8_t ucQueueType) { assert(queueQUEUE_TYPE_RECURSIVE_MUTEX == ucQueueType); - struct QueueDefinition *p_mutex = std::find_if( + struct QueueDefinition* p_mutex = std::find_if( std::begin(g_pTestClass->arrOfMutexes), std::end(g_pTestClass->arrOfMutexes), - [&](const struct QueueDefinition &x) { return !x.isUsed; }); + [&](const struct QueueDefinition& x) { return !x.isUsed; }); if (std::end(g_pTestClass->arrOfMutexes) == p_mutex) { return nullptr; @@ -130,11 +130,11 @@ xQueueCreateMutex(const uint8_t ucQueueType) } QueueHandle_t -xQueueCreateMutexStatic(const uint8_t ucQueueType, StaticQueue_t *pxStaticQueue) +xQueueCreateMutexStatic(const uint8_t ucQueueType, StaticQueue_t* pxStaticQueue) { assert(queueQUEUE_TYPE_RECURSIVE_MUTEX == ucQueueType); assert(nullptr != pxStaticQueue); - auto *p_mutex = reinterpret_cast(pxStaticQueue); + auto* p_mutex = reinterpret_cast(pxStaticQueue); prvInitialiseMutex(p_mutex, true); return p_mutex; } @@ -142,13 +142,13 @@ xQueueCreateMutexStatic(const uint8_t ucQueueType, StaticQueue_t *pxStaticQueue) void vQueueDelete(QueueHandle_t xQueue) { - auto *p_mutex = reinterpret_cast(xQueue); + auto* p_mutex = reinterpret_cast(xQueue); if (!p_mutex->isStaticallyAllocated) { - struct QueueDefinition *p_mutex2 = std::find_if( + struct QueueDefinition* p_mutex2 = std::find_if( std::begin(g_pTestClass->arrOfMutexes), std::end(g_pTestClass->arrOfMutexes), - [&](const struct QueueDefinition &x) { return &x == xQueue; }); + [&](const struct QueueDefinition& x) { return &x == xQueue; }); assert(std::end(g_pTestClass->arrOfMutexes) != p_mutex2); assert(p_mutex == p_mutex2); } @@ -160,14 +160,14 @@ xQueueTakeMutexRecursive(QueueHandle_t xMutex, TickType_t xTicksToWait) { (void)xTicksToWait; - auto *p_mutex = reinterpret_cast(xMutex); + auto* p_mutex = reinterpret_cast(xMutex); if (!p_mutex->isStaticallyAllocated) { - struct QueueDefinition *p_mutex2 = std::find_if( + struct QueueDefinition* p_mutex2 = std::find_if( std::begin(g_pTestClass->arrOfMutexes), std::end(g_pTestClass->arrOfMutexes), - [&](const struct QueueDefinition &x) { return &x == xMutex; }); + [&](const struct QueueDefinition& x) { return &x == xMutex; }); assert(std::end(g_pTestClass->arrOfMutexes) != p_mutex2); assert(p_mutex == p_mutex2); } @@ -180,14 +180,14 @@ xQueueTakeMutexRecursive(QueueHandle_t xMutex, TickType_t xTicksToWait) BaseType_t xQueueGiveMutexRecursive(QueueHandle_t xMutex) { - auto *p_mutex = reinterpret_cast(xMutex); + auto* p_mutex = reinterpret_cast(xMutex); if (!p_mutex->isStaticallyAllocated) { - struct QueueDefinition *p_mutex2 = std::find_if( + struct QueueDefinition* p_mutex2 = std::find_if( std::begin(g_pTestClass->arrOfMutexes), std::end(g_pTestClass->arrOfMutexes), - [&](const struct QueueDefinition &x) { return &x == xMutex; }); + [&](const struct QueueDefinition& x) { return &x == xMutex; }); assert(std::end(g_pTestClass->arrOfMutexes) != p_mutex2); assert(p_mutex == p_mutex2); } @@ -237,7 +237,7 @@ TEST_F(TestOsMutexRecursive, os_mutex_recursive_create_delete_static_only) // NO { static StaticSemaphore_t static_sema1; os_mutex_recursive_t h_mutex1 = os_mutex_recursive_create_static(&static_sema1); - ASSERT_EQ(reinterpret_cast(&static_sema1), reinterpret_cast(h_mutex1)); + ASSERT_EQ(reinterpret_cast(&static_sema1), reinterpret_cast(h_mutex1)); os_mutex_recursive_delete(&h_mutex1); ASSERT_EQ(nullptr, h_mutex1); @@ -252,13 +252,13 @@ TEST_F(TestOsMutexRecursive, os_mutex_recursive_create_delete_static_and_dynamic ASSERT_EQ(&this->arrOfMutexes[0], h_mutex_dyn1); os_mutex_recursive_t h_mutex_sta1 = os_mutex_recursive_create_static(&static_sema1); - ASSERT_EQ(reinterpret_cast(&static_sema1), reinterpret_cast(h_mutex_sta1)); + ASSERT_EQ(reinterpret_cast(&static_sema1), reinterpret_cast(h_mutex_sta1)); os_mutex_recursive_t h_mutex_dyn2 = os_mutex_recursive_create(); ASSERT_EQ(&this->arrOfMutexes[1], h_mutex_dyn2); os_mutex_recursive_t h_mutex_sta2 = os_mutex_recursive_create_static(&static_sema2); - ASSERT_EQ(reinterpret_cast(&static_sema2), reinterpret_cast(h_mutex_sta2)); + ASSERT_EQ(reinterpret_cast(&static_sema2), reinterpret_cast(h_mutex_sta2)); os_mutex_recursive_t h_mutex_dyn3 = os_mutex_recursive_create(); ASSERT_EQ(nullptr, h_mutex_dyn3); @@ -289,7 +289,7 @@ TEST_F(TestOsMutexRecursive, os_mutex_recursive_create_delete_static_and_dynamic TEST_F(TestOsMutexRecursive, os_mutex_recursive_lock_unlock) // NOLINT { os_mutex_recursive_t h_mutex = os_mutex_recursive_create(); - struct QueueDefinition *p_mutex = &this->arrOfMutexes[0]; + struct QueueDefinition* p_mutex = &this->arrOfMutexes[0]; ASSERT_EQ(p_mutex, h_mutex); ASSERT_EQ(0, p_mutex->uxRecursiveCallCount); @@ -308,8 +308,8 @@ TEST_F(TestOsMutexRecursive, os_mutex_recursive_lock_unlock_static) // NOLINT { static StaticSemaphore_t static_sema1; os_mutex_recursive_t h_mutex = os_mutex_recursive_create_static(&static_sema1); - ASSERT_EQ(reinterpret_cast(&static_sema1), reinterpret_cast(h_mutex)); - struct QueueDefinition *p_mutex = h_mutex; + ASSERT_EQ(reinterpret_cast(&static_sema1), reinterpret_cast(h_mutex)); + struct QueueDefinition* p_mutex = h_mutex; ASSERT_EQ(0, p_mutex->uxRecursiveCallCount); os_mutex_recursive_lock(h_mutex); @@ -326,7 +326,7 @@ TEST_F(TestOsMutexRecursive, os_mutex_recursive_lock_unlock_static) // NOLINT TEST_F(TestOsMutexRecursive, os_mutex_recursive_try_lock_unlock) // NOLINT { os_mutex_recursive_t h_mutex = os_mutex_recursive_create(); - struct QueueDefinition *p_mutex = &this->arrOfMutexes[0]; + struct QueueDefinition* p_mutex = &this->arrOfMutexes[0]; ASSERT_EQ(p_mutex, h_mutex); ASSERT_EQ(0, p_mutex->uxRecursiveCallCount); @@ -350,7 +350,7 @@ TEST_F(TestOsMutexRecursive, os_mutex_recursive_try_lock_unlock) // NOLINT TEST_F(TestOsMutexRecursive, os_mutex_recursive_lock_with_timeout_unlock) // NOLINT { os_mutex_recursive_t h_mutex = os_mutex_recursive_create(); - struct QueueDefinition *p_mutex = &this->arrOfMutexes[0]; + struct QueueDefinition* p_mutex = &this->arrOfMutexes[0]; ASSERT_EQ(p_mutex, h_mutex); ASSERT_EQ(0, p_mutex->uxRecursiveCallCount); diff --git a/tests/test_os_sema/test_os_sema.cpp b/tests/test_os_sema/test_os_sema.cpp index 93921aa..fabef90 100644 --- a/tests/test_os_sema/test_os_sema.cpp +++ b/tests/test_os_sema/test_os_sema.cpp @@ -17,7 +17,7 @@ using namespace std; * *********************************************************************************/ class TestOsSema; -static TestOsSema *g_pTestClass; +static TestOsSema* g_pTestClass; extern "C" { @@ -47,7 +47,7 @@ class TestOsSema : public ::testing::Test void SetUp() override { - for (auto &sema : this->arrOfSemaphores) + for (auto& sema : this->arrOfSemaphores) { #if ((configSUPPORT_STATIC_ALLOCATION == 1) && (configSUPPORT_DYNAMIC_ALLOCATION == 1)) sema.isStaticallyAllocated = false; @@ -88,7 +88,7 @@ TestOsSema::~TestOsSema() = default; extern "C" { -char * +char* pcTaskGetName(TaskHandle_t xTaskToQuery) { assert(nullptr == xTaskToQuery); @@ -96,18 +96,18 @@ pcTaskGetName(TaskHandle_t xTaskToQuery) { return nullptr; } - return const_cast(g_pTestClass->m_taskName.c_str()); + return const_cast(g_pTestClass->m_taskName.c_str()); } static void -prvInitialiseSema(struct QueueDefinition *p_sema, const bool isStaticallyAllocated) +prvInitialiseSema(struct QueueDefinition* p_sema, const bool isStaticallyAllocated) { p_sema->isUsed = true; p_sema->isStaticallyAllocated = isStaticallyAllocated; } static void -prvDeinitialiseSema(struct QueueDefinition *p_sema) +prvDeinitialiseSema(struct QueueDefinition* p_sema) { p_sema->isUsed = false; } @@ -118,10 +118,10 @@ xQueueGenericCreate(const UBaseType_t uxQueueLength, const UBaseType_t uxItemSiz assert(queueQUEUE_TYPE_BINARY_SEMAPHORE == ucQueueType); assert(1 == uxQueueLength); assert(semSEMAPHORE_QUEUE_ITEM_LENGTH == uxItemSize); - struct QueueDefinition *p_sema = std::find_if( + struct QueueDefinition* p_sema = std::find_if( std::begin(g_pTestClass->arrOfSemaphores), std::end(g_pTestClass->arrOfSemaphores), - [&](const struct QueueDefinition &x) { return !x.isUsed; }); + [&](const struct QueueDefinition& x) { return !x.isUsed; }); if (std::end(g_pTestClass->arrOfSemaphores) == p_sema) { return nullptr; @@ -134,8 +134,8 @@ QueueHandle_t xQueueGenericCreateStatic( const UBaseType_t uxQueueLength, const UBaseType_t uxItemSize, - uint8_t * pucQueueStorage, - StaticQueue_t * pxStaticQueue, + uint8_t* pucQueueStorage, + StaticQueue_t* pxStaticQueue, const uint8_t ucQueueType) { assert(queueQUEUE_TYPE_BINARY_SEMAPHORE == ucQueueType); @@ -143,7 +143,7 @@ xQueueGenericCreateStatic( assert(semSEMAPHORE_QUEUE_ITEM_LENGTH == uxItemSize); assert(nullptr == pucQueueStorage); assert(nullptr != pxStaticQueue); - auto *p_sema = reinterpret_cast(pxStaticQueue); + auto* p_sema = reinterpret_cast(pxStaticQueue); prvInitialiseSema(p_sema, true); return p_sema; } @@ -151,13 +151,13 @@ xQueueGenericCreateStatic( void vQueueDelete(QueueHandle_t xQueue) { - auto *p_sema = reinterpret_cast(xQueue); + auto* p_sema = reinterpret_cast(xQueue); if (!p_sema->isStaticallyAllocated) { - struct QueueDefinition *p_sema2 = std::find_if( + struct QueueDefinition* p_sema2 = std::find_if( std::begin(g_pTestClass->arrOfSemaphores), std::end(g_pTestClass->arrOfSemaphores), - [&](const struct QueueDefinition &x) { return &x == xQueue; }); + [&](const struct QueueDefinition& x) { return &x == xQueue; }); assert(std::end(g_pTestClass->arrOfSemaphores) != p_sema2); assert(p_sema == p_sema2); } @@ -169,14 +169,14 @@ xQueueSemaphoreTake(QueueHandle_t xQueue, TickType_t xTicksToWait) { (void)xTicksToWait; - auto *p_sema = reinterpret_cast(xQueue); + auto* p_sema = reinterpret_cast(xQueue); if (!p_sema->isStaticallyAllocated) { - struct QueueDefinition *p_sema2 = std::find_if( + struct QueueDefinition* p_sema2 = std::find_if( std::begin(g_pTestClass->arrOfSemaphores), std::end(g_pTestClass->arrOfSemaphores), - [&](const struct QueueDefinition &x) { return &x == xQueue; }); + [&](const struct QueueDefinition& x) { return &x == xQueue; }); assert(std::end(g_pTestClass->arrOfSemaphores) != p_sema2); assert(p_sema == p_sema2); } @@ -193,7 +193,7 @@ xQueueSemaphoreTake(QueueHandle_t xQueue, TickType_t xTicksToWait) BaseType_t xQueueGenericSend( QueueHandle_t xQueue, - const void *const pvItemToQueue, + const void* const pvItemToQueue, TickType_t xTicksToWait, const BaseType_t xCopyPosition) { @@ -201,14 +201,14 @@ xQueueGenericSend( assert(semGIVE_BLOCK_TIME == xTicksToWait); assert(queueSEND_TO_BACK == xCopyPosition); - auto *p_sema = reinterpret_cast(xQueue); + auto* p_sema = reinterpret_cast(xQueue); if (!p_sema->isStaticallyAllocated) { - struct QueueDefinition *p_sema2 = std::find_if( + struct QueueDefinition* p_sema2 = std::find_if( std::begin(g_pTestClass->arrOfSemaphores), std::end(g_pTestClass->arrOfSemaphores), - [&](const struct QueueDefinition &x) { return &x == xQueue; }); + [&](const struct QueueDefinition& x) { return &x == xQueue; }); assert(std::end(g_pTestClass->arrOfSemaphores) != p_sema2); assert(p_sema == p_sema2); } @@ -261,7 +261,7 @@ TEST_F(TestOsSema, os_sema_create_delete_static_only) // NOLINT { static StaticSemaphore_t static_sema1; os_sema_t h_sema1 = os_sema_create_static(&static_sema1); - ASSERT_EQ(reinterpret_cast(&static_sema1), reinterpret_cast(h_sema1)); + ASSERT_EQ(reinterpret_cast(&static_sema1), reinterpret_cast(h_sema1)); os_sema_delete(&h_sema1); ASSERT_EQ(nullptr, h_sema1); @@ -276,13 +276,13 @@ TEST_F(TestOsSema, os_sema_create_delete_static_and_dynamic) // NOLINT ASSERT_EQ(&this->arrOfSemaphores[0], h_sema_dyn1); os_sema_t h_sema_sta1 = os_sema_create_static(&static_sema1); - ASSERT_EQ(reinterpret_cast(&static_sema1), reinterpret_cast(h_sema_sta1)); + ASSERT_EQ(reinterpret_cast(&static_sema1), reinterpret_cast(h_sema_sta1)); os_sema_t h_sema_dyn2 = os_sema_create(); ASSERT_EQ(&this->arrOfSemaphores[1], h_sema_dyn2); os_sema_t h_sema_sta2 = os_sema_create_static(&static_sema2); - ASSERT_EQ(reinterpret_cast(&static_sema2), reinterpret_cast(h_sema_sta2)); + ASSERT_EQ(reinterpret_cast(&static_sema2), reinterpret_cast(h_sema_sta2)); os_sema_t h_sema_dyn3 = os_sema_create(); ASSERT_EQ(nullptr, h_sema_dyn3); @@ -313,7 +313,7 @@ TEST_F(TestOsSema, os_sema_create_delete_static_and_dynamic) // NOLINT TEST_F(TestOsSema, os_sema_wait_infinite) // NOLINT { os_sema_t h_sema = os_sema_create(); - struct QueueDefinition *p_sema = &this->arrOfSemaphores[0]; + struct QueueDefinition* p_sema = &this->arrOfSemaphores[0]; ASSERT_EQ(p_sema, h_sema); ASSERT_FALSE(p_sema->isLocked); @@ -332,8 +332,8 @@ TEST_F(TestOsSema, os_sema_wait_infinite_static) // NOLINT { static StaticSemaphore_t static_sema1; os_sema_t h_sema = os_sema_create_static(&static_sema1); - ASSERT_EQ(reinterpret_cast(&static_sema1), reinterpret_cast(h_sema)); - struct QueueDefinition *p_sema = h_sema; + ASSERT_EQ(reinterpret_cast(&static_sema1), reinterpret_cast(h_sema)); + struct QueueDefinition* p_sema = h_sema; ASSERT_FALSE(p_sema->isLocked); os_sema_wait_infinite(h_sema); @@ -350,7 +350,7 @@ TEST_F(TestOsSema, os_sema_wait_infinite_static) // NOLINT TEST_F(TestOsSema, os_sema_wait_immediate) // NOLINT { os_sema_t h_sema = os_sema_create(); - struct QueueDefinition *p_sema = &this->arrOfSemaphores[0]; + struct QueueDefinition* p_sema = &this->arrOfSemaphores[0]; ASSERT_EQ(p_sema, h_sema); ASSERT_FALSE(p_sema->isLocked); @@ -370,7 +370,7 @@ TEST_F(TestOsSema, os_sema_wait_immediate) // NOLINT TEST_F(TestOsSema, os_sema_wait_with_timeout) // NOLINT { os_sema_t h_sema = os_sema_create(); - struct QueueDefinition *p_sema = &this->arrOfSemaphores[0]; + struct QueueDefinition* p_sema = &this->arrOfSemaphores[0]; ASSERT_EQ(p_sema, h_sema); ASSERT_FALSE(p_sema->isLocked); diff --git a/tests/test_os_signal_freertos/test_os_signal_freertos.cpp b/tests/test_os_signal_freertos/test_os_signal_freertos.cpp index 6cfa476..3e76feb 100644 --- a/tests/test_os_signal_freertos/test_os_signal_freertos.cpp +++ b/tests/test_os_signal_freertos/test_os_signal_freertos.cpp @@ -38,10 +38,10 @@ typedef enum MainTaskCmd_Tag * *********************************************************************************/ class TestOsSignalFreertos; -static TestOsSignalFreertos *g_pTestClass; +static TestOsSignalFreertos* g_pTestClass; -static void * -freertosStartup(void *arg); +static void* +freertosStartup(void* arg); class TestOsSignalFreertos : public ::testing::Test { @@ -67,7 +67,7 @@ class TestOsSignalFreertos : public ::testing::Test { cmdQueue.push_and_wait(MainTaskCmd_Exit); vTaskEndScheduler(); - void *ret_code = nullptr; + void* ret_code = nullptr; pthread_join(pid, &ret_code); sem_destroy(&semaFreeRTOS); esp_log_wrapper_deinit(); @@ -75,12 +75,12 @@ class TestOsSignalFreertos : public ::testing::Test } public: - sem_t semaFreeRTOS; - TQueue cmdQueue; - std::vector testEvents; - os_signal_t * p_signal; - os_signal_t * p_signal2; - bool result_run_signal_handler_task; + sem_t semaFreeRTOS; + TQueue cmdQueue; + std::vector testEvents; + os_signal_t* p_signal; + os_signal_t* p_signal2; + bool result_run_signal_handler_task; TestOsSignalFreertos(); @@ -117,7 +117,7 @@ timespec_get_clock_monotonic(void) } static struct timespec -timespec_diff(const struct timespec *p_t2, const struct timespec *p_t1) +timespec_diff(const struct timespec* p_t2, const struct timespec* p_t1) { struct timespec result = { .tv_sec = p_t2->tv_sec - p_t1->tv_sec, @@ -132,7 +132,7 @@ timespec_diff(const struct timespec *p_t2, const struct timespec *p_t1) } static uint32_t -timespec_diff_ms(const struct timespec *p_t2, const struct timespec *p_t1) +timespec_diff_ms(const struct timespec* p_t2, const struct timespec* p_t1) { struct timespec diff = timespec_diff(p_t2, p_t1); return diff.tv_sec * 1000 + diff.tv_nsec / 1000000; @@ -199,9 +199,9 @@ TestOsSignalFreertos::wait_until_new_events_pushed(const uint32_t exp_num_events ATTR_NORETURN static void -signalHandlerTask1(void *p_param) +signalHandlerTask1(void* p_param) { - auto *pObj = static_cast(p_param); + auto* pObj = static_cast(p_param); pObj->p_signal = os_signal_create(); assert(nullptr != pObj->p_signal); if (!os_signal_add(pObj->p_signal, OS_SIGNAL_NUM_0)) @@ -249,12 +249,12 @@ signalHandlerTask1(void *p_param) ATTR_NORETURN static void -signalHandlerTask2(void *p_param) +signalHandlerTask2(void* p_param) { - auto * pObj = static_cast(p_param); + auto* pObj = static_cast(p_param); static os_signal_static_t signal_mem = {}; pObj->p_signal2 = os_signal_create_static(&signal_mem); - assert(reinterpret_cast(&signal_mem) == reinterpret_cast(pObj->p_signal2)); + assert(reinterpret_cast(&signal_mem) == reinterpret_cast(pObj->p_signal2)); if (!os_signal_add(pObj->p_signal2, OS_SIGNAL_NUM_0)) { assert(0); @@ -299,9 +299,9 @@ signalHandlerTask2(void *p_param) } static void -cmdHandlerTask(void *p_param) +cmdHandlerTask(void* p_param) { - auto *pObj = static_cast(p_param); + auto* pObj = static_cast(p_param); bool flagExit = false; sem_post(&pObj->semaFreeRTOS); while (!flagExit) @@ -370,10 +370,10 @@ cmdHandlerTask(void *p_param) vTaskDelete(nullptr); } -static void * -freertosStartup(void *arg) +static void* +freertosStartup(void* arg) { - auto * pObj = static_cast(arg); + auto* pObj = static_cast(arg); const bool res = xTaskCreate(&cmdHandlerTask, "cmdHandlerTask", configMINIMAL_STACK_SIZE, pObj, tskIDLE_PRIORITY + 1, nullptr); assert(res); @@ -393,9 +393,9 @@ TEST_F(TestOsSignalFreertos, test1) // NOLINT cmdQueue.push_and_wait(MainTaskCmd_SendToTask1Signal1); ASSERT_TRUE(wait_until_new_events_pushed(1, 1000)); { - auto *pBaseEv = testEvents[0]; + auto* pBaseEv = testEvents[0]; ASSERT_EQ(TestEventType_Signal, pBaseEv->eventType); - auto *pEv = reinterpret_cast(pBaseEv); + auto* pEv = reinterpret_cast(pBaseEv); ASSERT_EQ(OS_SIGNAL_NUM_1, pEv->sig_num); } testEvents.clear(); @@ -404,9 +404,9 @@ TEST_F(TestOsSignalFreertos, test1) // NOLINT cmdQueue.push_and_wait(MainTaskCmd_SendToTask1Signal0); ASSERT_TRUE(wait_until_new_events_pushed(1, 1000)); { - auto *pBaseEv = testEvents[0]; + auto* pBaseEv = testEvents[0]; ASSERT_EQ(TestEventType_Signal, pBaseEv->eventType); - auto *pEv = reinterpret_cast(pBaseEv); + auto* pEv = reinterpret_cast(pBaseEv); ASSERT_EQ(OS_SIGNAL_NUM_0, pEv->sig_num); } @@ -414,15 +414,15 @@ TEST_F(TestOsSignalFreertos, test1) // NOLINT cmdQueue.push_and_wait(MainTaskCmd_SendToTask1Signal2); ASSERT_TRUE(wait_until_new_events_pushed(2, 1000)); { - auto *pBaseEv = testEvents[0]; + auto* pBaseEv = testEvents[0]; ASSERT_EQ(TestEventType_Signal, pBaseEv->eventType); - auto *pEv = reinterpret_cast(pBaseEv); + auto* pEv = reinterpret_cast(pBaseEv); ASSERT_EQ(OS_SIGNAL_NUM_2, pEv->sig_num); } { - auto *pBaseEv = testEvents[1]; + auto* pBaseEv = testEvents[1]; ASSERT_EQ(TestEventType_ThreadExit, pBaseEv->eventType); - auto *pEv = reinterpret_cast(pBaseEv); + auto* pEv = reinterpret_cast(pBaseEv); ASSERT_EQ(1, pEv->thread_num); } @@ -439,9 +439,9 @@ TEST_F(TestOsSignalFreertos, test1) // NOLINT cmdQueue.push_and_wait(MainTaskCmd_SendToTask2Signal1); ASSERT_TRUE(wait_until_new_events_pushed(1, 1000)); { - auto *pBaseEv = testEvents[0]; + auto* pBaseEv = testEvents[0]; ASSERT_EQ(TestEventType_Signal, pBaseEv->eventType); - auto *pEv = reinterpret_cast(pBaseEv); + auto* pEv = reinterpret_cast(pBaseEv); ASSERT_EQ(OS_SIGNAL_NUM_1, pEv->sig_num); } testEvents.clear(); @@ -450,9 +450,9 @@ TEST_F(TestOsSignalFreertos, test1) // NOLINT cmdQueue.push_and_wait(MainTaskCmd_SendToTask2Signal0); ASSERT_TRUE(wait_until_new_events_pushed(1, 1000)); { - auto *pBaseEv = testEvents[0]; + auto* pBaseEv = testEvents[0]; ASSERT_EQ(TestEventType_Signal, pBaseEv->eventType); - auto *pEv = reinterpret_cast(pBaseEv); + auto* pEv = reinterpret_cast(pBaseEv); ASSERT_EQ(OS_SIGNAL_NUM_0, pEv->sig_num); } @@ -460,15 +460,15 @@ TEST_F(TestOsSignalFreertos, test1) // NOLINT cmdQueue.push_and_wait(MainTaskCmd_SendToTask2Signal2); ASSERT_TRUE(wait_until_new_events_pushed(2, 1000)); { - auto *pBaseEv = testEvents[0]; + auto* pBaseEv = testEvents[0]; ASSERT_EQ(TestEventType_Signal, pBaseEv->eventType); - auto *pEv = reinterpret_cast(pBaseEv); + auto* pEv = reinterpret_cast(pBaseEv); ASSERT_EQ(OS_SIGNAL_NUM_2, pEv->sig_num); } { - auto *pBaseEv = testEvents[1]; + auto* pBaseEv = testEvents[1]; ASSERT_EQ(TestEventType_ThreadExit, pBaseEv->eventType); - auto *pEv = reinterpret_cast(pBaseEv); + auto* pEv = reinterpret_cast(pBaseEv); ASSERT_EQ(2, pEv->thread_num); } } \ No newline at end of file diff --git a/tests/test_os_str/test_os_str_to_int32.cpp b/tests/test_os_str/test_os_str_to_int32.cpp index 4eea3eb..bebb97e 100644 --- a/tests/test_os_str/test_os_str_to_int32.cpp +++ b/tests/test_os_str/test_os_str_to_int32.cpp @@ -46,29 +46,29 @@ TestAppStrtol::~TestAppStrtol() = default; TEST_F(TestAppStrtol, test_strtol_cptr_123) // NOLINT { - const char * val_str = "123"; + const char* val_str = "123"; const int32_t result = os_str_to_int32_cptr(val_str, nullptr, 0); ASSERT_EQ(123, result); } TEST_F(TestAppStrtol, test_strtol_cptr_minus_123) // NOLINT { - const char * val_str = "-123"; + const char* val_str = "-123"; const int32_t result = os_str_to_int32_cptr(val_str, nullptr, 0); ASSERT_EQ(-123, result); } TEST_F(TestAppStrtol, test_strtol_cptr_0x123) // NOLINT { - const char * val_str = "0x123"; + const char* val_str = "0x123"; const int32_t result = os_str_to_int32_cptr(val_str, nullptr, 0); ASSERT_EQ(0x123, result); } TEST_F(TestAppStrtol, test_strtol_cptr_end) // NOLINT { - const char * val_str = "123abc"; - const char * end = nullptr; + const char* val_str = "123abc"; + const char* end = nullptr; const int32_t result = os_str_to_int32_cptr(val_str, &end, 0); ASSERT_EQ(123, result); ASSERT_EQ(&val_str[3], end); @@ -77,8 +77,8 @@ TEST_F(TestAppStrtol, test_strtol_cptr_end) // NOLINT TEST_F(TestAppStrtol, test_strtol_cptr_overflow_32bit) // NOLINT { - const char * val_str = "0x80000001"; - const char * end = nullptr; + const char* val_str = "0x80000001"; + const char* end = nullptr; const int32_t result = os_str_to_int32_cptr(val_str, &end, 0); ASSERT_EQ(INT32_MAX, result); ASSERT_EQ(&val_str[10], end); @@ -87,8 +87,8 @@ TEST_F(TestAppStrtol, test_strtol_cptr_overflow_32bit) // NOLINT TEST_F(TestAppStrtol, test_strtol_cptr_underflow_32bit) // NOLINT { - const char * val_str = "-0x80000001"; - const char * end = nullptr; + const char* val_str = "-0x80000001"; + const char* end = nullptr; const int32_t result = os_str_to_int32_cptr(val_str, &end, 0); ASSERT_EQ(INT32_MIN, result); ASSERT_EQ(&val_str[11], end); @@ -97,8 +97,8 @@ TEST_F(TestAppStrtol, test_strtol_cptr_underflow_32bit) // NOLINT TEST_F(TestAppStrtol, test_strtol_cptr_overflow_64bit) // NOLINT { - const char * val_str = "0x8000000000000001"; - const char * end = nullptr; + const char* val_str = "0x8000000000000001"; + const char* end = nullptr; const int32_t result = os_str_to_int32_cptr(val_str, &end, 0); ASSERT_EQ(INT32_MAX, result); ASSERT_EQ(&val_str[18], end); @@ -107,8 +107,8 @@ TEST_F(TestAppStrtol, test_strtol_cptr_overflow_64bit) // NOLINT TEST_F(TestAppStrtol, test_strtol_cptr_undeflow_64bit) // NOLINT { - const char * val_str = "-0x8000000000000001"; - const char * end = nullptr; + const char* val_str = "-0x8000000000000001"; + const char* end = nullptr; const int32_t result = os_str_to_int32_cptr(val_str, &end, 0); ASSERT_EQ(INT32_MIN, result); ASSERT_EQ(&val_str[19], end); @@ -143,7 +143,7 @@ TEST_F(TestAppStrtol, test_strtol_end) // NOLINT { char val_str[80]; snprintf(val_str, sizeof(val_str), "123abc"); - char * end = nullptr; + char* end = nullptr; const int32_t result = os_str_to_int32(val_str, &end, 0); ASSERT_EQ(123, result); ASSERT_EQ(&val_str[3], end); @@ -154,7 +154,7 @@ TEST_F(TestAppStrtol, test_strtol_overflow_32bit) // NOLINT { char val_str[80]; snprintf(val_str, sizeof(val_str), "0x80000001"); - char * end = nullptr; + char* end = nullptr; const int32_t result = os_str_to_int32(val_str, &end, 0); ASSERT_EQ(INT32_MAX, result); ASSERT_EQ(&val_str[10], end); @@ -165,7 +165,7 @@ TEST_F(TestAppStrtol, test_strtol_underflow_32bit) // NOLINT { char val_str[80]; snprintf(val_str, sizeof(val_str), "-0x80000001"); - char * end = nullptr; + char* end = nullptr; const int32_t result = os_str_to_int32(val_str, &end, 0); ASSERT_EQ(INT32_MIN, result); ASSERT_EQ(&val_str[11], end); @@ -176,7 +176,7 @@ TEST_F(TestAppStrtol, test_strtol_overflow_64bit) // NOLINT { char val_str[80]; snprintf(val_str, sizeof(val_str), "0x8000000000000001"); - char * end = nullptr; + char* end = nullptr; const int32_t result = os_str_to_int32(val_str, &end, 0); ASSERT_EQ(INT32_MAX, result); ASSERT_EQ(&val_str[18], end); @@ -187,7 +187,7 @@ TEST_F(TestAppStrtol, test_strtol_undeflow_64bit) // NOLINT { char val_str[80]; snprintf(val_str, sizeof(val_str), "-0x8000000000000001"); - char * end = nullptr; + char* end = nullptr; const int32_t result = os_str_to_int32(val_str, &end, 0); ASSERT_EQ(INT32_MIN, result); ASSERT_EQ(&val_str[19], end); diff --git a/tests/test_os_str/test_os_str_to_uint32.cpp b/tests/test_os_str/test_os_str_to_uint32.cpp index 00e1582..3408c66 100644 --- a/tests/test_os_str/test_os_str_to_uint32.cpp +++ b/tests/test_os_str/test_os_str_to_uint32.cpp @@ -46,22 +46,22 @@ TestAppStrtoul::~TestAppStrtoul() = default; TEST_F(TestAppStrtoul, test_strtoul_cptr_123) // NOLINT { - const char * val_str = "123"; + const char* val_str = "123"; const uint32_t result = os_str_to_uint32_cptr(val_str, nullptr, 0); ASSERT_EQ(123, result); } TEST_F(TestAppStrtoul, test_strtoul_cptr_0x123) // NOLINT { - const char * val_str = "0x123"; + const char* val_str = "0x123"; const uint32_t result = os_str_to_uint32_cptr(val_str, nullptr, 0); ASSERT_EQ(0x123, result); } TEST_F(TestAppStrtoul, test_strtoul_cptr_end) // NOLINT { - const char * val_str = "123abc"; - const char * end = nullptr; + const char* val_str = "123abc"; + const char* end = nullptr; const uint32_t result = os_str_to_uint32_cptr(val_str, &end, 0); ASSERT_EQ(123, result); ASSERT_EQ(&val_str[3], end); @@ -70,8 +70,8 @@ TEST_F(TestAppStrtoul, test_strtoul_cptr_end) // NOLINT TEST_F(TestAppStrtoul, test_strtoul_cptr_overflow_32bit) // NOLINT { - const char * val_str = "0x123456789"; - const char * end = nullptr; + const char* val_str = "0x123456789"; + const char* end = nullptr; const uint32_t result = os_str_to_uint32_cptr(val_str, &end, 0); ASSERT_EQ(UINT32_MAX, result); ASSERT_EQ(&val_str[11], end); @@ -80,8 +80,8 @@ TEST_F(TestAppStrtoul, test_strtoul_cptr_overflow_32bit) // NOLINT TEST_F(TestAppStrtoul, test_strtoul_cptr_overflow_64bit) // NOLINT { - const char * val_str = "0x12345678123456789"; - const char * end = nullptr; + const char* val_str = "0x12345678123456789"; + const char* end = nullptr; const uint32_t result = os_str_to_uint32_cptr(val_str, &end, 0); ASSERT_EQ(UINT32_MAX, result); ASSERT_EQ(&val_str[19], end); @@ -108,7 +108,7 @@ TEST_F(TestAppStrtoul, test_strtoul_end) // NOLINT { char val_str[80]; snprintf(val_str, sizeof(val_str), "123abc"); - char * end = nullptr; + char* end = nullptr; const uint32_t result = os_str_to_uint32(val_str, &end, 0); ASSERT_EQ(123, result); ASSERT_EQ(&val_str[3], end); @@ -119,7 +119,7 @@ TEST_F(TestAppStrtoul, test_strtoul_overflow_32bit) // NOLINT { char val_str[80]; snprintf(val_str, sizeof(val_str), "0x123456789"); - char * end = nullptr; + char* end = nullptr; const uint32_t result = os_str_to_uint32(val_str, &end, 0); ASSERT_EQ(UINT32_MAX, result); ASSERT_EQ(&val_str[11], end); @@ -130,7 +130,7 @@ TEST_F(TestAppStrtoul, test_strtoul_overflow_64bit) // NOLINT { char val_str[80]; snprintf(val_str, sizeof(val_str), "0x12345678123456789"); - char * end = nullptr; + char* end = nullptr; const uint32_t result = os_str_to_uint32(val_str, &end, 0); ASSERT_EQ(UINT32_MAX, result); ASSERT_EQ(&val_str[19], end); diff --git a/tests/test_os_task/stubs.cpp b/tests/test_os_task/stubs.cpp index d3755f0..a5ab44a 100644 --- a/tests/test_os_task/stubs.cpp +++ b/tests/test_os_task/stubs.cpp @@ -15,23 +15,23 @@ using namespace std; -TestOsTask *g_pTestClass; +TestOsTask* g_pTestClass; extern "C" { -void * +void* os_calloc(const size_t nmemb, const size_t size) { return calloc(nmemb, size); } void -os_free_internal(void *ptr) +os_free_internal(void* ptr) { free(ptr); } -char * +char* pcTaskGetName(TaskHandle_t xTaskToQuery) { assert(nullptr == xTaskToQuery); @@ -39,7 +39,7 @@ pcTaskGetName(TaskHandle_t xTaskToQuery) { return nullptr; } - return const_cast(g_pTestClass->m_taskName.c_str()); + return const_cast(g_pTestClass->m_taskName.c_str()); } UBaseType_t @@ -58,11 +58,11 @@ xTaskGetCurrentTaskHandle(void) BaseType_t xTaskCreate( TaskFunction_t pxTaskCode, - const char *const pcName, + const char* const pcName, const configSTACK_DEPTH_TYPE usStackDepth, - void *const pvParameters, + void* const pvParameters, UBaseType_t uxPriority, - TaskHandle_t *const pxCreatedTask) + TaskHandle_t* const pxCreatedTask) { if (nullptr == g_pTestClass->m_createdTaskHandle) { @@ -81,12 +81,12 @@ xTaskCreate( TaskHandle_t xTaskCreateStatic( TaskFunction_t pxTaskCode, - const char *const pcName, + const char* const pcName, const uint32_t ulStackDepth, - void *const pvParameters, + void* const pvParameters, UBaseType_t uxPriority, - StackType_t *const puxStackBuffer, - StaticTask_t *const pxTaskBuffer) + StackType_t* const puxStackBuffer, + StaticTask_t* const pxTaskBuffer) { (void)puxStackBuffer; (void)pxTaskBuffer; diff --git a/tests/test_os_task/test_os_task.cpp b/tests/test_os_task/test_os_task.cpp index eafa8fe..5277900 100644 --- a/tests/test_os_task/test_os_task.cpp +++ b/tests/test_os_task/test_os_task.cpp @@ -13,14 +13,14 @@ TEST_F(TestOsTask, os_task_get_name_ok) // NOLINT { this->m_taskName.assign("my_task_name1"); - const char *taskName = os_task_get_name(); + const char* taskName = os_task_get_name(); ASSERT_NE(nullptr, taskName); ASSERT_EQ(string(taskName), string("my_task_name1")); } TEST_F(TestOsTask, os_task_get_name_null) // NOLINT { - const char *taskName = os_task_get_name(); + const char* taskName = os_task_get_name(); ASSERT_NE(nullptr, taskName); ASSERT_EQ(string(taskName), string("???")); } diff --git a/tests/test_os_task/test_os_task.hpp b/tests/test_os_task/test_os_task.hpp index ebe4409..c7605b6 100644 --- a/tests/test_os_task/test_os_task.hpp +++ b/tests/test_os_task/test_os_task.hpp @@ -16,7 +16,7 @@ using namespace std; class TestOsTask; -extern TestOsTask *g_pTestClass; +extern TestOsTask* g_pTestClass; /*** Google-test class implementation * *********************************************************************************/ @@ -64,7 +64,7 @@ class TestOsTask : public ::testing::Test bool m_is_static; string m_createdTaskName; configSTACK_DEPTH_TYPE m_createdTaskStackDepth; - void * m_createdTaskParam; + void* m_createdTaskParam; UBaseType_t m_createdTaskPriority; std::array stack_mem; os_task_static_t task_mem; diff --git a/tests/test_os_task/test_os_task_create.cpp b/tests/test_os_task/test_os_task_create.cpp index 2c3669e..10b5f20 100644 --- a/tests/test_os_task/test_os_task_create.cpp +++ b/tests/test_os_task/test_os_task_create.cpp @@ -15,7 +15,7 @@ struct tskTaskControlBlock }; static ATTR_NORETURN void -task_func(void *p_param) +task_func(void* p_param) { (void)p_param; while (true) @@ -27,7 +27,7 @@ task_func(void *p_param) TEST_F(TestOsTask, os_task_create_ok) // NOLINT { - const char * task_name = "my_task_name2"; + const char* task_name = "my_task_name2"; const uint32_t stack_depth = 2048; const os_task_priority_t priority = 3; this->m_taskName.assign(task_name); @@ -52,7 +52,7 @@ TEST_F(TestOsTask, os_task_create_ok) // NOLINT TEST_F(TestOsTask, os_task_create_fail) // NOLINT { - const char * task_name = "my_task_name2"; + const char* task_name = "my_task_name2"; const uint32_t stack_depth = 2048; const os_task_priority_t priority = 3; this->m_taskName.assign(task_name); diff --git a/tests/test_os_task/test_os_task_create_finite.cpp b/tests/test_os_task/test_os_task_create_finite.cpp index 0e50f63..cf09d70 100644 --- a/tests/test_os_task/test_os_task_create_finite.cpp +++ b/tests/test_os_task/test_os_task_create_finite.cpp @@ -15,7 +15,7 @@ struct tskTaskControlBlock }; static void -task_func(void *p_param) +task_func(void* p_param) { (void)p_param; } @@ -24,7 +24,7 @@ task_func(void *p_param) TEST_F(TestOsTask, os_task_create_finite_ok) // NOLINT { - const char * task_name = "my_task_name2"; + const char* task_name = "my_task_name2"; const uint32_t stack_depth = 2048; const os_task_priority_t priority = 3; this->m_taskName.assign(task_name); @@ -47,7 +47,7 @@ TEST_F(TestOsTask, os_task_create_finite_ok) // NOLINT TEST_F(TestOsTask, os_task_create_finite_fail) // NOLINT { - const char * task_name = "my_task_name2"; + const char* task_name = "my_task_name2"; const uint32_t stack_depth = 2048; const os_task_priority_t priority = 3; this->m_taskName.assign(task_name); diff --git a/tests/test_os_task/test_os_task_create_finite_with_const_param.cpp b/tests/test_os_task/test_os_task_create_finite_with_const_param.cpp index 834fbb8..a7d5618 100644 --- a/tests/test_os_task/test_os_task_create_finite_with_const_param.cpp +++ b/tests/test_os_task/test_os_task_create_finite_with_const_param.cpp @@ -15,7 +15,7 @@ struct tskTaskControlBlock }; static void -task_func_with_const_param(const void *p_param) +task_func_with_const_param(const void* p_param) { (void)p_param; } @@ -24,7 +24,7 @@ task_func_with_const_param(const void *p_param) TEST_F(TestOsTask, os_task_create_finite_with_const_param_ok) // NOLINT { - const char * task_name = "my_task_name2"; + const char* task_name = "my_task_name2"; const uint32_t stack_depth = 2048; const os_task_priority_t priority = 3; this->m_taskName.assign(task_name); @@ -52,7 +52,7 @@ TEST_F(TestOsTask, os_task_create_finite_with_const_param_ok) // NOLINT TEST_F(TestOsTask, os_task_create_finite_with_const_param_fail) // NOLINT { - const char * task_name = "my_task_name2"; + const char* task_name = "my_task_name2"; const uint32_t stack_depth = 2048; const os_task_priority_t priority = 3; this->m_taskName.assign(task_name); diff --git a/tests/test_os_task/test_os_task_create_finite_without_param.cpp b/tests/test_os_task/test_os_task_create_finite_without_param.cpp index be004d1..7bcb0c8 100644 --- a/tests/test_os_task/test_os_task_create_finite_without_param.cpp +++ b/tests/test_os_task/test_os_task_create_finite_without_param.cpp @@ -23,7 +23,7 @@ task_func_without_param() TEST_F(TestOsTask, os_task_create_finite_with_without_param_ok) // NOLINT { - const char * task_name = "my_task_name2"; + const char* task_name = "my_task_name2"; const uint32_t stack_depth = 2048; const os_task_priority_t priority = 3; this->m_taskName.assign(task_name); @@ -45,7 +45,7 @@ TEST_F(TestOsTask, os_task_create_finite_with_without_param_ok) // NOLINT TEST_F(TestOsTask, os_task_create_finite_without_param_fail) // NOLINT { - const char * task_name = "my_task_name2"; + const char* task_name = "my_task_name2"; const uint32_t stack_depth = 2048; const os_task_priority_t priority = 3; this->m_taskName.assign(task_name); diff --git a/tests/test_os_task/test_os_task_create_static.cpp b/tests/test_os_task/test_os_task_create_static.cpp index 000618a..389240b 100644 --- a/tests/test_os_task/test_os_task_create_static.cpp +++ b/tests/test_os_task/test_os_task_create_static.cpp @@ -15,7 +15,7 @@ struct tskTaskControlBlock }; static ATTR_NORETURN void -task_func(void *p_param) +task_func(void* p_param) { (void)p_param; while (true) @@ -27,7 +27,7 @@ task_func(void *p_param) TEST_F(TestOsTask, os_task_create_static_ok) // NOLINT { - const char * task_name = "my_task_name2"; + const char* task_name = "my_task_name2"; const uint32_t stack_depth = sizeof(this->stack_mem) / sizeof(this->stack_mem[0]); const os_task_priority_t priority = 3; this->m_taskName.assign(task_name); @@ -59,7 +59,7 @@ TEST_F(TestOsTask, os_task_create_static_ok) // NOLINT TEST_F(TestOsTask, os_task_create_static_fail) // NOLINT { - const char * task_name = "my_task_name2"; + const char* task_name = "my_task_name2"; const uint32_t stack_depth = 2048; const os_task_priority_t priority = 3; this->m_taskName.assign(task_name); diff --git a/tests/test_os_task/test_os_task_create_static_finite.cpp b/tests/test_os_task/test_os_task_create_static_finite.cpp index 3cd7ec5..d7155d6 100644 --- a/tests/test_os_task/test_os_task_create_static_finite.cpp +++ b/tests/test_os_task/test_os_task_create_static_finite.cpp @@ -15,7 +15,7 @@ struct tskTaskControlBlock }; static void -task_func(void *p_param) +task_func(void* p_param) { (void)p_param; } @@ -24,7 +24,7 @@ task_func(void *p_param) TEST_F(TestOsTask, os_task_create_static_finite_ok) // NOLINT { - const char * task_name = "my_task_name2"; + const char* task_name = "my_task_name2"; const uint32_t stack_depth = sizeof(this->stack_mem) / sizeof(this->stack_mem[0]); const os_task_priority_t priority = 3; this->m_taskName.assign(task_name); @@ -54,7 +54,7 @@ TEST_F(TestOsTask, os_task_create_static_finite_ok) // NOLINT TEST_F(TestOsTask, os_task_create_static_finite_fail) // NOLINT { - const char * task_name = "my_task_name2"; + const char* task_name = "my_task_name2"; const uint32_t stack_depth = 2048; const os_task_priority_t priority = 3; this->m_taskName.assign(task_name); diff --git a/tests/test_os_task/test_os_task_create_static_finite_with_const_param.cpp b/tests/test_os_task/test_os_task_create_static_finite_with_const_param.cpp index 431af81..45d907e 100644 --- a/tests/test_os_task/test_os_task_create_static_finite_with_const_param.cpp +++ b/tests/test_os_task/test_os_task_create_static_finite_with_const_param.cpp @@ -15,7 +15,7 @@ struct tskTaskControlBlock }; static void -task_func(const void *p_param) +task_func(const void* p_param) { (void)p_param; } @@ -24,7 +24,7 @@ task_func(const void *p_param) TEST_F(TestOsTask, os_task_create_static_finite_with_const_param_ok) // NOLINT { - const char * task_name = "my_task_name2"; + const char* task_name = "my_task_name2"; const uint32_t stack_depth = sizeof(this->stack_mem) / sizeof(this->stack_mem[0]); const os_task_priority_t priority = 3; this->m_taskName.assign(task_name); @@ -54,7 +54,7 @@ TEST_F(TestOsTask, os_task_create_static_finite_with_const_param_ok) // NOLINT TEST_F(TestOsTask, os_task_create_static_finite_with_const_param_fail) // NOLINT { - const char * task_name = "my_task_name2"; + const char* task_name = "my_task_name2"; const uint32_t stack_depth = 2048; const os_task_priority_t priority = 3; this->m_taskName.assign(task_name); diff --git a/tests/test_os_task/test_os_task_create_static_finite_without_param.cpp b/tests/test_os_task/test_os_task_create_static_finite_without_param.cpp index 461d7d0..09e62ed 100644 --- a/tests/test_os_task/test_os_task_create_static_finite_without_param.cpp +++ b/tests/test_os_task/test_os_task_create_static_finite_without_param.cpp @@ -23,7 +23,7 @@ task_func() TEST_F(TestOsTask, os_task_create_static_finite_without_param_ok) // NOLINT { - const char * task_name = "my_task_name2"; + const char* task_name = "my_task_name2"; const uint32_t stack_depth = sizeof(this->stack_mem) / sizeof(this->stack_mem[0]); const os_task_priority_t priority = 3; this->m_taskName.assign(task_name); @@ -52,7 +52,7 @@ TEST_F(TestOsTask, os_task_create_static_finite_without_param_ok) // NOLINT TEST_F(TestOsTask, os_task_create_static_finite_without_param_fail) // NOLINT { - const char * task_name = "my_task_name2"; + const char* task_name = "my_task_name2"; const uint32_t stack_depth = 2048; const os_task_priority_t priority = 3; this->m_taskName.assign(task_name); diff --git a/tests/test_os_task/test_os_task_create_static_with_const_param.cpp b/tests/test_os_task/test_os_task_create_static_with_const_param.cpp index 3ae9596..ac1bf69 100644 --- a/tests/test_os_task/test_os_task_create_static_with_const_param.cpp +++ b/tests/test_os_task/test_os_task_create_static_with_const_param.cpp @@ -15,7 +15,7 @@ struct tskTaskControlBlock }; static ATTR_NORETURN void -task_func(const void *p_param) +task_func(const void* p_param) { (void)p_param; while (true) @@ -27,7 +27,7 @@ task_func(const void *p_param) TEST_F(TestOsTask, os_task_create_static_with_const_param_ok) // NOLINT { - const char * task_name = "my_task_name2"; + const char* task_name = "my_task_name2"; const uint32_t stack_depth = sizeof(this->stack_mem) / sizeof(this->stack_mem[0]); const os_task_priority_t priority = 3; this->m_taskName.assign(task_name); @@ -45,7 +45,7 @@ TEST_F(TestOsTask, os_task_create_static_with_const_param_ok) // NOLINT &h_task)); ASSERT_EQ(&taskControlBlock, h_task); ASSERT_TRUE(g_pTestClass->m_is_static); - ASSERT_EQ(reinterpret_cast(g_pTestClass->m_createdTaskFunc), reinterpret_cast(&task_func)); + ASSERT_EQ(reinterpret_cast(g_pTestClass->m_createdTaskFunc), reinterpret_cast(&task_func)); ASSERT_EQ(g_pTestClass->m_createdTaskName, task_name); ASSERT_EQ(g_pTestClass->m_createdTaskStackDepth, stack_depth); ASSERT_EQ(g_pTestClass->m_createdTaskParam, &this->m_taskParam); @@ -60,7 +60,7 @@ TEST_F(TestOsTask, os_task_create_static_with_const_param_ok) // NOLINT TEST_F(TestOsTask, os_task_create_static_with_const_param_fail) // NOLINT { - const char * task_name = "my_task_name2"; + const char* task_name = "my_task_name2"; const uint32_t stack_depth = 2048; const os_task_priority_t priority = 3; this->m_taskName.assign(task_name); diff --git a/tests/test_os_task/test_os_task_create_static_without_param.cpp b/tests/test_os_task/test_os_task_create_static_without_param.cpp index 8252ff9..3c4d8ec 100644 --- a/tests/test_os_task/test_os_task_create_static_without_param.cpp +++ b/tests/test_os_task/test_os_task_create_static_without_param.cpp @@ -26,7 +26,7 @@ task_func() TEST_F(TestOsTask, os_task_create_static_without_param_ok) // NOLINT { - const char * task_name = "my_task_name2"; + const char* task_name = "my_task_name2"; const uint32_t stack_depth = sizeof(this->stack_mem) / sizeof(this->stack_mem[0]); const os_task_priority_t priority = 3; this->m_taskName.assign(task_name); @@ -58,7 +58,7 @@ TEST_F(TestOsTask, os_task_create_static_without_param_ok) // NOLINT TEST_F(TestOsTask, os_task_create_static_without_param_fail) // NOLINT { - const char * task_name = "my_task_name2"; + const char* task_name = "my_task_name2"; const uint32_t stack_depth = 2048; const os_task_priority_t priority = 3; this->m_taskName.assign(task_name); diff --git a/tests/test_os_task/test_os_task_create_with_const_param.cpp b/tests/test_os_task/test_os_task_create_with_const_param.cpp index 7b03d44..2e68f73 100644 --- a/tests/test_os_task/test_os_task_create_with_const_param.cpp +++ b/tests/test_os_task/test_os_task_create_with_const_param.cpp @@ -15,7 +15,7 @@ struct tskTaskControlBlock }; static ATTR_NORETURN void -task_func_with_const_param(const void *p_param) +task_func_with_const_param(const void* p_param) { (void)p_param; while (true) @@ -27,7 +27,7 @@ task_func_with_const_param(const void *p_param) TEST_F(TestOsTask, os_task_create_with_const_param_ok) // NOLINT { - const char * task_name = "my_task_name2"; + const char* task_name = "my_task_name2"; const uint32_t stack_depth = 2048; const os_task_priority_t priority = 3; this->m_taskName.assign(task_name); @@ -44,8 +44,8 @@ TEST_F(TestOsTask, os_task_create_with_const_param_ok) // NOLINT ASSERT_EQ(&taskControlBlock, h_task); ASSERT_FALSE(g_pTestClass->m_is_static); ASSERT_EQ( - reinterpret_cast(g_pTestClass->m_createdTaskFunc), - reinterpret_cast(&task_func_with_const_param)); + reinterpret_cast(g_pTestClass->m_createdTaskFunc), + reinterpret_cast(&task_func_with_const_param)); ASSERT_EQ(g_pTestClass->m_createdTaskName, task_name); ASSERT_EQ(g_pTestClass->m_createdTaskStackDepth, stack_depth); ASSERT_EQ(g_pTestClass->m_createdTaskParam, &this->m_taskParam); @@ -60,7 +60,7 @@ TEST_F(TestOsTask, os_task_create_with_const_param_ok) // NOLINT TEST_F(TestOsTask, os_task_create_with_const_param_fail) // NOLINT { - const char * task_name = "my_task_name2"; + const char* task_name = "my_task_name2"; const uint32_t stack_depth = 2048; const os_task_priority_t priority = 3; this->m_taskName.assign(task_name); diff --git a/tests/test_os_task/test_os_task_create_without_param.cpp b/tests/test_os_task/test_os_task_create_without_param.cpp index 9c4c6ec..fdb630d 100644 --- a/tests/test_os_task/test_os_task_create_without_param.cpp +++ b/tests/test_os_task/test_os_task_create_without_param.cpp @@ -26,7 +26,7 @@ task_func_without_param() TEST_F(TestOsTask, os_task_create_with_without_param_ok) // NOLINT { - const char * task_name = "my_task_name2"; + const char* task_name = "my_task_name2"; const uint32_t stack_depth = 2048; const os_task_priority_t priority = 3; this->m_taskName.assign(task_name); @@ -39,8 +39,8 @@ TEST_F(TestOsTask, os_task_create_with_without_param_ok) // NOLINT ASSERT_EQ(g_pTestClass->m_createdTaskName, task_name); ASSERT_EQ(g_pTestClass->m_createdTaskStackDepth, stack_depth); ASSERT_EQ( - reinterpret_cast(&task_func_without_param), - reinterpret_cast(g_pTestClass->m_createdTaskParam)); + reinterpret_cast(&task_func_without_param), + reinterpret_cast(g_pTestClass->m_createdTaskParam)); ASSERT_EQ(g_pTestClass->m_createdTaskPriority, priority); TEST_CHECK_LOG_RECORD_WITH_THREAD( ESP_LOG_INFO, @@ -52,7 +52,7 @@ TEST_F(TestOsTask, os_task_create_with_without_param_ok) // NOLINT TEST_F(TestOsTask, os_task_create_without_param_fail) // NOLINT { - const char * task_name = "my_task_name2"; + const char* task_name = "my_task_name2"; const uint32_t stack_depth = 2048; const os_task_priority_t priority = 3; this->m_taskName.assign(task_name); diff --git a/tests/test_os_task_freertos/test_os_task_freertos.cpp b/tests/test_os_task_freertos/test_os_task_freertos.cpp index 2ebf7cf..c667798 100644 --- a/tests/test_os_task_freertos/test_os_task_freertos.cpp +++ b/tests/test_os_task_freertos/test_os_task_freertos.cpp @@ -24,10 +24,10 @@ typedef enum MainTaskCmd_Tag * *********************************************************************************/ class TestOsTaskFreertos; -static TestOsTaskFreertos *g_pTestClass; +static TestOsTaskFreertos* g_pTestClass; -static void * -freertosStartup(void *arg); +static void* +freertosStartup(void* arg); class TestOsTaskFreertos : public ::testing::Test { @@ -53,7 +53,7 @@ class TestOsTaskFreertos : public ::testing::Test { cmdQueue.push_and_wait(MainTaskCmd_Exit); vTaskEndScheduler(); - void *ret_code = nullptr; + void* ret_code = nullptr; pthread_join(pid, &ret_code); sem_destroy(&semaFreeRTOS); esp_log_wrapper_deinit(); @@ -100,9 +100,9 @@ sleep_ms(uint32_t msec) } // extern "C" static void -cmdHandlerTask(void *p_param) +cmdHandlerTask(void* p_param) { - auto *pObj = static_cast(p_param); + auto* pObj = static_cast(p_param); bool flagExit = false; sem_post(&pObj->semaFreeRTOS); while (!flagExit) @@ -123,10 +123,10 @@ cmdHandlerTask(void *p_param) vTaskDelete(nullptr); } -static void * -freertosStartup(void *arg) +static void* +freertosStartup(void* arg) { - auto * pObj = static_cast(arg); + auto* pObj = static_cast(arg); const bool res = xTaskCreate(&cmdHandlerTask, "cmdHandlerTask", configMINIMAL_STACK_SIZE, pObj, tskIDLE_PRIORITY + 1, nullptr); assert(res); @@ -138,9 +138,9 @@ freertosStartup(void *arg) * *******************************************************************************************************/ static ATTR_NORETURN void -task_func_infinite_with_param(void *p_arg) +task_func_infinite_with_param(void* p_arg) { - auto *p_counter = reinterpret_cast(p_arg); + auto* p_counter = reinterpret_cast(p_arg); for (;;) { *p_counter += 1; @@ -149,23 +149,23 @@ task_func_infinite_with_param(void *p_arg) } static void -task_func_finite_with_param(void *p_arg) +task_func_finite_with_param(void* p_arg) { - auto *p_counter = reinterpret_cast(p_arg); + auto* p_counter = reinterpret_cast(p_arg); *p_counter += 1; os_task_delay(10); } typedef struct PtrToCounter_t { - volatile uint32_t *p_counter; + volatile uint32_t* p_counter; } PtrToCounter_t; static ATTR_NORETURN void -task_func_infinite_with_const_param(const void *p_arg) +task_func_infinite_with_const_param(const void* p_arg) { - auto * p_param = reinterpret_cast(p_arg); - volatile uint32_t *p_counter = p_param->p_counter; + auto* p_param = reinterpret_cast(p_arg); + volatile uint32_t* p_counter = p_param->p_counter; for (;;) { *p_counter += 1; @@ -174,10 +174,10 @@ task_func_infinite_with_const_param(const void *p_arg) } static void -task_func_finite_with_const_param(const void *p_arg) +task_func_finite_with_const_param(const void* p_arg) { - auto * p_param = reinterpret_cast(p_arg); - volatile uint32_t *p_counter = p_param->p_counter; + auto* p_param = reinterpret_cast(p_arg); + volatile uint32_t* p_counter = p_param->p_counter; *p_counter += 1; os_task_delay(10); } @@ -185,7 +185,7 @@ task_func_finite_with_const_param(const void *p_arg) static ATTR_NORETURN void task_func_infinite_without_param() { - auto *p_counter = &g_pTestClass->m_counter; + auto* p_counter = &g_pTestClass->m_counter; for (;;) { *p_counter += 1; @@ -196,7 +196,7 @@ task_func_infinite_without_param() static void task_func_finite_without_param() { - auto *p_counter = &g_pTestClass->m_counter; + auto* p_counter = &g_pTestClass->m_counter; *p_counter += 1; os_task_delay(10); } @@ -212,7 +212,7 @@ TEST_F(TestOsTaskFreertos, test1) // NOLINT &task_func_infinite_with_param, "dyn_with_param", stack_depth, - reinterpret_cast(const_cast(&this->m_counter)), + reinterpret_cast(const_cast(&this->m_counter)), priority, &h_task)); sleep_ms(50); @@ -239,7 +239,7 @@ TEST_F(TestOsTaskFreertos, test1) // NOLINT &task_func_infinite_with_const_param, "dyn_with_cparam", stack_depth, - reinterpret_cast(&ptrToCounter), + reinterpret_cast(&ptrToCounter), priority, &h_task)); sleep_ms(50); @@ -284,7 +284,7 @@ TEST_F(TestOsTaskFreertos, test1) // NOLINT &task_func_finite_with_param, "dyn_fin_with_param", stack_depth, - reinterpret_cast(const_cast(&this->m_counter)), + reinterpret_cast(const_cast(&this->m_counter)), priority)); sleep_ms(50); const uint32_t saved_counter = this->m_counter; @@ -302,7 +302,7 @@ TEST_F(TestOsTaskFreertos, test1) // NOLINT &task_func_finite_with_const_param, "dyn_fin_with_cparam", stack_depth, - reinterpret_cast(&ptrToCounter), + reinterpret_cast(&ptrToCounter), priority)); sleep_ms(50); const uint32_t saved_counter = this->m_counter; @@ -332,7 +332,7 @@ TEST_F(TestOsTaskFreertos, test1) // NOLINT "dyn_with_param", &this->m_stack_mem[0], sizeof(this->m_stack_mem) / sizeof(this->m_stack_mem[0]), - reinterpret_cast(const_cast(&this->m_counter)), + reinterpret_cast(const_cast(&this->m_counter)), priority, &this->m_task_mem, &h_task)); @@ -360,7 +360,7 @@ TEST_F(TestOsTaskFreertos, test1) // NOLINT "dyn_with_cparam", &this->m_stack_mem[0], sizeof(this->m_stack_mem) / sizeof(this->m_stack_mem[0]), - reinterpret_cast(&ptrToCounter), + reinterpret_cast(&ptrToCounter), priority, &this->m_task_mem, &h_task)); @@ -407,7 +407,7 @@ TEST_F(TestOsTaskFreertos, test1) // NOLINT "dyn_fin_with_param", &this->m_stack_mem[0], sizeof(this->m_stack_mem) / sizeof(this->m_stack_mem[0]), - reinterpret_cast(const_cast(&this->m_counter)), + reinterpret_cast(const_cast(&this->m_counter)), priority, &this->m_task_mem)); sleep_ms(50); @@ -426,7 +426,7 @@ TEST_F(TestOsTaskFreertos, test1) // NOLINT "dyn_fin_with_cparam", &this->m_stack_mem[0], sizeof(this->m_stack_mem) / sizeof(this->m_stack_mem[0]), - reinterpret_cast(&ptrToCounter), + reinterpret_cast(&ptrToCounter), priority, &this->m_task_mem)); sleep_ms(50); diff --git a/tests/test_os_timer_freertos/test_os_timer_freertos.cpp b/tests/test_os_timer_freertos/test_os_timer_freertos.cpp index e8e0239..bdf2375 100644 --- a/tests/test_os_timer_freertos/test_os_timer_freertos.cpp +++ b/tests/test_os_timer_freertos/test_os_timer_freertos.cpp @@ -37,10 +37,10 @@ typedef enum MainTaskCmd_Tag * *********************************************************************************/ class TestOsTimerFreertos; -static TestOsTimerFreertos *g_pTestClass; +static TestOsTimerFreertos* g_pTestClass; -static void * -freertosStartup(void *arg); +static void* +freertosStartup(void* arg); class TestOsTimerFreertos : public ::testing::Test { @@ -66,7 +66,7 @@ class TestOsTimerFreertos : public ::testing::Test { cmdQueue.push_and_wait(MainTaskCmd_Exit); vTaskEndScheduler(); - void *ret_code = nullptr; + void* ret_code = nullptr; pthread_join(pid, &ret_code); sem_destroy(&semaFreeRTOS); esp_log_wrapper_deinit(); @@ -78,8 +78,8 @@ class TestOsTimerFreertos : public ::testing::Test TQueue cmdQueue; os_timer_periodic_static_t timer_periodic_static; os_timer_one_shot_static_t timer_one_shot_static; - os_timer_periodic_t * p_timer_periodic; - os_timer_one_shot_t * p_timer_one_shot; + os_timer_periodic_t* p_timer_periodic; + os_timer_one_shot_t* p_timer_one_shot; uint32_t counter; TestOsTimerFreertos(); @@ -128,7 +128,7 @@ get_uptime_ms(void) } static struct timespec -timespec_diff(const struct timespec *p_t2, const struct timespec *p_t1) +timespec_diff(const struct timespec* p_t2, const struct timespec* p_t1) { struct timespec result = { .tv_sec = p_t2->tv_sec - p_t1->tv_sec, @@ -143,7 +143,7 @@ timespec_diff(const struct timespec *p_t2, const struct timespec *p_t1) } static uint32_t -timespec_diff_ms(const struct timespec *p_t2, const struct timespec *p_t1) +timespec_diff_ms(const struct timespec* p_t2, const struct timespec* p_t1) { struct timespec diff = timespec_diff(p_t2, p_t1); return diff.tv_sec * 1000 + diff.tv_nsec / 1000000; @@ -185,25 +185,25 @@ TestOsTimerFreertos::delay_ms(const uint32_t timeout_ms) } static void -timer_callback_periodic(os_timer_periodic_t *p_timer, void *p_arg) +timer_callback_periodic(os_timer_periodic_t* p_timer, void* p_arg) { (void)p_timer; - auto *pObj = static_cast(p_arg); + auto* pObj = static_cast(p_arg); pObj->counter += 1; } static void -timer_callback_one_shot(os_timer_one_shot_t *p_timer, void *p_arg) +timer_callback_one_shot(os_timer_one_shot_t* p_timer, void* p_arg) { (void)p_timer; - auto *pObj = static_cast(p_arg); + auto* pObj = static_cast(p_arg); pObj->counter += 1; } static void -cmdHandlerTask(void *p_param) +cmdHandlerTask(void* p_param) { - auto *pObj = static_cast(p_param); + auto* pObj = static_cast(p_param); bool flagExit = false; sem_post(&pObj->semaFreeRTOS); while (!flagExit) @@ -271,10 +271,10 @@ cmdHandlerTask(void *p_param) vTaskDelete(nullptr); } -static void * -freertosStartup(void *arg) +static void* +freertosStartup(void* arg) { - auto * pObj = static_cast(arg); + auto* pObj = static_cast(arg); const bool res = xTaskCreate(&cmdHandlerTask, "cmdHandlerTask", configMINIMAL_STACK_SIZE, pObj, tskIDLE_PRIORITY + 1, nullptr); assert(res); diff --git a/tests/test_os_timer_sig_freertos/test_os_timer_sig_freertos.cpp b/tests/test_os_timer_sig_freertos/test_os_timer_sig_freertos.cpp index f819e7a..be47ab9 100644 --- a/tests/test_os_timer_sig_freertos/test_os_timer_sig_freertos.cpp +++ b/tests/test_os_timer_sig_freertos/test_os_timer_sig_freertos.cpp @@ -43,10 +43,10 @@ typedef enum MainTaskCmd_Tag * *********************************************************************************/ class TestOsTimerSigFreertos; -static TestOsTimerSigFreertos *g_pTestClass; +static TestOsTimerSigFreertos* g_pTestClass; -static void * -freertosStartup(void *arg); +static void* +freertosStartup(void* arg); class TestOsTimerSigFreertos : public ::testing::Test { @@ -72,7 +72,7 @@ class TestOsTimerSigFreertos : public ::testing::Test { cmdQueue.push_and_wait(MainTaskCmd_Exit); vTaskEndScheduler(); - void *ret_code = nullptr; + void* ret_code = nullptr; pthread_join(pid, &ret_code); sem_destroy(&semaFreeRTOS); esp_log_wrapper_deinit(); @@ -85,9 +85,9 @@ class TestOsTimerSigFreertos : public ::testing::Test os_timer_sig_periodic_static_t timer_sig_periodic_mem; os_timer_sig_one_shot_static_t timer_sig_one_shot_mem; bool result_run_signal_handler_task; - os_signal_t * p_signal; - os_timer_sig_periodic_t * p_timer_sig_periodic; - os_timer_sig_one_shot_t * p_timer_sig_one_shot; + os_signal_t* p_signal; + os_timer_sig_periodic_t* p_timer_sig_periodic; + os_timer_sig_one_shot_t* p_timer_sig_one_shot; uint32_t counter0; uint32_t counter1; @@ -143,7 +143,7 @@ get_uptime_ms(void) } static struct timespec -timespec_diff(const struct timespec *p_t2, const struct timespec *p_t1) +timespec_diff(const struct timespec* p_t2, const struct timespec* p_t1) { struct timespec result = { .tv_sec = p_t2->tv_sec - p_t1->tv_sec, @@ -158,7 +158,7 @@ timespec_diff(const struct timespec *p_t2, const struct timespec *p_t1) } static uint32_t -timespec_diff_ms(const struct timespec *p_t2, const struct timespec *p_t1) +timespec_diff_ms(const struct timespec* p_t2, const struct timespec* p_t1) { struct timespec diff = timespec_diff(p_t2, p_t1); return diff.tv_sec * 1000 + diff.tv_nsec / 1000000; @@ -221,9 +221,9 @@ TestOsTimerSigFreertos::delay_ms(const uint32_t timeout_ms) ATTR_NORETURN static void -signalHandlerTask1(void *p_param) +signalHandlerTask1(void* p_param) { - auto *pObj = static_cast(p_param); + auto* pObj = static_cast(p_param); pObj->p_signal = os_signal_create(); assert(nullptr != pObj->p_signal); if (!os_signal_add(pObj->p_signal, OS_SIGNAL_NUM_0)) @@ -259,9 +259,9 @@ signalHandlerTask1(void *p_param) } static void -cmdHandlerTask(void *p_param) +cmdHandlerTask(void* p_param) { - auto *pObj = static_cast(p_param); + auto* pObj = static_cast(p_param); bool flagExit = false; sem_post(&pObj->semaFreeRTOS); while (!flagExit) @@ -353,10 +353,10 @@ cmdHandlerTask(void *p_param) vTaskDelete(nullptr); } -static void * -freertosStartup(void *arg) +static void* +freertosStartup(void* arg) { - auto * pObj = static_cast(arg); + auto* pObj = static_cast(arg); const bool res = xTaskCreate(&cmdHandlerTask, "cmdHandlerTask", configMINIMAL_STACK_SIZE, pObj, tskIDLE_PRIORITY + 1, nullptr); assert(res); diff --git a/tests/test_str_buf/test_str_buf.cpp b/tests/test_str_buf/test_str_buf.cpp index 83c4b49..96addb0 100644 --- a/tests/test_str_buf/test_str_buf.cpp +++ b/tests/test_str_buf/test_str_buf.cpp @@ -14,7 +14,7 @@ using namespace std; /*** Google-test class implementation *********************************************************************************/ class TestStrBuf; -static TestStrBuf *g_pTestClass; +static TestStrBuf* g_pTestClass; class TestStrBuf : public ::testing::Test { @@ -51,19 +51,19 @@ TestStrBuf::~TestStrBuf() = default; extern "C" { -void * +void* os_malloc(size_t size) { if (g_pTestClass->m_flag_malloc_fail) { return nullptr; } - void *p_buf = malloc(size); + void* p_buf = malloc(size); return p_buf; } void -os_free_internal(void *p_buf) +os_free_internal(void* p_buf) { free(p_buf); } @@ -132,9 +132,9 @@ TEST_F(TestStrBuf, test_str_buf_init_with_alloc_and_free_buf) // NOLINT { const size_t len_of_str = 10; str_buf_t str_buf = { - .buf = nullptr, - .size = 0, - .idx = len_of_str, + .buf = nullptr, + .size = 0, + .idx = len_of_str, }; ASSERT_TRUE(str_buf_init_with_alloc(&str_buf)); ASSERT_NE(nullptr, str_buf.buf); @@ -151,9 +151,9 @@ TEST_F(TestStrBuf, test_str_buf_init_with_alloc_failed) // NOLINT { const size_t len_of_str = 10; str_buf_t str_buf = { - .buf = nullptr, - .size = 0, - .idx = len_of_str, + .buf = nullptr, + .size = 0, + .idx = len_of_str, }; this->m_flag_malloc_fail = true; ASSERT_FALSE(str_buf_init_with_alloc(&str_buf)); @@ -250,7 +250,7 @@ TEST_F(TestStrBuf, test_calc_length) // NOLINT TEST_F(TestStrBuf, test_null_str_buf) // NOLINT { - str_buf_t *p_str_buf = nullptr; + str_buf_t* p_str_buf = nullptr; ASSERT_FALSE(str_buf_printf(p_str_buf, "abc")); } @@ -281,7 +281,7 @@ TEST_F(TestStrBuf, test_fmt_null) // NOLINT char tmp_buf[10] = "undef"; str_buf_t str_buf = STR_BUF_INIT(tmp_buf, sizeof(tmp_buf)); - const char *fmt_null = nullptr; + const char* fmt_null = nullptr; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-security" ASSERT_FALSE(str_buf_printf(&str_buf, fmt_null));