diff options
author | James Youngman <jay@gnu.org> | 2011-06-03 01:38:11 +0100 |
---|---|---|
committer | James Youngman <jay@gnu.org> | 2011-06-04 00:42:04 +0100 |
commit | ec9afce2510d54824e5ba8819f42adb4b365b001 (patch) | |
tree | 96305b976964858dbebf4800ae63960b6730d39f | |
parent | 8b0f894dcfaaec0ea44f81b16dad29d65af43e3f (diff) | |
download | findutils-ec9afce2510d54824e5ba8819f42adb4b365b001.tar.gz |
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.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | find/defs.h | 4 | ||||
-rw-r--r-- | find/parser.c | 7 |
3 files changed, 12 insertions, 6 deletions
@@ -1,5 +1,12 @@ 2011-06-03 James Youngman <jay@gnu.org> + 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 a7fd7d9a..0f7a2661 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 52a1ef67..28318a59 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; |