Make the string parameter of parse_ofp_flow_stats_request_str() and parse_ofp_flow_mod_str() const
* Both parse_ofp_flow_stats_request_str() and parse_ofp_flow_mod_str() only pass their string parameter to it to parse_ofp_str() which treats the parameter as const. * do_flow_mod__() may pass a const string as the string argument to parse_ofp_flow_stats_request_str() and parse_ofp_flow_mod_str() Signed-off-by: Simon Horman <ho...@verge.net.au> --- $ gcc --version gcc (Debian 4.6.2-4) 4.6.2 Copyright (C) 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ make ... utilities/ovs-ofctl.c: In function ‘do_dump_flows__’: utilities/ovs-ofctl.c:628:5: warning: passing argument 3 of ‘parse_ofp_flow_stats_request_str’ discards ‘const’ qualifier from pointer target type [enabled by default] ./lib/ofp-parse.h:42:6: note: expected ‘char *’ but argument is of type ‘const char *’ utilities/ovs-ofctl.c: In function ‘do_flow_mod__’: utilities/ovs-ofctl.c:763:28: warning: passing argument 4 of ‘parse_ofp_flow_mod_str’ discards ‘const’ qualifier from pointer target type [enabled by default] ./lib/ofp-parse.h:35:6: note: expected ‘char *’ but argument is of type ‘const char *’ --- lib/ofp-parse.c | 6 +++--- lib/ofp-parse.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c index 24f6876..9640a71 100644 --- a/lib/ofp-parse.c +++ b/lib/ofp-parse.c @@ -668,8 +668,8 @@ parse_ofp_actions(const char *s_, struct ofpbuf *actions) * flow. */ void parse_ofp_flow_mod_str(struct list *packets, enum nx_flow_format *cur_format, - bool *flow_mod_table_id, char *string, uint16_t command, - bool verbose) + bool *flow_mod_table_id, const char *string, + uint16_t command, bool verbose) { enum nx_flow_format min_format, next_format; struct cls_rule rule_copy; @@ -729,7 +729,7 @@ parse_ofp_flow_mod_file(struct list *packets, void parse_ofp_flow_stats_request_str(struct ofputil_flow_stats_request *fsr, - bool aggregate, char *string) + bool aggregate, const char *string) { struct ofputil_flow_mod fm; diff --git a/lib/ofp-parse.h b/lib/ofp-parse.h index 6eba0dd..1812a45 100644 --- a/lib/ofp-parse.h +++ b/lib/ofp-parse.h @@ -34,13 +34,13 @@ void parse_ofp_str(struct ofputil_flow_mod *, int command, const char *str_, void parse_ofp_flow_mod_str(struct list *packets, enum nx_flow_format *cur, bool *flow_mod_table_id, - char *string, uint16_t command, bool verbose); + const char *string, uint16_t command, bool verbose); bool parse_ofp_flow_mod_file(struct list *packets, enum nx_flow_format *cur, bool *flow_mod_table_id, FILE *, uint16_t command); void parse_ofp_flow_stats_request_str(struct ofputil_flow_stats_request *, - bool aggregate, char *string); + bool aggregate, const char *string); void parse_ofp_actions(const char *, struct ofpbuf *actions); -- 1.7.6.3 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev