From 16271524e244ae459ad147f9511c49c2efcf3498 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 9 Sep 2003 21:46:50 +0000 Subject: [PATCH] Remove K&R cruft. --- lib/group-member.c | 10 ++++------ lib/idcache.c | 7 +------ lib/makepath.c | 17 ++++------------- lib/malloc.c | 6 ++---- lib/realloc.c | 11 +++-------- m4/group-member.m4 | 3 +-- m4/idcache.m4 | 7 +++---- m4/makepath.m4 | 7 +++---- 8 files changed, 21 insertions(+), 47 deletions(-) diff --git a/lib/group-member.c b/lib/group-member.c index 900c6c846..8823506b0 100644 --- a/lib/group-member.c +++ b/lib/group-member.c @@ -19,18 +19,16 @@ # include #endif +#include "group-member.h" + #include #include - -#ifdef STDC_HEADERS -# include -#endif +#include #if HAVE_UNISTD_H # include #endif -#include "group-member.h" #include "xalloc.h" struct group_info @@ -127,7 +125,7 @@ group_member (gid_t gid) char *program_name; int -main (int argc, char** argv) +main (int argc, char **argv) { int i; diff --git a/lib/idcache.c b/lib/idcache.c index 4241d1e12..8b85f07c3 100644 --- a/lib/idcache.c +++ b/lib/idcache.c @@ -21,16 +21,11 @@ #endif #include +#include #include #include #include -#if STDC_HEADERS || HAVE_STRING_H -# include -#else -# include -#endif - #if HAVE_UNISTD_H # include #endif diff --git a/lib/makepath.c b/lib/makepath.c index f2dfe8891..422bcda82 100644 --- a/lib/makepath.c +++ b/lib/makepath.c @@ -23,6 +23,8 @@ # include #endif +#include "makepath.h" + #include #include @@ -44,9 +46,7 @@ # define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO) #endif -#if STDC_HEADERS -# include -#endif +#include #include @@ -54,14 +54,7 @@ extern int errno; #endif -#if HAVE_STRING_H -# include -#else -# include -# ifndef strchr -# define strchr index -# endif -#endif +#include #ifndef S_ISUID # define S_ISUID 04000 @@ -88,8 +81,6 @@ extern int errno; #define WX_USR (S_IWUSR | S_IXUSR) -#include "makepath.h" - #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/lib/malloc.c b/lib/malloc.c index bcd6b564b..a43d16927 100644 --- a/lib/malloc.c +++ b/lib/malloc.c @@ -22,14 +22,12 @@ #endif #undef malloc -#include - -char *malloc (); +#include /* Allocate an N-byte block of memory from the heap. If N is zero, allocate a 1-byte block. */ -char * +void * rpl_malloc (size_t n) { if (n == 0) diff --git a/lib/realloc.c b/lib/realloc.c index 573712108..ccbf99138 100644 --- a/lib/realloc.c +++ b/lib/realloc.c @@ -22,19 +22,14 @@ #endif #undef realloc -#include - -char *malloc (); -char *realloc (); +#include /* Change the size of an allocated block of memory P to N bytes, with error checking. If N is zero, change it to 1. If P is NULL, use malloc. */ -char * -rpl_realloc (p, n) - char *p; - size_t n; +void * +rpl_realloc (void *p, size_t n) { if (n == 0) n = 1; diff --git a/m4/group-member.m4 b/m4/group-member.m4 index 36fda49f1..bfef4809c 100644 --- a/m4/group-member.m4 +++ b/m4/group-member.m4 @@ -1,4 +1,4 @@ -#serial 4 +#serial 5 dnl Written by Jim Meyering @@ -18,7 +18,6 @@ AC_DEFUN([jm_FUNC_GROUP_MEMBER], # Prerequisites of lib/group-member.c. AC_DEFUN([gl_PREREQ_GROUP_MEMBER], [ - AC_REQUIRE([AC_HEADER_STDC]) AC_CHECK_HEADERS_ONCE(unistd.h) AC_REQUIRE([AC_FUNC_GETGROUPS]) ]) diff --git a/m4/idcache.m4 b/m4/idcache.m4 index 834d1f19a..d20d39209 100644 --- a/m4/idcache.m4 +++ b/m4/idcache.m4 @@ -1,5 +1,5 @@ -# idcache.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. +# idcache.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,6 +9,5 @@ dnl the same distribution terms as the rest of that program. AC_DEFUN([gl_IDCACHE], [ dnl Prerequisites of lib/idcache.c. - AC_REQUIRE([AC_HEADER_STDC]) - AC_CHECK_HEADERS_ONCE(string.h unistd.h) + AC_CHECK_HEADERS_ONCE(unistd.h) ]) diff --git a/m4/makepath.m4 b/m4/makepath.m4 index 487666eb5..edd2d9bce 100644 --- a/m4/makepath.m4 +++ b/m4/makepath.m4 @@ -1,5 +1,5 @@ -# makepath.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. +# makepath.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 @@ -10,8 +10,7 @@ AC_DEFUN([gl_MAKEPATH], [ dnl Prerequisites of lib/makepath.c. AC_REQUIRE([AC_FUNC_ALLOCA]) - AC_REQUIRE([AC_HEADER_STDC]) - AC_CHECK_HEADERS_ONCE(string.h unistd.h) + AC_CHECK_HEADERS_ONCE(unistd.h) AC_REQUIRE([AC_HEADER_STAT]) AC_REQUIRE([jm_AFS]) ]) -- 2.11.0