lib: remove clock class priority map, use default clock value
[babeltrace.git] / lib / values.c
index 4719e4514ed33bbc8363606c931028bc3edff04a..654d9b7c128227280f6fc0310a851baf708b95ac 100644 (file)
@@ -57,7 +57,7 @@
                (_value))
 
 #define BT_ASSERT_PRE_VALUE_HOT(_value, _name)                         \
-       BT_ASSERT_PRE_HOT((_value), (_name), ": +%!+v", (_value))
+       BT_ASSERT_PRE_HOT((_value), (_name), ": %!+v", (_value))
 
 #define BT_ASSERT_PRE_VALUE_INDEX_IN_BOUNDS(_index, _count)            \
        BT_ASSERT_PRE((_index) < (_count),                              \
@@ -71,16 +71,21 @@ struct bt_value {
        bt_bool frozen;
 };
 
+static
+void bt_value_null_instance_release_func(struct bt_object *obj)
+{
+       BT_LOGW("Releasing the null value singleton: addr=%p", obj);
+}
+
 static
 struct bt_value bt_value_null_instance = {
        .base = {
-               .ref_count = {
-                       .count = 1,
-                       .release = NULL,
-               },
-               .release = NULL,
-               .parent = NULL,
                .is_shared = true,
+               .ref_count = 1,
+               .release_func = bt_value_null_instance_release_func,
+               .spec_release_func = NULL,
+               .parent_is_owner_listener_func = NULL,
+               .parent = NULL,
        },
        .type = BT_VALUE_TYPE_NULL,
        .frozen = BT_TRUE,
@@ -572,12 +577,12 @@ enum bt_value_type bt_value_get_type(const struct bt_value *object)
 static
 struct bt_value bt_value_create_base(enum bt_value_type type)
 {
-       struct bt_value base;
+       struct bt_value value;
 
-       base.type = type;
-       base.frozen = BT_FALSE;
-       bt_object_init(&base, bt_value_destroy);
-       return base;
+       value.type = type;
+       value.frozen = BT_FALSE;
+       bt_object_init_shared(&value.base, bt_value_destroy);
+       return value;
 }
 
 struct bt_value *bt_value_bool_create_init(bt_bool val)
This page took 0.024524 seconds and 4 git commands to generate.