[PATCH] libosmocore[master]: statsd: Fix compiler warning (int32_t vs. int64_t)

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri Nov 11 14:25:06 UTC 2016


Review at  https://gerrit.osmocom.org/1226

statsd: Fix compiler warning (int32_t vs. int64_t)

Fixes the following compiler warning:

stats_statsd.c: In function ‘osmo_stats_reporter_create_statsd’: stats_statsd.c:54:18: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
  srep->send_item = osmo_stats_reporter_statsd_send_item;

Change-Id: Id36914906e0982f6ac092a311210727de66b343a
---
M include/osmocom/core/stats.h
M src/stats.c
M src/stats_statsd.c
3 files changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/26/1226/1

diff --git a/include/osmocom/core/stats.h b/include/osmocom/core/stats.h
index 96f687e..f754e41 100644
--- a/include/osmocom/core/stats.h
+++ b/include/osmocom/core/stats.h
@@ -78,7 +78,7 @@
 	int (*send_item)(struct osmo_stats_reporter *srep,
 		const struct osmo_stat_item_group *statg,
 		const struct osmo_stat_item_desc *desc,
-		int32_t value);
+		int64_t value);
 };
 
 struct osmo_stats_config {
diff --git a/src/stats.c b/src/stats.c
index 5f1d028..1efc8cd 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -62,7 +62,7 @@
 	int64_t value, int64_t delta);
 static int osmo_stats_reporter_log_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);
 
 static int update_srep_config(struct osmo_stats_reporter *srep)
 {
@@ -429,7 +429,7 @@
 
 static int osmo_stats_reporter_log_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)
 {
 	return osmo_stats_reporter_log_send(srep, "i",
 		statg->desc->group_name_prefix, statg->idx,
diff --git a/src/stats_statsd.c b/src/stats_statsd.c
index 3cecec3..8b53881 100644
--- a/src/stats_statsd.c
+++ b/src/stats_statsd.c
@@ -32,6 +32,7 @@
 #include <osmocom/core/rate_ctr.h>
 #include <osmocom/core/stat_item.h>
 #include <osmocom/core/msgb.h>
+#include <osmocom/core/stats.h>
 
 static int osmo_stats_reporter_statsd_send_counter(struct osmo_stats_reporter *srep,
 	const struct rate_ctr_group *ctrg,

-- 
To view, visit https://gerrit.osmocom.org/1226
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id36914906e0982f6ac092a311210727de66b343a
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list