void bt_clock_value_destroy(struct bt_clock_value *clock_value)
{
BT_LIB_LOGD("Destroying clock value: %!+k", clock_value);
- bt_object_put_ref(clock_value->clock_class);
+ BT_OBJECT_PUT_REF_AND_RESET(clock_value->clock_class);
g_free(clock_value);
}
}
bt_object_init_unique(&ret->base);
- ret->clock_class = bt_object_get_ref(clock_class);
+ ret->clock_class = clock_class;
+ bt_object_get_no_null_check(clock_class);
bt_clock_class_freeze(clock_class);
BT_LIB_LOGD("Created clock value object: %!+k", ret);
}
if (likely(!clock_value->clock_class)) {
- clock_value->clock_class = bt_object_get_ref(clock_class);
+ clock_value->clock_class = clock_class;
+ bt_object_get_no_null_check(clock_class);
}
goto end;
bt_object_put_ref(clock_class);
}
-uint64_t bt_clock_value_get_value(struct bt_clock_value *clock_value)
+uint64_t bt_clock_value_get_value(const struct bt_clock_value *clock_value)
{
BT_ASSERT_PRE_NON_NULL(clock_value, "Clock value");
BT_ASSERT_PRE(clock_value->is_set,
return clock_value->value_cycles;
}
-int bt_clock_value_get_ns_from_origin(struct bt_clock_value *clock_value,
+int bt_clock_value_get_ns_from_origin(const struct bt_clock_value *clock_value,
int64_t *ret_value_ns)
{
int ret = 0;
return ret;
}
-struct bt_clock_class *bt_clock_value_borrow_clock_class(
- struct bt_clock_value *clock_value)
+const struct bt_clock_class *bt_clock_value_borrow_clock_class_const(
+ const struct bt_clock_value *clock_value)
{
BT_ASSERT_PRE_NON_NULL(clock_value, "Clock value");
return clock_value->clock_class;