Always evaluate BT_ASSERT(); add BT_ASSERT_DBG() for debug mode only
[babeltrace.git] / src / lib / graph / graph.c
index f406a526e7d5e827779627dea99a2447417ce289..32af1ef898585d4c240f7e505c79de01970226be 100644 (file)
@@ -303,7 +303,6 @@ struct bt_graph *bt_graph_create(uint64_t mip_version)
                graph->listeners.source_output_port_added);
 
        if (!graph->listeners.source_output_port_added) {
-               ret = -1;
                goto error;
        }
 
@@ -311,7 +310,6 @@ struct bt_graph *bt_graph_create(uint64_t mip_version)
                graph->listeners.filter_output_port_added);
 
        if (!graph->listeners.filter_output_port_added) {
-               ret = -1;
                goto error;
        }
 
@@ -319,7 +317,6 @@ struct bt_graph *bt_graph_create(uint64_t mip_version)
                graph->listeners.filter_input_port_added);
 
        if (!graph->listeners.filter_input_port_added) {
-               ret = -1;
                goto error;
        }
 
@@ -327,7 +324,6 @@ struct bt_graph *bt_graph_create(uint64_t mip_version)
                graph->listeners.sink_input_port_added);
 
        if (!graph->listeners.sink_input_port_added) {
-               ret = -1;
                goto error;
        }
 
@@ -335,7 +331,6 @@ struct bt_graph *bt_graph_create(uint64_t mip_version)
                graph->listeners.source_filter_ports_connected);
 
        if (!graph->listeners.source_filter_ports_connected) {
-               ret = -1;
                goto error;
        }
 
@@ -343,7 +338,6 @@ struct bt_graph *bt_graph_create(uint64_t mip_version)
                graph->listeners.source_sink_ports_connected);
 
        if (!graph->listeners.source_sink_ports_connected) {
-               ret = -1;
                goto error;
        }
 
@@ -351,7 +345,6 @@ struct bt_graph *bt_graph_create(uint64_t mip_version)
                graph->listeners.filter_filter_ports_connected);
 
        if (!graph->listeners.filter_filter_ports_connected) {
-               ret = -1;
                goto error;
        }
 
@@ -359,7 +352,6 @@ struct bt_graph *bt_graph_create(uint64_t mip_version)
                graph->listeners.filter_sink_ports_connected);
 
        if (!graph->listeners.filter_sink_ports_connected) {
-               ret = -1;
                goto error;
        }
 
@@ -581,9 +573,9 @@ int consume_graph_sink(struct bt_component_sink *comp)
        enum bt_component_class_sink_consume_method_status consume_status;
        struct bt_component_class_sink *sink_class = NULL;
 
-       BT_ASSERT(comp);
+       BT_ASSERT_DBG(comp);
        sink_class = (void *) comp->parent.class;
-       BT_ASSERT(sink_class->methods.consume);
+       BT_ASSERT_DBG(sink_class->methods.consume);
        BT_LIB_LOGD("Calling user's consume method: %!+c", comp);
        consume_status = sink_class->methods.consume((void *) comp);
        BT_LOGD("User method returned: status=%s",
@@ -656,7 +648,7 @@ int bt_graph_consume_sink_no_check(struct bt_graph *graph,
        int index;
 
        BT_LIB_LOGD("Making specific sink consume: %![comp-]+c", sink);
-       BT_ASSERT(bt_component_borrow_graph((void *) sink) == graph);
+       BT_ASSERT_DBG(bt_component_borrow_graph((void *) sink) == graph);
 
        if (g_queue_is_empty(graph->sinks_to_consume)) {
                BT_LOGD_STR("Graph's sink queue is empty: end of graph.");
@@ -673,7 +665,7 @@ int bt_graph_consume_sink_no_check(struct bt_graph *graph,
        }
 
        sink_node = g_queue_pop_nth_link(graph->sinks_to_consume, index);
-       BT_ASSERT(sink_node);
+       BT_ASSERT_DBG(sink_node);
        status = consume_sink_node(graph, sink_node);
 
 end:
@@ -1612,7 +1604,7 @@ void bt_graph_add_message(struct bt_graph *graph,
 BT_HIDDEN
 bool bt_graph_is_interrupted(const struct bt_graph *graph)
 {
-       BT_ASSERT(graph);
+       BT_ASSERT_DBG(graph);
        return bt_interrupter_array_any_is_set(graph->interrupters);
 }
 
This page took 0.025028 seconds and 4 git commands to generate.