From: Paul Eggert <eggert@cs.ucla.edu>
Date: Wed, 10 Sep 2003 06:53:45 +0000 (+0000)
Subject: Remove K&R cruft.
X-Git-Tag: cvs-readonly~4511
X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=d01e199f674be88351d5956a13fe6dc406efacb5;p=gnulib.git

Remove K&R cruft.
---

diff --git a/lib/save-cwd.c b/lib/save-cwd.c
index b7b85a1b55..6fb39f0aa0 100644
--- a/lib/save-cwd.c
+++ b/lib/save-cwd.c
@@ -22,10 +22,7 @@
 #endif
 
 #include <stdio.h>
-
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-#endif
+#include <stdlib.h>
 
 #if HAVE_UNISTD_H
 # include <unistd.h>
diff --git a/lib/sha.c b/lib/sha.c
index 150bf0e422..b645bf4026 100644
--- a/lib/sha.c
+++ b/lib/sha.c
@@ -11,19 +11,13 @@
 # include <config.h>
 #endif
 
+#include "sha.h"
+
 #include <sys/types.h>
 
-#if STDC_HEADERS || defined _LIBC
-# include <stdlib.h>
-# include <string.h>
-#else
-# ifndef HAVE_MEMCPY
-#  define memcpy(d, s, n) bcopy ((s), (d), (n))
-# endif
-#endif
+#include <stdlib.h>
+#include <string.h>
 
-#include "md5.h"
-#include "sha.h"
 #include "unlocked-io.h"
 
 /*
diff --git a/lib/stat.c b/lib/stat.c
index 284da0cbc8..f8fc82ebce 100644
--- a/lib/stat.c
+++ b/lib/stat.c
@@ -31,12 +31,9 @@
 extern int errno;
 #endif
 #if defined LSTAT && ! LSTAT_FOLLOWS_SLASHED_SYMLINK
+# include <stdlib.h>
 # include <string.h>
 
-# if HAVE_STDLIB_H
-#  include <stdlib.h>
-# endif
-
 # ifdef STAT_MACROS_BROKEN
 #  undef S_ISLNK
 # endif
@@ -49,13 +46,6 @@ extern int errno;
 #  endif
 # endif
 
-# ifndef HAVE_DECL_FREE
-"this configure-time declaration test was not run"
-# endif
-# if !HAVE_DECL_FREE
-void free ();
-# endif
-
 # include "xalloc.h"
 
 /* lstat works differently on Linux and Solaris systems.  POSIX (see
diff --git a/lib/xgetcwd.c b/lib/xgetcwd.c
index ed425200d0..2089b8897c 100644
--- a/lib/xgetcwd.c
+++ b/lib/xgetcwd.c
@@ -28,10 +28,8 @@ extern int errno;
 #endif
 
 #include <sys/types.h>
+#include <stdlib.h>
 
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
 #if HAVE_UNISTD_H
 # include <unistd.h>
 #endif
diff --git a/m4/getcwd.m4 b/m4/getcwd.m4
index 7790dde1ac..159aa2bafe 100644
--- a/m4/getcwd.m4
+++ b/m4/getcwd.m4
@@ -1,6 +1,6 @@
 # getcwd.m4 - check whether getcwd (NULL, 0) allocates memory for result
 
-# Copyright 2001 Free Software Foundation, Inc.
+# Copyright (C) 2001, 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
@@ -20,14 +20,12 @@
 
 AC_DEFUN([AC_FUNC_GETCWD_NULL],
   [
-   AC_CHECK_HEADERS_ONCE(stdlib.h unistd.h)
+   AC_CHECK_HEADERS_ONCE(unistd.h)
    AC_CACHE_CHECK([whether getcwd (NULL, 0) allocates memory for result],
      [ac_cv_func_getcwd_null],
      [AC_TRY_RUN(
         [
-#	 ifdef HAVE_STDLIB_H
-#	  include <stdlib.h>
-#	 endif
+#	 include <stdlib.h>
 #	 ifdef HAVE_UNISTD_H
 #	  include <unistd.h>
 #	 endif
diff --git a/m4/save-cwd.m4 b/m4/save-cwd.m4
index fcafca9137..f127222813 100644
--- a/m4/save-cwd.m4
+++ b/m4/save-cwd.m4
@@ -1,5 +1,5 @@
-# save-cwd.m4 serial 1
-dnl Copyright (C) 2002 Free Software Foundation, Inc.
+# save-cwd.m4 serial 2
+dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 dnl This file is free software, distributed under the terms of the GNU
 dnl General Public License.  As a special exception to the GNU General
 dnl Public License, this file may be distributed as part of a program
@@ -9,7 +9,6 @@ dnl the same distribution terms as the rest of that program.
 AC_DEFUN([gl_SAVE_CWD],
 [
   dnl Prerequisites for lib/save-cwd.c.
-  AC_REQUIRE([AC_HEADER_STDC])
   AC_CHECK_HEADERS_ONCE(fcntl.h unistd.h)
   AC_CHECK_FUNCS(fchdir)
 ])
diff --git a/m4/xgetcwd.m4 b/m4/xgetcwd.m4
index efd30af3f0..48b77a16e6 100644
--- a/m4/xgetcwd.m4
+++ b/m4/xgetcwd.m4
@@ -1,5 +1,5 @@
-# xgetcwd.m4 serial 1
-dnl Copyright (C) 2002 Free Software Foundation, Inc.
+# xgetcwd.m4 serial 2
+dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 dnl This file is free software, distributed under the terms of the GNU
 dnl General Public License.  As a special exception to the GNU General
 dnl Public License, this file may be distributed as part of a program
@@ -9,7 +9,7 @@ dnl the same distribution terms as the rest of that program.
 AC_DEFUN([gl_XGETCWD],
 [
   dnl Prerequisites of lib/xgetcwd.c.
-  AC_CHECK_HEADERS_ONCE(stdlib.h unistd.h)
+  AC_CHECK_HEADERS_ONCE(unistd.h)
   AC_CHECK_FUNCS(getcwd)
   AC_FUNC_GETCWD_NULL
 ])