From: H. Peter Anvin Date: Wed, 6 Jun 2007 01:18:02 +0000 (-0700) Subject: Unify hexval functions; fix % in printf string X-Git-Tag: syslinux-3.50-pre20~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f8d8735f2cc92796d84e0af8d46132ad51a61e68;p=profile%2Fivi%2Fsyslinux.git Unify hexval functions; fix % in printf string --- diff --git a/com32/modules/menu.h b/com32/modules/menu.h index e6fcbcd..933df43 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 107a1d0..80e5231 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 a2f9cfd..c9453a4 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]); }