+/*
+ * (C) Copyright 2014 Leo C. <erbl259-lmu@yahoo.de>
+ *
+ * (C) Copyright 2000-2009
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
/*
* Command Processor Table
*/
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
-#include <stdio.h>
#include "config.h"
#include "print-utils.h"
{
unsigned char c1, c2;
- while ((c1 = *(const FLASH unsigned char *)s1++)
+ while ((c1 = *(const FLASH unsigned char *)s1++)
== (c2 = *(const FLASH unsigned char *)s2++))
if (c1 == 0)
return 0;
return c1 - c2;
}
-int cmpstringp(const void *p1, const void *p2)
+int cmpstring_PP(const void *p1, const void *p2)
{
- return strcmp_PP((*(const FLASH cmd_tbl_t **) p1)->name,
+ return strcmp_PP((*(const FLASH cmd_tbl_t **) p1)->name,
(*(const FLASH cmd_tbl_t **) p2)->name);
}
}
/* Sort command list */
- qsort(cmd_array, cmd_items, sizeof (cmd_tbl_t *), cmpstringp);
+ qsort(cmd_array, cmd_items, sizeof (cmd_tbl_t *), cmpstring_PP);
/* print short help (usage) */
for (i = 0; i < cmd_items; i++) {
return CMD_RET_FAILURE;
if (usage == NULL)
continue;
-#ifdef GCC_BUG_61443
+#ifdef GCC_BUG_61443
print_usage_line(cmd_array[i]->name, max_len, usage);
#else
- printf_P(PSTR("%-" stringify(8) /*FIXME*/ "S - %S\n"),
+ printf_P(PSTR("%-" stringify(8) /*FIXME*/ "S - %S\n"),
cmd_array[i]->name, usage);
#endif
}
*/
for (i = 1; i < argc; ++i) {
if ((cmdtp = find_cmd_tbl (argv[i], cmd_start, cmd_items )) != NULL) {
- rcode = cmd_usage(cmdtp);
+ cmd_usage(cmdtp);
} else {
printf_P(PSTR("Unknown command '%s' - try 'help'"
" without arguments.\n\n"), argv[i]
for (cmdtp = table;
cmdtp != table + table_len;
cmdtp++) {
- if (strncmp_P (cmd, cmdtp->name, len) == 0) {
- if (len == strlen (cmdtp->name))
+ if (strncmp_P(cmd, cmdtp->name, len) == 0) {
+ if (len == strlen_P(cmdtp->name))
return cmdtp; /* full match */
cmdtp_temp = cmdtp; /* abbreviated command ? */