changeset 1170:8de2d981b46f

Use PARAMS, not __P.
author Jim Meyering <jim@meyering.net>
date Sun, 21 Dec 1997 11:22:51 +0000
parents 7d847e03dad4
children 68efd95df6f4
files lib/fsusage.h lib/getline.h lib/hash.h lib/human.h lib/long-options.h lib/makepath.h lib/modechange.h lib/path-concat.h lib/save-cwd.c lib/save-cwd.h lib/savedir.h lib/strverscmp.h lib/xalloc.h lib/xstrtol.h
diffstat 14 files changed, 134 insertions(+), 107 deletions(-) [+]
line wrap: on
line diff
--- a/lib/fsusage.h
+++ b/lib/fsusage.h
@@ -1,5 +1,5 @@
 /* fsusage.h -- declarations for filesystem space usage info
-   Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -16,6 +16,10 @@
    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* Space usage statistics for a filesystem.  Blocks are 512-byte. */
+
+#if !defined FSUSAGE_H_
+# define FSUSAGE_H_
+
 struct fs_usage
 {
   int fsu_blocksize;		/* Size of a block.  */
@@ -26,13 +30,15 @@
   uintmax_t fsu_ffree;		/* Free file nodes. */
 };
 
-#ifndef __P
-#if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
-#define __P(args) args
-#else
-#define __P(args) ()
-#endif  /* GCC.  */
-#endif  /* Not __P.  */
+# ifndef PARAMS
+#  if defined PROTOTYPES || (defined __STDC__ && __STDC__)
+#   define PARAMS(Args) Args
+#  else
+#   define PARAMS(Args) ()
+#  endif
+# endif
 
-int get_fs_usage __P ((const char *path, const char *disk,
-		       struct fs_usage *fsp));
+int get_fs_usage PARAMS ((const char *path, const char *disk,
+			  struct fs_usage *fsp));
+
+#endif
--- a/lib/getline.h
+++ b/lib/getline.h
@@ -1,4 +1,4 @@
-/*  Copyright (C) 1995 Free Software Foundation, Inc.
+/*  Copyright (C) 1995, 1997 Free Software Foundation, Inc.
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -20,10 +20,10 @@
 # include <stdio.h>
 
 # ifndef PARAMS
-#  if defined (__GNUC__) || __STDC__
-#   define PARAMS(args) args
+#  if defined PROTOTYPES || (defined __STDC__ && __STDC__)
+#   define PARAMS(Args) Args
 #  else
-#   define PARAMS(args) ()
+#   define PARAMS(Args) ()
 #  endif
 # endif
 
--- a/lib/hash.h
+++ b/lib/hash.h
@@ -5,14 +5,6 @@
 #  include <config.h>
 # endif
 
-# ifndef PARAMS
-#  if defined (__GNUC__) || __STDC__
-#   define PARAMS(args) args
-#  else
-#   define PARAMS(args) ()
-#  endif
-# endif
-
 # include <stdio.h>
 # include <assert.h>
 
@@ -28,6 +20,14 @@
 char *malloc ();
 # endif
 
+# ifndef PARAMS
+#  if defined PROTOTYPES || (defined __STDC__ && __STDC__)
+#   define PARAMS(Args) Args
+#  else
+#   define PARAMS(Args) ()
+#  endif
+# endif
+
 # define USE_OBSTACK
 # ifdef USE_OBSTACK
 #  include "obstack.h"
--- a/lib/human.h
+++ b/lib/human.h
@@ -7,14 +7,14 @@
 # define LONGEST_HUMAN_READABLE ((sizeof (uintmax_t) + sizeof (int)) \
 				 * CHAR_BIT / 3)
 
-# ifndef __P
-#  if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
-#   define __P(args) args
+# ifndef PARAMS
+#  if defined PROTOTYPES || (defined __STDC__ && __STDC__)
+#   define PARAMS(Args) Args
 #  else
-#   define __P(args) ()
-#  endif  /* GCC.  */
-# endif  /* Not __P.  */
+#   define PARAMS(Args) ()
+#  endif
+# endif
 
-char *human_readable __P ((uintmax_t, char *, int, int, int));
+char *human_readable PARAMS ((uintmax_t, char *, int, int, int));
 
 #endif /* HUMAN_H_ */
--- a/lib/long-options.h
+++ b/lib/long-options.h
@@ -1,5 +1,5 @@
 /* long-options.h -- declaration for --help- and --version-handling function.
-   Copyright (C) 1993, 1994 Free Software Foundation, Inc.
+   Copyright (C) 1993, 1994, 1997 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -17,11 +17,12 @@
 
 /* Written by Jim Meyering.  */
 
-#undef PARAMS
-#if defined (__STDC__) && __STDC__
-# define PARAMS(Args) Args
-#else
-# define PARAMS(Args) ()
+#ifndef PARAMS
+# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
+#  define PARAMS(Args) Args
+# else
+#  define PARAMS(Args) ()
+# endif
 #endif
 
 void
--- a/lib/makepath.h
+++ b/lib/makepath.h
@@ -1,15 +1,16 @@
-# undef __P
-#if __STDC__
-# define __P(Args) Args
-#else
-# define __P(Args) ()
+#ifndef PARAMS
+# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
+#  define PARAMS(Args) Args
+# else
+#  define PARAMS(Args) ()
+# endif
 #endif
 
 int
-make_path __P ((const char *_argpath,
-		int _mode,
-		int _parent_mode,
-		uid_t _owner,
-		gid_t _group,
-		int _preserve_existing,
-		const char *_verbose_fmt_string));
+make_path PARAMS ((const char *_argpath,
+		   int _mode,
+		   int _parent_mode,
+		   uid_t _owner,
+		   gid_t _group,
+		   int _preserve_existing,
+		   const char *_verbose_fmt_string));
--- a/lib/modechange.h
+++ b/lib/modechange.h
@@ -17,14 +17,17 @@
 
 /* Masks for the `flags' field in a `struct mode_change'. */
 
+#if ! defined MODECHANGE_H_
+# define MODECHANGE_H_
+
 /* Affect the execute bits only if at least one execute bit is set already,
    or if the file is a directory. */
-#define MODE_X_IF_ANY_X 01
+# define MODE_X_IF_ANY_X 01
 
 /* If set, copy some existing permissions for u, g, or o onto the other two.
    Which of u, g, or o is copied is determined by which bits are set in the
    `value' field. */
-#define MODE_COPY_EXISTING 02
+# define MODE_COPY_EXISTING 02
 
 struct mode_change
 {
@@ -36,25 +39,27 @@
 };
 
 /* Masks for mode_compile argument. */
-#define MODE_MASK_EQUALS 1
-#define MODE_MASK_PLUS 2
-#define MODE_MASK_MINUS 4
-#define MODE_MASK_ALL (MODE_MASK_EQUALS | MODE_MASK_PLUS | MODE_MASK_MINUS)
+# define MODE_MASK_EQUALS 1
+# define MODE_MASK_PLUS 2
+# define MODE_MASK_MINUS 4
+# define MODE_MASK_ALL (MODE_MASK_EQUALS | MODE_MASK_PLUS | MODE_MASK_MINUS)
 
 /* Error return values for mode_compile. */
-#define MODE_INVALID (struct mode_change *) 0
-#define MODE_MEMORY_EXHAUSTED (struct mode_change *) 1
-#define MODE_BAD_REFERENCE (struct mode_change *) 2
+# define MODE_INVALID (struct mode_change *) 0
+# define MODE_MEMORY_EXHAUSTED (struct mode_change *) 1
+# define MODE_BAD_REFERENCE (struct mode_change *) 2
 
-#ifndef __P
-# if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
-#  define __P(Args) Args
-# else
-#  define __P(Args) ()
+# ifndef PARAMS
+#  if defined PROTOTYPES || (defined __STDC__ && __STDC__)
+#   define PARAMS(Args) Args
+#  else
+#   define PARAMS(Args) ()
+#  endif
 # endif
-#endif
 
-struct mode_change *mode_compile __P ((const char *, unsigned));
-struct mode_change *mode_create_from_ref __P ((const char *));
-unsigned short mode_adjust __P ((unsigned, const struct mode_change *));
-void mode_free __P ((struct mode_change *));
+struct mode_change *mode_compile PARAMS ((const char *, unsigned));
+struct mode_change *mode_create_from_ref PARAMS ((const char *));
+unsigned short mode_adjust PARAMS ((unsigned, const struct mode_change *));
+void mode_free PARAMS ((struct mode_change *));
+
+#endif
--- a/lib/path-concat.h
+++ b/lib/path-concat.h
@@ -1,9 +1,15 @@
-#if __STDC__
-# undef __P
-# define __P(args) args
-#else
-# define __P(args) ()
-#endif
+#if ! defined PATH_CONCAT_H_
+# define PATH_CONCAT_H_
+
+# ifndef PARAMS
+#  if defined PROTOTYPES || (defined __STDC__ && __STDC__)
+#   define PARAMS(Args) Args
+#  else
+#   define PARAMS(Args) ()
+#  endif
+# endif
 
 char *
-path_concat __P ((const char *dir, const char *base, char **base_in_result));
+path_concat PARAMS ((const char *dir, const char *base, char **base_in_result));
+
+#endif
--- a/lib/save-cwd.c
+++ b/lib/save-cwd.c
@@ -45,7 +45,7 @@
 #include "save-cwd.h"
 #include "error.h"
 
-char *xgetcwd __P((void));
+char *xgetcwd PARAMS ((void));
 
 /* Record the location of the current working directory in CWD so that
    the program may change to other directories and later use restore_cwd
--- a/lib/save-cwd.h
+++ b/lib/save-cwd.h
@@ -7,17 +7,17 @@
     char *name;
   };
 
-# ifndef __P
-#  if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
-#   define __P(args) args
+# ifndef PARAMS
+#  if __STDC__
+#   define PARAMS(Args) Args
 #  else
-#   define __P(args) ()
-#  endif  /* GCC.  */
-# endif  /* Not __P.  */
+#   define PARAMS(Args) ()
+#  endif
+# endif
 
-int save_cwd __P((struct saved_cwd *cwd));
-int restore_cwd __P((const struct saved_cwd *cwd, const char *dest,
-		     const char *from));
-void free_cwd __P((struct saved_cwd *cwd));
+int save_cwd PARAMS ((struct saved_cwd *cwd));
+int restore_cwd PARAMS ((const struct saved_cwd *cwd, const char *dest,
+			 const char *from));
+void free_cwd PARAMS ((struct saved_cwd *cwd));
 
 #endif /* SAVE_CWD_H */
--- a/lib/savedir.h
+++ b/lib/savedir.h
@@ -1,9 +1,15 @@
-#undef __P
-#if defined (__STDC__) && __STDC__
-# define __P(x) x
-#else
-# define __P(x) ()
-#endif
+#if !defined SAVEDIR_H_
+# define SAVEDIR_H_
+
+# ifndef PARAMS
+#  if defined PROTOTYPES || (defined __STDC__ && __STDC__)
+#   define PARAMS(Args) Args
+#  else
+#   define PARAMS(Args) ()
+#  endif
+# endif
 
 char *
-savedir __P((const char *dir, unsigned int name_size));
+savedir PARAMS ((const char *dir, unsigned int name_size));
+
+#endif
--- a/lib/strverscmp.h
+++ b/lib/strverscmp.h
@@ -8,10 +8,10 @@
 # endif
 
 # ifndef PARAMS
-#  if defined (__GNUC__) || __STDC__
-#   define PARAMS(args) args
+#  if defined PROTOTYPES || (defined __STDC__ && __STDC__)
+#   define PARAMS(Args) Args
 #  else
-#   define PARAMS(args) ()
+#   define PARAMS(Args) ()
 #  endif
 # endif
 
--- a/lib/xalloc.h
+++ b/lib/xalloc.h
@@ -1,8 +1,9 @@
-#undef PARAMS
-#if defined (__STDC__) && __STDC__
-# define PARAMS(Args) Args
-#else
-# define PARAMS(Args) ()
+#ifndef PARAMS
+# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
+#  define PARAMS(Args) Args
+# else
+#  define PARAMS(Args) ()
+# endif
 #endif
 
 /* Exit value when the requested amount of memory is not available.
--- a/lib/xstrtol.h
+++ b/lib/xstrtol.h
@@ -13,26 +13,27 @@
 #  define __ZLONG_MAX LONG_MAX
 # endif
 
-# undef PARAMS
-# if defined (__STDC__) && __STDC__
-#  define PARAMS(Args) Args
-# else
-#  define PARAMS(Args) ()
+# ifndef PARAMS
+#  if defined PROTOTYPES || (defined __STDC__ && __STDC__)
+#   define PARAMS(Args) Args
+#  else
+#   define PARAMS(Args) ()
+#  endif
 # endif
 
-#ifndef _STRTOL_ERROR
+# ifndef _STRTOL_ERROR
 enum strtol_error
   {
     LONGINT_OK, LONGINT_INVALID, LONGINT_INVALID_SUFFIX_CHAR, LONGINT_OVERFLOW
   };
 typedef enum strtol_error strtol_error;
-#endif
+# endif
 
 strtol_error
   __xstrtol PARAMS ((const char *s, char **ptr, int base,
 		     __unsigned long int *val, const char *valid_suffixes));
 
-#undef _STRTOL_ERROR
+# undef _STRTOL_ERROR
 # define _STRTOL_ERROR(Exit_code, Str, Argument_type_string, Err)	\
   do									\
     {									\