From 2ac1565f4dab9de1a5e30fbe7f11d2bacccb6550 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Wed, 22 May 2019 09:12:08 +0300 Subject: [PATCH] lib: test-event-flatten - Fix initializators for value Older gcc complains about using anonymous members directly, so instead use nested braces. This fixes the issue. Continues fix in ae3c9db544c40367cded872a5f46dbd6abc8cd78 --- src/lib/test-event-flatten.c | 72 ++++++++++++++++++++++-------------- 1 file changed, 45 insertions(+), 27 deletions(-) diff --git a/src/lib/test-event-flatten.c b/src/lib/test-event-flatten.c index 28414a0fb4..14759b013b 100644 --- a/src/lib/test-event-flatten.c +++ b/src/lib/test-event-flatten.c @@ -145,40 +145,50 @@ static void test_event_flatten_one_parent(void) static struct event_field exp_int = { .key = "abc", .value_type = EVENT_FIELD_VALUE_TYPE_INTMAX, - .value.intmax = 42, - .value.str = NULL, - .value.timeval = {0}, + .value = { + .str = NULL, + .intmax = 42, + .timeval = {0}, + } }; static struct event_field exp_2int[2] = { { .key = "abc", .value_type = EVENT_FIELD_VALUE_TYPE_INTMAX, - .value.intmax = 42, - .value.str = NULL, - .value.timeval = {0}, + .value = { + .intmax = 42, + .str = NULL, + .timeval = {0}, + } }, { .key = "def", .value_type = EVENT_FIELD_VALUE_TYPE_INTMAX, - .value.intmax = 49, - .value.str = NULL, - .value.timeval = {0}, + .value = { + .intmax = 49, + .str = NULL, + .timeval = {0}, + } }, }; static struct event_field exp_1str1int[2] = { { .key = "abc", .value_type = EVENT_FIELD_VALUE_TYPE_STR, - .value.str = "foo", - .value.intmax = 0, - .value.timeval = {0}, + .value = { + .str = "foo", + .intmax = 0, + .timeval = {0}, + } }, { .key = "def", .value_type = EVENT_FIELD_VALUE_TYPE_INTMAX, - .value.intmax = 49, - .value.str = NULL, - .value.timeval = {0}, + .value = { + .intmax = 49, + .str = NULL, + .timeval = {0}, + } }, }; struct event *parent; @@ -218,31 +228,39 @@ static void test_event_flatten_override_parent_field(void) static struct event_field exp_int = { .key = "abc", .value_type = EVENT_FIELD_VALUE_TYPE_INTMAX, - .value.intmax = 42, - .value.str = NULL, - .value.timeval = {0}, + .value = { + .intmax = 42, + .str = NULL, + .timeval = {0}, + } }; static struct event_field exp_str = { .key = "abc", .value_type = EVENT_FIELD_VALUE_TYPE_STR, - .value.str = "def", - .value.intmax = 0, - .value.timeval = {0}, + .value = { + .str = "def", + .intmax = 0, + .timeval = {0}, + } }; static struct event_field exp_2str[2] = { { .key = "abc", .value_type = EVENT_FIELD_VALUE_TYPE_STR, - .value.str = "def", - .value.intmax = 0, - .value.timeval = {0}, + .value = { + .str = "def", + .intmax = 0, + .timeval = {0}, + } }, { .key = "foo", .value_type = EVENT_FIELD_VALUE_TYPE_STR, - .value.str = "bar", - .value.intmax = 0, - .value.timeval = {0}, + .value = { + .str = "bar", + .intmax = 0, + .timeval = {0}, + } }, }; struct event *parent; -- 2.47.3