From 90a6d2d2ff6c5977f2be027d42ebdca22d1e7262 Mon Sep 17 00:00:00 2001 From: Darian Leung <32921628+Dazza0@users.noreply.github.com> Date: Tue, 6 May 2025 10:46:07 +0800 Subject: [PATCH] chore: Run "c-code-style" astyle formatter on source/header files Ran `astyle --options="astyle-code-format.cfg" "./*.c,*.h"`. Fixed some trailing whitepsaces and indentation. --- dev/main.c | 2 +- lwshell/src/include/lwshell/lwshell_opt.h | 16 +++---- lwshell/src/lwshell/lwshell.c | 6 +-- tests/test.c | 54 +++++++++++------------ 4 files changed, 39 insertions(+), 39 deletions(-) diff --git a/dev/main.c b/dev/main.c index c83d314..69cd301 100644 --- a/dev/main.c +++ b/dev/main.c @@ -4,7 +4,7 @@ #include "lwshell/lwshell.h" /** - * \brief Reading one character at a time + * \brief Reading one character at a time * * This is useful to test the shell in a "raw" mode (non-canonical input) * Please note that conio.h is a windows only header diff --git a/lwshell/src/include/lwshell/lwshell_opt.h b/lwshell/src/include/lwshell/lwshell_opt.h index 85e9b40..dabf786 100644 --- a/lwshell/src/include/lwshell/lwshell_opt.h +++ b/lwshell/src/include/lwshell/lwshell_opt.h @@ -54,7 +54,7 @@ extern "C" { /** * \brief Memory set function - * + * * \note Function footprint is the same as \ref memset */ #ifndef LWSHELL_MEMSET @@ -63,7 +63,7 @@ extern "C" { /** * \brief Memory copy function - * + * * \note Function footprint is the same as \ref memcpy */ #ifndef LWSHELL_MEMCPY @@ -72,7 +72,7 @@ extern "C" { /** * \brief Enables `1` or disables `0` dynamic command register with \ref lwshell_register_cmd or \ref lwshell_register_cmd_ex functions - * + * * \note Set to `1` by default for backward compatibility * \sa LWSHELL_CFG_USE_STATIC_COMMANDS */ @@ -82,12 +82,12 @@ extern "C" { /** * \brief Enables `1` or disables `0` static command registration. - * + * * When enabled, a single register call is used where application * can pass constant array of the commands and respective callback functions. - * + * * This allows RAM reduction as lookup tables can be stored in the non-volatile memory - * + * * \note Set to `0` by default for backward compatibility * \sa LWSHELL_CFG_USE_DYNAMIC_COMMANDS */ @@ -97,7 +97,7 @@ extern "C" { /** * \brief Maximum number of different dynamic registered commands - * + * * \warning Deprecated and replaced with \ref LWSHELL_CFG_MAX_DYNAMIC_CMDS * \deprecated */ @@ -126,7 +126,7 @@ extern "C" { /** * \brief Maximum characters for command name in bytes. - * + * * \note Used only when \ref LWSHELL_CFG_USE_DYNAMIC_COMMANDS is enabled */ #ifndef LWSHELL_CFG_MAX_CMD_NAME_LEN diff --git a/lwshell/src/lwshell/lwshell.c b/lwshell/src/lwshell/lwshell.c index 86bbd11..22d7d77 100644 --- a/lwshell/src/lwshell/lwshell.c +++ b/lwshell/src/lwshell/lwshell.c @@ -93,7 +93,7 @@ prv_parse_input(lwshell_t* lwobj) { size_t s_len; char* str; - /* + /* * Check string length and compare with buffer pointer * Must be more than `1` character since we have to include end of line */ @@ -220,8 +220,8 @@ prv_parse_input(lwshell_t* lwobj) { #endif /* LWSHELL_CFG_USE_LIST_CMD */ } else { LWSHELL_OUTPUT(lwobj, LWSHELL_CFG_USE_LIST_CMD - ? "Unknown command, use listcmd to list available commands\r\n" - : "Unknown command\r\n"); + ? "Unknown command, use listcmd to list available commands\r\n" + : "Unknown command\r\n"); } } } diff --git a/tests/test.c b/tests/test.c index 6662065..c9649e4 100644 --- a/tests/test.c +++ b/tests/test.c @@ -11,40 +11,40 @@ static const test_str_t commands[] = { { .command = "test 123 456 789\n", .args_list = - { - "test", - "123", - "456", - "789", - }, + { + "test", + "123", + "456", + "789", + }, }, { .command = "test 123 longer text\n", .args_list = - { - "test", - "123", - "longer", - "text", - }, + { + "test", + "123", + "longer", + "text", + }, }, { .command = "test 123 \"longer text\"\n", .args_list = - { - "test", - "123", - "longer text", - }, + { + "test", + "123", + "longer text", + }, }, { .command = "test 123 \"longer text with \\\" quotes\"\n", .args_list = - { - "test", - "123", - "longer text with \\\" quotes", - }, + { + "test", + "123", + "longer text with \\\" quotes", + }, }, }; static uint32_t current_cmd_index; @@ -52,10 +52,10 @@ static int failed = 0; /** * \brief Test command function - * - * \param argc - * \param argv - * \return int32_t + * + * \param argc + * \param argv + * \return int32_t */ int32_t prv_test_cmd(int32_t argc, char** argv) { @@ -87,7 +87,7 @@ prv_test_cmd(int32_t argc, char** argv) { /** * \brief Global test run function - * + * */ int run_test(void) {