[Asterisk-code-review] stasic.c: Fix printf format type mismatches with arguments. (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Wed Dec 19 13:04:45 CST 2018


Richard Mudgett has uploaded this change for review. ( https://gerrit.asterisk.org/10826


Change subject: stasic.c: Fix printf format type mismatches with arguments.
......................................................................

stasic.c: Fix printf format type mismatches with arguments.

An int64_t is not necessarily the same size as a long.

Change-Id: Ic090a070e9dc4ca650ebdb9c01ed50a581289962
---
M main/stasis.c
1 file changed, 6 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/26/10826/1

diff --git a/main/stasis.c b/main/stasis.c
index 8793b2b..3d72dc6 100644
--- a/main/stasis.c
+++ b/main/stasis.c
@@ -2134,7 +2134,7 @@
 	iter = ao2_iterator_init(subscription_statistics, 0);
 	while ((statistics = ao2_iterator_next(&iter))) {
 		ast_cli(a->fd, FMT_FIELDS, statistics->uniqueid, statistics->messages_dropped, statistics->messages_passed,
-			statistics->lowest_time_invoked, statistics->highest_time_invoked);
+			(long) statistics->lowest_time_invoked, (long) statistics->highest_time_invoked);
 		dropped += statistics->messages_dropped;
 		passed += statistics->messages_passed;
 		ao2_ref(statistics, -1);
@@ -2221,8 +2221,8 @@
 	ast_cli(a->fd, "Number of messages passed to subscriber callback: %d\n", statistics->messages_passed);
 	ast_cli(a->fd, "Using mailbox to queue messages: %s\n", statistics->uses_mailbox ? "Yes" : "No");
 	ast_cli(a->fd, "Using stasis threadpool for handling messages: %s\n", statistics->uses_threadpool ? "Yes" : "No");
-	ast_cli(a->fd, "Lowest amount of time (in milliseconds) spent invoking message: %ld\n", statistics->lowest_time_invoked);
-	ast_cli(a->fd, "Highest amount of time (in milliseconds) spent invoking message: %ld\n", statistics->highest_time_invoked);
+	ast_cli(a->fd, "Lowest amount of time (in milliseconds) spent invoking message: %ld\n", (long) statistics->lowest_time_invoked);
+	ast_cli(a->fd, "Highest amount of time (in milliseconds) spent invoking message: %ld\n", (long) statistics->highest_time_invoked);
 
 	ao2_lock(statistics);
 	if (statistics->highest_time_message_type) {
@@ -2270,7 +2270,7 @@
 	iter = ao2_iterator_init(topic_statistics, 0);
 	while ((statistics = ao2_iterator_next(&iter))) {
 		ast_cli(a->fd, FMT_FIELDS, statistics->name, statistics->messages_not_dispatched, statistics->messages_dispatched,
-			statistics->lowest_time_dispatched, statistics->highest_time_dispatched);
+			(long) statistics->lowest_time_dispatched, (long) statistics->highest_time_dispatched);
 		not_dispatched += statistics->messages_not_dispatched;
 		dispatched += statistics->messages_dispatched;
 		ao2_ref(statistics, -1);
@@ -2351,8 +2351,8 @@
 	ast_cli(a->fd, "Topic: %s\n", statistics->name);
 	ast_cli(a->fd, "Number of messages published that went to no subscriber: %d\n", statistics->messages_not_dispatched);
 	ast_cli(a->fd, "Number of messages that went to at least one subscriber: %d\n", statistics->messages_dispatched);
-	ast_cli(a->fd, "Lowest amount of time (in milliseconds) spent dispatching message: %ld\n", statistics->lowest_time_dispatched);
-	ast_cli(a->fd, "Highest amount of time (in milliseconds) spent dispatching messages: %ld\n", statistics->highest_time_dispatched);
+	ast_cli(a->fd, "Lowest amount of time (in milliseconds) spent dispatching message: %ld\n", (long) statistics->lowest_time_dispatched);
+	ast_cli(a->fd, "Highest amount of time (in milliseconds) spent dispatching messages: %ld\n", (long) statistics->highest_time_dispatched);
 	ast_cli(a->fd, "Number of subscribers: %d\n", statistics->subscriber_count);
 
 	ao2_ref(statistics, -1);

-- 
To view, visit https://gerrit.asterisk.org/10826
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic090a070e9dc4ca650ebdb9c01ed50a581289962
Gerrit-Change-Number: 10826
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181219/1c03ce94/attachment.html>


More information about the asterisk-code-review mailing list