|
From: openocd-gerrit <ope...@us...> - 2025-11-22 19:04:49
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 709e635b39235de2b97b03616003b3d845be36f4 (commit)
from d2aeb5fcc9eb1445684306441ea2524c4e196196 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 709e635b39235de2b97b03616003b3d845be36f4
Author: Antonio Borneo <bor...@gm...>
Date: Sun Nov 16 19:00:54 2025 +0100
helper: command: use COMMAND_HELPER for converted functions
Use COMMAND_HELPER for command_help_show_indent() and
command_help_show_wrap().
Change-Id: Ied0d5d3e1b702524dad0274cc12d146c6032a036
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/9238
Tested-by: jenkins
Reviewed-by: Evgeniy Naydanov <eu...@gm...>
diff --git a/src/helper/command.c b/src/helper/command.c
index 867a84013..6b5337f42 100644
--- a/src/helper/command.c
+++ b/src/helper/command.c
@@ -679,12 +679,15 @@ static COMMAND_HELPER(command_help_show_list, bool show_help, const char *cmd_ma
#define HELP_LINE_WIDTH(_n) (int)(76 - (2 * _n))
-static void command_help_show_indent(struct command_invocation *cmd, unsigned int n)
+static COMMAND_HELPER(command_help_show_indent, unsigned int n)
{
for (unsigned int i = 0; i < n; i++)
- command_print_sameline(cmd, " ");
+ command_print_sameline(CMD, " ");
+
+ return ERROR_OK;
}
-static void command_help_show_wrap(struct command_invocation *cmd,
+
+static COMMAND_HELPER(command_help_show_wrap,
const char *str, unsigned int n, unsigned int n2)
{
const char *cp = str, *last = str;
@@ -698,11 +701,13 @@ static void command_help_show_wrap(struct command_invocation *cmd,
} while ((next - last < HELP_LINE_WIDTH(n)) && *next != '\0');
if (next - last < HELP_LINE_WIDTH(n))
cp = next;
- command_help_show_indent(cmd, n);
- command_print(cmd, "%.*s", (int)(cp - last), last);
+ CALL_COMMAND_HANDLER(command_help_show_indent, n);
+ command_print(CMD, "%.*s", (int)(cp - last), last);
last = cp + 1;
n = n2;
}
+
+ return ERROR_OK;
}
static COMMAND_HELPER(command_help_show, struct help_entry *c,
@@ -721,10 +726,10 @@ static COMMAND_HELPER(command_help_show, struct help_entry *c,
if (is_match) {
if (c->usage && strlen(c->usage) > 0) {
char *msg = alloc_printf("%s %s", c->cmd_name, c->usage);
- command_help_show_wrap(CMD, msg, n, n + 5);
+ CALL_COMMAND_HANDLER(command_help_show_wrap, msg, n, n + 5);
free(msg);
} else {
- command_help_show_wrap(CMD, c->cmd_name, n, n + 5);
+ CALL_COMMAND_HANDLER(command_help_show_wrap, c->cmd_name, n, n + 5);
}
}
@@ -758,7 +763,7 @@ static COMMAND_HELPER(command_help_show, struct help_entry *c,
return ERROR_FAIL;
}
- command_help_show_wrap(CMD, msg, n + 3, n + 3);
+ CALL_COMMAND_HANDLER(command_help_show_wrap, msg, n + 3, n + 3);
free(msg);
}
-----------------------------------------------------------------------
Summary of changes:
src/helper/command.c | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|