Make libctfcopytrace a convenience lib. and link to it in plugins
[babeltrace.git] / lib / values.c
index cea4b10bdc2e3e7b99be948b9dde0618b4392841..fb62293e8dd6d06ef868b1dcde0c881bf5f9a615 100644 (file)
 #include <string.h>
 #include <assert.h>
 #include <string.h>
-#include <babeltrace/compiler.h>
+#include <babeltrace/compiler-internal.h>
 #include <babeltrace/object-internal.h>
 #include <babeltrace/ref.h>
 #include <babeltrace/values.h>
-#include <babeltrace/compat/glib.h>
+#include <babeltrace/compat/glib-internal.h>
 
 #define BT_VALUE_FROM_CONCRETE(_concrete) ((struct bt_value *) (_concrete))
 #define BT_VALUE_TO_BOOL(_base) ((struct bt_value_bool *) (_base))
@@ -51,6 +51,14 @@ struct bt_value {
 
 static
 struct bt_value bt_value_null_instance = {
+       .base = {
+               .ref_count = {
+                       .count = 1,
+                       .release = NULL,
+               },
+               .release = NULL,
+               .parent = NULL,
+       },
        .type = BT_VALUE_TYPE_NULL,
        .is_frozen = true,
 };
@@ -804,9 +812,9 @@ end:
        return ret;
 }
 
-int bt_value_array_size(const struct bt_value *array_obj)
+int64_t bt_value_array_size(const struct bt_value *array_obj)
 {
-       int ret;
+       int64_t ret;
        struct bt_value_array *typed_array_obj =
                BT_VALUE_TO_ARRAY(array_obj);
 
@@ -815,7 +823,7 @@ int bt_value_array_size(const struct bt_value *array_obj)
                goto end;
        }
 
-       ret = (int) typed_array_obj->garray->len;
+       ret = (int64_t) typed_array_obj->garray->len;
 
 end:
        return ret;
@@ -973,9 +981,9 @@ end:
        return ret;
 }
 
-int bt_value_map_size(const struct bt_value *map_obj)
+int64_t bt_value_map_size(const struct bt_value *map_obj)
 {
-       int ret;
+       int64_t ret;
        struct bt_value_map *typed_map_obj = BT_VALUE_TO_MAP(map_obj);
 
        if (!map_obj || !bt_value_is_map(map_obj)) {
@@ -983,7 +991,7 @@ int bt_value_map_size(const struct bt_value *map_obj)
                goto end;
        }
 
-       ret = (int) g_hash_table_size(typed_map_obj->ght);
+       ret = (int64_t) g_hash_table_size(typed_map_obj->ght);
 
 end:
        return ret;
This page took 0.024873 seconds and 4 git commands to generate.