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/ovsdb-parser.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/ovsdb-parser.c')
-rw-r--r-- | lib/ovsdb-parser.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ovsdb-parser.c b/lib/ovsdb-parser.c index 42937b649..38119c195 100644 --- a/lib/ovsdb-parser.c +++ b/lib/ovsdb-parser.c @@ -83,7 +83,7 @@ ovsdb_parser_member(struct ovsdb_parser *parser, const char *name, if (((int) value->type >= 0 && value->type < JSON_N_TYPES && types & (1u << value->type)) || (types & OP_ID && value->type == JSON_STRING - && ovsdb_parser_is_id(value->u.string))) + && ovsdb_parser_is_id(value->string))) { sset_add(&parser->used, name); return value; |