xfstests: fix a few build warnings
authorAlex Elder <aelder@sgi.com>
Fri, 4 Mar 2011 19:37:31 +0000 (19:37 +0000)
committerAlex Elder <aelder@sgi.com>
Wed, 9 Mar 2011 20:52:45 +0000 (14:52 -0600)
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>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
lib/tlibio.c
src/aio-dio-regress/aiodio_sparse2.c
src/pwrite_mmap_blocked.c
src/unwritten_sync.c
src/xfsctl.c

index 85d3bb6cbe867b9a8fa7b4fc571ec95fe733882a..c509af387d96d546425383b42377c0534fe9452d 100644 (file)
@@ -453,7 +453,7 @@ int
 lio_random_methods(long curr_mask)
 {
     int mask=0;
 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));
 
     /* remove random select, io type, and wait method bits from curr_mask */
     mask = curr_mask & (~(LIO_IO_TYPES | LIO_WAIT_TYPES | LIO_RANDOM));
index 681a093b6603464e45c2ee7d12774826ca48bdd3..79aa92416c164ee4cd4e439644417351a579e3de 100644 (file)
@@ -227,7 +227,8 @@ void aiodio_sparse(char *filename, int align, int writesize, int startoffset, in
                unsigned char *badbuf;
 
                if (debug)
                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",
                lseek(fd, offset, SEEK_SET);
                if (read(fd, bufptr, writesize) < writesize) {
                        fprintf(stderr, "short read() at offset %lld\n",
index f24f71896688cbc78668d8cdebb5e48c0ed93b4c..26e2230d9e52f79d07f59dec20e13b0ec24a7fae 100644 (file)
@@ -59,7 +59,8 @@ int main(int argc, char *argv[])
                perror("mmap");
                exit(1);
        }
                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) {
 
        ret = pwrite(fd, (char *)mapped_mem + from, amount, to);
        if (ret != amount) {
index 454eba066a04bd4bb0046e5813bf8a66fc88ad37..6cdf7e8a777ee5bf45dbb9a97ac32295a4d306d9 100644 (file)
@@ -136,7 +136,9 @@ again:
                }
                if (bmapx[x].bmv_oflags & 1) {
                        fprintf(stderr, "FOUND ONE %lld %lld %x\n",
                }
                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;
                }
                        foundone = 1;
                        foundany = 1;
                }
index 8fa3348829e6ca4ed2a5cff286ecebccf0324d4a..3f82f4adb3500637637da4a80423a32f5c400b13 100644 (file)
@@ -16,6 +16,8 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <sys/stat.h>
+
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>