changeset 24363:e9b307cd2d66

Remove K&R cruft.
author Paul Eggert <eggert@cs.ucla.edu>
date Wed, 10 Sep 2003 04:22:10 +0000
parents d16dcd94ea47
children 7ce6483d43b7
files lib/putenv.c lib/readtokens.c m4/putenv.m4 m4/readtokens.m4
diffstat 4 files changed, 14 insertions(+), 42 deletions(-) [+]
line wrap: on
line diff
--- a/lib/putenv.c	Wed Sep 10 03:47:34 2003 +0000
+++ b/lib/putenv.c	Wed Sep 10 04:22:10 2003 +0000
@@ -37,23 +37,15 @@
    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 <string.h>
-#endif
+#include <string.h>
+
 #if defined (__GNU_LIBRARY__) || defined (HAVE_UNISTD_H)
 # include <unistd.h>
 #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 @@
 # define UNLOCK
 #endif
 
-#ifndef NULL
-# define NULL 0
-#endif
-
 static int
 unsetenv (const char *name)
 {
--- a/lib/readtokens.c	Wed Sep 10 03:47:34 2003 +0000
+++ b/lib/readtokens.c	Wed Sep 10 04:22:10 2003 +0000
@@ -31,24 +31,12 @@
 # include <config.h>
 #endif
 
-#include <stdio.h>
-
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-#endif
+#include "readtokens.h"
 
-#if defined (STDC_HEADERS) || defined(HAVE_STRING_H)
-# include <string.h>
-/* An ANSI string.h and pre-ANSI memory.h might conflict.  */
-# if !defined (STDC_HEADERS) && defined (HAVE_MEMORY_H)
-#  include <memory.h>
-# endif /* not STDC_HEADERS and HAVE_MEMORY_H */
-#else /* not STDC_HEADERS and not HAVE_STRING_H */
-# include <strings.h>
-/* memory.h and strings.h conflict on some systems.  */
-#endif /* not STDC_HEADERS and not HAVE_STRING_H */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
-#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);
--- a/m4/putenv.m4	Wed Sep 10 03:47:34 2003 +0000
+++ b/m4/putenv.m4	Wed Sep 10 04:22:10 2003 +0000
@@ -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 @@
 
 # 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)
 ])
--- a/m4/readtokens.m4	Wed Sep 10 03:47:34 2003 +0000
+++ b/m4/readtokens.m4	Wed Sep 10 04:22:10 2003 +0000
@@ -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 @@
 AC_DEFUN([gl_READTOKENS],
 [
   dnl Prerequisites of lib/readtokens.c.
-  AC_REQUIRE([AC_HEADER_STDC])
-  AC_CHECK_HEADERS_ONCE(memory.h string.h)
+  :
 ])