helper/jim-nvp: comply with coding style [2/2]

With the API fixed to comply with OpenOCD coding style, fix all
the references in the code.

Patch generated automatically with the script below.
The list is in reverse order to replace a common prefix after the
replacement of the symbols with the same prefix.

%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---
(cat << EOF
Jim_SetResult_NvpUnknown         jim_set_result_nvp_unknown
Jim_Nvp_value2name_simple        jim_nvp_value2name_simple
Jim_Nvp_value2name_obj           jim_nvp_value2name_obj
Jim_Nvp_value2name               jim_nvp_value2name
Jim_Nvp_name2value_simple        jim_nvp_name2value_simple
Jim_Nvp_name2value_obj_nocase    jim_nvp_name2value_obj_nocase
Jim_Nvp_name2value_obj           jim_nvp_name2value_obj
Jim_Nvp_name2value_nocase_simple jim_nvp_name2value_nocase_simple
Jim_Nvp_name2value_nocase        jim_nvp_name2value_nocase
Jim_Nvp_name2value               jim_nvp_name2value
Jim_Nvp                        struct jim_nvp
Jim_GetOpt_Wide                  jim_getopt_wide
Jim_GetOpt_String                jim_getopt_string
Jim_GetOpt_Setup                 jim_getopt_setup
Jim_GetOpt_Obj                   jim_getopt_obj
Jim_GetOpt_NvpUnknown            jim_getopt_nvp_unknown
Jim_GetOpt_Nvp                   jim_getopt_nvp
Jim_GetOpt_Enum                  jim_getopt_enum
Jim_GetOpt_Double                jim_getopt_double
Jim_GetOpt_Debug                 jim_getopt_debug
Jim_GetOptInfo                 struct jim_getopt_info
Jim_GetNvp                       jim_get_nvp
Jim_Debug_ArgvString             jim_debug_argv_string
EOF
) | while read a b; do
    sed -i "s/$a/$b/g" $(find src -type f ! -name jim-nvp.\? )
done
%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---

Change-Id: I10a12bd64bb8b17575fd9150482c989c92b298a2
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/6184
Reviewed-by: Marc Schink <dev@zapb.de>
Tested-by: jenkins
This commit is contained in:
Antonio Borneo
2021-04-25 00:48:14 +02:00
parent b8e18d292e
commit 9e7b31479b
21 changed files with 316 additions and 316 deletions

View File

@@ -28,11 +28,11 @@
#include <transport/transport.h>
#include <helper/time_support.h>
static int jim_newtap_expected_id(Jim_Nvp *n, Jim_GetOptInfo *goi,
static int jim_newtap_expected_id(struct jim_nvp *n, struct jim_getopt_info *goi,
struct jtag_tap *pTap)
{
jim_wide w;
int e = Jim_GetOpt_Wide(goi, &w);
int e = jim_getopt_wide(goi, &w);
if (e != JIM_OK) {
Jim_SetResultFormatted(goi->interp, "option: %s bad parameter",
n->name);
@@ -60,14 +60,14 @@ static int jim_newtap_expected_id(Jim_Nvp *n, Jim_GetOptInfo *goi,
#define NTAP_OPT_EXPECTED_ID 5
#define NTAP_OPT_VERSION 6
static int jim_hl_newtap_cmd(Jim_GetOptInfo *goi)
static int jim_hl_newtap_cmd(struct jim_getopt_info *goi)
{
struct jtag_tap *pTap;
int x;
int e;
Jim_Nvp *n;
struct jim_nvp *n;
char *cp;
const Jim_Nvp opts[] = {
const struct jim_nvp opts[] = {
{ .name = "-irlen", .value = NTAP_OPT_IRLEN },
{ .name = "-irmask", .value = NTAP_OPT_IRMASK },
{ .name = "-ircapture", .value = NTAP_OPT_IRCAPTURE },
@@ -95,10 +95,10 @@ static int jim_hl_newtap_cmd(Jim_GetOptInfo *goi)
}
const char *tmp;
Jim_GetOpt_String(goi, &tmp, NULL);
jim_getopt_string(goi, &tmp, NULL);
pTap->chip = strdup(tmp);
Jim_GetOpt_String(goi, &tmp, NULL);
jim_getopt_string(goi, &tmp, NULL);
pTap->tapname = strdup(tmp);
/* name + dot + name + null */
@@ -111,9 +111,9 @@ static int jim_hl_newtap_cmd(Jim_GetOptInfo *goi)
pTap->chip, pTap->tapname, pTap->dotted_name, goi->argc);
while (goi->argc) {
e = Jim_GetOpt_Nvp(goi, opts, &n);
e = jim_getopt_nvp(goi, opts, &n);
if (e != JIM_OK) {
Jim_GetOpt_NvpUnknown(goi, opts, 0);
jim_getopt_nvp_unknown(goi, opts, 0);
free(cp);
free(pTap);
return e;
@@ -132,7 +132,7 @@ static int jim_hl_newtap_cmd(Jim_GetOptInfo *goi)
case NTAP_OPT_IRMASK:
case NTAP_OPT_IRCAPTURE:
/* dummy read to ignore the next argument */
Jim_GetOpt_Wide(goi, NULL);
jim_getopt_wide(goi, NULL);
break;
} /* switch (n->value) */
} /* while (goi->argc) */
@@ -146,7 +146,7 @@ static int jim_hl_newtap_cmd(Jim_GetOptInfo *goi)
int jim_hl_newtap(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
{
Jim_GetOptInfo goi;
Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
struct jim_getopt_info goi;
jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
return jim_hl_newtap_cmd(&goi);
}