summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDavid Wragg <dpw@lshift.net>2010-05-30 23:31:40 +0100
committerDavid Wragg <dpw@lshift.net>2010-05-30 23:31:40 +0100
commit7e8fbea4c9212774c101e33218d26a0dc992dc03 (patch)
tree4815bc608e2f3f54187c20142c5c909fa1ab0810 /examples
parent2347dc9977d3bf0c9ed19f7ed3a905eb4e65fa46 (diff)
downloadrabbitmq-c-7e8fbea4c9212774c101e33218d26a0dc992dc03.tar.gz
Remove uses of the GNU-specific %ll printf format modifier
The MS C runtime doesn't support it. Use the C99 inttypes.h macros instead, which is supplied by MinGW.
Diffstat (limited to 'examples')
-rw-r--r--examples/amqp_consumer.c4
-rw-r--r--examples/amqp_producer.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/examples/amqp_consumer.c b/examples/amqp_consumer.c
index 331fe1d..45db990 100644
--- a/examples/amqp_consumer.c
+++ b/examples/amqp_consumer.c
@@ -84,8 +84,8 @@ static void run(amqp_connection_state_t conn)
if (now > next_summary_time) {
int countOverInterval = received - previous_received;
double intervalRate = countOverInterval / ((now - previous_report_time) / 1000000.0);
- printf("%lld ms: Received %d - %d since last report (%d Hz)\n",
- (now - start_time) / 1000, received, countOverInterval, (int) intervalRate);
+ printf("%d ms: Received %d - %d since last report (%d Hz)\n",
+ (int)(now - start_time) / 1000, received, countOverInterval, (int) intervalRate);
previous_received = received;
previous_report_time = now;
diff --git a/examples/amqp_producer.c b/examples/amqp_producer.c
index 94c529d..61cc925 100644
--- a/examples/amqp_producer.c
+++ b/examples/amqp_producer.c
@@ -95,8 +95,8 @@ static void send_batch(amqp_connection_state_t conn,
if (now > next_summary_time) {
int countOverInterval = sent - previous_sent;
double intervalRate = countOverInterval / ((now - previous_report_time) / 1000000.0);
- printf("%lld ms: Sent %d - %d since last report (%d Hz)\n",
- (now - start_time) / 1000, sent, countOverInterval, (int) intervalRate);
+ printf("%d ms: Sent %d - %d since last report (%d Hz)\n",
+ (int)(now - start_time) / 1000, sent, countOverInterval, (int) intervalRate);
previous_sent = sent;
previous_report_time = now;
@@ -111,10 +111,10 @@ static void send_batch(amqp_connection_state_t conn,
{
long long stop_time = now_microseconds();
- long long total_delta = stop_time - start_time;
+ int total_delta = stop_time - start_time;
printf("PRODUCER - Message count: %d\n", message_count);
- printf("Total time, milliseconds: %lld\n", total_delta / 1000);
+ printf("Total time, milliseconds: %d\n", total_delta / 1000);
printf("Overall messages-per-second: %g\n", (message_count / (total_delta / 1000000.0)));
}
}