* lib/.cppi-disable: Add wcwidth.
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 6 Jul 2006 21:51:28 +0000 (21:51 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 6 Jul 2006 21:51:28 +0000 (21:51 +0000)
* 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.

16 files changed:
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

index 57a07aa..7106f0c 100644 (file)
@@ -42,3 +42,4 @@ time_r.h
 utimecmp.h
 vasnprintf.h
 vasprintf.h
+wcwidth.h
index a29f436..d749903 100644 (file)
@@ -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.
index a990add..3dfaf45 100644 (file)
 #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)
 
index 4fc19b4..bd41358 100644 (file)
@@ -86,15 +86,8 @@ extern int fnmatch (const char *pattern, const char *string, int flags);
 #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 @@ static int posixly_correct;
 # 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
index d86899b..308d311 100644 (file)
@@ -290,10 +290,10 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
 #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))
index 534e268..d874d68 100644 (file)
@@ -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 @@ lookup_word (parser_control const *pc, char *word)
   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++)
index 5023c34..43161d2 100644 (file)
 #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)
 
index b2c44fe..993c992 100644 (file)
@@ -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
 
index 00089be..bf4b7cb 100644 (file)
@@ -247,11 +247,11 @@ static struct numname { int num; char const name[8]; } numname_table[] =
 #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)
 
index cfeac4e..4a4ac06 100644 (file)
@@ -278,17 +278,12 @@ extern char *tzname[];
 #  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
index 6276bca..5361a5c 100644 (file)
 
 
 /* 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)
 
index b09c8d8..fbdc2f9 100644 (file)
 #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)
 
index a089b88..c26cfe7 100644 (file)
@@ -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
index d8b9382..ce94c84 100644 (file)
@@ -63,7 +63,7 @@ AS_IF([test $$2 = yes], [$3], [$4])
 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])
index 0919788..57fa8a4 100644 (file)
@@ -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_DEFUN([gl_PREREQ_TEMPNAME],
 [
   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])
 ])
index c600852..22d489d 100644 (file)
@@ -166,5 +166,6 @@ AC_DEFUN([gl_PREREQ_REGEX],
   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>])
 ])