> If I fold in the following (basically dropping all the "const"s) it
> compiles warning-free for me and the generated code is prettier. What
> do you think?
Strange, I could have sworn I tried that when I originally wrote the patch. At
any rate works for me. I'll merge it that with this Incremental.
---
ovsdb/ovsdb-idlc.in | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in
index 8df11df..0ee5c6b 100755
--- a/ovsdb/ovsdb-idlc.in
+++ b/ovsdb/ovsdb-idlc.in
@@ -531,12 +531,14 @@ const struct ovsdb_datum *
print """
const char * %(s)s_get_%(c)s_value(const struct %(s)s *row, const char
*search_key, const char *default_value)
{
- char **const keys = row->key_%(c)s;
- char **const values = row->value_%(c)s;
+ char **keys = row->key_%(c)s;
+ char **values = row->value_%(c)s;
size_t n_keys = row->n_%(c)s;
- char **const result_key = bsearch(&search_key, keys, n_keys, sizeof *keys,
- bsearch_strcmp);
+ char ** result_key;
+
assert(inited);
+ result_key = bsearch(&search_key, keys, n_keys, sizeof *keys,
+ bsearch_strcmp);
return result_key ? values[result_key - keys] : default_value;
}""" % {'s': structName, 'c': columnName}
--
1.7.9.4
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev