Message ID | 1446839725-21682-3-git-send-email-alexander.huemer@xx.vu |
---|---|
State | New |
Headers | show |
> On 06 Nov 2015, at 20:55, Alexander Huemer <alexander.huemer@xx.vu> wrote: Hi Jacob, > src/stat_item.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/stat_item.c b/src/stat_item.c > index 0545ea0..7017523 100644 > --- a/src/stat_item.c > +++ b/src/stat_item.c > @@ -81,7 +81,7 @@ struct osmo_stat_item_group *osmo_stat_item_group_alloc(void *ctx, > size = (size + sizeof(void *) - 1) & ~(sizeof(void *) - 1); > > /* Store offsets into the item array */ > - group->items[item_idx] = (void *)items_size; > + group->items[item_idx] = (struct osmo_stat_item *)items_size; This will silence the warning but I think we could change the code to be more direct at the cost of recalculating the offset twice but staying with the pointers of the right type?
> On 07 Nov 2015, at 12:30, Holger Freyther <holger@freyther.de> wrote: > > >> src/stat_item.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/src/stat_item.c b/src/stat_item.c >> index 0545ea0..7017523 100644 >> --- a/src/stat_item.c >> +++ b/src/stat_item.c >> @@ -81,7 +81,7 @@ struct osmo_stat_item_group *osmo_stat_item_group_alloc(void *ctx, >> size = (size + sizeof(void *) - 1) & ~(sizeof(void *) - 1); >> >> /* Store offsets into the item array */ >> - group->items[item_idx] = (void *)items_size; >> + group->items[item_idx] = (struct osmo_stat_item *)items_size; > > This will silence the warning but I think we could change the code to be more direct at > the cost of recalculating the offset twice but staying with the pointers of the right type? @Jacob: ping?
diff --git a/src/stat_item.c b/src/stat_item.c index 0545ea0..7017523 100644 --- a/src/stat_item.c +++ b/src/stat_item.c @@ -81,7 +81,7 @@ struct osmo_stat_item_group *osmo_stat_item_group_alloc(void *ctx, size = (size + sizeof(void *) - 1) & ~(sizeof(void *) - 1); /* Store offsets into the item array */ - group->items[item_idx] = (void *)items_size; + group->items[item_idx] = (struct osmo_stat_item *)items_size; items_size += size; }