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]);
                        ^
sysmocom/shared/log-speed
Harald Welte 2015-11-20 10:22:14 +01:00
parent a99d45ac59
commit b32a19467f
1 changed files with 2 additions and 2 deletions

View File

@ -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;