From 610929c6edc41aee01cd3f8f1fe36aa6c30c0606 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Wed, 12 Jan 2005 18:46:08 +0000 Subject: [PATCH] the is_xxx_char() functions should take unsigned ints for consistency git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2254 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- src/chars.c | 6 +++--- src/proto.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/chars.c b/src/chars.c index de28d420..64a15e44 100644 --- a/src/chars.c +++ b/src/chars.c @@ -38,7 +38,7 @@ #endif /* This function is equivalent to isblank(). */ -bool is_blank_char(unsigned char c) +bool is_blank_char(unsigned int c) { return #ifdef HAVE_ISBLANK @@ -86,9 +86,9 @@ bool is_blank_wchar(wchar_t wc) /* This function is equivalent to iscntrl(), except in that it also * handles control characters with their high bits set. */ -bool is_cntrl_char(unsigned char c) +bool is_cntrl_char(unsigned int c) { - return (c < 32) || (127 <= c && c < 160); + return (0 <= c && c < 32) || (127 <= c && c < 160); } /* This function is equivalent to iscntrl() for multibyte characters, diff --git a/src/proto.h b/src/proto.h index 2e4c768e..6b6396da 100644 --- a/src/proto.h +++ b/src/proto.h @@ -151,12 +151,12 @@ extern char *homedir; /* Functions we want available. */ /* Public functions in chars.c. */ -bool is_blank_char(unsigned char c); +bool is_blank_char(unsigned int c); bool is_blank_mbchar(const char *c); #ifdef NANO_WIDE bool is_blank_wchar(wchar_t wc); #endif -bool is_cntrl_char(unsigned char c); +bool is_cntrl_char(unsigned int c); bool is_cntrl_mbchar(const char *c); #ifdef NANO_WIDE bool is_cntrl_wchar(wchar_t wc); -- 2.39.5