X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=lib%2Fgraph%2Fiterator.c;h=aec91f114315dbe9eb83533588e92746988fc202;hb=3fadfbc0c91f82c46bd36e6e0657ea93570c9db1;hp=6a969826cc4da08a253d023360e01ead5851a99c;hpb=0952128ec846a14bad1e7be9da815fb53842e272;p=babeltrace.git diff --git a/lib/graph/iterator.c b/lib/graph/iterator.c index 6a969826..aec91f11 100644 --- a/lib/graph/iterator.c +++ b/lib/graph/iterator.c @@ -22,50 +22,50 @@ */ #define BT_LOG_TAG "MSG-ITER" -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -83,9 +83,8 @@ (_iter)->state == BT_SELF_COMPONENT_PORT_INPUT_MESSAGE_ITERATOR_STATE_LAST_SEEKING_RETURNED_ERROR, \ "Message iterator is in the wrong state: %!+i", _iter) -BT_ASSERT_PRE_FUNC static inline -void _set_self_comp_port_input_msg_iterator_state( +void set_self_comp_port_input_msg_iterator_state( struct bt_self_component_port_input_message_iterator *iterator, enum bt_self_component_port_input_message_iterator_state state) { @@ -95,12 +94,6 @@ void _set_self_comp_port_input_msg_iterator_state( iterator->state = state; } -#ifdef BT_DEV_MODE -# define set_self_comp_port_input_msg_iterator_state _set_self_comp_port_input_msg_iterator_state -#else -# define set_self_comp_port_input_msg_iterator_state(_a, _b) ((void) _a); ((void) _b); -#endif - static void destroy_base_message_iterator(struct bt_object *obj) { @@ -567,7 +560,6 @@ bt_self_component_port_input_message_iterator_next( goto end; } -#ifdef BT_DEV_MODE /* * There is no way that this iterator could have been finalized * during its "next" method, as the only way to do this is to @@ -579,7 +571,6 @@ bt_self_component_port_input_message_iterator_next( */ BT_ASSERT(iterator->state == BT_SELF_COMPONENT_PORT_INPUT_MESSAGE_ITERATOR_STATE_ACTIVE); -#endif switch (status) { case BT_MESSAGE_ITERATOR_STATUS_OK: @@ -792,11 +783,14 @@ bt_port_output_message_iterator_create(struct bt_graph *graph, */ bt_graph_set_can_consume(iterator->graph, false); - /* - * Also set the graph as being configured: it has no active sink - * anyway, so we don't need to call bt_graph_configure(). - */ - graph->config_state = BT_GRAPH_CONFIGURATION_STATE_CONFIGURED; + /* Also set the graph as being configured. */ + graph_status = bt_graph_configure(graph); + if (graph_status != BT_GRAPH_STATUS_OK) { + BT_LIB_LOGW("Cannot configure graph after having added colander: " + "%![graph-]+g, status=%s", graph, + bt_graph_status_string(graph_status)); + goto error; + } goto end; error: @@ -882,9 +876,8 @@ bt_bool bt_self_component_port_input_message_iterator_can_seek_beginning( return can; } -BT_ASSERT_PRE_FUNC static inline -void _set_iterator_state_after_seeking( +void set_iterator_state_after_seeking( struct bt_self_component_port_input_message_iterator *iterator, enum bt_message_iterator_status status) { @@ -912,12 +905,6 @@ void _set_iterator_state_after_seeking( set_self_comp_port_input_msg_iterator_state(iterator, new_state); } -#ifdef BT_DEV_MODE -# define set_iterator_state_after_seeking _set_iterator_state_after_seeking -#else -# define set_iterator_state_after_seeking(_iter, _status) ((void) _iter); ((void) _status); -#endif - enum bt_message_iterator_status bt_self_component_port_input_message_iterator_seek_beginning( struct bt_self_component_port_input_message_iterator *iterator) @@ -1188,14 +1175,12 @@ enum bt_message_iterator_status find_message_ge_ns_from_origin( BT_LOGD("User method returned: status=%s", bt_message_iterator_status_string(status)); -#ifdef BT_DEV_MODE /* * The user's "next" method must not do any action which * would change the iterator's state. */ BT_ASSERT(iterator->state == BT_SELF_COMPONENT_PORT_INPUT_MESSAGE_ITERATOR_STATE_ACTIVE); -#endif switch (status) { case BT_MESSAGE_ITERATOR_STATUS_OK: