#include <babeltrace/graph/connection-internal.h>
#include <babeltrace/object-internal.h>
#include <babeltrace/compiler-internal.h>
+#include <babeltrace/assert-internal.h>
static
void bt_port_destroy(struct bt_object *obj)
g_free(port);
}
-struct bt_port *bt_port_from_private(
+struct bt_port *bt_port_borrow_from_private(
struct bt_private_port *private_port)
{
- return bt_get(bt_port_borrow_from_private(private_port));
+ return (void *) private_port;
}
BT_HIDDEN
{
struct bt_port *port = NULL;
- assert(name);
- assert(parent_component);
- assert(type == BT_PORT_TYPE_INPUT || type == BT_PORT_TYPE_OUTPUT);
+ BT_ASSERT(name);
+ BT_ASSERT(parent_component);
+ BT_ASSERT(type == BT_PORT_TYPE_INPUT || type == BT_PORT_TYPE_OUTPUT);
if (strlen(name) == 0) {
BT_LOGW_STR("Invalid parameter: name is an empty string.");
/* bt_component_remove_port() logs details */
comp_status = bt_component_remove_port(comp, port);
- assert(comp_status != BT_COMPONENT_STATUS_INVALID);
+ BT_ASSERT(comp_status != BT_COMPONENT_STATUS_INVALID);
if (comp_status < 0) {
status = BT_PORT_STATUS_ERROR;
goto end;