scope = parent_scope;
}
- bt_put(ctx->trace);
+ bt_object_put_ref(ctx->trace);
if (ctx->ctf_tc) {
ctf_trace_class_destroy(ctx->ctf_tc);
goto error;
}
- if (nested_decl->id == CTF_FIELD_CLASS_ID_INT) {
+ if (nested_decl->type == CTF_FIELD_CLASS_TYPE_INT) {
/* Pointer: force integer's base to 16 */
struct ctf_field_class_int *int_fc =
(void *) nested_decl;
}
/* Do not allow field class def and alias of untagged variants */
- if (class_decl->id == CTF_FIELD_CLASS_ID_VARIANT) {
+ if (class_decl->type == CTF_FIELD_CLASS_TYPE_VARIANT) {
struct ctf_field_class_variant *var_fc =
(void *) class_decl;
}
/* Do not allow field class def and alias of untagged variants */
- if (class_decl->id == CTF_FIELD_CLASS_ID_VARIANT) {
+ if (class_decl->type == CTF_FIELD_CLASS_TYPE_VARIANT) {
struct ctf_field_class_variant *var_fc = (void *) class_decl;
if (var_fc->tag_path.path->len == 0) {
BT_ASSERT(integer_decl);
- if (integer_decl->base.base.id != CTF_FIELD_CLASS_ID_INT) {
+ if (integer_decl->base.base.type != CTF_FIELD_CLASS_TYPE_INT) {
BT_LOGE("Container field class for enumeration field class is not an integer field class: "
- "fc-id=%d", integer_decl->base.base.id);
+ "fc-type=%d", integer_decl->base.base.type);
ret = -EINVAL;
goto error;
}
(*integer_decl)->is_signed = (signedness > 0);
(*integer_decl)->disp_base = base;
(*integer_decl)->encoding = encoding;
- (*integer_decl)->mapped_clock_class = bt_get(mapped_clock_class);
+ (*integer_decl)->mapped_clock_class = bt_object_get_ref(mapped_clock_class);
return 0;
error:
goto end;
}
- if (fc->id != CTF_FIELD_CLASS_ID_INT &&
- fc->id != CTF_FIELD_CLASS_ID_ENUM) {
+ if (fc->type != CTF_FIELD_CLASS_TYPE_INT &&
+ fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
goto end;
}
"default");
BT_ASSERT(ret == 0);
g_ptr_array_add(ctx->ctf_tc->clock_classes,
- bt_get(clock_class_to_map_to));
+ bt_object_get_ref(clock_class_to_map_to));
break;
case 1:
/*
* this one.
*/
clock_class_to_map_to =
- bt_get(ctx->ctf_tc->clock_classes->pdata[0]);
+ bt_object_get_ref(ctx->ctf_tc->clock_classes->pdata[0]);
break;
default:
/*
}
BT_ASSERT(clock_class_to_map_to);
- int_fc->mapped_clock_class = bt_get(clock_class_to_map_to);
+ int_fc->mapped_clock_class = bt_object_get_ref(clock_class_to_map_to);
end:
- bt_put(clock_class_to_map_to);
+ bt_object_put_ref(clock_class_to_map_to);
return ret;
}
goto end;
}
- if (root_fc->id != CTF_FIELD_CLASS_ID_STRUCT &&
- root_fc->id != CTF_FIELD_CLASS_ID_VARIANT) {
+ if (root_fc->type != CTF_FIELD_CLASS_TYPE_STRUCT &&
+ root_fc->type != CTF_FIELD_CLASS_TYPE_VARIANT) {
goto end;
}
- if (root_fc->id == CTF_FIELD_CLASS_ID_STRUCT) {
+ if (root_fc->type == CTF_FIELD_CLASS_TYPE_STRUCT) {
count = struct_fc->members->len;
} else {
count = var_fc->options->len;
for (i = 0; i < count; i++) {
struct ctf_named_field_class *named_fc = NULL;
- if (root_fc->id == CTF_FIELD_CLASS_ID_STRUCT) {
+ if (root_fc->type == CTF_FIELD_CLASS_TYPE_STRUCT) {
named_fc = ctf_field_class_struct_borrow_member_by_index(
struct_fc, i);
- } else if (root_fc->id == CTF_FIELD_CLASS_ID_VARIANT) {
+ } else if (root_fc->type == CTF_FIELD_CLASS_TYPE_VARIANT) {
named_fc = ctf_field_class_variant_borrow_option_by_index(
var_fc, i);
}
goto error;
}
- 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) {
_BT_LOGE_NODE(node,
"Stream class has a `id` attribute, "
"but trace's packet header field class's `stream_id` field is not an integer field class.");
ret = bt_clock_class_set_offset(clock, offset_seconds, offset_cycles);
BT_ASSERT(ret == 0);
apply_clock_class_offset(ctx, clock);
- g_ptr_array_add(ctx->ctf_tc->clock_classes, bt_get(clock));
+ g_ptr_array_add(ctx->ctf_tc->clock_classes, bt_object_get_ref(clock));
end:
- BT_PUT(clock);
+ BT_OBJECT_PUT_REF_AND_RESET(clock);
return ret;
}
BT_ASSERT(ctx);
BT_ASSERT(ctx->trace);
- return bt_get(ctx->trace);
+ return bt_object_get_ref(ctx->trace);
}
BT_HIDDEN