BT_LOGV_STR("Creating character field from string field's character field type.");
character = bt_ctf_field_create(character_type);
- for (i = 0; i < string->payload->len + 1; i++) {
- const uint64_t chr = (uint64_t) string->payload->str[i];
+ for (i = 0; i < string->size + 1; i++) {
+ const uint64_t chr = (uint64_t) ((char *) string->buf->data)[i];
ret = bt_ctf_field_integer_unsigned_set_value(character, chr);
BT_ASSERT(ret == 0);
BT_ASSERT_PRE_NON_NULL(length_field, "Length field");
BT_ASSERT_PRE_FIELD_COMMON_IS_SET((void *) length_field, "Length field");
- BT_ASSERT_PRE(common_length_field->type->id == BT_CTF_FIELD_TYPE_ID_INTEGER ||
- common_length_field->type->id == BT_CTF_FIELD_TYPE_ID_ENUM,
+ BT_ASSERT_PRE(common_length_field->type->id == BT_FIELD_TYPE_ID_INTEGER ||
+ common_length_field->type->id == BT_FIELD_TYPE_ID_ENUM,
"Length field must be an integer or enumeration field: %!+wf",
length_field);
- if (common_length_field->type->id == BT_CTF_FIELD_TYPE_ID_ENUM) {
+ if (common_length_field->type->id == BT_FIELD_TYPE_ID_ENUM) {
struct bt_ctf_field_enumeration *enumeration = (void *)
length_field;
BT_LOGD("Creating CTF writer string field object: ft-addr=%p", type);
if (string) {
- bt_field_common_initialize(BT_TO_COMMON(string),
+ bt_field_common_string_initialize(BT_TO_COMMON(string),
(void *) type,
(bt_object_release_func)
bt_ctf_field_string_destroy,