* [PATCH] xfstests: fix a few build warnings
@ 2011-03-04 19:37 Alex Elder
2011-03-09 17:34 ` Eric Sandeen
2011-03-10 17:24 ` Christoph Hellwig
0 siblings, 2 replies; 4+ messages in thread
From: Alex Elder @ 2011-03-04 19:37 UTC (permalink / raw)
To: xfs
This patch fixes a few build warnings. I have built the code using
i386, x86_64, and ia64 architectures and each has ends up with
complaints of one sort or anther. This gets rid of all of them
*except* those reported by files under the "ltp" (Linux Test
Project) sub-tree.
Signed-off-by: Alex Elder <aelder@sgi.com>
---
lib/tlibio.c | 2 +-
src/aio-dio-regress/aiodio_sparse2.c | 3 ++-
src/pwrite_mmap_blocked.c | 3 ++-
src/unwritten_sync.c | 4 +++-
src/xfsctl.c | 2 ++
5 files changed, 10 insertions(+), 4 deletions(-)
Index: b/lib/tlibio.c
===================================================================
--- a/lib/tlibio.c
+++ b/lib/tlibio.c
@@ -453,7 +453,7 @@ int
lio_random_methods(long curr_mask)
{
int mask=0;
- long random_bit();
+ long random_bit(long);
/* remove random select, io type, and wait method bits from curr_mask */
mask = curr_mask & (~(LIO_IO_TYPES | LIO_WAIT_TYPES | LIO_RANDOM));
Index: b/src/aio-dio-regress/aiodio_sparse2.c
===================================================================
--- a/src/aio-dio-regress/aiodio_sparse2.c
+++ b/src/aio-dio-regress/aiodio_sparse2.c
@@ -227,7 +227,8 @@ void aiodio_sparse(char *filename, int a
unsigned char *badbuf;
if (debug)
- fprintf(stderr, "seek to %ld and read %d\n", offset, writesize);
+ fprintf(stderr, "seek to %lld and read %d\n",
+ (long long) offset, writesize);
lseek(fd, offset, SEEK_SET);
if (read(fd, bufptr, writesize) < writesize) {
fprintf(stderr, "short read() at offset %lld\n",
Index: b/src/pwrite_mmap_blocked.c
===================================================================
--- a/src/pwrite_mmap_blocked.c
+++ b/src/pwrite_mmap_blocked.c
@@ -59,7 +59,8 @@ int main(int argc, char *argv[])
perror("mmap");
exit(1);
}
- printf("pwrite %Ld bytes from %Ld to %Ld\n", amount, from, to);
+ printf("pwrite %Ld bytes from %Ld to %Ld\n",
+ (long long) amount, (long long) from, (long long) to);
ret = pwrite(fd, (char *)mapped_mem + from, amount, to);
if (ret != amount) {
Index: b/src/unwritten_sync.c
===================================================================
--- a/src/unwritten_sync.c
+++ b/src/unwritten_sync.c
@@ -136,7 +136,9 @@ again:
}
if (bmapx[x].bmv_oflags & 1) {
fprintf(stderr, "FOUND ONE %lld %lld %x\n",
- bmapx[x].bmv_offset, bmapx[x].bmv_length,bmapx[x].bmv_oflags);
+ (long long) bmapx[x].bmv_offset,
+ (long long) bmapx[x].bmv_length,
+ bmapx[x].bmv_oflags);
foundone = 1;
foundany = 1;
}
Index: b/src/xfsctl.c
===================================================================
--- a/src/xfsctl.c
+++ b/src/xfsctl.c
@@ -16,6 +16,8 @@
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <sys/stat.h>
+
#include <xfs/xfs.h>
#include <xfs/jdm.h>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] xfstests: fix a few build warnings
2011-03-04 19:37 [PATCH] xfstests: fix a few build warnings Alex Elder
@ 2011-03-09 17:34 ` Eric Sandeen
2011-03-10 17:24 ` Christoph Hellwig
1 sibling, 0 replies; 4+ messages in thread
From: Eric Sandeen @ 2011-03-09 17:34 UTC (permalink / raw)
To: Alex Elder; +Cc: xfs
On 3/4/11 1:37 PM, Alex Elder wrote:
> This patch fixes a few build warnings. I have built the code using
> i386, x86_64, and ia64 architectures and each has ends up with
> complaints of one sort or anther. This gets rid of all of them
> *except* those reported by files under the "ltp" (Linux Test
> Project) sub-tree.
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
> Signed-off-by: Alex Elder <aelder@sgi.com>
>
> ---
> lib/tlibio.c | 2 +-
> src/aio-dio-regress/aiodio_sparse2.c | 3 ++-
> src/pwrite_mmap_blocked.c | 3 ++-
> src/unwritten_sync.c | 4 +++-
> src/xfsctl.c | 2 ++
> 5 files changed, 10 insertions(+), 4 deletions(-)
>
> Index: b/lib/tlibio.c
> ===================================================================
> --- a/lib/tlibio.c
> +++ b/lib/tlibio.c
> @@ -453,7 +453,7 @@ int
> lio_random_methods(long curr_mask)
> {
> int mask=0;
> - long random_bit();
> + long random_bit(long);
>
> /* remove random select, io type, and wait method bits from curr_mask */
> mask = curr_mask & (~(LIO_IO_TYPES | LIO_WAIT_TYPES | LIO_RANDOM));
> Index: b/src/aio-dio-regress/aiodio_sparse2.c
> ===================================================================
> --- a/src/aio-dio-regress/aiodio_sparse2.c
> +++ b/src/aio-dio-regress/aiodio_sparse2.c
> @@ -227,7 +227,8 @@ void aiodio_sparse(char *filename, int a
> unsigned char *badbuf;
>
> if (debug)
> - fprintf(stderr, "seek to %ld and read %d\n", offset, writesize);
> + fprintf(stderr, "seek to %lld and read %d\n",
> + (long long) offset, writesize);
> lseek(fd, offset, SEEK_SET);
> if (read(fd, bufptr, writesize) < writesize) {
> fprintf(stderr, "short read() at offset %lld\n",
> Index: b/src/pwrite_mmap_blocked.c
> ===================================================================
> --- a/src/pwrite_mmap_blocked.c
> +++ b/src/pwrite_mmap_blocked.c
> @@ -59,7 +59,8 @@ int main(int argc, char *argv[])
> perror("mmap");
> exit(1);
> }
> - printf("pwrite %Ld bytes from %Ld to %Ld\n", amount, from, to);
> + printf("pwrite %Ld bytes from %Ld to %Ld\n",
> + (long long) amount, (long long) from, (long long) to);
>
> ret = pwrite(fd, (char *)mapped_mem + from, amount, to);
> if (ret != amount) {
> Index: b/src/unwritten_sync.c
> ===================================================================
> --- a/src/unwritten_sync.c
> +++ b/src/unwritten_sync.c
> @@ -136,7 +136,9 @@ again:
> }
> if (bmapx[x].bmv_oflags & 1) {
> fprintf(stderr, "FOUND ONE %lld %lld %x\n",
> - bmapx[x].bmv_offset, bmapx[x].bmv_length,bmapx[x].bmv_oflags);
> + (long long) bmapx[x].bmv_offset,
> + (long long) bmapx[x].bmv_length,
> + bmapx[x].bmv_oflags);
> foundone = 1;
> foundany = 1;
> }
> Index: b/src/xfsctl.c
> ===================================================================
> --- a/src/xfsctl.c
> +++ b/src/xfsctl.c
> @@ -16,6 +16,8 @@
> * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
> */
>
> +#include <sys/stat.h>
> +
> #include <xfs/xfs.h>
> #include <xfs/jdm.h>
>
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] xfstests: fix a few build warnings
2011-03-04 19:37 [PATCH] xfstests: fix a few build warnings Alex Elder
2011-03-09 17:34 ` Eric Sandeen
@ 2011-03-10 17:24 ` Christoph Hellwig
2011-03-10 22:16 ` Alex Elder
1 sibling, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2011-03-10 17:24 UTC (permalink / raw)
To: Alex Elder; +Cc: xfs
> lio_random_methods(long curr_mask)
> {
> int mask=0;
> - long random_bit();
> + long random_bit(long);
This should use the prototype from include/random_range.h instead.
Otherwise looks good to me,
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] xfstests: fix a few build warnings
2011-03-10 17:24 ` Christoph Hellwig
@ 2011-03-10 22:16 ` Alex Elder
0 siblings, 0 replies; 4+ messages in thread
From: Alex Elder @ 2011-03-10 22:16 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: xfs
On Thu, 2011-03-10 at 12:24 -0500, Christoph Hellwig wrote:
> > lio_random_methods(long curr_mask)
> > {
> > int mask=0;
> > - long random_bit();
> > + long random_bit(long);
>
> This should use the prototype from include/random_range.h instead.
>
> Otherwise looks good to me,
>
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
I should have done that. Already committed though.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-03-10 22:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-04 19:37 [PATCH] xfstests: fix a few build warnings Alex Elder
2011-03-09 17:34 ` Eric Sandeen
2011-03-10 17:24 ` Christoph Hellwig
2011-03-10 22:16 ` Alex Elder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox