From dcf0cc71fe6be79cb9daef48fb8bf3184ac04ae7 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Thu, 11 May 2017 01:11:41 -0400 Subject: [PATCH] ir: attributes: fix index and count integer types MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- include/babeltrace/ctf-ir/attributes-internal.h | 5 +++-- lib/ctf-ir/attributes.c | 12 ++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/include/babeltrace/ctf-ir/attributes-internal.h b/include/babeltrace/ctf-ir/attributes-internal.h index fc82e729..359e75ed 100644 --- a/include/babeltrace/ctf-ir/attributes-internal.h +++ b/include/babeltrace/ctf-ir/attributes-internal.h @@ -32,6 +32,7 @@ extern "C" { #endif +#include #include #include @@ -46,11 +47,11 @@ int64_t bt_ctf_attributes_get_count(struct bt_value *attr_obj); BT_HIDDEN const char *bt_ctf_attributes_get_field_name(struct bt_value *attr_obj, - int index); + uint64_t index); BT_HIDDEN struct bt_value *bt_ctf_attributes_get_field_value(struct bt_value *attr_obj, - int index); + uint64_t index); BT_HIDDEN int bt_ctf_attributes_set_field_value(struct bt_value *attr_obj, diff --git a/lib/ctf-ir/attributes.c b/lib/ctf-ir/attributes.c index 0ea3cfd7..b3549510 100644 --- a/lib/ctf-ir/attributes.c +++ b/lib/ctf-ir/attributes.c @@ -65,7 +65,7 @@ int64_t bt_ctf_attributes_get_count(struct bt_value *attr_obj) BT_HIDDEN const char *bt_ctf_attributes_get_field_name(struct bt_value *attr_obj, - int index) + uint64_t index) { int rc; const char *ret = NULL; @@ -103,7 +103,7 @@ end: BT_HIDDEN struct bt_value *bt_ctf_attributes_get_field_value(struct bt_value *attr_obj, - int index) + uint64_t index) { struct bt_value *value_obj = NULL; struct bt_value *attr_field_obj = NULL; @@ -130,8 +130,8 @@ static struct bt_value *bt_ctf_attributes_get_field_by_name( struct bt_value *attr_obj, const char *name) { - int i; - int attr_size; + uint64_t i; + int64_t attr_size; struct bt_value *value_obj = NULL; struct bt_value *attr_field_name_obj = NULL; @@ -251,8 +251,8 @@ end: BT_HIDDEN int bt_ctf_attributes_freeze(struct bt_value *attr_obj) { - int i; - int count; + uint64_t i; + int64_t count; int ret = 0; if (!attr_obj) { -- 2.34.1