lib: remove unused internal component destroy functions
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 2 Nov 2023 19:33:18 +0000 (19:33 +0000)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 3 Nov 2023 18:56:03 +0000 (14:56 -0400)
These destroy functions are empty, remove them.  They can always be
added back later if needed, but I don't see the value in keeping then
"just in case".

Change-Id: I5845d2834294583367c85a840b016a536bf0b120
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11205
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/lib/graph/component-filter.c
src/lib/graph/component-filter.h
src/lib/graph/component-sink.c
src/lib/graph/component-sink.h
src/lib/graph/component-source.c
src/lib/graph/component-source.h
src/lib/graph/component.c
src/lib/graph/component.h

index 507ef2b5f234b426385d0d7283ed4213ba26cc92..fe6b6898f166d1594fadaeafb1042aceaf19de3d 100644 (file)
 #include "component-class.h"
 #include "lib/func-status.h"
 
-void bt_component_filter_destroy(
-               struct bt_component *component __attribute__((unused)))
-{
-}
-
 struct bt_component *bt_component_filter_create(void)
 {
        struct bt_component_filter *filter = NULL;
index 4d90d5c94e14fe9bcdd5f557ea5a3df48aa9464e..091ef1b8b4c6f59c92e502f2eb5e7fad648d3612 100644 (file)
@@ -20,6 +20,4 @@ struct bt_component_filter {
 
 struct bt_component *bt_component_filter_create(void);
 
-void bt_component_filter_destroy(struct bt_component *component);
-
 #endif /* BABELTRACE_GRAPH_COMPONENT_FILTER_INTERNAL_H */
index adbc26997e46e9b2208cc67d893a6d981325408f..af55ce4290062245211fe15426594dffbee10b83 100644 (file)
 #include "graph.h"
 #include "lib/func-status.h"
 
-void bt_component_sink_destroy(
-               struct bt_component *component __attribute__((unused)))
-{
-}
-
 struct bt_component *bt_component_sink_create(void)
 {
        struct bt_component_sink *sink = NULL;
index 59181549c85061893984b5cafdd5c7ad511fa6c6..7ed41fd93d8e849d130b2f5a9a99fa85e9f8ce0d 100644 (file)
@@ -24,6 +24,4 @@ struct bt_component_sink {
 
 struct bt_component *bt_component_sink_create(void);
 
-void bt_component_sink_destroy(struct bt_component *component);
-
 #endif /* BABELTRACE_GRAPH_COMPONENT_SINK_INTERNAL_H */
index 1007f478d985428471ea3362600351d6b20b5acb..096d24250a0c6d880d36a522d218eb38748f1dff 100644 (file)
 #include "message/iterator.h"
 #include "lib/func-status.h"
 
-void bt_component_source_destroy(
-               struct bt_component *component __attribute__((unused)))
-{
-}
-
 struct bt_component *bt_component_source_create(void)
 {
        struct bt_component_source *source = NULL;
index e6d7a64382d2e3da5594cf585b6c1080697dee7c..693162d3e5710dff19dfa5f9c0fe5e448c7990c3 100644 (file)
@@ -19,6 +19,4 @@ struct bt_component_source {
 
 struct bt_component *bt_component_source_create(void);
 
-void bt_component_source_destroy(struct bt_component *component);
-
 #endif /* BABELTRACE_GRAPH_COMPONENT_SOURCE_INTERNAL_H */
index e5584b0fe9017bf671bd276dbc7bbcefcff75882..7b592b5031808935d0e05d4f0342f35989b6a65d 100644 (file)
@@ -40,13 +40,6 @@ struct bt_component * (* const component_create_funcs[])(void) = {
        [BT_COMPONENT_CLASS_TYPE_FILTER] = bt_component_filter_create,
 };
 
-static
-void (*component_destroy_funcs[])(struct bt_component *) = {
-       [BT_COMPONENT_CLASS_TYPE_SOURCE] = bt_component_source_destroy,
-       [BT_COMPONENT_CLASS_TYPE_SINK] = bt_component_sink_destroy,
-       [BT_COMPONENT_CLASS_TYPE_FILTER] = bt_component_filter_destroy,
-};
-
 static
 void finalize_component(struct bt_component *comp)
 {
@@ -147,11 +140,6 @@ void destroy_component(struct bt_object *obj)
                finalize_component(component);
        }
 
-       if (component->destroy) {
-               BT_LOGD_STR("Destroying type-specific data.");
-               component->destroy(component);
-       }
-
        if (component->input_ports) {
                BT_LOGD_STR("Destroying input ports.");
                g_ptr_array_free(component->input_ports, TRUE);
@@ -327,7 +315,6 @@ int bt_component_create(struct bt_component_class *component_class,
        bt_object_init_shared_with_parent(&component->base, destroy_component);
        component->class = component_class;
        bt_object_get_ref_no_null_check(component->class);
-       component->destroy = component_destroy_funcs[type];
        component->name = g_string_new(name);
        if (!component->name) {
                BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate one GString.");
index a562d3d5fbea6189894185e8e65b29b4cf459053..93546445d0dbdd45e9cd6a127cb8df90957d0801 100644 (file)
@@ -38,12 +38,6 @@ struct bt_component {
        GString *name;
        bt_logging_level log_level;
 
-       /*
-        * Internal destroy function specific to a source, filter, or
-        * sink component object.
-        */
-       void (*destroy)(struct bt_component *);
-
        /* User-defined data */
        void *user_data;
 
This page took 0.027948 seconds and 4 git commands to generate.