+2001-07-28 Bruno Haible <haible@clisp.cons.org>
+
+ * l10nflist.c (_nl_normalize_codeset): Cast isalnum, isalpha, isdigit,
+ tolower argument to 'unsigned char'.
+ * loadmsgcat.c (_nl_load_domain): Cast isspace argument to
+ 'unsigned char'.
+ * localealias.c (read_alias_file): Cast isspace argument to
+ 'unsigned char'.
+
2001-07-23 Bruno Haible <haible@clisp.cons.org>
* gettext.h: Assume <limits.h> exists.
size_t cnt;
for (cnt = 0; cnt < name_len; ++cnt)
- if (isalnum (codeset[cnt]))
+ if (isalnum ((unsigned char) codeset[cnt]))
{
++len;
- if (isalpha (codeset[cnt]))
+ if (isalpha ((unsigned char) codeset[cnt]))
only_digit = 0;
}
wp = retval;
for (cnt = 0; cnt < name_len; ++cnt)
- if (isalpha (codeset[cnt]))
- *wp++ = tolower (codeset[cnt]);
- else if (isdigit (codeset[cnt]))
+ if (isalpha ((unsigned char) codeset[cnt]))
+ *wp++ = tolower ((unsigned char) codeset[cnt]);
+ else if (isdigit ((unsigned char) codeset[cnt]))
*wp++ = codeset[cnt];
*wp = '\0';
struct parse_args args;
nplurals += 9;
- while (*nplurals != '\0' && isspace (*nplurals))
+ while (*nplurals != '\0' && isspace ((unsigned char) *nplurals))
++nplurals;
#if defined HAVE_STRTOUL || defined _LIBC
n = strtoul (nplurals, &endp, 10);
cp = buf;
/* Ignore leading white space. */
- while (isspace (cp[0]))
+ while (isspace ((unsigned char) cp[0]))
++cp;
/* A leading '#' signals a comment line. */
if (cp[0] != '\0' && cp[0] != '#')
{
alias = cp++;
- while (cp[0] != '\0' && !isspace (cp[0]))
+ while (cp[0] != '\0' && !isspace ((unsigned char) cp[0]))
++cp;
/* Terminate alias name. */
if (cp[0] != '\0')
*cp++ = '\0';
/* Now look for the beginning of the value. */
- while (isspace (cp[0]))
+ while (isspace ((unsigned char) cp[0]))
++cp;
if (cp[0] != '\0')
size_t value_len;
value = cp++;
- while (cp[0] != '\0' && !isspace (cp[0]))
+ while (cp[0] != '\0' && !isspace ((unsigned char) cp[0]))
++cp;
/* Terminate value. */
if (cp[0] == '\n')
+2001-07-28 Bruno Haible <haible@clisp.cons.org>
+
+ * printf-parse.h: Don't include <ctype.h>.
+ (ISDIGIT): New macro.
+ (read_int, parse_one_spec): Use ISDIGIT instead of isdigit.
+
2001-08-05 Bruno Haible <haible@clisp.cons.org>
* stdbool.h.in (_Bool): Define differently in C++ mode.
/* Internal header for parsing printf format strings.
- Copyright (C) 1995, 1996, 1998, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1995-1996, 1998, 2000, 2001 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
/* We use some extension so define this here. */
#define _GNU_SOURCE 1
-#include <ctype.h>
#include <printf.h>
#if HAVE_STDDEF_H
# include <stddef.h>
# endif
#endif
+/* Locale independent test for a decimal digit.
+ Argument can be 'char' or 'unsigned char'. (Whereas the argument of
+ isdigit must be an 'unsigned char'.) */
+#define ISDIGIT(c) ((unsigned int) ((c) - '0') < 10)
+
struct printf_spec
{
/* Information parsed from the format spec. */
{
unsigned int retval = **pstr - '0';
- while (isdigit (*++(*pstr)))
+ while (ISDIGIT (*++(*pstr)))
{
retval *= 10;
retval += **pstr - '0';
spec->info.pad = ' ';
/* Test for positional argument. */
- if (isdigit (*format))
+ if (ISDIGIT (*format))
{
const char *begin = format;
A negative field width indicates left justification. */
const char *begin = ++format;
- if (isdigit (*format))
+ if (ISDIGIT (*format))
{
/* The width argument might be found in a positional parameter. */
n = read_int (&format);
format = begin; /* Step back and reread. */
}
}
- else if (isdigit (*format))
+ else if (ISDIGIT (*format))
/* Constant width specification. */
spec->info.width = read_int (&format);
/* The precision is given in an argument. */
const char *begin = ++format;
- if (isdigit (*format))
+ if (ISDIGIT (*format))
{
n = read_int (&format);
format = begin;
}
}
- else if (isdigit (*format))
+ else if (ISDIGIT (*format))
spec->info.prec = read_int (&format);
else
/* "%.?" is treated like "%.0?". */
+2001-07-28 Bruno Haible <haible@clisp.cons.org>
+
+ * po-lex.c: Include c-ctype.h instead of <ctype.h>.
+ (control_sequence): Use C locale character classifications.
+ * xgettext.c (main): Cast isspace argument to 'unsigned char'.
+
2001-07-28 Bruno Haible <haible@clisp.cons.org>
* po-lex.h (lex_start, lex_end): New declarations.
# include "config.h"
#endif
-#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <stdio.h>
# include <iconv.h>
#endif
+#include "c-ctype.h"
#include "linebreak.h"
#include "libgettext.h"
#define _(str) gettext(str)
case 'x':
lex_getc (mbc);
- if (mb_iseof (mbc) || mb_len (mbc) != 1 || !isxdigit (mb_ptr (mbc) [0]))
+ if (mb_iseof (mbc) || mb_len (mbc) != 1
+ || !c_isxdigit (mb_ptr (mbc) [0]))
break;
val = 0;
{
char c = mb_ptr (mbc) [0];
val *= 16;
- if (isdigit (c))
+ if (c_isdigit (c))
/* Warning: not portable, can't depend on '0'..'9' ordering */
val += c - '0';
- else if (isupper (c))
+ else if (c_isupper (c))
/* Warning: not portable, can't depend on 'A'..'F' ordering */
val += c - 'A' + 10;
else
add_all_comments = false;
comment_tag = optarg;
/* We ignore leading white space. */
- while (isspace (*comment_tag))
+ while (isspace ((unsigned char) *comment_tag))
++comment_tag;
}
break;