Remove unnecessary inclusions of "internal public" headers
[babeltrace.git] / src / ctf-writer / resolve.c
index ccb55a24bd9f0767a17c465d79ac75532e667c4c..1cd244899a49713df748df91e65bb6f0db5f4f47 100644 (file)
@@ -1,31 +1,10 @@
 /*
- * resolve.c
- *
- * Babeltrace - CTF writer: Type resolving internal
+ * SPDX-License-Identifier: MIT
  *
  * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
  * Copyright 2016 Philippe Proulx <pproulx@efficios.com>
  *
- * Authors: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *          Philippe Proulx <pproulx@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
+ * Babeltrace - CTF writer: Type resolving internal
  */
 
 #define BT_LOG_TAG "CTF-WRITER/RESOLVE"
@@ -39,7 +18,6 @@
 #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"
@@ -299,7 +277,8 @@ end:
  * 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);
 }
@@ -562,7 +541,7 @@ int relative_ptokens_to_field_path(GList *ptokens,
                        }
 
                        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);
 
@@ -683,7 +662,7 @@ struct bt_ctf_field_path *pathstr_to_field_path(const char *pathstr,
                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);
@@ -730,7 +709,7 @@ struct bt_ctf_field_type_common *field_path_to_field_type(
        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,
@@ -806,9 +785,9 @@ int get_field_paths_lca_index(struct bt_ctf_field_path *field_path1,
                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\"",
@@ -848,9 +827,9 @@ int get_field_paths_lca_index(struct bt_ctf_field_path *field_path1,
                        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) {
@@ -931,9 +910,9 @@ int validate_target_field_path(struct bt_ctf_field_path *target_field_path,
                 * 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) {
@@ -1218,7 +1197,6 @@ int resolve_root_type(enum bt_ctf_scope root_scope, struct resolve_context *ctx)
        return ret;
 }
 
-BT_HIDDEN
 int bt_ctf_resolve_types(
                struct bt_ctf_private_value *environment,
                struct bt_ctf_field_type_common *packet_header_type,
This page took 0.025635 seconds and 4 git commands to generate.