return true;
}
-int bt_private_field_class_integer_set_field_value_range(
+void bt_private_field_class_integer_set_field_value_range(
struct bt_private_field_class *priv_fc, uint64_t size)
{
struct bt_field_class *fc = (void *) priv_fc;
"which are outside this range: %!+F, size=%" PRIu64, fc, size);
int_fc->range = size;
BT_LIB_LOGV("Set integer field class's field value range: %!+F", fc);
- return 0;
}
enum bt_field_class_integer_preferred_display_base
return int_fc->base;
}
-int bt_private_field_class_integer_set_preferred_display_base(
+void bt_private_field_class_integer_set_preferred_display_base(
struct bt_private_field_class *priv_fc,
enum bt_field_class_integer_preferred_display_base base)
{
BT_ASSERT_PRE_FC_HOT(fc, "Field class");
int_fc->base = base;
BT_LIB_LOGV("Set integer field class's preferred display base: %!+F", fc);
- return 0;
}
static
}
g_array_free(fc->mappings, TRUE);
+ fc->mappings = NULL;
}
if (fc->label_buf) {
g_ptr_array_free(fc->label_buf, TRUE);
+ fc->label_buf = NULL;
}
g_free(fc);
return real_fc->is_single_precision;
}
-int bt_private_field_class_real_set_is_single_precision(
+void bt_private_field_class_real_set_is_single_precision(
struct bt_private_field_class *priv_fc,
bt_bool is_single_precision)
{
real_fc->is_single_precision = (bool) is_single_precision;
BT_LIB_LOGV("Set real field class's \"is single precision\" property: "
"%!+F", fc);
- return 0;
}
static
}
BT_LOGD_STR("Putting named field class's field class.");
- bt_object_put_ref(named_fc->fc);
+ BT_OBJECT_PUT_REF_AND_RESET(named_fc->fc);
}
static
BT_LIB_LOGD("Destroying variant field class object: %!+F", fc);
finalize_named_field_classes_container((void *) fc);
BT_LOGD_STR("Putting selector field path.");
- bt_object_put_ref(fc->selector_field_path);
+ BT_OBJECT_PUT_REF_AND_RESET(fc->selector_field_path);
+ BT_LOGD_STR("Putting selector field class.");
+ BT_OBJECT_PUT_REF_AND_RESET(fc->selector_fc);
g_free(fc);
}
BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
BT_ASSERT_PRE_FC_IS_ENUM(selector_fc, "Selector field class");
BT_ASSERT_PRE_FC_HOT(fc, "Variant field class");
- var_fc->selector_fc = (void *) selector_fc;
+ var_fc->selector_fc = bt_object_get_ref(selector_fc);
bt_field_class_freeze((void *) selector_fc);
return 0;
}
{
BT_ASSERT(array_fc);
BT_LOGD_STR("Putting element field class.");
- bt_object_put_ref(array_fc->element_fc);
+ BT_OBJECT_PUT_REF_AND_RESET(array_fc->element_fc);
}
static
BT_LIB_LOGD("Destroying dynamic array field class object: %!+F", fc);
finalize_array_field_class((void *) fc);
BT_LOGD_STR("Putting length field path.");
- bt_object_put_ref(fc->length_field_path);
+ BT_OBJECT_PUT_REF_AND_RESET(fc->length_field_path);
+ BT_LOGD_STR("Putting length field class.");
+ BT_OBJECT_PUT_REF_AND_RESET(fc->length_fc);
g_free(fc);
}
"Field class");
BT_ASSERT_PRE_FC_IS_UNSIGNED_INT(length_fc, "Length field class");
BT_ASSERT_PRE_FC_HOT(fc, "Dynamic array field class");
- array_fc->length_fc = length_fc;
+ array_fc->length_fc = bt_object_get_ref(length_fc);
bt_field_class_freeze(length_fc);
return 0;
}