diff options
author | Ben Pfaff <blp@ovn.org> | 2018-05-24 10:32:59 -0700 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2018-05-25 13:36:05 -0700 |
commit | fa37affad362df15fc59db00aa96ee79cd5eebd9 (patch) | |
tree | f539cdab21f0951aa8bb7c8b6984d9854d33112d /lib/db-ctl-base.c | |
parent | 3d62892884d88cf1d0d02f58b3317e6ec0ca8971 (diff) | |
download | openvswitch-fa37affad362df15fc59db00aa96ee79cd5eebd9.tar.gz |
Embrace anonymous unions.
Several OVS structs contain embedded named unions, like this:
struct {
...
union {
...
} u;
};
C11 standardized a feature that many compilers already implemented
anyway, where an embedded union may be unnamed, like this:
struct {
...
union {
...
};
};
This is more convenient because it allows the programmer to omit "u."
in many places. OVS already used this feature in several places. This
commit embraces it in several others.
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
Tested-by: Alin Gabriel Serdean <aserdean@ovn.org>
Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
Diffstat (limited to 'lib/db-ctl-base.c')
-rw-r--r-- | lib/db-ctl-base.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/db-ctl-base.c b/lib/db-ctl-base.c index bfd7a54a8..f2a17f7d1 100644 --- a/lib/db-ctl-base.c +++ b/lib/db-ctl-base.c @@ -1809,12 +1809,12 @@ cmd_show_row(struct ctl_context *ctx, const struct ovsdb_idl_row *row, datum = ovsdb_idl_read(row, column); if (column->type.key.type == OVSDB_TYPE_UUID && - column->type.key.u.uuid.refTableName) { + column->type.key.uuid.refTableName) { const struct cmd_show_table *ref_show; size_t j; ref_show = cmd_show_find_table_by_name( - column->type.key.u.uuid.refTableName); + column->type.key.uuid.refTableName); if (ref_show) { for (j = 0; j < datum->n; j++) { const struct ovsdb_idl_row *ref_row; @@ -1830,14 +1830,14 @@ cmd_show_row(struct ctl_context *ctx, const struct ovsdb_idl_row *row, } } else if (ovsdb_type_is_map(&column->type) && column->type.value.type == OVSDB_TYPE_UUID && - column->type.value.u.uuid.refTableName) { + column->type.value.uuid.refTableName) { const struct cmd_show_table *ref_show; size_t j; /* Prints the key to ref'ed table name map if the ref'ed table * is also defined in 'cmd_show_tables'. */ ref_show = cmd_show_find_table_by_name( - column->type.value.u.uuid.refTableName); + column->type.value.uuid.refTableName); if (ref_show && ref_show->name_column) { ds_put_char_multiple(&ctx->output, ' ', (level + 1) * 4); ds_put_format(&ctx->output, "%s:\n", column->name); |