From: Paul Eggert Date: Wed, 10 Sep 2003 04:22:10 +0000 (+0000) Subject: Remove K&R cruft. X-Git-Tag: cvs-readonly~4514 X-Git-Url: http://erislabs.net/gitweb/?a=commitdiff_plain;h=68900e91578c2f84454cb930afa3ef52a7483779;p=gnulib.git Remove K&R cruft. --- diff --git a/lib/putenv.c b/lib/putenv.c index f5ce1dd88..87c552281 100644 --- a/lib/putenv.c +++ b/lib/putenv.c @@ -37,23 +37,15 @@ extern int errno; with a non-const argument. That would conflict with the declaration of rpl_putenv below (due to the #define putenv rpl_putenv from config.h). */ -char *malloc (); +void *malloc (); void free (); -#if defined (__GNU_LIBRARY__) || defined (HAVE_STRING_H) -# include -#endif +#include + #if defined (__GNU_LIBRARY__) || defined (HAVE_UNISTD_H) # include #endif -#if !defined (__GNU_LIBRARY__) && !defined (HAVE_STRCHR) -# define strchr index -#endif -#if !defined (__GNU_LIBRARY__) && !defined (HAVE_MEMCPY) -# define memcpy(d,s,n) bcopy ((s), (d), (n)) -#endif - #if HAVE_GNU_LD # define environ __environ #else @@ -71,10 +63,6 @@ __libc_lock_define_initialized (static, envlock) # define UNLOCK #endif -#ifndef NULL -# define NULL 0 -#endif - static int unsetenv (const char *name) { diff --git a/lib/readtokens.c b/lib/readtokens.c index bb427729c..e826c8daa 100644 --- a/lib/readtokens.c +++ b/lib/readtokens.c @@ -31,24 +31,12 @@ # include #endif -#include - -#ifdef STDC_HEADERS -# include -#endif +#include "readtokens.h" -#if defined (STDC_HEADERS) || defined(HAVE_STRING_H) -# include -/* An ANSI string.h and pre-ANSI memory.h might conflict. */ -# if !defined (STDC_HEADERS) && defined (HAVE_MEMORY_H) -# include -# endif /* not STDC_HEADERS and HAVE_MEMORY_H */ -#else /* not STDC_HEADERS and not HAVE_STRING_H */ -# include -/* memory.h and strings.h conflict on some systems. */ -#endif /* not STDC_HEADERS and not HAVE_STRING_H */ +#include +#include +#include -#include "readtokens.h" #include "unlocked-io.h" #include "xalloc.h" @@ -58,8 +46,7 @@ /* Initialize a tokenbuffer. */ void -init_tokenbuffer (tokenbuffer) - token_buffer *tokenbuffer; +init_tokenbuffer (token_buffer *tokenbuffer) { tokenbuffer->size = INITIAL_TOKEN_LENGTH; tokenbuffer->buffer = xmalloc (INITIAL_TOKEN_LENGTH); diff --git a/m4/putenv.m4 b/m4/putenv.m4 index 5a7aa4c16..77b9f7874 100644 --- a/m4/putenv.m4 +++ b/m4/putenv.m4 @@ -1,5 +1,5 @@ -# putenv.m4 serial 6 -dnl Copyright (C) 2002 Free Software Foundation, Inc. +# putenv.m4 serial 7 +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 @@ -47,7 +47,5 @@ AC_DEFUN([jm_FUNC_PUTENV], # Prerequisites of lib/putenv.c. AC_DEFUN([gl_PREREQ_PUTENV], [ - AC_CHECK_HEADERS_ONCE(string.h unistd.h) - AC_CHECK_FUNCS_ONCE(memcpy) - AC_CHECK_FUNCS(strchr) + AC_CHECK_HEADERS_ONCE(unistd.h) ]) diff --git a/m4/readtokens.m4 b/m4/readtokens.m4 index 3f97474af..9fdf2eb17 100644 --- a/m4/readtokens.m4 +++ b/m4/readtokens.m4 @@ -1,5 +1,5 @@ -# readtokens.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. +# readtokens.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_READTOKENS], [ dnl Prerequisites of lib/readtokens.c. - AC_REQUIRE([AC_HEADER_STDC]) - AC_CHECK_HEADERS_ONCE(memory.h string.h) + : ])