From fa37affad362df15fc59db00aa96ee79cd5eebd9 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 24 May 2018 10:32:59 -0700 Subject: 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 Acked-by: Justin Pettit Tested-by: Alin Gabriel Serdean Acked-by: Alin Gabriel Serdean --- ovsdb/storage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ovsdb/storage.c') 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) { -- cgit v1.2.1