Add BT_ASSERT_PRE_NO_ERROR_FROM_FUNC calls in
bt_component_add_output_port and bt_component_add_input_port, and remove
the equivalent calls in their callers. This moves the assertion check
next to the other existing assertions.
Change-Id: Ia251510ce2b6ba369cfc1f4afae50e8e46060957
Reviewed-on: https://review.lttng.org/c/babeltrace/+/10036
CI-Build: Simon Marchi <simon.marchi@efficios.com>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
enum bt_self_component_add_port_status status;
struct bt_port *port = NULL;
enum bt_self_component_add_port_status status;
struct bt_port *port = NULL;
- BT_ASSERT_PRE_NO_ERROR();
-
/*
* bt_component_add_output_port() logs details/errors and checks
* preconditions.
/*
* bt_component_add_output_port() logs details/errors and checks
* preconditions.
struct bt_port *port = NULL;
struct bt_component *comp = (void *) self_comp;
struct bt_port *port = NULL;
struct bt_component *comp = (void *) self_comp;
- BT_ASSERT_PRE_NO_ERROR();
-
/*
* bt_component_add_input_port() logs details/errors and checks
* preconditions.
/*
* bt_component_add_input_port() logs details/errors and checks
* preconditions.
struct bt_port *port = NULL;
struct bt_component *comp = (void *) self_comp;
struct bt_port *port = NULL;
struct bt_component *comp = (void *) self_comp;
- BT_ASSERT_PRE_NO_ERROR();
-
/*
* bt_component_add_input_port() logs details/errors and checks
* preconditions.
/*
* bt_component_add_input_port() logs details/errors and checks
* preconditions.
enum bt_self_component_add_port_status status;
struct bt_port *port = NULL;
enum bt_self_component_add_port_status status;
struct bt_port *port = NULL;
- BT_ASSERT_PRE_NO_ERROR();
-
/*
* bt_component_add_output_port() logs details/errors and checks
* preconditions.
/*
* bt_component_add_output_port() logs details/errors and checks
* preconditions.
struct bt_component *component, const char *name,
void *user_data, struct bt_port **port, const char *api_func)
{
struct bt_component *component, const char *name,
void *user_data, struct bt_port **port, const char *api_func)
{
+ BT_ASSERT_PRE_NO_ERROR_FROM_FUNC(api_func);
BT_ASSERT_PRE_COMP_NON_NULL_FROM_FUNC(api_func, component);
BT_ASSERT_PRE_NAME_NON_NULL_FROM_FUNC(api_func, name);
BT_ASSERT_PRE_FROM_FUNC(api_func, "input-port-name-is-unique",
BT_ASSERT_PRE_COMP_NON_NULL_FROM_FUNC(api_func, component);
BT_ASSERT_PRE_NAME_NON_NULL_FROM_FUNC(api_func, name);
BT_ASSERT_PRE_FROM_FUNC(api_func, "input-port-name-is-unique",
void *user_data, struct bt_port **port,
const char *api_func)
{
void *user_data, struct bt_port **port,
const char *api_func)
{
+ BT_ASSERT_PRE_NO_ERROR_FROM_FUNC(api_func);
BT_ASSERT_PRE_COMP_NON_NULL_FROM_FUNC(api_func, component);
BT_ASSERT_PRE_NAME_NON_NULL_FROM_FUNC(api_func, name);
BT_ASSERT_PRE_FROM_FUNC(api_func, "output-port-name-is-unique",
BT_ASSERT_PRE_COMP_NON_NULL_FROM_FUNC(api_func, component);
BT_ASSERT_PRE_NAME_NON_NULL_FROM_FUNC(api_func, name);
BT_ASSERT_PRE_FROM_FUNC(api_func, "output-port-name-is-unique",