findutils-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Findutils-patches] [PATCH 12/19] find: avoid warning about unused local


From: James Youngman
Subject: [Findutils-patches] [PATCH 12/19] find: avoid warning about unused local, remove unnecessary include.
Date: Fri, 10 Apr 2009 23:53:09 +0100

From: Jim Meyering <address@hidden>

* find/pred.c (scan_for_digit_differences): Remove declaration of
unused local, "ok".
(do_time_format): Remove decl of "done"; replace sole use with a
constant, "true".  Initialize "i" and "n".
* lib/dircallback.c: Don't include unistd.h.  Not needed.
---
 ChangeLog         |    8 ++++++++
 find/pred.c       |    5 ++---
 lib/dircallback.c |    7 +------
 3 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 91b0072..291116f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,14 @@
 2009-04-10  Jim Meyering <address@hidden>
 
        Backport a fix from 4.5.x.
+       find: avoid warning about unused local, remove unnecessary include.
+       * find/pred.c (scan_for_digit_differences): Remove declaration of
+       unused local, "ok".
+       (do_time_format): Remove decl of "done"; replace sole use with a
+       constant, "true".  Initialize "i" and "n".
+       * lib/dircallback.c: Don't include unistd.h.  Not needed.
+
+       Backport a fix from 4.5.x.
        * README-CVS: tiny typo fix (s/fileutils/findutils/).
 
 2009-04-10  James Youngman  <address@hidden>
diff --git a/find/pred.c b/find/pred.c
index 92da9fc..b4e0404 100644
--- a/find/pred.c
+++ b/find/pred.c
@@ -2070,7 +2070,6 @@ do_time_format (const char *fmt, const struct tm *p, 
const char *ns, size_t ns_s
   static char *buf = NULL;
   static size_t buf_size;
   char *timefmt = NULL;
-  boolean done = false;
   struct tm altered_time;
 
 
@@ -2098,7 +2097,7 @@ do_time_format (const char *fmt, const struct tm *p, 
const char *ns, size_t ns_s
    */
   buf_size = 1u;
   buf = xmalloc (buf_size);
-  while (!done)
+  while (true)
     {
       /* I'm not sure that Solaris will return 0 when the buffer is too small.
        * Therefore we do not check for (buf_used != 0) as the termination
@@ -2109,7 +2108,7 @@ do_time_format (const char *fmt, const struct tm *p, 
const char *ns, size_t ns_s
          && (buf_used < buf_size)) /* Solaris workaround */
        {
          char *altbuf;
-         size_t i, n;
+         size_t i = 0, n = 0;
          size_t final_len = (buf_used
                              + 1u /* for \0 */
                              + ns_size);
diff --git a/lib/dircallback.c b/lib/dircallback.c
index 29fb276..5dbf3b3 100644
--- a/lib/dircallback.c
+++ b/lib/dircallback.c
@@ -1,5 +1,5 @@
 /* listfile.c -- run a function in a specific directory
-   Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2008, 2009 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
@@ -32,11 +32,6 @@
 #include "save-cwd.h"
 
 
-/* The presence of unistd.h is assumed by gnulib these days, so we 
- * might as well assume it too. 
- */
-#include <unistd.h> /* for readlink() */
-
 #ifdef HAVE_LOCALE_H
 #include <locale.h>
 #endif
-- 
1.5.6.5





reply via email to

[Prev in Thread] Current Thread [Next in Thread]