changeset 4655:4f71e1292ad1

Remove K&R cruft.
author Paul Eggert <eggert@cs.ucla.edu>
date Tue, 09 Sep 2003 19:23:55 +0000
parents a4086e076f77
children 4f4fb4d3874d
files lib/getusershell.c m4/getusershell.m4
diffstat 2 files changed, 10 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/lib/getusershell.c
+++ b/lib/getusershell.c
@@ -32,9 +32,7 @@
 #endif
 
 #include <stdio.h>
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
+#include <stdlib.h>
 #include <ctype.h>
 #include "unlocked-io.h"
 #include "xalloc.h"
@@ -47,7 +45,7 @@
 
 #define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c))
 
-static int readname ();
+static int readname (char **, int *, FILE *);
 
 #if ! defined ADDITIONAL_DEFAULT_SHELLS && defined __MSDOS__
 # define ADDITIONAL_DEFAULT_SHELLS \
@@ -82,7 +80,7 @@
    Return NULL if there are no more entries.  */
 
 char *
-getusershell ()
+getusershell (void)
 {
   if (default_index > 0)
     {
@@ -114,7 +112,7 @@
 /* Rewind the shells file. */
 
 void
-setusershell ()
+setusershell (void)
 {
   default_index = 0;
   if (shellstream)
@@ -124,7 +122,7 @@
 /* Close the shells file. */
 
 void
-endusershell ()
+endusershell (void)
 {
   if (shellstream)
     {
@@ -142,10 +140,7 @@
    if some nonempty sequence was found, otherwise 0.  */
 
 static int
-readname (name, size, stream)
-     char **name;
-     int *size;
-     FILE *stream;
+readname (char **name, int *size, FILE *stream)
 {
   int c;
   int name_index = 0;
@@ -175,7 +170,8 @@
 }
 
 #ifdef TEST
-main ()
+int
+main (void)
 {
   char *s;
 
--- a/m4/getusershell.m4
+++ b/m4/getusershell.m4
@@ -1,5 +1,5 @@
-# getusershell.m4 serial 1
-dnl Copyright (C) 2002 Free Software Foundation, Inc.
+# getusershell.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
@@ -17,7 +17,6 @@
 # Prerequisites of lib/getusershell.c.
 AC_DEFUN([gl_PREREQ_GETUSERSHELL], [
   AC_REQUIRE([AC_HEADER_STDC])
-  AC_CHECK_HEADERS_ONCE(stdlib.h)
   AC_CHECK_FUNCS_ONCE(isascii)
 ])