[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Findutils-patches] [PATCH 6/8] locate: Fix compiler warnings.
From: |
James Youngman |
Subject: |
[Findutils-patches] [PATCH 6/8] locate: Fix compiler warnings. |
Date: |
Sat, 2 Jan 2016 23:54:56 +0000 |
* locate/word_io.c (decode_value): Fix typo in comment.
(getword): Remove unused parameter minvalue.
* locate/locatedb.h: Adjust declaration of decode_value to remove
minvalue parameter.
* locate/locate.c: Declare dolocate(). Make that function static.
(visit_old_format): Don't pass a minvalue parameter to getword()
since it no longer wants it.
---
locate/locate.c | 7 ++++---
locate/locatedb.h | 2 +-
locate/word_io.c | 3 +--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/locate/locate.c b/locate/locate.c
index 7954895..d406978 100644
--- a/locate/locate.c
+++ b/locate/locate.c
@@ -161,6 +161,7 @@ static bool results_were_filtered;
static const char *selected_secure_db = NULL;
+static int dolocate (int argc, char **argv, int secure_db_fd);
/* Change the number of days old the database can be
* before we complain about it.
@@ -492,7 +493,8 @@ visit_old_format (struct process_data *procdata, void
*context)
else
maxval = (procdata->len - 0);
word = getword (procdata->fp, procdata->dbfile,
- minval, maxval, &procdata->endian_state);
+ maxval, &procdata->endian_state);
+ assert (word >= minval);
procdata->count += word;
assert (procdata->count >= 0);
}
@@ -1543,7 +1545,7 @@ cleanup_quote_opts (void)
}
-int
+static int
dolocate (int argc, char **argv, int secure_db_fd)
{
char *path_element = NULL;
@@ -1922,7 +1924,6 @@ dolocate (int argc, char **argv, int secure_db_fd)
return 1;
}
-#define ARRAYSIZE(a) (sizeof (a)/sizeof (a[0]))
static int
open_secure_db (void)
{
diff --git a/locate/locatedb.h b/locate/locatedb.h
index 048a2ea..bc19ddb 100644
--- a/locate/locatedb.h
+++ b/locate/locatedb.h
@@ -60,7 +60,7 @@ typedef enum
} GetwordEndianState;
int getword (FILE *fp, const char *filename,
- size_t minvalue, size_t maxvalue,
+ size_t maxvalue,
GetwordEndianState *endian_state_flag);
bool putword (FILE *fp, int word,
diff --git a/locate/word_io.c b/locate/word_io.c
index 40a1890..743780d 100644
--- a/locate/word_io.c
+++ b/locate/word_io.c
@@ -71,7 +71,7 @@ decode_value (const unsigned char data[],
{
/* the native value is inside the limit and the
* swapped value is not. We take this as proof
- * that we should be using the ative byte order.
+ * that we should be using the native byte order.
*/
*endian_state_flag = GetwordEndianStateNative;
}
@@ -113,7 +113,6 @@ decode_value (const unsigned char data[],
int
getword (FILE *fp,
const char *filename,
- size_t minvalue,
size_t maxvalue,
GetwordEndianState *endian_state_flag)
{
--
2.1.4
- [Findutils-patches] (no subject), James Youngman, 2016/01/02
- [Findutils-patches] [PATCH 1/8] maint: Remove --I../intl from AM_CPPFLAGS; the directory is gone., James Youngman, 2016/01/02
- [Findutils-patches] [PATCH 4/8] xargs: Avoid unused-macro warnings., James Youngman, 2016/01/02
- [Findutils-patches] [PATCH 5/8] lib: Update the width of the st_nlink field and fix some compiler warnings., James Youngman, 2016/01/02
- [Findutils-patches] [PATCH 3/8] find: Fix a number of compiler warnings (mostly const-correctness)., James Youngman, 2016/01/02
- [Findutils-patches] [PATCH 2/8] maint: Don't define the gettext-related macro N_ where it is not needed., James Youngman, 2016/01/02
- [Findutils-patches] [PATCH 6/8] locate: Fix compiler warnings.,
James Youngman <=
- [Findutils-patches] [PATCH 8/8] configure: Add option --enable-compiler-warnings-are-errors, limit --enable-compiler-warnings., James Youngman, 2016/01/02
- [Findutils-patches] [PATCH 7/8] find: fix some compiler warnings., James Youngman, 2016/01/02