bug-findutils
[Top][All Lists]
Advanced

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

[PATCH 6/9] Eliminate some compiler warnings in find/parser.c.


From: James Youngman
Subject: [PATCH 6/9] Eliminate some compiler warnings in find/parser.c.
Date: Sat, 4 Jun 2011 01:21:50 +0100

* find/defs.h (struct parser_table): Make parser_name field const.
* find/parser.c: Remove redundant declaration of parse_print.
(insert_path_check): Change name of parameter pred_name to avoid
shadowing the function of that name.
(find_parser): Make search_name parameter const.
---
 ChangeLog     |    7 +++++++
 find/defs.h   |    4 ++--
 find/parser.c |    7 +++----
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 66a7022..3ff1060 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2011-06-03  James Youngman  <address@hidden>
 
+       Eliminate some compiler warnings in find/parser.c.
+       * find/defs.h (struct parser_table): Make parser_name field const.
+       * find/parser.c: Remove redundant declaration of parse_print.
+       (insert_path_check): Change name of parameter pred_name to avoid
+       shadowing the function of that name.
+       (find_parser): Make search_name parameter const.
+
        Fix a compiler warning in lib/buildcmd.c
        * lib/buildcmd.c: special_terminating_arg should be const.
 
diff --git a/find/defs.h b/find/defs.h
index a7fd7d9..0f7a266 100644
--- a/find/defs.h
+++ b/find/defs.h
@@ -382,13 +382,13 @@ typedef bool (*PARSE_FUNC)(const struct parser_table *p,
 struct parser_table
 {
   enum arg_type type;
-  char *parser_name;
+  const char *parser_name;
   PARSE_FUNC parser_func;
   PRED_FUNC    pred_func;
 };
 
 /* parser.c */
-const struct parser_table* find_parser (char *search_name);
+const struct parser_table* find_parser (const char *search_name);
 bool parse_print (const struct parser_table*, char *argv[], int *arg_ptr);
 void pred_sanity_check (const struct predicate *predicates);
 void check_option_combinations (const struct predicate *p);
diff --git a/find/parser.c b/find/parser.c
index 52a1ef6..28318a5 100644
--- a/find/parser.c
+++ b/find/parser.c
@@ -157,7 +157,6 @@ static bool parse_warn          (const struct 
parser_table*, char *argv[], int *
 static bool parse_xtype         (const struct parser_table*, char *argv[], int 
*arg_ptr);
 static bool parse_quit          (const struct parser_table*, char *argv[], int 
*arg_ptr);
 static bool parse_context       (const struct parser_table*, char *argv[], int 
*arg_ptr);
-bool   parse_print              (const struct parser_table*, char *argv[], int 
*arg_ptr);
 #if 0
 static bool parse_show_control_chars (const struct parser_table*, char 
*argv[], int *arg_ptr);
 #endif
@@ -648,7 +647,7 @@ found_parser (const char *original_arg, const struct 
parser_table *entry)
    Return NULL if SEARCH_NAME is not a valid predicate name. */
 
 const struct parser_table*
-find_parser (char *search_name)
+find_parser (const char *search_name)
 {
   int i;
   const char *original_arg = search_name;
@@ -1877,7 +1876,7 @@ is_feasible_path_argument (const char *arg, bool foldcase)
 
 static bool
 insert_path_check (const struct parser_table* entry, char **argv, int *arg_ptr,
-                  const char *pred_name, PREDICATEFUNCTION pred)
+                  const char *predicate_name, PREDICATEFUNCTION pred)
 {
   const char *name;
   bool foldcase = false;
@@ -1899,7 +1898,7 @@ insert_path_check (const struct parser_table* entry, char 
**argv, int *arg_ptr,
        {
          error (0, 0, _("warning: -%s %s will not match anything "
                         "because it ends with /."),
-                pred_name, name);
+                predicate_name, name);
          our_pred->est_success_rate = 1.0e-8;
        }
       return true;
-- 
1.7.2.5




reply via email to

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