]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Assume ANSI C header files and <ctype.h> functions.
authorBruno Haible <bruno@clisp.org>
Fri, 30 Jun 2006 14:19:23 +0000 (14:19 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:13:27 +0000 (12:13 +0200)
gettext-tools/ChangeLog
gettext-tools/configure.ac
gettext-tools/lib/ChangeLog
gettext-tools/lib/fnmatch.c
gettext-tools/lib/fnmatch_loop.c
gettext-tools/lib/getndelim2.c
gettext-tools/lib/mbswidth.c
gettext-tools/lib/strtol.c

index 4866d192afdbe167e99e6c64eb0de578d594a0f0..6245178eeeef0574670f64e79c14a18d31c90080 100644 (file)
@@ -1,3 +1,8 @@
+2006-06-27  Bruno Haible  <bruno@clisp.org>
+
+       Assume ANSI C header files and <ctype.h> functions.
+       * configure.ac: Remove AC_HEADER_STDC invocation.
+
 2006-06-27  Bruno Haible  <bruno@clisp.org>
 
        Assume vprintf function.
index eab42486a67afe78c752b37d1809c28e590973f3..7058f805d976d4de7bb7360ad21ee1fc0160d8b0 100644 (file)
@@ -131,7 +131,6 @@ fi
 AC_SUBST([MSGMERGE_LIBM])
 
 dnl Checks for header files.
-AC_HEADER_STDC
 AC_CHECK_HEADERS(limits.h malloc.h pwd.h string.h unistd.h utime.h values.h)
 gl_STDARG_H
 AM_STDBOOL_H
index 4a4b929edd21c1e904c92b7f8152e9344e417c54..edcb44bf790cfd53ce0b0e565889ddcfa1f1b616 100644 (file)
@@ -1,3 +1,19 @@
+2006-06-27  Bruno Haible  <bruno@clisp.org>
+
+       Assume ANSI C header files and <ctype.h> functions.
+       * fnmatch.c (ISASCII): Remove macro.
+       (isblank): Renamed from ISBLANK.
+       (isgraph): Renamed from isgraph.
+       (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT,
+       ISSPACE, ISUPPER, ISXDIGIT): Remove macros.
+       (FOLD): Update.
+       * fnmatch_loop.c (FCT): Update.
+       * getndelim2.c: Include <stdlib.h> always.
+       * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
+       (mbsnwidth): Use isprint, iscntrl instead.
+       * strtol.c (IN_CTYPE_DOMAIN): Remove macro.
+       (ISSPACE, ISALPHA, TOUPPER): Use isspace, isalpha, toupper directly.
+
 2006-06-28  Bruno Haible  <bruno@clisp.org>
 
         * xvasprintf.h: Update from gnulib.
index 80b8572590834a8d5e5ae9317c0748633717c451..81e3002dca4d9e6dd0fd271467fdaf6f7445e9c5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1993,1996-1999,2000-2005 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1993,1996-1999,2000-2006 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
@@ -85,34 +85,13 @@ extern int fnmatch (const char *pattern, const char *string, int flags);
 #if defined _LIBC || !defined __GNU_LIBRARY__ || !HAVE_FNMATCH_GNU
 
 
-# if defined STDC_HEADERS || !defined isascii
-#  define ISASCII(c) 1
-# else
-#  define ISASCII(c) isascii(c)
-# endif
-
-# ifdef isblank
-#  define ISBLANK(c) (ISASCII (c) && isblank (c))
-# else
-#  define ISBLANK(c) ((c) == ' ' || (c) == '\t')
+# ifndef isblank
+#  define isblank(c) ((c) == ' ' || (c) == '\t')
 # endif
-# ifdef isgraph
-#  define ISGRAPH(c) (ISASCII (c) && isgraph (c))
-# else
-#  define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c))
+# ifndef isgraph
+#  define isgraph(c) (isprint (c) && !isspace (c))
 # endif
 
-# define ISPRINT(c) (ISASCII (c) && isprint (c))
-# define ISDIGIT(c) (ISASCII (c) && isdigit (c))
-# define ISALNUM(c) (ISASCII (c) && isalnum (c))
-# define ISALPHA(c) (ISASCII (c) && isalpha (c))
-# define ISCNTRL(c) (ISASCII (c) && iscntrl (c))
-# define ISLOWER(c) (ISASCII (c) && islower (c))
-# define ISPUNCT(c) (ISASCII (c) && ispunct (c))
-# define ISSPACE(c) (ISASCII (c) && isspace (c))
-# define ISUPPER(c) (ISASCII (c) && isupper (c))
-# define ISXDIGIT(c) (ISASCII (c) && isxdigit (c))
-
 # define STREQ(s1, s2) ((strcmp (s1, s2) == 0))
 
 # if defined _LIBC || WIDE_CHAR_SUPPORT
@@ -171,7 +150,7 @@ static int posixly_correct;
 # ifdef _LIBC
 #  define FOLD(c) ((flags & FNM_CASEFOLD) ? tolower (c) : (c))
 # else
-#  define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
+#  define FOLD(c) ((flags & FNM_CASEFOLD) && isupper (c) ? tolower (c) : (c))
 # endif
 # define CHAR  char
 # define UCHAR unsigned char
index feb73c1b1851b840643364c421e97ec272cd371f..e6f0ef39f5e2da38d730edae47e8aa72526a9fd4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2004
+/* Copyright (C) 1991-1993,1996-1999,2000-2004,2006
        Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -288,18 +288,18 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
                      goto matched;
 # endif
 #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("cntrl")) && ISCNTRL ((UCHAR) *n))
-                       || (STREQ (str, L("digit")) && ISDIGIT ((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))
-                       || (STREQ (str, L("space")) && ISSPACE ((UCHAR) *n))
-                       || (STREQ (str, L("upper")) && ISUPPER ((UCHAR) *n))
-                       || (STREQ (str, L("xdigit")) && ISXDIGIT ((UCHAR) *n)))
+                   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("cntrl")) && iscntrl ((UCHAR) *n))
+                       || (STREQ (str, L("digit")) && isdigit ((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))
+                       || (STREQ (str, L("space")) && isspace ((UCHAR) *n))
+                       || (STREQ (str, L("upper")) && isupper ((UCHAR) *n))
+                       || (STREQ (str, L("xdigit")) && isxdigit ((UCHAR) *n)))
                      goto matched;
 #endif
                    c = *p++;
index 5adcabb66706ed2ec0dc3daf56c00589cec2411b..5c97e66109d2b39caa3c1287ea1fe4b73e635735 100644 (file)
@@ -1,7 +1,7 @@
 /* getndelim2 - Read a line from a stream, stopping at one of 2 delimiters,
    with bounded memory allocation.
 
-   Copyright (C) 1993, 1996-1998, 2000, 2003, 2005 Free Software
+   Copyright (C) 1993, 1996-1998, 2000, 2003, 2005-2006 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
 /* Specification.  */
 #include "getndelim2.h"
 
-#if STDC_HEADERS
-# include <stdlib.h>
-#else
-char *malloc (), *realloc ();
-#endif
+#include <stdlib.h>
 
 #include "unlocked-io.h"
 
index c1e3612e23b4f568850d9d5342aa7c4c7c444da7..6f04e21f7826b651be7266d993401b8be1815ad0 100644 (file)
@@ -1,5 +1,5 @@
 /* Determine the number of screen columns needed for a string.
-   Copyright (C) 2000-2004 Free Software Foundation, Inc.
+   Copyright (C) 2000-2004, 2006 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
@@ -75,18 +75,6 @@ int wcwidth ();
 # endif
 #endif
 
-/* Get ISPRINT.  */
-#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
-# define IN_CTYPE_DOMAIN(c) 1
-#else
-# define IN_CTYPE_DOMAIN(c) isascii(c)
-#endif
-/* Undefine to protect against the definition in wctype.h of Solaris 2.6.   */
-#undef ISPRINT
-#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (c))
-#undef ISCNTRL
-#define ISCNTRL(c) (IN_CTYPE_DOMAIN (c) && iscntrl (c))
-
 /* Returns the number of columns needed to represent the multibyte
    character string pointed to by STRING.  If a non-printable character
    occurs, and MBSW_REJECT_UNPRINTABLE is specified, -1 is returned.
@@ -208,10 +196,10 @@ mbsnwidth (const char *string, size_t nbytes, int flags)
     {
       unsigned char c = (unsigned char) *p++;
 
-      if (ISPRINT (c))
+      if (isprint (c))
        width++;
       else if (!(flags & MBSW_REJECT_UNPRINTABLE))
-       width += (ISCNTRL (c) ? 0 : 1);
+       width += (iscntrl (c) ? 0 : 1);
       else
        return -1;
     }
index 8a547ac15f48efda361b7e9f49fbece429d28d6f..b2c538520475e532ee3e7cdf7bc3f544ab3389fb 100644 (file)
 #  define TOUPPER(Ch) towupper (Ch)
 # endif
 #else
-# if defined STDC_HEADERS || (!defined isascii && !defined HAVE_ISASCII)
-#  define IN_CTYPE_DOMAIN(c) 1
-# else
-#  define IN_CTYPE_DOMAIN(c) isascii(c)
-# endif
 # define L_(Ch) Ch
 # define UCHAR_TYPE unsigned char
 # define STRING_TYPE char
 #  define ISALPHA(Ch) __isalpha_l ((Ch), loc)
 #  define TOUPPER(Ch) __toupper_l ((Ch), loc)
 # else
-#  define ISSPACE(Ch) (IN_CTYPE_DOMAIN (Ch) && isspace (Ch))
-#  define ISALPHA(Ch) (IN_CTYPE_DOMAIN (Ch) && isalpha (Ch))
-#  define TOUPPER(Ch) (IN_CTYPE_DOMAIN (Ch) ? toupper (Ch) : (Ch))
+#  define ISSPACE(Ch) isspace (Ch)
+#  define ISALPHA(Ch) isalpha (Ch)
+#  define TOUPPER(Ch) toupper (Ch)
 # endif
 #endif