From 7c56f3cc43c4a45c87a6edd3146885d7d1976856 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 25 Nov 2016 17:21:08 -0500 Subject: [PATCH] Cleanup: object-internal.h static inlines MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- include/babeltrace/object-internal.h | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/include/babeltrace/object-internal.h b/include/babeltrace/object-internal.h index fb37d97a..4bf4def6 100644 --- a/include/babeltrace/object-internal.h +++ b/include/babeltrace/object-internal.h @@ -45,11 +45,14 @@ struct bt_object { }; static inline -long bt_object_get_ref_count(const void *); -static inline -void bt_object_set_parent(void *, void *); +long bt_object_get_ref_count(const void *ptr) +{ + const struct bt_object *obj = ptr; -static + return obj->ref_count.count; +} + +static inline void bt_object_release(void *ptr) { struct bt_object *obj = ptr; @@ -59,7 +62,7 @@ void bt_object_release(void *ptr) } } -static +static inline void generic_release(struct bt_object *obj) { if (obj->parent) { @@ -106,12 +109,4 @@ void bt_object_init(void *ptr, bt_object_release_func release) bt_ref_init(&obj->ref_count, generic_release); } -static inline -long bt_object_get_ref_count(const void *ptr) -{ - const struct bt_object *obj = ptr; - - return obj->ref_count.count; -} - #endif /* BABELTRACE_OBJECT_INTERNAL_H */ -- 2.34.1