#include <babeltrace2-ctf-writer/field-types.h>
#include <babeltrace2-ctf-writer/object.h>
#include <babeltrace2-ctf-writer/stream-class.h>
-#include <babeltrace2/types.h>
#include "common/macros.h"
#include "common/assert.h"
* Destroys a path token.
*/
static
-void ptokens_destroy_func(gpointer ptoken, gpointer data)
+void ptokens_destroy_func(gpointer ptoken,
+ gpointer data __attribute__((unused)))
{
g_string_free(ptoken, TRUE);
}
}
for (i = 0; i < tail_field_path_len; i++) {
- int index = g_array_index(
+ int index = bt_g_array_index(
tail_field_path->indexes,
int, i);
GString *field_path_pretty =
bt_ctf_field_path_string(field_path);
const char *field_path_pretty_str =
- field_path_pretty ? field_path_pretty->str : NULL;
+ field_path_pretty ? field_path_pretty->str : "(null)";
BT_LOGT("Found field path: path=\"%s\", field-path=\"%s\"",
pathstr, field_path_pretty_str);
for (i = 0; i < field_path->indexes->len; i++) {
struct bt_ctf_field_type_common *child_type;
int child_index =
- g_array_index(field_path->indexes, int, i);
+ bt_g_array_index(field_path->indexes, int, i);
/* Get child field type */
child_type = bt_ctf_field_type_common_borrow_field_at_index(type,
GString *field_path2_pretty =
bt_ctf_field_path_string(field_path2);
const char *field_path1_pretty_str =
- field_path1_pretty ? field_path1_pretty->str : NULL;
+ field_path1_pretty ? field_path1_pretty->str : "(null)";
const char *field_path2_pretty_str =
- field_path2_pretty ? field_path2_pretty->str : NULL;
+ field_path2_pretty ? field_path2_pretty->str : "(null)";
BT_LOGT("Finding lowest common ancestor (LCA) between two field paths: "
"field-path-1=\"%s\", field-path-2=\"%s\"",
break;
}
- target_index = g_array_index(field_path1->indexes, int,
+ target_index = bt_g_array_index(field_path1->indexes, int,
lca_index);
- ctx_index = g_array_index(field_path2->indexes, int,
+ ctx_index = bt_g_array_index(field_path2->indexes, int,
lca_index);
if (target_index != ctx_index) {
* Make sure the target field path is located before the
* context field path.
*/
- target_index = g_array_index(target_field_path->indexes,
+ target_index = bt_g_array_index(target_field_path->indexes,
int, lca_index);
- ctx_index = g_array_index(ctx_field_path->indexes,
+ ctx_index = bt_g_array_index(ctx_field_path->indexes,
int, lca_index);
if (target_index >= ctx_index) {
ret = bt_ctf_field_type_common_variant_set_tag_field_path(
type, target_field_path);
if (ret) {
- BT_LOGW("Cannot set varaint field type's tag field path: "
+ BT_LOGW("Cannot set variant field type's tag field path: "
"ret=%d, ft-addr=%p, path=\"%s\", target-field-path=\"%s\"",
ret, type, pathstr,
target_field_path_pretty_str);
ret = bt_ctf_field_type_common_variant_set_tag_field_type(
type, target_type);
if (ret) {
- BT_LOGW("Cannot set varaint field type's tag field type: "
+ BT_LOGW("Cannot set variant field type's tag field type: "
"ret=%d, ft-addr=%p, path=\"%s\", target-field-path=\"%s\"",
ret, type, pathstr,
target_field_path_pretty_str);
return ret;
}
-BT_HIDDEN
int bt_ctf_resolve_types(
struct bt_ctf_private_value *environment,
struct bt_ctf_field_type_common *packet_header_type,