This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

intl patches (23)



A portability patch: ISO C says that the arguments of <ctype.h> functions
must be 'int's in the value range of an 'unsigned char', not 'char'.


2001-07-28  Bruno Haible  <bruno@clisp.org>

	* intl/l10nflist.c (_nl_normalize_codeset): Cast isalnum, isalpha,
	isdigit, tolower argument to 'unsigned char'.
	* intl/loadmsgcat.c (_nl_load_domain): Cast isspace argument to
	'unsigned char'.
	* intl/localealias.c (read_alias_file): Cast isspace argument to
	'unsigned char'.

--- glibc-20011110/intl/l10nflist.c.bak	Tue Jul 10 22:58:51 2001
+++ glibc-20011110/intl/l10nflist.c	Tue Nov 20 01:00:00 2001
@@ -368,11 +352,11 @@
   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;
       }
 
@@ -386,9 +370,9 @@
 	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';
--- glibc-20011110/intl/loadmsgcat.c.bak	Wed Nov 21 12:07:24 2001
+++ glibc-20011110/intl/loadmsgcat.c	Wed Nov 21 12:08:47 2001
@@ -492,7 +492,7 @@
 	  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);
--- glibc-20011110/intl/localealias.c.bak	Fri Jul 27 18:47:16 2001
+++ glibc-20011110/intl/localealias.c	Tue Nov 20 01:00:00 2001
@@ -277,21 +256,21 @@
 
       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')
@@ -300,7 +279,7 @@
 	      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')


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]