lib: remove unused parameters in internal component creation functions
[babeltrace.git] / src / lib / graph / component.c
index 95df2dff97b18ea9e70e39d3183acda08512ef5a..e5584b0fe9017bf671bd276dbc7bbcefcff75882 100644 (file)
@@ -34,8 +34,7 @@
 #include "lib/func-status.h"
 
 static
-struct bt_component * (* const component_create_funcs[])(
-               const struct bt_component_class *) = {
+struct bt_component * (* const component_create_funcs[])(void) = {
        [BT_COMPONENT_CLASS_TYPE_SOURCE] = bt_component_source_create,
        [BT_COMPONENT_CLASS_TYPE_SINK] = bt_component_sink_create,
        [BT_COMPONENT_CLASS_TYPE_FILTER] = bt_component_filter_create,
@@ -133,7 +132,7 @@ void destroy_component(struct bt_object *obj)
 
        for (i = component->destroy_listeners->len - 1; i >= 0; i--) {
                struct bt_component_destroy_listener *listener =
-                       &g_array_index(component->destroy_listeners,
+                       &bt_g_array_index(component->destroy_listeners,
                                struct bt_component_destroy_listener, i);
 
                listener->func(component, listener->data);
@@ -236,8 +235,6 @@ enum bt_self_component_add_port_status add_port(
                "Component's graph is already configured: "
                "%![comp-]+c, %![graph-]+g", component, graph);
 
-       // TODO: Validate that the name is not already used.
-
        BT_LIB_LOGI("Adding port to component: %![comp-]+c, "
                "port-type=%s, port-name=\"%s\"", component,
                bt_port_type_string(port_type), name);
@@ -319,7 +316,7 @@ int bt_component_create(struct bt_component_class *component_class,
        BT_LIB_LOGI("Creating empty component from component class: %![cc-]+C, "
                "comp-name=\"%s\", log-level=%s", component_class, name,
                bt_common_logging_level_string(log_level));
-       component = component_create_funcs[type](component_class);
+       component = component_create_funcs[type]();
        if (!component) {
                BT_LIB_LOGE_APPEND_CAUSE(
                        "Cannot create specific component object.");
@@ -612,7 +609,7 @@ void bt_component_remove_destroy_listener(struct bt_component *component,
 
        for (i = 0; i < component->destroy_listeners->len; i++) {
                struct bt_component_destroy_listener *listener =
-                       &g_array_index(component->destroy_listeners,
+                       &bt_g_array_index(component->destroy_listeners,
                                struct bt_component_destroy_listener, i);
 
                if (listener->func == func && listener->data == data) {
This page took 0.027565 seconds and 4 git commands to generate.