common: introduce bt_g_array_index
[babeltrace.git] / src / lib / trace-ir / trace-class.c
index 9f7068a7d00311f7947564e48f675ab16d2b39e5..1518214999b29f28e62cc8f0ff0ac770db91e32a 100644 (file)
@@ -85,7 +85,7 @@ void destroy_trace_class(struct bt_object *obj)
                /* Call all the trace class destruction listeners */
                for (i = 0; i < tc->destruction_listeners->len; i++) {
                        struct bt_trace_class_destruction_listener_elem elem =
-                               g_array_index(tc->destruction_listeners,
+                               bt_g_array_index(tc->destruction_listeners,
                                                struct bt_trace_class_destruction_listener_elem, i);
 
                        if (elem.func) {
@@ -188,7 +188,7 @@ enum bt_trace_class_add_listener_status bt_trace_class_add_destruction_listener(
        /* Find the next available spot */
        for (i = 0; i < tc->destruction_listeners->len; i++) {
                struct bt_trace_class_destruction_listener_elem elem =
-                       g_array_index(tc->destruction_listeners,
+                       bt_g_array_index(tc->destruction_listeners,
                                struct bt_trace_class_destruction_listener_elem, i);
 
                if (!elem.func) {
@@ -215,7 +215,7 @@ static
 bool has_listener_id(const struct bt_trace_class *tc, uint64_t listener_id)
 {
        BT_ASSERT(listener_id < tc->destruction_listeners->len);
-       return (&g_array_index(tc->destruction_listeners,
+       return (&bt_g_array_index(tc->destruction_listeners,
                        struct bt_trace_class_destruction_listener_elem,
                        listener_id))->func;
 }
@@ -233,7 +233,7 @@ enum bt_trace_class_remove_listener_status bt_trace_class_remove_destruction_lis
                has_listener_id(tc, listener_id),
                "Trace class has no such trace class destruction listener ID: "
                "%![tc-]+T, %" PRIu64, tc, listener_id);
-       elem = &g_array_index(tc->destruction_listeners,
+       elem = &bt_g_array_index(tc->destruction_listeners,
                        struct bt_trace_class_destruction_listener_elem,
                        listener_id);
        BT_ASSERT(elem->func);
This page took 0.024115 seconds and 4 git commands to generate.