This is an automated email from Gerrit.

Antonio Borneo ([email protected]) just uploaded a new patch set to 
Gerrit, which you can find at http://openocd.zylin.com/5791

-- gerrit

commit 36b815a90ce5be347f6300f79254380cea019184
Author: Antonio Borneo <[email protected]>
Date:   Mon Aug 3 23:03:46 2020 +0200

    helper/command: rename s/command_unknown/jim_command_dispatch/
    
    The function's name was consistent with it's purpose to handle
    commands that were not at root level, thus not directly 'known'
    by jimtcl.
    
    Rename it as jim_command_dispatch() to highlight that now it is
    a jim_handler and its purpose is to dispatch the call to the
    proper command handler.
    
    Change-Id: I9491a6d6459b8eb37a6c402abcae08388c693764
    Signed-off-by: Antonio Borneo <[email protected]>

diff --git a/src/helper/command.c b/src/helper/command.c
index d8da707..32f9d3a 100644
--- a/src/helper/command.c
+++ b/src/helper/command.c
@@ -51,7 +51,7 @@ struct log_capture_state {
 
 static int unregister_command(struct command_context *context,
        const char *cmd_prefix, const char *name);
-static int command_unknown(Jim_Interp *interp, int argc, Jim_Obj * const 
*argv);
+static int jim_command_dispatch(Jim_Interp *interp, int argc, Jim_Obj * const 
*argv);
 
 /* set of functions to wrap jimtcl internal data */
 static inline bool jimcmd_is_proc(Jim_Cmd *cmd)
@@ -61,7 +61,7 @@ static inline bool jimcmd_is_proc(Jim_Cmd *cmd)
 
 static inline bool jimcmd_is_ocd_command(Jim_Cmd *cmd)
 {
-       return !cmd->isproc && cmd->u.native.cmdProc == command_unknown;
+       return !cmd->isproc && cmd->u.native.cmdProc == jim_command_dispatch;
 }
 
 static inline void *jimcmd_privdata(Jim_Cmd *cmd)
@@ -306,7 +306,7 @@ static struct command *register_command(struct 
command_context *context,
 
        LOG_DEBUG("registering '%s'...", full_name);
        int retval = Jim_CreateCommand(context->interp, full_name,
-                               command_unknown, c, command_free);
+                               jim_command_dispatch, c, command_free);
        if (retval != JIM_OK) {
                command_run_linef(context, "del_help_text {%s}", full_name);
                command_run_linef(context, "del_usage_text {%s}", full_name);
@@ -780,7 +780,7 @@ static int exec_command(Jim_Interp *interp, struct 
command_context *cmd_ctx,
        return command_retval_set(interp, retval);
 }
 
-static int command_unknown(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
+static int jim_command_dispatch(Jim_Interp *interp, int argc, Jim_Obj *const 
*argv)
 {
        struct command *c = Jim_CmdPrivData(interp);
 
@@ -822,7 +822,7 @@ static int command_unknown(Jim_Interp *interp, int argc, 
Jim_Obj *const *argv)
         * current_target_override is used also for event handlers
         * therefore we prevent touching it if command has no prefix.
         * Previous override is saved and restored back to ensure
-        * correct work when command_unknown() is re-entered.
+        * correct work when jim_command_dispatch() is re-entered.
         */
        struct target *saved_target_override = cmd_ctx->current_target_override;
        if (c->jim_override_target)

-- 


_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to