This function cannot return a negative number and cannot fail as it uses
the `bt_value_array_get_length()` function.
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: I1dfb06ffceaab9ef1c1ab6fa11041a2c3ddeb464
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2248
Tested-by: jenkins <jenkins@lttng.org>
}
BT_HIDDEN
-int64_t bt_attributes_get_count(const struct bt_value *attr_obj)
+uint64_t bt_attributes_get_count(const struct bt_value *attr_obj)
{
return bt_value_array_get_length(attr_obj);
}
void bt_attributes_destroy(struct bt_value *attr_obj);
BT_HIDDEN
-int64_t bt_attributes_get_count(const struct bt_value *attr_obj);
+uint64_t bt_attributes_get_count(const struct bt_value *attr_obj);
BT_HIDDEN
const char *bt_attributes_get_field_name(const struct bt_value *attr_obj,
uint64_t bt_trace_get_environment_entry_count(const struct bt_trace *trace)
{
- int64_t ret;
-
BT_ASSERT_PRE_DEV_NON_NULL(trace, "Trace");
- ret = bt_attributes_get_count(trace->environment);
- BT_ASSERT(ret >= 0);
- return (uint64_t) ret;
+ return bt_attributes_get_count(trace->environment);
}
void bt_trace_borrow_environment_entry_by_index_const(