From: David Lawrence Ramsey Date: Sun, 28 May 2006 17:30:28 +0000 (+0000) Subject: more cosmetic fixes X-Git-Tag: v1.3.12~90 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=7f1b1198a7a609b1d9d9ec700788dc14d1ff6c1f;p=nano.git more cosmetic fixes git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3590 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/src/proto.h b/src/proto.h index 6d356108..17e9653b 100644 --- a/src/proto.h +++ b/src/proto.h @@ -729,8 +729,8 @@ int get_escape_seq_abcd(int kbinput); int parse_escape_seq_kbinput(int kbinput); int get_byte_kbinput(int kbinput); #ifdef ENABLE_UTF8 -long get_unicode_kbinput(int kbinput); long add_unicode_digit(int kbinput, long factor, long *uni); +long get_unicode_kbinput(int kbinput); #endif int get_control_kbinput(int kbinput); void unparse_kbinput(char *output, size_t output_len); diff --git a/src/winio.c b/src/winio.c index c5de60e1..3ff44380 100644 --- a/src/winio.c +++ b/src/winio.c @@ -1254,6 +1254,24 @@ int get_byte_kbinput(int kbinput) } #ifdef ENABLE_UTF8 +/* If the character in kbinput is a valid hexadecimal digit, multiply it + * by factor and add the result to uni. */ +long add_unicode_digit(int kbinput, long factor, long *uni) +{ + long retval = ERR; + + if ('0' <= kbinput && kbinput <= '9') + *uni += (kbinput - '0') * factor; + else if ('a' <= tolower(kbinput) && tolower(kbinput) <= 'f') + *uni += (tolower(kbinput) - 'a' + 10) * factor; + else + /* If this character isn't a valid hexadecimal value, save it as + * the result. */ + retval = kbinput; + + return retval; +} + /* Translate a Unicode sequence: turn a six-digit hexadecimal number * (from 000000 to 10FFFF, case-insensitive) into its corresponding * multibyte value. */ @@ -1336,24 +1354,6 @@ long get_unicode_kbinput(int kbinput) return retval; } - -/* If the character in kbinput is a valid hexadecimal digit, multiply it - * by factor and add the result to uni. */ -long add_unicode_digit(int kbinput, long factor, long *uni) -{ - long retval = ERR; - - if ('0' <= kbinput && kbinput <= '9') - *uni += (kbinput - '0') * factor; - else if ('a' <= tolower(kbinput) && tolower(kbinput) <= 'f') - *uni += (tolower(kbinput) - 'a' + 10) * factor; - else - /* If this character isn't a valid hexadecimal value, save it as - * the result. */ - retval = kbinput; - - return retval; -} #endif /* ENABLE_UTF8 */ /* Translate a control character sequence: turn an ASCII non-control