Rename: bt_put(), bt_get() -> bt_object_put_ref(), bt_object_get_ref()
[babeltrace.git] / plugins / ctf / common / metadata / ctf-meta-translate.c
index 2829a0578cd65fcef4c7d0fd574a4289656b6aaf..08b7499edd5550133c199322df4303aa48bbb8da 100644 (file)
@@ -152,7 +152,7 @@ struct bt_field_class *ctf_field_class_struct_to_ir(
                ret = bt_field_class_structure_append_member(ir_fc,
                        named_fc->name->str, member_ir_fc);
                BT_ASSERT(ret == 0);
-               bt_put(member_ir_fc);
+               bt_object_put_ref(member_ir_fc);
        }
 
        return ir_fc;
@@ -205,7 +205,7 @@ struct bt_field_class *ctf_field_class_variant_to_ir(
                ret = bt_field_class_variant_append_option(ir_fc,
                        named_fc->name->str, option_ir_fc);
                BT_ASSERT(ret == 0);
-               bt_put(option_ir_fc);
+               bt_object_put_ref(option_ir_fc);
        }
 
        return ir_fc;
@@ -231,7 +231,7 @@ struct bt_field_class *ctf_field_class_array_to_ir(
        BT_ASSERT(elem_ir_fc);
        ir_fc = bt_field_class_static_array_create(elem_ir_fc, fc->length);
        BT_ASSERT(ir_fc);
-       bt_put(elem_ir_fc);
+       bt_object_put_ref(elem_ir_fc);
 
 end:
        return ir_fc;
@@ -258,7 +258,7 @@ struct bt_field_class *ctf_field_class_sequence_to_ir(
        BT_ASSERT(elem_ir_fc);
        ir_fc = bt_field_class_dynamic_array_create(elem_ir_fc);
        BT_ASSERT(ir_fc);
-       bt_put(elem_ir_fc);
+       bt_object_put_ref(elem_ir_fc);
        BT_ASSERT(ir_fc);
        ret = bt_field_class_dynamic_array_set_length_field_class(ir_fc,
                borrow_ir_ft_from_field_path(&fc->length_path, tc, sc, ec));
@@ -279,29 +279,29 @@ struct bt_field_class *ctf_field_class_to_ir(struct ctf_field_class *fc,
        BT_ASSERT(fc);
        BT_ASSERT(fc->in_ir);
 
-       switch (fc->id) {
-       case CTF_FIELD_CLASS_ID_INT:
+       switch (fc->type) {
+       case CTF_FIELD_CLASS_TYPE_INT:
                ir_fc = ctf_field_class_int_to_ir((void *) fc);
                break;
-       case CTF_FIELD_CLASS_ID_ENUM:
+       case CTF_FIELD_CLASS_TYPE_ENUM:
                ir_fc = ctf_field_class_enum_to_ir((void *) fc);
                break;
-       case CTF_FIELD_CLASS_ID_FLOAT:
+       case CTF_FIELD_CLASS_TYPE_FLOAT:
                ir_fc = ctf_field_class_float_to_ir((void *) fc);
                break;
-       case CTF_FIELD_CLASS_ID_STRING:
+       case CTF_FIELD_CLASS_TYPE_STRING:
                ir_fc = ctf_field_class_string_to_ir((void *) fc);
                break;
-       case CTF_FIELD_CLASS_ID_STRUCT:
+       case CTF_FIELD_CLASS_TYPE_STRUCT:
                ir_fc = ctf_field_class_struct_to_ir((void *) fc, tc, sc, ec);
                break;
-       case CTF_FIELD_CLASS_ID_ARRAY:
+       case CTF_FIELD_CLASS_TYPE_ARRAY:
                ir_fc = ctf_field_class_array_to_ir((void *) fc, tc, sc, ec);
                break;
-       case CTF_FIELD_CLASS_ID_SEQUENCE:
+       case CTF_FIELD_CLASS_TYPE_SEQUENCE:
                ir_fc = ctf_field_class_sequence_to_ir((void *) fc, tc, sc, ec);
                break;
-       case CTF_FIELD_CLASS_ID_VARIANT:
+       case CTF_FIELD_CLASS_TYPE_VARIANT:
                ir_fc = ctf_field_class_variant_to_ir((void *) fc, tc, sc, ec);
                break;
        default:
@@ -345,7 +345,7 @@ struct bt_field_class *scope_ctf_field_class_to_ir(struct ctf_field_class *fc,
                goto end;
        }
 
-       BT_ASSERT(fc->id == CTF_FIELD_CLASS_ID_STRUCT);
+       BT_ASSERT(fc->type == CTF_FIELD_CLASS_TYPE_STRUCT);
 
        if (!ctf_field_class_struct_has_immediate_member_in_ir((void *) fc)) {
                /*
@@ -377,8 +377,8 @@ struct ctf_field_class_int *borrow_named_int_field_class(
                goto end;
        }
 
-       if (named_fc->fc->id != CTF_FIELD_CLASS_ID_INT &&
-                       named_fc->fc->id != CTF_FIELD_CLASS_ID_ENUM) {
+       if (named_fc->fc->type != CTF_FIELD_CLASS_TYPE_INT &&
+                       named_fc->fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
                goto end;
        }
 
@@ -405,7 +405,7 @@ struct bt_event_class *ctf_event_class_to_ir(struct ctf_event_class *ec,
 
        ir_ec = bt_event_class_create_with_id(ir_sc, ec->id);
        BT_ASSERT(ir_ec);
-       bt_put(ir_ec);
+       bt_object_put_ref(ir_ec);
 
        if (ec->spec_context_fc) {
                struct bt_field_class *ir_fc = scope_ctf_field_class_to_ir(
@@ -415,7 +415,7 @@ struct bt_event_class *ctf_event_class_to_ir(struct ctf_event_class *ec,
                        ret = bt_event_class_set_specific_context_field_class(
                                ir_ec, ir_fc);
                        BT_ASSERT(ret == 0);
-                       bt_put(ir_fc);
+                       bt_object_put_ref(ir_fc);
                }
        }
 
@@ -427,7 +427,7 @@ struct bt_event_class *ctf_event_class_to_ir(struct ctf_event_class *ec,
                        ret = bt_event_class_set_payload_field_class(ir_ec,
                                ir_fc);
                        BT_ASSERT(ret == 0);
-                       bt_put(ir_fc);
+                       bt_object_put_ref(ir_fc);
                }
        }
 
@@ -470,7 +470,7 @@ struct bt_stream_class *ctf_stream_class_to_ir(struct ctf_stream_class *sc,
 
        ir_sc = bt_stream_class_create_with_id(ir_trace, sc->id);
        BT_ASSERT(ir_sc);
-       bt_put(ir_sc);
+       bt_object_put_ref(ir_sc);
 
        if (sc->packet_context_fc) {
                struct bt_field_class *ir_fc = scope_ctf_field_class_to_ir(
@@ -480,7 +480,7 @@ struct bt_stream_class *ctf_stream_class_to_ir(struct ctf_stream_class *sc,
                        ret = bt_stream_class_set_packet_context_field_class(
                                ir_sc, ir_fc);
                        BT_ASSERT(ret == 0);
-                       bt_put(ir_fc);
+                       bt_object_put_ref(ir_fc);
                }
        }
 
@@ -492,7 +492,7 @@ struct bt_stream_class *ctf_stream_class_to_ir(struct ctf_stream_class *sc,
                        ret = bt_stream_class_set_event_header_field_class(ir_sc,
                                ir_fc);
                        BT_ASSERT(ret == 0);
-                       bt_put(ir_fc);
+                       bt_object_put_ref(ir_fc);
                }
        }
 
@@ -504,7 +504,7 @@ struct bt_stream_class *ctf_stream_class_to_ir(struct ctf_stream_class *sc,
                        ret = bt_stream_class_set_event_common_context_field_class(
                                ir_sc, ir_fc);
                        BT_ASSERT(ret == 0);
-                       bt_put(ir_fc);
+                       bt_object_put_ref(ir_fc);
                }
        }
 
@@ -586,7 +586,7 @@ int ctf_trace_class_to_ir(struct bt_trace *ir_trace,
                        ret = bt_trace_set_packet_header_field_class(ir_trace,
                                ir_fc);
                        BT_ASSERT(ret == 0);
-                       bt_put(ir_fc);
+                       bt_object_put_ref(ir_fc);
                }
        }
 
This page took 0.026809 seconds and 4 git commands to generate.