bt_get() now returns the pointer it was passed to replace code
of the form:
bt_get(my_thingy);
another_object->thingy = my_thingy;
to the shorter form
another_object->thingy = bt_get(my_thingy);
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
* It is safe to call this function with a NULL object.
*
* @param obj Babeltrace object.
+ *
+ * Returns obj.
*/
-void bt_get(void *obj);
+void *bt_get(void *obj);
/*
* bt_put: decrements the reference count of a Babeltrace object.
#include <babeltrace/ref-internal.h>
#include <babeltrace/object-internal.h>
-void bt_get(void *obj)
+void *bt_get(void *obj)
{
if (obj) {
struct bt_object *base = obj;
bt_ref_get(&base->ref_count);
}
+ return obj;
}
void bt_put(void *obj)