struct structure_field *field = structure->fields->pdata[i];
BT_LOGD("Serializing structure field type's field metadata: "
- "index=%" PRId64 ", "
+ "index=%zu, "
"field-ft-addr=%p, field-name=\"%s\"",
i, field, g_quark_to_string(field->name));
ret = bt_ctf_field_type_serialize(field->type, context);
if (ret) {
BT_LOGW("Cannot serialize structure field type's field's metadata: "
- "index=%" PRId64 ", "
+ "index=%zu, "
"field-ft-addr=%p, field-name=\"%s\"",
i, field->type,
g_quark_to_string(field->name));
struct structure_field *field = variant->fields->pdata[i];
BT_LOGD("Serializing variant field type's field metadata: "
- "index=%" PRId64 ", "
+ "index=%zu, "
"field-ft-addr=%p, field-name=\"%s\"",
i, field, g_quark_to_string(field->name));
ret = bt_ctf_field_type_serialize(field->type, context);
if (ret) {
BT_LOGW("Cannot serialize variant field type's field's metadata: "
- "index=%" PRId64 ", "
+ "index=%zu, "
"field-ft-addr=%p, field-name=\"%s\"",
i, field->type,
g_quark_to_string(field->name));
switch (type_id) {
case CTF_TYPE_STRUCT:
- bt_ctf_field_type_structure_get_field_by_index(field_type,
- NULL, &field, index);
+ {
+ int ret = bt_ctf_field_type_structure_get_field_by_index(
+ field_type, NULL, &field, index);
+ if (ret) {
+ field = NULL;
+ goto end;
+ }
break;
+ }
case CTF_TYPE_VARIANT:
{
int ret = bt_ctf_field_type_variant_get_field_by_index(