stats_test: fix mismatching osmo_stats_reporter->send_item signature

The function pointer expects the last arg as int64_t, stats_test.c uses
an int instead. Fix the argument type as well as the printf format for it.

Fixes this compiler warning seen on our FreeBSD build slave:

    CC       stats/stats_test.o
  ../../tests/stats/stats_test.c:288:18: warning: incompatible pointer types assigning to 'int (*)(struct osmo_stats_reporter *, const struct osmo_stat_item_group *, const struct osmo_stat_item_desc *, int64_t)' from 'int (struct osmo_stats_reporter *, const struct osmo_stat_item_group *, const struct osmo_stat_item_desc *, int)' [-Wincompatible-pointer-types]
          srep->send_item = stats_reporter_test_send_item;
                          ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1 warning generated.

Change-Id: I91cbfd4dd25a881b803943430101dabf07dafc7c
This commit is contained in:
Neels Hofmeyr 2017-01-13 00:11:34 +01:00 committed by Harald Welte
parent df83eced68
commit b41b48e76a
1 changed files with 3 additions and 2 deletions

View File

@ -27,6 +27,7 @@
#include <osmocom/core/stats.h>
#include <stdio.h>
#include <inttypes.h>
enum test_ctr {
TEST_A_CTR,
@ -251,9 +252,9 @@ static int stats_reporter_test_send_counter(struct osmo_stats_reporter *srep,
static int stats_reporter_test_send_item(struct osmo_stats_reporter *srep,
const struct osmo_stat_item_group *statg,
const struct osmo_stat_item_desc *desc, int value)
const struct osmo_stat_item_desc *desc, int64_t value)
{
printf(" %s: item p=%s g=%s i=%u n=%s v=%d u=%s\n",
printf(" %s: item p=%s g=%s i=%u n=%s v=%"PRId64" u=%s\n",
srep->name,
srep->name_prefix ? srep->name_prefix : "",
statg->desc->group_name_prefix, statg->idx,