From 586411e520c7cb71f6b0d8a4763bde72d637915e Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Thu, 11 Feb 2016 18:23:26 -0500 Subject: [PATCH] ir: freeze mapped clock when freezing integer FT MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- formats/ctf/ir/field-types.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/formats/ctf/ir/field-types.c b/formats/ctf/ir/field-types.c index 1613dd191..b6c2102fb 100644 --- a/formats/ctf/ir/field-types.c +++ b/formats/ctf/ir/field-types.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -90,6 +91,8 @@ void (* const type_destroy_funcs[])(struct bt_ctf_field_type *) = { static void generic_field_type_freeze(struct bt_ctf_field_type *); static +void bt_ctf_field_type_integer_freeze(struct bt_ctf_field_type *); +static void bt_ctf_field_type_enumeration_freeze(struct bt_ctf_field_type *); static void bt_ctf_field_type_structure_freeze(struct bt_ctf_field_type *); @@ -102,7 +105,7 @@ void bt_ctf_field_type_sequence_freeze(struct bt_ctf_field_type *); static type_freeze_func const type_freeze_funcs[] = { - [BT_CTF_TYPE_ID_INTEGER] = generic_field_type_freeze, + [BT_CTF_TYPE_ID_INTEGER] = bt_ctf_field_type_integer_freeze, [BT_CTF_TYPE_ID_ENUM] = bt_ctf_field_type_enumeration_freeze, [BT_CTF_TYPE_ID_FLOAT] = generic_field_type_freeze, [BT_CTF_TYPE_ID_STRUCT] = bt_ctf_field_type_structure_freeze, @@ -2680,6 +2683,19 @@ void generic_field_type_freeze(struct bt_ctf_field_type *type) type->frozen = 1; } +static +void bt_ctf_field_type_integer_freeze(struct bt_ctf_field_type *type) +{ + struct bt_ctf_field_type_integer *integer_type = container_of( + type, struct bt_ctf_field_type_integer, parent); + + if (integer_type->mapped_clock) { + bt_ctf_clock_freeze(integer_type->mapped_clock); + } + + generic_field_type_freeze(type); +} + static void bt_ctf_field_type_enumeration_freeze(struct bt_ctf_field_type *type) { -- 2.34.1