- int ret = 0;
- struct stack_entry *entry;
-
- BT_ASSERT(stack);
- BT_ASSERT(base_type);
- BT_LOGV("Pushing field type on stack: stack-addr=%p, "
- "ft-addr=%p, ft-id=%s, base-length=%zu, "
- "stack-size-before=%u, stack-size-after=%u",
- stack, base_type, bt_common_field_type_id_string(
- bt_field_type_get_type_id(base_type)),
- base_len, stack->entries->len, stack->entries->len + 1);
- entry = g_new0(struct stack_entry, 1);
- if (!entry) {
- BT_LOGE("Failed to allocate one stack entry: stack-addr=%p",
- stack);
- ret = BT_BTR_STATUS_ERROR;
- goto end;
- }
-
- entry->base_type = base_type;
- entry->base_len = base_len;
- g_ptr_array_add(stack->entries, entry);
-
-end:
- return ret;
-}
-
-static
-int stack_push_with_len(struct bt_btr *btr,
- struct bt_field_type *base_type)
-{
- int ret = 0;
- int64_t base_len = get_compound_field_type_length(btr, base_type);