From d01e199f674be88351d5956a13fe6dc406efacb5 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 10 Sep 2003 06:53:45 +0000 Subject: [PATCH] Remove K&R cruft. --- lib/save-cwd.c | 5 +---- lib/sha.c | 14 ++++---------- lib/stat.c | 12 +----------- lib/xgetcwd.c | 4 +--- m4/getcwd.m4 | 8 +++----- m4/save-cwd.m4 | 5 ++--- m4/xgetcwd.m4 | 6 +++--- 7 files changed, 15 insertions(+), 39 deletions(-) diff --git a/lib/save-cwd.c b/lib/save-cwd.c index b7b85a1b5..6fb39f0aa 100644 --- a/lib/save-cwd.c +++ b/lib/save-cwd.c @@ -22,10 +22,7 @@ #endif #include - -#ifdef STDC_HEADERS -# include -#endif +#include #if HAVE_UNISTD_H # include diff --git a/lib/sha.c b/lib/sha.c index 150bf0e42..b645bf402 100644 --- a/lib/sha.c +++ b/lib/sha.c @@ -11,19 +11,13 @@ # include #endif +#include "sha.h" + #include -#if STDC_HEADERS || defined _LIBC -# include -# include -#else -# ifndef HAVE_MEMCPY -# define memcpy(d, s, n) bcopy ((s), (d), (n)) -# endif -#endif +#include +#include -#include "md5.h" -#include "sha.h" #include "unlocked-io.h" /* diff --git a/lib/stat.c b/lib/stat.c index 284da0cbc..f8fc82ebc 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 # include -# if HAVE_STDLIB_H -# include -# 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 ed425200d..2089b8897 100644 --- a/lib/xgetcwd.c +++ b/lib/xgetcwd.c @@ -28,10 +28,8 @@ extern int errno; #endif #include +#include -#if HAVE_STDLIB_H -# include -#endif #if HAVE_UNISTD_H # include #endif diff --git a/m4/getcwd.m4 b/m4/getcwd.m4 index 7790dde1a..159aa2baf 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 -# endif +# include # ifdef HAVE_UNISTD_H # include # endif diff --git a/m4/save-cwd.m4 b/m4/save-cwd.m4 index fcafca913..f12722281 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 efd30af3f..48b77a16e 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 ]) -- 2.11.0