From bf5817d2737f6b341bcdcc485b6c29c5e50b6957 Mon Sep 17 00:00:00 2001 From: "Peter A. Bigot" Date: Fri, 1 Nov 2019 11:07:53 -0500 Subject: [PATCH] Bluetooth: rework to support C++20 designated initializers C++ does not allow chaining of data members when identifying the designator. Since the generic structure has only one member remove the designator from its internal initializer. Signed-off-by: Peter A. Bigot --- include/bluetooth/uuid.h | 6 +++--- subsys/bluetooth/host/uuid.c | 2 +- subsys/bluetooth/mesh/main.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/bluetooth/uuid.h b/include/bluetooth/uuid.h index 4226c4d976e..4faf696d132 100644 --- a/include/bluetooth/uuid.h +++ b/include/bluetooth/uuid.h @@ -52,19 +52,19 @@ struct bt_uuid_128 { #define BT_UUID_INIT_16(value) \ { \ - .uuid.type = BT_UUID_TYPE_16, \ + .uuid = { BT_UUID_TYPE_16 }, \ .val = (value), \ } #define BT_UUID_INIT_32(value) \ { \ - .uuid.type = BT_UUID_TYPE_32, \ + .uuid = { BT_UUID_TYPE_32 }, \ .val = (value), \ } #define BT_UUID_INIT_128(value...) \ { \ - .uuid.type = BT_UUID_TYPE_128, \ + .uuid = { BT_UUID_TYPE_128 }, \ .val = { value }, \ } diff --git a/subsys/bluetooth/host/uuid.c b/subsys/bluetooth/host/uuid.c index 30eaccebd8a..193fe23f7ae 100644 --- a/subsys/bluetooth/host/uuid.c +++ b/subsys/bluetooth/host/uuid.c @@ -23,7 +23,7 @@ * big endian 0x2800 : [28 00] -> swapping required */ static const struct bt_uuid_128 uuid128_base = { - .uuid.type = BT_UUID_TYPE_128, + .uuid = { BT_UUID_TYPE_128 }, .val = { BT_UUID_128_ENCODE( 0x00000000, 0x0000, 0x1000, 0x8000, 0x00805F9B34FB) } }; diff --git a/subsys/bluetooth/mesh/main.c b/subsys/bluetooth/mesh/main.c index 1e36a96e720..1b20b233e01 100644 --- a/subsys/bluetooth/mesh/main.c +++ b/subsys/bluetooth/mesh/main.c @@ -167,7 +167,7 @@ int bt_mesh_prov_enable(bt_mesh_prov_bearer_t bearers) if (IS_ENABLED(CONFIG_BT_DEBUG)) { const struct bt_mesh_prov *prov = bt_mesh_prov_get(); - struct bt_uuid_128 uuid = { .uuid.type = BT_UUID_TYPE_128 }; + struct bt_uuid_128 uuid = { .uuid = { BT_UUID_TYPE_128 } }; memcpy(uuid.val, prov->uuid, 16); BT_INFO("Device UUID: %s", bt_uuid_str(&uuid.uuid));