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

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

* Changed the int64_t values in the statistics structs to longs so casting
is not necessary when generating the formatted CLI output.  The offending
members did not need to be int64_t anyway as they were only set by an int
type variable which was already truncating bits.

* Reordered the statistics structs to reduce potential padding bytes.

Change-Id: Ic090a070e9dc4ca650ebdb9c01ed50a581289962
pull/12/head
Richard Mudgett 7 years ago
parent 192d9dd9c5
commit 7c08ff51d7

@ -339,14 +339,14 @@ static AST_VECTOR(, struct stasis_message_type_statistics) message_type_statisti
/*! \internal */
struct stasis_topic_statistics {
/*! \brief Highest time spent dispatching messages to subscribers */
long highest_time_dispatched;
/*! \brief Lowest time spent dispatching messages to subscribers */
long lowest_time_dispatched;
/*! \brief The number of messages that were not dispatched to any subscriber */
int messages_not_dispatched;
/*! \brief The number of messages that were dispatched to at least 1 subscriber */
int messages_dispatched;
/*! \brief Highest time spent dispatching messages to subscribers */
int64_t highest_time_dispatched;
/*! \brief Lowest time spent dispatching messages to subscribers */
int64_t lowest_time_dispatched;
/*! \brief The number of subscribers to this topic */
int subscriber_count;
/*! \brief Name of the topic */
@ -461,26 +461,26 @@ size_t stasis_topic_subscribers(const struct stasis_topic *topic)
struct stasis_subscription_statistics {
/*! \brief The filename where the subscription originates */
const char *file;
/*! \brief The line number where the subscription originates */
int lineno;
/*! \brief The function where the subscription originates */
const char *func;
/*! \brief Name of the topic we subscribed to */
char *topic;
/*! \brief The message type that currently took the longest to process */
struct stasis_message_type *highest_time_message_type;
/*! \brief Highest time spent invoking a message */
long highest_time_invoked;
/*! \brief Lowest time spent invoking a message */
long lowest_time_invoked;
/*! \brief The number of messages that were filtered out */
int messages_dropped;
/*! \brief The number of messages that passed filtering */
int messages_passed;
/*! \brief Highest time spent invoking a message */
int64_t highest_time_invoked;
/*! \brief The message type that currently took the longest to process */
struct stasis_message_type *highest_time_message_type;
/*! \brief Lowest time spent invoking a message */
int64_t lowest_time_invoked;
/*! \brief Using a mailbox to queue messages */
int uses_mailbox;
/*! \brief Using stasis threadpool for handling messages */
int uses_threadpool;
/*! \brief Name of the topic we subscribed to */
char *topic;
/*! \brief The line number where the subscription originates */
int lineno;
/*! \brief Unique ID of the subscription */
char uniqueid[0];
};
@ -561,7 +561,7 @@ static void subscription_invoke(struct stasis_subscription *sub,
int message_type_id = stasis_message_type_id(stasis_subscription_change_type());
#ifdef AST_DEVMODE
struct timeval start;
int elapsed;
long elapsed;
start = ast_tvnow();
#endif
@ -1243,7 +1243,7 @@ static void publish_msg(struct stasis_topic *topic,
int message_type_id = stasis_message_type_id(stasis_message_type(message));
struct stasis_message_type_statistics *statistics;
struct timeval start;
int elapsed;
long elapsed;
#endif
ast_assert(topic != NULL);

Loading…
Cancel
Save