]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - avr/command.c
VT100/ANSI parser
[z180-stamp.git] / avr / command.c
index 2b53adfe921beb3d5a837021dbf0bea087593d5f..c080527bb166822847f78cc17bb903f66dc81e40 100644 (file)
@@ -6,8 +6,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
-#include <stdio.h>
-#include <avr/pgmspace.h>
 
 #include "config.h"
 #include "print-utils.h"
@@ -36,7 +34,7 @@ int strcmp_PP(const FLASH char *s1, const FLASH char *s2)
 {
        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;
@@ -44,9 +42,9 @@ int strcmp_PP(const FLASH char *s1, const FLASH char *s2)
        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);
 }
 
@@ -88,7 +86,7 @@ command_ret_t _do_help(cmd_tbl_t *cmd_start, int cmd_items, cmd_tbl_t * cmdtp,
                }
 
                /* 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++) {
@@ -99,10 +97,10 @@ command_ret_t _do_help(cmd_tbl_t *cmd_start, int cmd_items, cmd_tbl_t * cmdtp,
                                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
                }