diff --git a/gcc/intl/ChangeLog b/gcc/intl/ChangeLog index a677ba5e467..4e11a8def2a 100644 --- a/gcc/intl/ChangeLog +++ b/gcc/intl/ChangeLog @@ -1,3 +1,14 @@ +2001-11-03 Kaveh R. Ghazi + + * l10nflist.c (_nl_normalize_codeset): Cast argument of ctype + function to `unsigned char'. + * loadmsgcat.c (_nl_load_domain): Likewise. + * localealias.c (read_alias_file, alias_compare): Likewise. + * localcharset.c: Include "gettextP.h". + * plural.y (__attribute__): Define. + (yyerror): Mark parameter with __attribute__ ((__unused__)). + * plural.c: Regenerate. + 2001-10-24 Zack Weinberg * loadmsgcat.c (INTTYPE_SIGNED, INTTYPE_MINIMUM, diff --git a/gcc/intl/l10nflist.c b/gcc/intl/l10nflist.c index 533e94be889..3a1cbd06500 100644 --- a/gcc/intl/l10nflist.c +++ b/gcc/intl/l10nflist.c @@ -356,11 +356,11 @@ _nl_normalize_codeset (codeset, name_len) 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; } @@ -374,9 +374,9 @@ _nl_normalize_codeset (codeset, name_len) 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'; diff --git a/gcc/intl/loadmsgcat.c b/gcc/intl/loadmsgcat.c index 7055e52fadc..bf444f6ddd4 100644 --- a/gcc/intl/loadmsgcat.c +++ b/gcc/intl/loadmsgcat.c @@ -521,7 +521,7 @@ _nl_load_domain (domain_file, domainbinding) 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); diff --git a/gcc/intl/localcharset.c b/gcc/intl/localcharset.c index 07c50589ed8..b528ea70272 100644 --- a/gcc/intl/localcharset.c +++ b/gcc/intl/localcharset.c @@ -55,6 +55,8 @@ # include #endif +#include "gettextP.h" + #ifndef DIRECTORY_SEPARATOR # define DIRECTORY_SEPARATOR '/' #endif diff --git a/gcc/intl/localealias.c b/gcc/intl/localealias.c index a1679bff4f7..85e5c90e3c2 100644 --- a/gcc/intl/localealias.c +++ b/gcc/intl/localealias.c @@ -244,21 +244,21 @@ read_alias_file (fname, fname_len) 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') @@ -267,7 +267,7 @@ read_alias_file (fname, fname_len) 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') @@ -390,8 +390,8 @@ alias_compare (map1, map2) { /* I know this seems to be odd but the tolower() function in some systems libc cannot handle nonalpha characters. */ - c1 = isupper (*p1) ? tolower (*p1) : *p1; - c2 = isupper (*p2) ? tolower (*p2) : *p2; + c1 = isupper ((unsigned char)*p1) ? tolower ((unsigned char)*p1) : *p1; + c2 = isupper ((unsigned char)*p2) ? tolower ((unsigned char)*p2) : *p2; if (c1 == '\0') break; ++p1; diff --git a/gcc/intl/plural.c b/gcc/intl/plural.c index 640d43cc561..7d7e6af7de1 100644 --- a/gcc/intl/plural.c +++ b/gcc/intl/plural.c @@ -1317,10 +1317,13 @@ yylex (lval, pexp) return result; } +#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) +#define __attribute__(x) +#endif static void yyerror (str) - const char *str; + const char *str __attribute__ ((__unused__)); { /* Do nothing. We don't print error messages here. */ } diff --git a/gcc/intl/plural.y b/gcc/intl/plural.y index be049a6d4ec..4eff3e03061 100644 --- a/gcc/intl/plural.y +++ b/gcc/intl/plural.y @@ -404,10 +404,13 @@ yylex (lval, pexp) return result; } +#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) +#define __attribute__(x) +#endif static void yyerror (str) - const char *str; + const char *str __attribute__ ((__unused__)); { /* Do nothing. We don't print error messages here. */ }