Remove K&R cruft.
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 10 Sep 2003 04:22:10 +0000 (04:22 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 10 Sep 2003 04:22:10 +0000 (04:22 +0000)
lib/putenv.c
lib/readtokens.c
m4/putenv.m4
m4/readtokens.m4

index f5ce1dd..87c5522 100644 (file)
@@ -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 <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 @@ __libc_lock_define_initialized (static, envlock)
 # define UNLOCK
 #endif
 
-#ifndef NULL
-# define NULL 0
-#endif
-
 static int
 unsetenv (const char *name)
 {
index bb42772..e826c8d 100644 (file)
 # 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);
index 5a7aa4c..77b9f78 100644 (file)
@@ -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)
 ])
index 3f97474..9fdf2eb 100644 (file)
@@ -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)
+  :
 ])