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 /ovsdb/storage.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 'ovsdb/storage.c')
-rw-r--r-- | ovsdb/storage.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ovsdb/storage.c b/ovsdb/storage.c index 446cae086..b810bff04 100644 --- a/ovsdb/storage.c +++ b/ovsdb/storage.c @@ -246,12 +246,12 @@ ovsdb_storage_read(struct ovsdb_storage *storage, raft_next_entry(storage->raft, txnid, &is_snapshot)); if (!json) { return NULL; - } else if (json->type != JSON_ARRAY || json->u.array.n != 2) { + } else if (json->type != JSON_ARRAY || json->array.n != 2) { json_destroy(json); return ovsdb_error(NULL, "invalid commit format"); } - struct json **e = json->u.array.elems; + struct json **e = json->array.elems; schema_json = e[0]->type != JSON_NULL ? e[0] : NULL; txn_json = e[1]->type != JSON_NULL ? e[1] : NULL; } else if (storage->log) { |