bt_value_map_extend(): make base/extension objects `const`
[deliverable/babeltrace.git] / lib / trace-ir / event-class.c
index e47c77f8548a485d60c3629b868d96ed5f6851e1..895557aa9e5911c6cbd0d0ce15ec5e37b51b7642 100644 (file)
@@ -42,7 +42,7 @@
 #include <babeltrace/trace-ir/trace-internal.h>
 #include <babeltrace/trace-ir/utils-internal.h>
 #include <babeltrace/trace-ir/resolve-field-path-internal.h>
-#include <babeltrace/ref.h>
+#include <babeltrace/object.h>
 #include <babeltrace/trace-ir/attributes-internal.h>
 #include <babeltrace/compiler-internal.h>
 #include <babeltrace/endian-internal.h>
@@ -71,9 +71,9 @@ void destroy_event_class(struct bt_object *obj)
        }
 
        BT_LOGD_STR("Putting context field classe.");
-       bt_put(event_class->specific_context_fc);
+       bt_object_put_ref(event_class->specific_context_fc);
        BT_LOGD_STR("Putting payload field classe.");
-       bt_put(event_class->payload_fc);
+       bt_object_put_ref(event_class->payload_fc);
        bt_object_pool_finalize(&event_class->event_pool);
        g_free(obj);
 }
@@ -161,7 +161,7 @@ struct bt_event_class *create_event_class_with_id(
        goto end;
 
 error:
-       BT_PUT(event_class);
+       BT_OBJECT_PUT_REF_AND_RESET(event_class);
 
 end:
        return event_class;
@@ -284,8 +284,8 @@ int bt_event_class_set_specific_context_field_class(
        BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
        BT_ASSERT_PRE_NON_NULL(field_class, "Field class");
        BT_ASSERT_PRE_EVENT_CLASS_HOT(event_class);
-       BT_ASSERT_PRE(bt_field_class_get_id(field_class) ==
-               BT_FIELD_CLASS_ID_STRUCTURE,
+       BT_ASSERT_PRE(bt_field_class_get_type(field_class) ==
+               BT_FIELD_CLASS_TYPE_STRUCTURE,
                "Specific context field classe is not a structure field classe: "
                "%!+F", field_class);
        stream_class = bt_event_class_borrow_stream_class_inline(
@@ -303,8 +303,8 @@ int bt_event_class_set_specific_context_field_class(
        }
 
        bt_field_class_make_part_of_trace(field_class);
-       bt_put(event_class->specific_context_fc);
-       event_class->specific_context_fc = bt_get(field_class);
+       bt_object_put_ref(event_class->specific_context_fc);
+       event_class->specific_context_fc = bt_object_get_ref(field_class);
        bt_field_class_freeze(field_class);
        BT_LIB_LOGV("Set event class's specific context field classe: %!+E",
                event_class);
@@ -338,8 +338,8 @@ int bt_event_class_set_payload_field_class(struct bt_event_class *event_class,
        BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
        BT_ASSERT_PRE_NON_NULL(field_class, "Field class");
        BT_ASSERT_PRE_EVENT_CLASS_HOT(event_class);
-       BT_ASSERT_PRE(bt_field_class_get_id(field_class) ==
-               BT_FIELD_CLASS_ID_STRUCTURE,
+       BT_ASSERT_PRE(bt_field_class_get_type(field_class) ==
+               BT_FIELD_CLASS_TYPE_STRUCTURE,
                "Payload field classe is not a structure field classe: %!+F",
                field_class);
        stream_class = bt_event_class_borrow_stream_class_inline(
@@ -358,8 +358,8 @@ int bt_event_class_set_payload_field_class(struct bt_event_class *event_class,
        }
 
        bt_field_class_make_part_of_trace(field_class);
-       bt_put(event_class->payload_fc);
-       event_class->payload_fc = bt_get(field_class);
+       bt_object_put_ref(event_class->payload_fc);
+       event_class->payload_fc = bt_object_get_ref(field_class);
        bt_field_class_freeze(field_class);
        BT_LIB_LOGV("Set event class's payload field classe: %!+E", event_class);
 
This page took 0.02632 seconds and 5 git commands to generate.