avoid misc. warnings
authorJim Meyering <meyering@redhat.com>
Sun, 30 Nov 2008 16:10:29 +0000 (17:10 +0100)
committerJim Meyering <meyering@redhat.com>
Wed, 4 Feb 2009 14:54:59 +0000 (15:54 +0100)
* lib/fsusage.c (UNUSED_PARAM): Define.
(get_fs_usage): Mark parameter "disk" as unused.
* lib/getugroups.c (getgrent): Use "void" in prototype.
* lib/mountlist.c: Mark unused parameters.
(read_file_system_list): Declare a local with "const".
* lib/nanosleep.c (getnow): Declare static.
* lib/strftime.c: Include strftime.h, for declaration of nstrftime.

ChangeLog
lib/fsusage.c
lib/getugroups.c
lib/mountlist.c
lib/nanosleep.c
lib/strftime.c

index 3377837..5f72527 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2009-02-04  Jim Meyering  <meyering@redhat.com>
 
+       avoid misc. warnings
+       * lib/fsusage.c (UNUSED_PARAM): Define.
+       (get_fs_usage): Mark parameter "disk" as unused.
+       * lib/getugroups.c (getgrent): Use "void" in prototype.
+       * lib/mountlist.c: Mark unused parameters.
+       (read_file_system_list): Declare a local with "const".
+       * lib/nanosleep.c (getnow): Declare static.
+       * lib/strftime.c: Include strftime.h, for declaration of nstrftime.
+
        dirfd: set errno upon failure
        * lib/dirfd.c: Include <errno.h>.
        Set errno to ENOTSUP when returning -1.
index 23d40ea..f4bda09 100644 (file)
@@ -1,6 +1,6 @@
 /* fsusage.c -- return space usage of mounted file systems
 
-   Copyright (C) 1991, 1992, 1996, 1998, 1999, 2002, 2003, 2004, 2005, 2006
+   Copyright (C) 1991-1992, 1996, 1998-1999, 2002-2006, 2008
    Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    otherwise, use PROPAGATE_ALL_ONES.  */
 #define PROPAGATE_TOP_BIT(x) ((x) | ~ (EXTRACT_TOP_BIT (x) - 1))
 
+#ifdef STAT_READ_FILSYS
+# define UNUSED_PARAM /* empty */
+#else
+# define UNUSED_PARAM _UNUSED_PARAMETER_
+#endif
+
 /* Fill in the fields of FSP with information about space usage for
    the file system on which FILE resides.
    DISK is the device on which FILE is mounted, for space-getting
@@ -92,7 +98,8 @@
    ERRNO is either a system error value, or zero if DISK is NULL
    on a system that requires a non-NULL value.  */
 int
-get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp)
+get_fs_usage (char const *file, char const *disk UNUSED_PARAM,
+             struct fs_usage *fsp)
 {
 #if defined STAT_STATVFS               /* POSIX */
 
index e102f21..b266bb8 100644 (file)
@@ -32,7 +32,7 @@
 /* Some old header files might not declare setgrent, getgrent, and endgrent.
    If you don't have them at all, we can't implement this function.
    You lose!  */
-struct group *getgrent ();
+struct group *getgrent (void);
 
 #include <string.h>
 
index 4c975c6..119cdf0 100644 (file)
@@ -1,7 +1,6 @@
 /* mountlist.c -- return a list of mounted file systems
 
-   Copyright (C) 1991, 1992, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-   2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1992, 1997-2008 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
@@ -298,11 +297,17 @@ fstype_to_string (int t)
 
 #if defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2
 
+#undef UNUSED_PARAM
+#ifdef __linux__
+# define UNUSED_PARAM _UNUSED_PARAMETER_
+#else
+# define UNUSED_PARAM
+#endif
+
 /* Return the device number from MOUNT_OPTIONS, if possible.
    Otherwise return (dev_t) -1.  */
-
 static dev_t
-dev_from_mount_options (char const *mount_options)
+dev_from_mount_options (char const *mount_options UNUSED_PARAM)
 {
   /* GNU/Linux allows file system implementations to define their own
      meaning for "dev=" mount options, so don't trust the meaning
@@ -333,13 +338,20 @@ dev_from_mount_options (char const *mount_options)
 
 #endif
 
+#undef UNUSED_PARAM
+#ifdef GETFSTYP
+# define UNUSED_PARAM
+#else
+# define UNUSED_PARAM _UNUSED_PARAMETER_
+#endif
+
 /* Return a list of the currently mounted file systems, or NULL on error.
    Add each entry to the tail of the list so that they stay in order.
    If NEED_FS_TYPE is true, ensure that the file system type fields in
    the returned list are valid.  Otherwise, they might not be.  */
 
 struct mount_entry *
-read_file_system_list (bool need_fs_type)
+read_file_system_list (bool need_fs_type UNUSED_PARAM)
 {
   struct mount_entry *mount_list;
   struct mount_entry *me;
@@ -378,7 +390,7 @@ read_file_system_list (bool need_fs_type)
 #ifdef MOUNTED_GETMNTENT1 /* GNU/Linux, 4.3BSD, SunOS, HP-UX, Dynix, Irix.  */
   {
     struct mntent *mnt;
-    char *table = MOUNTED;
+    char const *table = MOUNTED;
     FILE *fp;
 
     fp = setmntent (table, "r");
index e413c5d..7a7cc02 100644 (file)
@@ -42,7 +42,7 @@ enum { BILLION = 1000 * 1000 * 1000 };
 
 #if HAVE_BUG_BIG_NANOSLEEP
 
-void
+static void
 getnow (struct timespec *t)
 {
 # if defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME
index ea425c4..fff5d38 100644 (file)
@@ -28,6 +28,8 @@
 # include <config.h>
 # if FPRINTFTIME
 #  include "fprintftime.h"
+# else
+#  include "strftime.h"
 # endif
 #endif