changeset 6932:6aeb4d6c28d9

* lib/.cppi-disable: Add wcwidth. * lib/fnmatch.c (ISBLANK): Remove. All uses changed to isblank. (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro. (ISGRAPH): Remove. All uses changed to isgraph. (FOLD) [!defined _LIBC]: Remove special case. * lib/getdate.y (lookup_word): Remove no-longer-needed call to islower. * lib/regext_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not HAVE_ISBLANK. * lib/strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case. * m4/fnmatch.m4 (_AC_LIBOBJ_FNMATCH): Don't check for getenv decl; no longer needed. Check for isblank decl. * m4/mkstemp.m4 (gl_PREREQ_TEMPNAME): Don't check for getenv decl. * m4/regex.m4 (gl_PREREQ_REGEX): Dheck for isblank decl instead of existence.
author Paul Eggert <eggert@cs.ucla.edu>
date Thu, 06 Jul 2006 21:51:28 +0000
parents 5ea6fd01516c
children 53581389f883
files lib/.cppi-disable lib/ChangeLog lib/backupfile.c lib/fnmatch.c lib/fnmatch_loop.c lib/getdate.y lib/posixtm.c lib/regex_internal.h lib/sig2str.c lib/strftime.c lib/strverscmp.c lib/userspec.c m4/ChangeLog m4/fnmatch.m4 m4/mkstemp.m4 m4/regex.m4
diffstat 16 files changed, 55 insertions(+), 51 deletions(-) [+]
line wrap: on
line diff
--- a/lib/.cppi-disable
+++ b/lib/.cppi-disable
@@ -42,3 +42,4 @@
 utimecmp.h
 vasnprintf.h
 vasprintf.h
+wcwidth.h
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,15 @@
+2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
+
+	* .cppi-disable: Add wcwidth.
+	* fnmatch.c (ISBLANK): Remove.  All uses changed to isblank.
+	(isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
+	(ISGRAPH): Remove.  All uses changed to isgraph.
+	(FOLD) [!defined _LIBC]: Remove special case.
+	* getdate.y (lookup_word): Remove no-longer-needed call to islower.
+	* regext_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
+	HAVE_ISBLANK.
+	* strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
+
 2006-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
 	* strtod.c (strtod): cast the argument of tolower to unsigned char.
--- a/lib/backupfile.c
+++ b/lib/backupfile.c
@@ -95,11 +95,11 @@
 #endif
 
 /* ISDIGIT differs from isdigit, as follows:
-   - Its arg may be any int or unsigned int; it need not be an unsigned char.
-   - It's guaranteed to evaluate its argument exactly once.
+   - Its arg may be any int or unsigned int; it need not be an unsigned char
+     or EOF.
    - It's typically faster.
    POSIX says that only '0' through '9' are digits.  Prefer ISDIGIT to
-   ISDIGIT_LOCALE unless it's important to use the locale's definition
+   ISDIGIT unless it's important to use the locale's definition
    of `digit' even when the host does not conform to POSIX.  */
 #define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9)
 
--- a/lib/fnmatch.c
+++ b/lib/fnmatch.c
@@ -86,15 +86,8 @@
 #if defined _LIBC || !defined __GNU_LIBRARY__ || !HAVE_FNMATCH_GNU
 
 
-# ifdef isblank
-#  define ISBLANK(c) isblank (c)
-# else
-#  define ISBLANK(c) ((c) == ' ' || (c) == '\t')
-# endif
-# ifdef isgraph
-#  define ISGRAPH(c) isgraph (c)
-# else
-#  define ISGRAPH(c) (isprint (c) && !isspace (c))
+# if ! (defined isblank || HAVE_DECL_ISBLANK)
+#  define isblank(c) ((c) == ' ' || (c) == '\t')
 # endif
 
 # define STREQ(s1, s2) ((strcmp (s1, s2) == 0))
@@ -152,11 +145,7 @@
 # endif
 
 /* Note that this evaluates C many times.  */
-# ifdef _LIBC
-#  define FOLD(c) ((flags & FNM_CASEFOLD) ? tolower (c) : (c))
-# else
-#  define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
-# endif
+# define FOLD(c) ((flags & FNM_CASEFOLD) ? tolower (c) : (c))
 # define CHAR	char
 # define UCHAR	unsigned char
 # define INT	int
--- a/lib/fnmatch_loop.c
+++ b/lib/fnmatch_loop.c
@@ -290,10 +290,10 @@
 #else
 		    if ((STREQ (str, L_("alnum")) && isalnum ((UCHAR) *n))
 			|| (STREQ (str, L_("alpha")) && isalpha ((UCHAR) *n))
-			|| (STREQ (str, L_("blank")) && ISBLANK ((UCHAR) *n))
+			|| (STREQ (str, L_("blank")) && isblank ((UCHAR) *n))
 			|| (STREQ (str, L_("cntrl")) && iscntrl ((UCHAR) *n))
 			|| (STREQ (str, L_("digit")) && isdigit ((UCHAR) *n))
-			|| (STREQ (str, L_("graph")) && ISGRAPH ((UCHAR) *n))
+			|| (STREQ (str, L_("graph")) && isgraph ((UCHAR) *n))
 			|| (STREQ (str, L_("lower")) && islower ((UCHAR) *n))
 			|| (STREQ (str, L_("print")) && isprint ((UCHAR) *n))
 			|| (STREQ (str, L_("punct")) && ispunct ((UCHAR) *n))
--- a/lib/getdate.y
+++ b/lib/getdate.y
@@ -70,8 +70,8 @@
 
 
 /* ISDIGIT differs from isdigit, as follows:
-   - Its arg may be any int or unsigned int; it need not be an unsigned char.
-   - It's guaranteed to evaluate its argument exactly once.
+   - Its arg may be any int or unsigned int; it need not be an unsigned char
+     or EOF.
    - It's typically faster.
    POSIX says that only '0' through '9' are digits.  Prefer ISDIGIT to
    isdigit unless it's important to use the locale's definition
@@ -887,8 +887,7 @@
   for (p = word; *p; p++)
     {
       unsigned char ch = *p;
-      if (islower (ch))
-	*p = toupper (ch);
+      *p = toupper (ch);
     }
 
   for (tp = meridian_table; tp->name; tp++)
--- a/lib/posixtm.c
+++ b/lib/posixtm.c
@@ -44,11 +44,11 @@
 #endif
 
 /* ISDIGIT differs from isdigit, as follows:
-   - Its arg may be any int or unsigned int; it need not be an unsigned char.
-   - It's guaranteed to evaluate its argument exactly once.
+   - Its arg may be any int or unsigned int; it need not be an unsigned char
+     or EOF.
    - It's typically faster.
    POSIX says that only '0' through '9' are digits.  Prefer ISDIGIT to
-   ISDIGIT_LOCALE unless it's important to use the locale's definition
+   isdigit unless it's important to use the locale's definition
    of `digit' even when the host does not conform to POSIX.  */
 #define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9)
 
--- a/lib/regex_internal.h
+++ b/lib/regex_internal.h
@@ -56,7 +56,7 @@
 #endif
 
 /* In case that the system doesn't have isblank().  */
-#if !defined _LIBC && !defined HAVE_ISBLANK && !defined isblank
+#if !defined _LIBC && !HAVE_DECL_ISBLANK && !defined isblank
 # define isblank(ch) ((ch) == ' ' || (ch) == '\t')
 #endif
 
--- a/lib/sig2str.c
+++ b/lib/sig2str.c
@@ -247,11 +247,11 @@
 #define NUMNAME_ENTRIES (sizeof numname_table / sizeof numname_table[0])
 
 /* ISDIGIT differs from isdigit, as follows:
-   - Its arg may be any int or unsigned int; it need not be an unsigned char.
-   - It's guaranteed to evaluate its argument exactly once.
+   - Its arg may be any int or unsigned int; it need not be an unsigned char
+     or EOF.
    - It's typically faster.
    POSIX says that only '0' through '9' are digits.  Prefer ISDIGIT to
-   ISDIGIT_LOCALE unless it's important to use the locale's definition
+   isdigit unless it's important to use the locale's definition
    of `digit' even when the host does not conform to POSIX.  */
 #define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9)
 
--- a/lib/strftime.c
+++ b/lib/strftime.c
@@ -278,17 +278,12 @@
 #  define TOLOWER(Ch, L) towlower (Ch)
 # endif
 #else
-# ifdef _LIBC
-#  ifdef USE_IN_EXTENDED_LOCALE_MODEL
-#   define TOUPPER(Ch, L) __toupper_l (Ch, L)
-#   define TOLOWER(Ch, L) __tolower_l (Ch, L)
-#  else
-#   define TOUPPER(Ch, L) toupper (Ch)
-#   define TOLOWER(Ch, L) tolower (Ch)
-#  endif
+# ifdef USE_IN_EXTENDED_LOCALE_MODEL
+#  define TOUPPER(Ch, L) __toupper_l (Ch, L)
+#  define TOLOWER(Ch, L) __tolower_l (Ch, L)
 # else
-#  define TOUPPER(Ch, L) (islower (Ch) ? toupper (Ch) : (Ch))
-#  define TOLOWER(Ch, L) (isupper (Ch) ? tolower (Ch) : (Ch))
+#  define TOUPPER(Ch, L) toupper (Ch)
+#  define TOLOWER(Ch, L) tolower (Ch)
 # endif
 #endif
 /* We don't use `isdigit' here since the locale dependent
--- a/lib/strverscmp.c
+++ b/lib/strverscmp.c
@@ -37,11 +37,11 @@
 
 
 /* ISDIGIT differs from isdigit, as follows:
-   - Its arg may be any int or unsigned int; it need not be an unsigned char.
-   - It's guaranteed to evaluate its argument exactly once.
+   - Its arg may be any int or unsigned int; it need not be an unsigned char
+     or EOF.
    - It's typically faster.
    POSIX says that only '0' through '9' are digits.  Prefer ISDIGIT to
-   ISDIGIT_LOCALE unless it's important to use the locale's definition
+   isdigit unless it's important to use the locale's definition
    of `digit' even when the host does not conform to POSIX.  */
 #define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9)
 
--- a/lib/userspec.c
+++ b/lib/userspec.c
@@ -76,11 +76,11 @@
 #endif
 
 /* ISDIGIT differs from isdigit, as follows:
-   - Its arg may be any int or unsigned int; it need not be an unsigned char.
-   - It's guaranteed to evaluate its argument exactly once.
+   - Its arg may be any int or unsigned int; it need not be an unsigned char
+     or EOF.
    - It's typically faster.
    POSIX says that only '0' through '9' are digits.  Prefer ISDIGIT to
-   ISDIGIT_LOCALE unless it's important to use the locale's definition
+   isdigit unless it's important to use the locale's definition
    of `digit' even when the host does not conform to POSIX.  */
 #define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9)
 
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,3 +1,11 @@
+2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
+
+	* fnmatch.m4 (_AC_LIBOBJ_FNMATCH): Don't check for getenv decl;
+	no longer needed.  Check for isblank decl.
+	* mkstemp.m4 (gl_PREREQ_TEMPNAME): Don't check for getenv decl.
+	* regex.m4 (gl_PREREQ_REGEX): Dheck for isblank decl instead
+	of existence.
+
 2006-07-05  Paul Eggert  <eggert@cs.ucla.edu>
 
 	* xstrtol.m4 (gl_PREREQ_XSTRTOL): Use AC_CHECK_DECLS_ONCE
--- a/m4/fnmatch.m4
+++ b/m4/fnmatch.m4
@@ -63,7 +63,7 @@
 AC_DEFUN([_AC_LIBOBJ_FNMATCH],
 [AC_REQUIRE([AC_FUNC_ALLOCA])dnl
 AC_REQUIRE([AC_TYPE_MBSTATE_T])dnl
-AC_CHECK_DECLS([getenv])
+AC_CHECK_DECLS([isblank], [], [], [#include <ctype.h>])
 AC_CHECK_FUNCS([btowc mbsrtowcs mempcpy wmemchr wmemcpy wmempcpy])
 AC_CHECK_HEADERS([wchar.h wctype.h])
 AC_LIBOBJ([fnmatch])
--- a/m4/mkstemp.m4
+++ b/m4/mkstemp.m4
@@ -1,6 +1,6 @@
-#serial 12
+#serial 13
 
-# Copyright (C) 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -67,6 +67,5 @@
 [
   AC_CHECK_HEADERS_ONCE(sys/time.h)
   AC_CHECK_FUNCS(__secure_getenv gettimeofday)
-  AC_CHECK_DECLS_ONCE(getenv)
   AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])
 ])
--- a/m4/regex.m4
+++ b/m4/regex.m4
@@ -166,5 +166,6 @@
   AC_REQUIRE([gl_C_RESTRICT])
   AC_REQUIRE([AM_LANGINFO_CODESET])
   AC_CHECK_HEADERS_ONCE([locale.h wchar.h wctype.h])
-  AC_CHECK_FUNCS_ONCE([isblank mbrtowc mempcpy wcrtomb wcscoll])
+  AC_CHECK_FUNCS_ONCE([mbrtowc mempcpy wcrtomb wcscoll])
+  AC_CHECK_DECLS([isblank], [], [], [#include <ctype.h>])
 ])