Author: kgiusti
Date: Tue Apr 2 14:49:11 2013
New Revision: 1463574
URL: http://svn.apache.org/r1463574
Log:
PROTON-223: use primitive types to fix warnings on 32 bit linux, windows
Modified:
qpid/proton/trunk/tests/tools/apps/c/msgr-common.c
qpid/proton/trunk/tests/tools/apps/c/msgr-common.h
qpid/proton/trunk/tests/tools/apps/c/msgr-recv.c
qpid/proton/trunk/tests/tools/apps/c/msgr-send.c
Modified: qpid/proton/trunk/tests/tools/apps/c/msgr-common.c
URL:
http://svn.apache.org/viewvc/qpid/proton/trunk/tests/tools/apps/c/msgr-common.c?rev=1463574&r1=1463573&r2=1463574&view=diff
==============================================================================
--- qpid/proton/trunk/tests/tools/apps/c/msgr-common.c (original)
+++ qpid/proton/trunk/tests/tools/apps/c/msgr-common.c Tue Apr 2 14:49:11 2013
@@ -129,12 +129,12 @@ void statistics_msg_received( Statistics
}
}
-void statistics_report( Statistics_t *s, uint64_t sent, uint64_t received )
+void statistics_report( Statistics_t *s, unsigned long long sent, unsigned
long long received )
{
pn_timestamp_t end = msgr_now() - s->start;
double secs = end/(double)1000.0;
- fprintf(stdout, "Messages sent: %lu recv: %lu\n", sent, received );
+ fprintf(stdout, "Messages sent: %llu recv: %llu\n", sent, received );
fprintf(stdout, "Total time: %f sec\n", secs );
fprintf(stdout, "Throughput: %f msgs/sec\n", (secs != 0.0) ?
(double)sent/secs : 0);
fprintf(stdout, "Latency (sec): %f min %f max %f avg\n",
Modified: qpid/proton/trunk/tests/tools/apps/c/msgr-common.h
URL:
http://svn.apache.org/viewvc/qpid/proton/trunk/tests/tools/apps/c/msgr-common.h?rev=1463574&r1=1463573&r2=1463574&view=diff
==============================================================================
--- qpid/proton/trunk/tests/tools/apps/c/msgr-common.h (original)
+++ qpid/proton/trunk/tests/tools/apps/c/msgr-common.h Tue Apr 2 14:49:11 2013
@@ -58,7 +58,7 @@ typedef struct {
void statistics_start( Statistics_t *s );
void statistics_msg_received( Statistics_t *s, pn_message_t *message );
-void statistics_report( Statistics_t *s, uint64_t sent, uint64_t received );
+void statistics_report( Statistics_t *s, unsigned long long sent, unsigned
long long received );
#if defined(_WIN32) && ! defined(__CYGWIN__)
Modified: qpid/proton/trunk/tests/tools/apps/c/msgr-recv.c
URL:
http://svn.apache.org/viewvc/qpid/proton/trunk/tests/tools/apps/c/msgr-recv.c?rev=1463574&r1=1463573&r2=1463574&view=diff
==============================================================================
--- qpid/proton/trunk/tests/tools/apps/c/msgr-recv.c (original)
+++ qpid/proton/trunk/tests/tools/apps/c/msgr-recv.c Tue Apr 2 14:49:11 2013
@@ -30,7 +30,7 @@
typedef struct {
Addresses_t subscriptions;
- uint64_t msg_count;
+ unsigned long long msg_count;
int recv_count;
int incoming_window;
int timeout; // seconds
@@ -89,7 +89,7 @@ static void parse_options( int argc, cha
{
case 'a': addresses_merge( &opts->subscriptions, optarg );
break;
case 'c':
- if (sscanf( optarg, "%lu", &opts->msg_count ) != 1) {
+ if (sscanf( optarg, "%llu", &opts->msg_count ) != 1) {
fprintf(stderr, "Option -%c requires an integer
argument.\n", optopt);
usage(1);
}
@@ -153,8 +153,8 @@ int main(int argc, char** argv)
{
Options_t opts;
Statistics_t stats;
- uint64_t sent = 0;
- uint64_t received = 0;
+ unsigned long long sent = 0;
+ unsigned long long received = 0;
int forwarding_index = 0;
int rc;
@@ -250,7 +250,7 @@ int main(int argc, char** argv)
}
}
- LOG("Messages received=%lu sent=%lu\n", received, sent);
+ LOG("Messages received=%llu sent=%llu\n", received, sent);
}
// this will flush any pending sends
Modified: qpid/proton/trunk/tests/tools/apps/c/msgr-send.c
URL:
http://svn.apache.org/viewvc/qpid/proton/trunk/tests/tools/apps/c/msgr-send.c?rev=1463574&r1=1463573&r2=1463574&view=diff
==============================================================================
--- qpid/proton/trunk/tests/tools/apps/c/msgr-send.c (original)
+++ qpid/proton/trunk/tests/tools/apps/c/msgr-send.c Tue Apr 2 14:49:11 2013
@@ -32,7 +32,7 @@
typedef struct {
Addresses_t targets;
- uint64_t msg_count;
+ unsigned long long msg_count;
uint32_t msg_size; // of body
uint32_t send_batch;
int outgoing_window;
@@ -86,7 +86,7 @@ static void parse_options( int argc, cha
switch(c) {
case 'a': addresses_merge( &opts->targets, optarg ); break;
case 'c':
- if (sscanf( optarg, "%lu", &opts->msg_count ) != 1) {
+ if (sscanf( optarg, "%llu", &opts->msg_count ) != 1) {
fprintf(stderr, "Option -%c requires an integer argument.\n",
optopt);
usage(1);
}
@@ -175,8 +175,8 @@ int main(int argc, char** argv)
{
Options_t opts;
Statistics_t stats;
- uint64_t sent = 0;
- uint64_t received = 0;
+ unsigned long long sent = 0;
+ unsigned long long received = 0;
int target_index = 0;
int rc;
@@ -254,7 +254,7 @@ int main(int argc, char** argv)
check_messenger(messenger);
}
- LOG("Messages received=%lu sent=%lu\n", received, sent);
+ LOG("Messages received=%llu sent=%llu\n", received, sent);
if (get_replies) {
// wait for the last of the replies
@@ -264,7 +264,7 @@ int main(int argc, char** argv)
check( count > 0 || (opts.timeout == 0),
"Error: timed out waiting for reply messages\n");
received += count;
- LOG("Messages received=%lu sent=%lu\n", received, sent);
+ LOG("Messages received=%llu sent=%llu\n", received, sent);
}
} else if (pn_messenger_outgoing(messenger) > 0) {
LOG("Calling pn_messenger_send()\n");
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]