[Top][All Lists]
[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
- [Findutils-patches] [PATCH 02/19] Fix Savannah bug 22662 (nanoseconds wrongly appended after PM for find -printf %AX), (continued)
- [Findutils-patches] [PATCH 02/19] Fix Savannah bug 22662 (nanoseconds wrongly appended after PM for find -printf %AX), James Youngman, 2009/04/10
- [Findutils-patches] [PATCH 03/19] Fix bugs in bugfix for #22662, James Youngman, 2009/04/10
- [Findutils-patches] [PATCH 04/19] Fixed Savannah bug #23663, crash in some locales for find -printf '%AX', James Youngman, 2009/04/10
- [Findutils-patches] [PATCH 05/19] Fix bug #23996 (integer overflow when parsing "-used 3")., James Youngman, 2009/04/10
- [Findutils-patches] [PATCH 06/19] Moved bugfixes in the NEWS file out of "Documentation Enhancements" into "Bug Fixes"., James Youngman, 2009/04/10
- [Findutils-patches] [PATCH 07/19] Fix Savannah bug #24283, find-4.5.2 -printf %TY causes NULL pointer dereference, James Youngman, 2009/04/10
- [Findutils-patches] [PATCH 08/19] Typo fix from Jim Meyering <address@hidden>, James Youngman, 2009/04/10
- [Findutils-patches] [PATCH 09/19] fix a typo in a comment, James Youngman, 2009/04/10
- [Findutils-patches] [PATCH 10/19] find: avoid using undefined statbuf, James Youngman, 2009/04/10
- [Findutils-patches] [PATCH 11/19] find: Fix -regexptype parse specification bug: declare as POSOPT., James Youngman, 2009/04/10
- [Findutils-patches] [PATCH 12/19] find: avoid warning about unused local, remove unnecessary include.,
James Youngman <=
- [Findutils-patches] [PATCH 13/19] Really apply Jim's earlier patch., James Youngman, 2009/04/10
- [Findutils-patches] [PATCH 14/19] Fix Savannah bug #25764, duplicate entry for proc in PRUNEFS., James Youngman, 2009/04/10
- [Findutils-patches] [PATCH 15/19] Provide more detailed help on how to work with the git sources., James Youngman, 2009/04/10
- [Findutils-patches] [PATCH 16/19] Ignore 'compile', James Youngman, 2009/04/10
- [Findutils-patches] [PATCH 17/19] Change suffix for non-release versions from -CVS to -git., James Youngman, 2009/04/10
- [Findutils-patches] [PATCH 18/19] clean tool-versions.txt for 'make distclean', James Youngman, 2009/04/10
- [Findutils-patches] [PATCH 19/19] Remove unused Debian files; the Debian package doesn't use them., James Youngman, 2009/04/10