From b32a19467ffde540b059bf166a378decf07701b8 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 20 Nov 2015 10:22:14 +0100 Subject: stat_item.c: Fix compiler warnings CC stat_item.lo stat_item.c: In function 'osmo_stat_item_group_alloc': stat_item.c:84:28: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] group->items[item_idx] = (void *)items_size; ^ stat_item.c:98:24: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] ((uint8_t *)items + (int)group->items[item_idx]); ^ --- src/stat_item.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stat_item.c b/src/stat_item.c index 0545ea0d..a6a8481e 100644 --- a/src/stat_item.c +++ b/src/stat_item.c @@ -52,7 +52,7 @@ struct osmo_stat_item_group *osmo_stat_item_group_alloc(void *ctx, unsigned int idx) { unsigned int group_size; - unsigned int items_size = 0; + unsigned long items_size = 0; unsigned int item_idx; void *items; @@ -95,7 +95,7 @@ struct osmo_stat_item_group *osmo_stat_item_group_alloc(void *ctx, /* Update item pointers */ for (item_idx = 0; item_idx < desc->num_items; item_idx++) { struct osmo_stat_item *item = (struct osmo_stat_item *) - ((uint8_t *)items + (int)group->items[item_idx]); + ((uint8_t *)items + (unsigned long)group->items[item_idx]); unsigned int i; group->items[item_idx] = item; -- cgit v1.2.3