ir: freeze mapped clock when freezing integer FT
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 11 Feb 2016 23:23:26 +0000 (18:23 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 19 Feb 2016 22:21:34 +0000 (17:21 -0500)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
formats/ctf/ir/field-types.c

index 1613dd19178ea2f9e7e19d4085982b2a3d62753d..b6c2102fb08335d4cbd06d88925b8476c8081b9d 100644 (file)
@@ -31,6 +31,7 @@
 #include <babeltrace/ctf-ir/utils.h>
 #include <babeltrace/ref.h>
 #include <babeltrace/ctf-ir/clock.h>
+#include <babeltrace/ctf-ir/clock-internal.h>
 #include <babeltrace/ctf-writer/writer-internal.h>
 #include <babeltrace/object-internal.h>
 #include <babeltrace/ref.h>
@@ -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)
 {
This page took 0.039519 seconds and 4 git commands to generate.