projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib: make trace IR API const-correct
[babeltrace.git]
/
lib
/
trace-ir
/
clock-value.c
diff --git
a/lib/trace-ir/clock-value.c
b/lib/trace-ir/clock-value.c
index 877d8687f8b0968e751c63273e56c53133e4565e..a89fdca9f060ff78586875372108cf3327e91cf1 100644
(file)
--- a/
lib/trace-ir/clock-value.c
+++ b/
lib/trace-ir/clock-value.c
@@
-39,7
+39,7
@@
BT_HIDDEN
void bt_clock_value_destroy(struct bt_clock_value *clock_value)
{
BT_LIB_LOGD("Destroying clock value: %!+k", clock_value);
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);
}
g_free(clock_value);
}
@@
-58,7
+58,8
@@
struct bt_clock_value *bt_clock_value_new(struct bt_clock_class *clock_class)
}
bt_object_init_unique(&ret->base);
}
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);
bt_clock_class_freeze(clock_class);
BT_LIB_LOGD("Created clock value object: %!+k", ret);
@@
-80,7
+81,8
@@
struct bt_clock_value *bt_clock_value_create(struct bt_clock_class *clock_class)
}
if (likely(!clock_value->clock_class)) {
}
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;
}
goto end;
@@
-132,7
+134,7
@@
void bt_clock_value_recycle(struct bt_clock_value *clock_value)
bt_object_put_ref(clock_class);
}
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,
{
BT_ASSERT_PRE_NON_NULL(clock_value, "Clock value");
BT_ASSERT_PRE(clock_value->is_set,
@@
-140,7
+142,7
@@
uint64_t bt_clock_value_get_value(struct bt_clock_value *clock_value)
return clock_value->value_cycles;
}
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;
int64_t *ret_value_ns)
{
int ret = 0;
@@
-163,8
+165,8
@@
end:
return ret;
}
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;
{
BT_ASSERT_PRE_NON_NULL(clock_value, "Clock value");
return clock_value->clock_class;
This page took
0.024244 seconds
and
4
git commands to generate.