Replace assert() -> BT_ASSERT() and some preconditions with BT_ASSERT_PRE()
[babeltrace.git] / include / babeltrace / object-internal.h
index 2b368c5510e46f86ea26758b44e8c939a0346ae6..9d906da1ba093d7faaea5b33d7e9fd7f1d019fda 100644 (file)
@@ -29,6 +29,7 @@
 
 #include <babeltrace/ref-internal.h>
 #include <babeltrace/ref.h>
+#include <babeltrace/assert-internal.h>
 
 /**
  * All objects publicly exposed by Babeltrace APIs must contain this structure
@@ -64,7 +65,7 @@ void bt_object_release(void *ptr)
                obj->ref_count.count);
 #endif
 
-       if (obj && obj->release && !bt_object_get_ref_count(obj)) {
+       if (obj && obj->release && bt_object_get_ref_count(obj) == 0) {
                obj->release(obj);
        }
 }
@@ -151,7 +152,7 @@ static inline
 void bt_object_set_parent_is_owner_listener(void *obj,
                bt_object_release_func cb)
 {
-       assert(obj);
+       BT_ASSERT(obj);
        ((struct bt_object *) obj)->parent_is_owner_listener = cb;
 }
 
This page took 0.04024 seconds and 4 git commands to generate.