diff options
author | Bruno Haible <bruno@clisp.org> | 2006-06-30 14:19:23 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-06-23 12:13:27 +0200 |
commit | 5128887c91036ba23bf8faea7642e49542ca9724 (patch) | |
tree | c3ebb26a0e3cc5e638508a6989ff249361d127d1 | |
parent | a7ec2e51a265c2faf8cc55cf0fa9a99de93d5819 (diff) | |
download | external_gettext-5128887c91036ba23bf8faea7642e49542ca9724.zip external_gettext-5128887c91036ba23bf8faea7642e49542ca9724.tar.gz external_gettext-5128887c91036ba23bf8faea7642e49542ca9724.tar.bz2 |
Assume ANSI C header files and <ctype.h> functions.
-rw-r--r-- | gettext-tools/ChangeLog | 5 | ||||
-rw-r--r-- | gettext-tools/configure.ac | 1 | ||||
-rw-r--r-- | gettext-tools/lib/ChangeLog | 16 | ||||
-rw-r--r-- | gettext-tools/lib/fnmatch.c | 33 | ||||
-rw-r--r-- | gettext-tools/lib/fnmatch_loop.c | 26 | ||||
-rw-r--r-- | gettext-tools/lib/getndelim2.c | 8 | ||||
-rw-r--r-- | gettext-tools/lib/mbswidth.c | 18 | ||||
-rw-r--r-- | gettext-tools/lib/strtol.c | 11 |
8 files changed, 48 insertions, 70 deletions
diff --git a/gettext-tools/ChangeLog b/gettext-tools/ChangeLog index 4866d19..6245178 100644 --- a/gettext-tools/ChangeLog +++ b/gettext-tools/ChangeLog @@ -1,5 +1,10 @@ 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. * configure.ac: Remove AC_FUNC_VPRINTF invocation. * Makefile.am (config.h_vms, config.h.msvc): Remove unused HAVE_VPRINTF diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac index eab4248..7058f80 100644 --- a/gettext-tools/configure.ac +++ b/gettext-tools/configure.ac @@ -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 diff --git a/gettext-tools/lib/ChangeLog b/gettext-tools/lib/ChangeLog index 4a4b929..edcb44b 100644 --- a/gettext-tools/lib/ChangeLog +++ b/gettext-tools/lib/ChangeLog @@ -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. diff --git a/gettext-tools/lib/fnmatch.c b/gettext-tools/lib/fnmatch.c index 80b8572..81e3002 100644 --- a/gettext-tools/lib/fnmatch.c +++ b/gettext-tools/lib/fnmatch.c @@ -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 diff --git a/gettext-tools/lib/fnmatch_loop.c b/gettext-tools/lib/fnmatch_loop.c index feb73c1..e6f0ef3 100644 --- a/gettext-tools/lib/fnmatch_loop.c +++ b/gettext-tools/lib/fnmatch_loop.c @@ -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++; diff --git a/gettext-tools/lib/getndelim2.c b/gettext-tools/lib/getndelim2.c index 5adcabb..5c97e66 100644 --- a/gettext-tools/lib/getndelim2.c +++ b/gettext-tools/lib/getndelim2.c @@ -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 @@ -27,11 +27,7 @@ /* Specification. */ #include "getndelim2.h" -#if STDC_HEADERS -# include <stdlib.h> -#else -char *malloc (), *realloc (); -#endif +#include <stdlib.h> #include "unlocked-io.h" diff --git a/gettext-tools/lib/mbswidth.c b/gettext-tools/lib/mbswidth.c index c1e3612..6f04e21 100644 --- a/gettext-tools/lib/mbswidth.c +++ b/gettext-tools/lib/mbswidth.c @@ -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; } diff --git a/gettext-tools/lib/strtol.c b/gettext-tools/lib/strtol.c index 8a547ac..b2c5385 100644 --- a/gettext-tools/lib/strtol.c +++ b/gettext-tools/lib/strtol.c @@ -192,11 +192,6 @@ # 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 @@ -205,9 +200,9 @@ # 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 |