diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-06-05 18:18:02 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2007-06-05 18:18:02 -0700 |
commit | f8d8735f2cc92796d84e0af8d46132ad51a61e68 (patch) | |
tree | bc5aa6870fd67bfed74736d192ba4ded7f7378e5 | |
parent | 82ad8f00df11a959ccf7febf8aa825e38718de3d (diff) | |
download | syslinux-f8d8735f2cc92796d84e0af8d46132ad51a61e68.tar.gz |
Unify hexval functions; fix % in printf string
-rw-r--r-- | com32/modules/menu.h | 4 | ||||
-rw-r--r-- | com32/modules/printmsg.c | 14 | ||||
-rw-r--r-- | com32/modules/readconfig.c | 6 |
3 files changed, 8 insertions, 16 deletions
diff --git a/com32/modules/menu.h b/com32/modules/menu.h index e6fcbcd0..933df43c 100644 --- a/com32/modules/menu.h +++ b/com32/modules/menu.h @@ -119,6 +119,10 @@ static inline int my_isspace(char c) return (unsigned char)c <= ' '; } +int my_isxdigit(char c); +unsigned int hexval(char c); +unsigned int hexval2(const char *p); + int menu_main(int argc, char *argv[]); void console_prepare(void); void console_cleanup(void); diff --git a/com32/modules/printmsg.c b/com32/modules/printmsg.c index 107a1d0e..80e52318 100644 --- a/com32/modules/printmsg.c +++ b/com32/modules/printmsg.c @@ -19,18 +19,6 @@ int (*draw_background)(const char *filename); -static int hexval(int c) -{ - if (c >= '0' && c <= '9') - return c-'0'; - - c |= 0x20; - if (c >= 'a' && c <= 'f') - return c-'a'+10; - - return 0; -} - static int draw_message_file(const char *filename) { FILE *f; @@ -49,7 +37,7 @@ static int draw_message_file(const char *filename) return -1; /* Clear screen, hide cursor, default attribute */ - printf("\033e\033%@\033)0\033(B\3#%03d\033[?25l\033[2J\033[H", + printf("\033e\033%%@\033)0\033(B\3#%03d\033[?25l\033[2J\033[H", message_base_color+0x07); while (!eof && (ch = getc(f)) != EOF) { diff --git a/com32/modules/readconfig.c b/com32/modules/readconfig.c index a2f9cfd8..c9453a4b 100644 --- a/com32/modules/readconfig.c +++ b/com32/modules/readconfig.c @@ -312,7 +312,7 @@ dup_word(char **p) return dp; } -static int my_isxdigit(char c) +int my_isxdigit(char c) { unsigned int uc = c; @@ -320,7 +320,7 @@ static int my_isxdigit(char c) ((uc|0x20)-'a') < 6; } -static unsigned int hexval(char c) +unsigned int hexval(char c) { unsigned char uc = c | 0x20; unsigned int v; @@ -332,7 +332,7 @@ static unsigned int hexval(char c) return uc-'a'+10; } -static unsigned int hexval2(const char *p) +unsigned int hexval2(const char *p) { return (hexval(p[0]) << 4)+hexval(p[1]); } |