summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2015-11-20 10:22:14 +0100
committerHarald Welte <laforge@gnumonks.org>2015-11-20 10:22:14 +0100
commitb32a19467ffde540b059bf166a378decf07701b8 (patch)
tree74180dff6705c25f95dc6279c8ef245adb5f4f0b
parenta99d45ac5960c25818b980683cb5920ffd25588c (diff)
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]); ^
-rw-r--r--src/stat_item.c4
1 files 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;