Remove K&R cruft.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 9 Sep 2003 06:48:57 +0000 (06:48 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 9 Sep 2003 06:48:57 +0000 (06:48 +0000)
lib/fnmatch.c
lib/fnmatch_.h
lib/fnmatch_loop.c
m4/fnmatch.m4

index 73dc0e7..fe4e502 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2000, 2001,
-   2002 Free Software Foundation, Inc.
+   2002, 2003 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
@@ -45,23 +45,14 @@ char *alloca ();
 # define __builtin_expect(expr, expected) (expr)
 #endif
 
-#include <assert.h>
-#include <errno.h>
 #include <fnmatch.h>
-#include <ctype.h>
-
-#if HAVE_STRING_H || defined _LIBC
-# include <string.h>
-#else
-# if HAVE_STRINGS_H
-#  include <strings.h>
-# endif
-#endif
 
-#if defined STDC_HEADERS || defined _LIBC
-# include <stddef.h>
-# include <stdlib.h>
-#endif
+#include <assert.h>
+#include <ctype.h>
+#include <errno.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
 
 #define WIDE_CHAR_SUPPORT (HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_BTOWC)
 
@@ -178,10 +169,6 @@ extern int fnmatch (const char *pattern, const char *string, int flags);
 /* Avoid depending on library functions or files
    whose names are inconsistent.  */
 
-# if !defined _LIBC && !defined getenv && !HAVE_DECL_GETENV
-extern char *getenv ();
-# endif
-
 # ifndef errno
 extern int errno;
 # endif
@@ -328,10 +315,7 @@ is_char_class (const wchar_t *wcs)
 
 
 int
-fnmatch (pattern, string, flags)
-     const char *pattern;
-     const char *string;
-     int flags;
+fnmatch (const char *pattern, const char *string, int flags)
 {
 # if HANDLE_MULTIBYTE
   if (__builtin_expect (MB_CUR_MAX, 1) != 1)
index 5d83ac9..87e661f 100644 (file)
 extern "C" {
 # endif
 
-# if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
-#  if !defined __GLIBC__ || !defined __P
-#   undef      __P
-#   define __P(protos) protos
-#  endif
-# else /* Not C++ or ANSI C.  */
-#  undef       __P
-#  define __P(protos)  ()
-/* We can get away without defining `const' here only because in this file
-   it is used only inside the prototype for `fnmatch', which is elided in
-   non-ANSI C where `const' is problematical.  */
-# endif /* C++ or ANSI C.  */
-
 /* We #undef these before defining them because some losing systems
    (HP-UX A.08.07 for example) define these in <unistd.h>.  */
 # undef        FNM_PATHNAME
@@ -66,8 +53,8 @@ extern "C" {
 
 /* Match NAME against the filename pattern PATTERN,
    returning zero if it matches, FNM_NOMATCH if not.  */
-extern int fnmatch __P ((const char *__pattern, const char *__name,
-                        int __flags));
+extern int fnmatch (const char *__pattern, const char *__name,
+                   int __flags);
 
 # ifdef        __cplusplus
 }
index 932d907..a83dd96 100644 (file)
@@ -17,9 +17,6 @@
 
 /* Match STRING against the filename pattern PATTERN, returning zero if
    it matches, nonzero if not.  */
-static int FCT (const CHAR *pattern, const CHAR *string,
-               const CHAR *string_end, int no_leading_period, int flags)
-     internal_function;
 static int EXT (INT opt, const CHAR *pattern, const CHAR *string,
                const CHAR *string_end, int no_leading_period, int flags)
      internal_function;
@@ -27,12 +24,8 @@ static const CHAR *END (const CHAR *patternp) internal_function;
 
 static int
 internal_function
-FCT (pattern, string, string_end, no_leading_period, flags)
-     const CHAR *pattern;
-     const CHAR *string;
-     const CHAR *string_end;
-     int no_leading_period;
-     int flags;
+FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
+     int no_leading_period, int flags)
 {
   register const CHAR *p = pattern, *n = string;
   register UCHAR c;
index befb73e..ba2a88f 100644 (file)
@@ -77,14 +77,6 @@ FNMATCH_H=fnmatch.h
 ])# _AC_LIBOBJ_FNMATCH
 
 
-# Additional prerequisites of lib/fnmatch.c, not part of _AC_LIBOBJ_FNMATCH.
-AC_DEFUN([gl_PREREQ_FNMATCH_EXTRA],
-[
-  AC_REQUIRE([AC_HEADER_STDC])
-  AC_CHECK_HEADERS_ONCE(string.h strings.h)
-])
-
-
 AC_DEFUN([gl_FUNC_FNMATCH_POSIX],
 [
   FNMATCH_H=
@@ -92,7 +84,6 @@ AC_DEFUN([gl_FUNC_FNMATCH_POSIX],
                       [rm -f lib/fnmatch.h],
                       [_AC_LIBOBJ_FNMATCH])
   if test $ac_cv_func_fnmatch_posix != yes; then
-    gl_PREREQ_FNMATCH_EXTRA
     dnl We must choose a different name for our function, since on ELF systems
     dnl a broken fnmatch() in libc.so would override our fnmatch() if it is
     dnl compiled into a shared library.
@@ -113,7 +104,6 @@ AC_DEFUN([gl_FUNC_FNMATCH_GNU],
                       [rm -f lib/fnmatch.h],
                       [_AC_LIBOBJ_FNMATCH])
   if test $ac_cv_func_fnmatch_gnu != yes; then
-    gl_PREREQ_FNMATCH_EXTRA
     dnl We must choose a different name for our function, since on ELF systems
     dnl a broken fnmatch() in libc.so would override our fnmatch() if it is
     dnl compiled into a shared library.