From cb9819cbb9261bd50c3466cf0a4cd873f0d7ebd7 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 3 Oct 2008 14:04:31 +0200 Subject: [PATCH] Add a comment. --- ChangeLog | 5 +++++ lib/c-ctype.h | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2a2ac3f8b..3967763d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-10-03 Bruno Haible + + * lib/c-ctype.h: Add comment. + Reported by Jim Meyering. + 2008-10-02 Bruno Haible * modules/posix_spawn-internal (Depends-on): Add 'open'. diff --git a/lib/c-ctype.h b/lib/c-ctype.h index b26eccfb3..f3f9ab9d4 100644 --- a/lib/c-ctype.h +++ b/lib/c-ctype.h @@ -5,7 +5,7 @@ functions' behaviour depends on the current locale set via setlocale. - Copyright (C) 2000-2003, 2006 Free Software Foundation, Inc. + Copyright (C) 2000-2003, 2006, 2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -103,6 +103,21 @@ extern "C" { /* Function declarations. */ +/* Unlike the functions in , which require an argument in the range + of the 'unsigned char' type, the functions here operate on values that are + in the 'unsigned char' range or in the 'char' range. In other words, + when you have a 'char' value, you need to cast it before using it as + argument to a function: + + const char *s = ...; + if (isalpha ((unsigned char) *s)) ... + + but you don't need to cast it for the functions defined in this file: + + const char *s = ...; + if (c_isalpha (*s)) ... + */ + extern bool c_isascii (int c); /* not locale dependent */ extern bool c_isalnum (int c); -- 2.11.0