[ovs-dev] [PATCH 3/3] ovsdb-client: Move iterator definition to prevent shadowing.

Daniele Di Proietto diproiettod at ovn.org
Wed Jul 13 06:57:10 UTC 2016


Acked-by: Daniele Di Proietto <diproiettod at vmware.com>

I see that there are a bunch of similar problems in the tree.

Should we fix those? I started working on a series, though a lot of
creative naming is required

Should we enable -Wshadow in configure.ac?

Thanks,

Daniele


2016-07-12 12:19 GMT-07:00 Justin Pettit <jpettit at ovn.org>:

> This doesn't fix a bug, but is more standard.
>
> Signed-off-by: Justin Pettit <jpettit at ovn.org>
> ---
>  ovsdb/ovsdb-client.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/ovsdb/ovsdb-client.c b/ovsdb/ovsdb-client.c
> index 80819a8..25fe903 100644
> --- a/ovsdb/ovsdb-client.c
> +++ b/ovsdb/ovsdb-client.c
> @@ -655,7 +655,6 @@ monitor2_print_table(struct json *table_update2,
>      const struct ovsdb_column_set *columns = &mt->columns;
>      struct shash_node *node;
>      struct table t;
> -    size_t i;
>
>      if (table_update2->type != JSON_OBJECT) {
>          ovs_error(0, "<table-update> for table %s is not object",
> table->name);
> @@ -668,7 +667,7 @@ monitor2_print_table(struct json *table_update2,
>
>      table_add_column(&t, "row");
>      table_add_column(&t, "action");
> -    for (i = 0; i < columns->n_columns; i++) {
> +    for (size_t i = 0; i < columns->n_columns; i++) {
>          table_add_column(&t, "%s", columns->columns[i]->name);
>      }
>      SHASH_FOR_EACH (node, json_object(table_update2)) {
> --
> 1.9.1
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>



More information about the dev mailing list