From: Dave Chinner <david@fromorbit.com>
To: xfs@oss.sgi.com
Subject: [PATCH 7/8] xfstests: fix printf warnings in locktest.c
Date: Wed, 20 Jan 2010 14:38:07 +1100 [thread overview]
Message-ID: <1263958688-435-8-git-send-email-david@fromorbit.com> (raw)
In-Reply-To: <1263958688-435-1-git-send-email-david@fromorbit.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
---
src/locktest.c | 35 ++++++++++++++++++++---------------
1 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/src/locktest.c b/src/locktest.c
index 7552ace..a108b6f 100644
--- a/src/locktest.c
+++ b/src/locktest.c
@@ -718,7 +718,7 @@ send_ctl(void)
if (debug > 1) {
fprintf(stderr, "send_ctl: test=%d, command=%d offset=%"LL"d, length=%"LL"d, result=%d, error=%d\n",
- ctl.test, ctl.command, ctl.offset, ctl.length,ctl.result, ctl.error);
+ ctl.test, ctl.command, (long long)ctl.offset, (long long)ctl.length,ctl.result, ctl.error);
}
ctl.test= bswap_uint32(ctl.test);
@@ -741,7 +741,7 @@ send_ctl(void)
if (nwrite < 0)
perror("send_ctl: write");
else
- fprintf(stderr, "send_ctl[%d]: write() returns %d, not %d as expected\n",
+ fprintf(stderr, "send_ctl[%d]: write() returns %d, not %lu as expected\n",
ctl.test, nwrite, sizeof(ctl));
exit(1);
/*NOTREACHED*/
@@ -756,7 +756,7 @@ void recv_ctl(void)
if (nread < 0)
perror("recv_ctl: read");
else {
- fprintf(stderr, "recv_ctl[%d]: read() returns %d, not %d as expected\n",
+ fprintf(stderr, "recv_ctl[%d]: read() returns %d, not %lu as expected\n",
ctl.test, nread, sizeof(ctl));
fprintf(stderr, "socket might has been closed by other locktest\n");
}
@@ -773,7 +773,7 @@ void recv_ctl(void)
if (debug > 1) {
fprintf(stderr, "recv_ctl: test=%d, command=%d offset=%"LL"d, length=%"LL"d, result=%d, error=%d\n",
- ctl.test, ctl.command, ctl.offset, ctl.length, ctl.result, ctl.error);
+ ctl.test, ctl.command, (long long)ctl.offset, (long long)ctl.length, ctl.result, ctl.error);
}
}
@@ -1040,14 +1040,16 @@ main(int argc, char *argv[])
fail_flag++;
/* We have a failure */
if(debug)
- fprintf(stderr, "Server failure in test %d, while %sing using offset %llu, length %llu - err = %d:%s\n",
+ fprintf(stderr, "Server failure in test %d, while %sing using offset %lld, length %lld - err = %d:%s\n",
ctl.test, tests[index][COMMAND]==WRLOCK?"write lock":
tests[index][COMMAND]==RDLOCK?"read lock":
tests[index][COMMAND]==UNLOCK?"unlock":
tests[index][COMMAND]==F_OPEN?"open":"clos",
- tests[index][OFFSET], tests[index][LENGTH], saved_errno, strerror(saved_errno));
- fprintf(stderr, "Server failure in %llu:%s\n",
- tests[index][TEST_NUM],
+ (long long)tests[index][OFFSET],
+ (long long)tests[index][LENGTH],
+ saved_errno, strerror(saved_errno));
+ fprintf(stderr, "Server failure in %lld:%s\n",
+ (long long)tests[index][TEST_NUM],
descriptions[tests[index][TEST_NUM] - 1]);
}
}
@@ -1058,12 +1060,13 @@ main(int argc, char *argv[])
end=1;
}
if(debug > 1)
- fprintf(stderr, "Sending command to client (%d) - %s - %llu:%llu\n",
+ fprintf(stderr, "Sending command to client (%d) - %s - %lld:%lld\n",
index, tests[index][COMMAND]==WRLOCK?"write lock":
tests[index][COMMAND]==RDLOCK?"read lock":
tests[index][COMMAND]==UNLOCK?"unlock":
tests[index][COMMAND]==F_OPEN?"open":"clos",
- tests[index][OFFSET], tests[index][LENGTH]);
+ (long long)tests[index][OFFSET],
+ (long long)tests[index][LENGTH]);
/* get the client to do something */
ctl.index = index;
send_ctl();
@@ -1075,14 +1078,15 @@ main(int argc, char *argv[])
if( ctl.result == FAIL ) {
fail_flag++;
if(debug)
- fprintf(stderr, "Client failure in test %d, while %sing using offset %llu, length %llu - err = %d:%s\n",
+ fprintf(stderr, "Client failure in test %d, while %sing using offset %lld, length %lld - err = %d:%s\n",
ctl.test, ctl.command==WRLOCK?"write lock":
ctl.command==RDLOCK?"read lock":
ctl.command==UNLOCK?"unlock":
ctl.command==F_OPEN?"open":"clos",
- ctl.offset, ctl.length, ctl.error, strerror(ctl.error));
- fprintf(stderr, "Client failure in %llu:%s\n",
- tests[index][TEST_NUM],
+ (long long)ctl.offset, (long long)ctl.length,
+ ctl.error, strerror(ctl.error));
+ fprintf(stderr, "Client failure in %lld:%s\n",
+ (long long)tests[index][TEST_NUM],
descriptions[tests[index][TEST_NUM] - 1]);
}
}
@@ -1144,7 +1148,8 @@ main(int argc, char *argv[])
}
if( result != tests[index][RESULT] ) {
if(debug)
- fprintf(stderr,"Got %d, wanted %llu\n", result, tests[index][RESULT]);
+ fprintf(stderr,"Got %d, wanted %lld\n", result,
+ (long long)tests[index][RESULT]);
ctl.result = FAIL;
ctl.error = saved_errno;
fail_count++;
--
1.6.5
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2010-01-20 3:37 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-20 3:38 [PATCH 0/8] xfstests: fix compile warnings Dave Chinner
2010-01-20 3:38 ` [PATCH 1/8] xfstests: fix compile warning in doio.c Dave Chinner
2010-01-20 8:26 ` Christoph Hellwig
2010-01-20 3:38 ` [PATCH 2/8] xfstests: fix bulkstat related compile warnings Dave Chinner
2010-01-20 8:26 ` Christoph Hellwig
2010-01-20 3:38 ` [PATCH 3/8] xfstests: Don't use tempnam in growfiles.c Dave Chinner
2010-01-20 8:28 ` Christoph Hellwig
2010-01-20 3:38 ` [PATCH 4/8] xfstests: fix printf format warnings in aio-stress.c Dave Chinner
2010-01-20 8:30 ` Christoph Hellwig
2010-01-20 3:38 ` [PATCH 5/8] xfstests: fix compile warnings in iopat.c Dave Chinner
2010-01-20 8:31 ` Christoph Hellwig
2010-01-20 3:38 ` [PATCH 6/8] xfstests: fix printf format warnings in looptest.c Dave Chinner
2010-01-20 8:32 ` Christoph Hellwig
2010-01-20 3:38 ` Dave Chinner [this message]
2010-01-20 8:32 ` [PATCH 7/8] xfstests: fix printf warnings in locktest.c Christoph Hellwig
2010-01-20 3:38 ` [PATCH 8/8] xfstests: don't redefine _GNU_SOURCE in aio tests Dave Chinner
2010-01-20 8:33 ` Christoph Hellwig
2010-01-20 22:02 ` [PATCH 0/8] xfstests: fix compile warnings Dave Chinner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1263958688-435-8-git-send-email-david@fromorbit.com \
--to=david@fromorbit.com \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox