bt_common_field_class_type_string(type));
int_fc = g_new0(struct bt_field_class_integer, 1);
if (!int_fc) {
- BT_LOGE_STR("Failed to allocate one integer field class.");
+ BT_LIB_LOGE_APPEND_CAUSE(
+ "Failed to allocate one integer field class.");
goto error;
}
bt_common_field_class_type_string(type));
enum_fc = g_new0(struct bt_field_class_enumeration, 1);
if (!enum_fc) {
- BT_LOGE_STR("Failed to allocate one enumeration field class.");
+ BT_LIB_LOGE_APPEND_CAUSE(
+ "Failed to allocate one enumeration field class.");
goto error;
}
enum_fc->mappings = g_array_new(FALSE, TRUE,
sizeof(struct bt_field_class_enumeration_mapping));
if (!enum_fc->mappings) {
- BT_LOGE_STR("Failed to allocate a GArray.");
+ BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GArray.");
goto error;
}
enum_fc->label_buf = g_ptr_array_new();
if (!enum_fc->label_buf) {
- BT_LOGE_STR("Failed to allocate a GArray.");
+ BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GArray.");
goto error;
}
BT_LOGD_STR("Creating default real field class object.");
real_fc = g_new0(struct bt_field_class_real, 1);
if (!real_fc) {
- BT_LOGE_STR("Failed to allocate one real field class.");
+ BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate one real field class.");
goto error;
}
fc->named_fcs = g_array_new(FALSE, TRUE,
sizeof(struct bt_named_field_class));
if (!fc->named_fcs) {
- BT_LOGE_STR("Failed to allocate a GArray.");
+ BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GArray.");
ret = -1;
goto end;
}
fc->name_to_index = g_hash_table_new(g_str_hash, g_str_equal);
if (!fc->name_to_index) {
- BT_LOGE_STR("Failed to allocate a GHashTable.");
+ BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GHashTable.");
ret = -1;
goto end;
}
BT_LOGD_STR("Creating default structure field class object.");
struct_fc = g_new0(struct bt_field_class_structure, 1);
if (!struct_fc) {
- BT_LOGE_STR("Failed to allocate one structure field class.");
+ BT_LIB_LOGE_APPEND_CAUSE(
+ "Failed to allocate one structure field class.");
goto error;
}
"%![container-fc-]+F, name=\"%s\"", container_fc, name);
name_str = g_string_new(name);
if (!name_str) {
- BT_LOGE_STR("Failed to allocate a GString.");
+ BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GString.");
ret = BT_FUNC_STATUS_MEMORY_ERROR;
goto end;
}
BT_LOGD_STR("Creating default variant field class object.");
var_fc = g_new0(struct bt_field_class_variant, 1);
if (!var_fc) {
- BT_LOGE_STR("Failed to allocate one variant field class.");
+ BT_LIB_LOGE_APPEND_CAUSE(
+ "Failed to allocate one variant field class.");
goto error;
}
BT_LOGD_STR("Creating default static array field class object.");
array_fc = g_new0(struct bt_field_class_static_array, 1);
if (!array_fc) {
- BT_LOGE_STR("Failed to allocate one static array field class.");
+ BT_LIB_LOGE_APPEND_CAUSE(
+ "Failed to allocate one static array field class.");
goto error;
}
BT_LOGD_STR("Creating default dynamic array field class object.");
array_fc = g_new0(struct bt_field_class_dynamic_array, 1);
if (!array_fc) {
- BT_LOGE_STR("Failed to allocate one dynamic array field class.");
+ BT_LIB_LOGE_APPEND_CAUSE(
+ "Failed to allocate one dynamic array field class.");
goto error;
}
BT_LOGD_STR("Creating default string field class object.");
string_fc = g_new0(struct bt_field_class_string, 1);
if (!string_fc) {
- BT_LOGE_STR("Failed to allocate one string field class.");
+ BT_LIB_LOGE_APPEND_CAUSE(
+ "Failed to allocate one string field class.");
goto error;
}