From: ptools Date: Fri, 30 Jul 2004 06:21:22 +0000 (+0000) Subject: compiler warning fixes on IA64 X-Git-Tag: v1.1.0~805 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e32d1beb99f72d7e680b82bf949b8649a7a6f282;p=xfstests-dev.git compiler warning fixes on IA64 added the correct type cast for printfs --- diff --git a/src/resvtest.c b/src/resvtest.c index 28772c86..66fe5084 100644 --- a/src/resvtest.c +++ b/src/resvtest.c @@ -1,35 +1,24 @@ /* * Copyright (c) 2004 Silicon Graphics, Inc. All Rights Reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it would be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * Further, this software is distributed without any warranty that it is - * free of the rightful claim of any third person regarding infringement - * or the like. Any license provided herein, whether implied or - * otherwise, applies only to this software file. Patent licenses, if - * any, provided herein do not apply to combinations of this program with - * other software, or any other product whatsoever. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write the Free Software Foundation, Inc., 59 - * Temple Place - Suite 330, Boston MA 02111-1307, USA. - * - * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, - * Mountain View, CA 94043, or: - * - * http://www.sgi.com - * - * For further information regarding this notice, see: - * - * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ - */ - + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane, + * Mountain View, CA 94043, USA, or: http://www.sgi.com + */ + #include "global.h" int @@ -105,11 +94,11 @@ main(int argc, char **argv) if (ioctl(writefd, XFS_IOC_RESVSP64, &resvsp) < 0) { fprintf(stdout, "attempt to reserve %lld bytes for %s " "using %s failed: %s (%d)\n", - resvsize, filename, "XFS_IOC_RESVSP64", + (long long int)resvsize, filename, "XFS_IOC_RESVSP64", strerror(errno), errno); } else { fprintf(stdout, "reserved %lld bytes for %s using %s\n", - resvsize, filename, "XFS_IOC_RESVSP64"); + (long long int)resvsize, filename, "XFS_IOC_RESVSP64"); } /* Space is now preallocated, start IO -- diff --git a/src/t_immutable.c b/src/t_immutable.c index 854986ed..a8c43d7d 100644 --- a/src/t_immutable.c +++ b/src/t_immutable.c @@ -566,7 +566,7 @@ static int test_immutable(const char *dir) fail++; } else { if (write(fd, scribble, strlen(scribble)) != strlen(scribble)) { - fprintf(stderr, "write(%s, %s, %d) failed: %s\n", path, scribble, strlen(scribble), strerror(errno)); + fprintf(stderr, "write(%s, %s, %d) failed: %s\n", path, scribble, (int)strlen(scribble), strerror(errno)); fail++; } close(fd); @@ -636,11 +636,11 @@ static int test_immutable(const char *dir) if (!getuid()) { if (stat("/dev/null", &st) != -1) { if (mknod(path, S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH, st.st_rdev) != -1) { - fprintf(stderr, "mknod(%s, S_IFCHR|0666, %lld) did not fail\n", path, st.st_rdev); + fprintf(stderr, "mknod(%s, S_IFCHR|0666, %lld) did not fail\n", path, (long long int)st.st_rdev); fail++; unlink(path); } else if (errno != EACCES) { - fprintf(stderr, "mknod(%s, S_IFCHR|0666, %lld) did not set errno == EACCESS\n", path, st.st_rdev); + fprintf(stderr, "mknod(%s, S_IFCHR|0666, %lld) did not set errno == EACCESS\n", path, (long long int)st.st_rdev); fail++; } } @@ -665,7 +665,7 @@ static int test_immutable(const char *dir) fail++; } else { if (write(fd, scribble, strlen(scribble)) != strlen(scribble)) { - fprintf(stderr, "write(%s, %s, %d) failed: %s\n", path, scribble, strlen(scribble), strerror(errno)); + fprintf(stderr, "write(%s, %s, %d) failed: %s\n", path, scribble, (int)strlen(scribble), strerror(errno)); fail++; } close(fd); @@ -1182,13 +1182,13 @@ static int test_append(const char *dir) } else { lseek(fd, 0, SEEK_SET); /* this is silently ignored */ if (write(fd, scribble, strlen(scribble)) != strlen(scribble)) { - fprintf(stderr, "write(%s, %s, %d) failed: %s\n", path, scribble, strlen(scribble), + fprintf(stderr, "write(%s, %s, %d) failed: %s\n", path, scribble, (int)strlen(scribble), strerror(errno)); fail++; } lseek(fd, origsize, SEEK_SET); /* this is silently ignored */ if (write(fd, scribble, strlen(scribble)) != strlen(scribble)) { - fprintf(stderr, "write(%s, %s, %d) failed: %s\n", path, scribble, strlen(scribble), + fprintf(stderr, "write(%s, %s, %d) failed: %s\n", path, scribble, (int)strlen(scribble), strerror(errno)); fail++; } @@ -1225,7 +1225,7 @@ static int test_append(const char *dir) else { if (read(fd, buf, strlen(scribble2)) == -1) { fprintf(stderr, "read(%s, &buf, %d) failed: %s\n", path, - strlen(scribble2), strerror(errno)); + (int)strlen(scribble2), strerror(errno)); fail++; } else { if (memcmp(scribble2, buf, strlen(scribble2))) { @@ -1246,13 +1246,13 @@ static int test_append(const char *dir) } else { lseek(fd, 0, SEEK_SET); /* this is silently ignored */ if (write(fd, scribble, strlen(scribble)) != strlen(scribble)) { - fprintf(stderr, "write(%s, %s, %d) failed: %s\n", path, scribble, strlen(scribble), + fprintf(stderr, "write(%s, %s, %d) failed: %s\n", path, scribble, (int)strlen(scribble), strerror(errno)); fail++; } lseek(fd, origsize, SEEK_SET); /* this is silently ignored */ if (write(fd, scribble, strlen(scribble)) != strlen(scribble)) { - fprintf(stderr, "write(%s, %s, %d) failed: %s\n", path, scribble, strlen(scribble), + fprintf(stderr, "write(%s, %s, %d) failed: %s\n", path, scribble, (int)strlen(scribble), strerror(errno)); fail++; } @@ -1290,7 +1290,7 @@ static int test_append(const char *dir) else { if (read(fd, buf, strlen(scribble4)) == -1) { fprintf(stderr, "read(%s, &buf, %d) failed: %s\n", path, - strlen(scribble4), strerror(errno)); + (int)strlen(scribble4), strerror(errno)); fail++; } else { if (memcmp(scribble4, buf, strlen(scribble4))) { @@ -1374,13 +1374,13 @@ static int test_append(const char *dir) } else { lseek(fd, 0, SEEK_SET); /* this is silently ignored */ if (write(fd, scribble, strlen(scribble)) != strlen(scribble)) { - fprintf(stderr, "write(%s, %s, %d) failed: %s\n", path, scribble, strlen(scribble), + fprintf(stderr, "write(%s, %s, %d) failed: %s\n", path, scribble, (int)strlen(scribble), strerror(errno)); fail++; } lseek(fd, origsize, SEEK_SET); /* this is silently ignored */ if (write(fd, scribble, strlen(scribble)) != strlen(scribble)) { - fprintf(stderr, "write(%s, %s, %d) failed: %s\n", path, scribble, strlen(scribble), + fprintf(stderr, "write(%s, %s, %d) failed: %s\n", path, scribble, (int)strlen(scribble), strerror(errno)); fail++; } @@ -1417,7 +1417,7 @@ static int test_append(const char *dir) else { if (read(fd, buf, strlen(scribble2)) == -1) { fprintf(stderr, "read(%s, &buf, %d) failed: %s\n", path, - strlen(scribble2), strerror(errno)); + (int)strlen(scribble2), strerror(errno)); fail++; } else { if (memcmp(scribble2, buf, strlen(scribble2))) { @@ -1438,13 +1438,13 @@ static int test_append(const char *dir) } else { lseek(fd, 0, SEEK_SET); /* this is silently ignored */ if (write(fd, scribble, strlen(scribble)) != strlen(scribble)) { - fprintf(stderr, "write(%s, %s, %d) failed: %s\n", path, scribble, strlen(scribble), + fprintf(stderr, "write(%s, %s, %d) failed: %s\n", path, scribble, (int)strlen(scribble), strerror(errno)); fail++; } lseek(fd, origsize, SEEK_SET); /* this is silently ignored */ if (write(fd, scribble, strlen(scribble)) != strlen(scribble)) { - fprintf(stderr, "write(%s, %s, %d) failed: %s\n", path, scribble, strlen(scribble), + fprintf(stderr, "write(%s, %s, %d) failed: %s\n", path, scribble, (int)strlen(scribble), strerror(errno)); fail++; } @@ -1482,7 +1482,7 @@ static int test_append(const char *dir) else { if (read(fd, buf, strlen(scribble4)) == -1) { fprintf(stderr, "read(%s, &buf, %d) failed: %s\n", path, - strlen(scribble4), strerror(errno)); + (int)strlen(scribble4), strerror(errno)); fail++; } else { if (memcmp(scribble4, buf, strlen(scribble4))) { @@ -1514,7 +1514,7 @@ static int test_append(const char *dir) fail++; } else { if (write(fd, scribble, strlen(scribble)) != strlen(scribble)) { - fprintf(stderr, "write(%s, %s, %d) failed: %s\n", path, scribble, strlen(scribble), strerror(errno)); + fprintf(stderr, "write(%s, %s, %d) failed: %s\n", path, scribble, (int)strlen(scribble), strerror(errno)); fail++; } close(fd); @@ -1589,7 +1589,7 @@ static int test_append(const char *dir) asprintf(&path, "%s/append-only.d/newdev-%d", dir, getuid()); if (stat("/dev/null", &st) != -1) { if (mknod(path, S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH, st.st_rdev) == -1) { - fprintf(stderr, "mknod(%s, S_IFCHR|0666, %lld) failed: %s\n", path, st.st_rdev, strerror(errno)); + fprintf(stderr, "mknod(%s, S_IFCHR|0666, %lld) failed: %s\n", path, (long long int)st.st_rdev, strerror(errno)); fail++; } else if (unlink(path) != -1) { fprintf(stderr, "unlink(%s) did not fail\n", path); @@ -1615,7 +1615,7 @@ static int test_append(const char *dir) fail++; } else { if (write(fd, scribble, strlen(scribble)) != strlen(scribble)) { - fprintf(stderr, "write(%s, %s, %d) failed: %s\n", path, scribble, strlen(scribble), strerror(errno)); + fprintf(stderr, "write(%s, %s, %d) failed: %s\n", path, scribble, (int)strlen(scribble), strerror(errno)); fail++; } close(fd); @@ -1633,7 +1633,7 @@ static int test_append(const char *dir) } else chown(path, 0, 0); } - + free(path); asprintf(&path, "%s/append-only.d/dir/newfile-%d", dir, getuid()); if ((fd = open(path, O_RDWR|O_CREAT, 0666)) == -1) { @@ -1641,7 +1641,7 @@ static int test_append(const char *dir) fail++; } else { if (write(fd, scribble, strlen(scribble)) != strlen(scribble)) { - fprintf(stderr, "write(%s, %s, %d) failed: %s\n", path, scribble, strlen(scribble), strerror(errno)); + fprintf(stderr, "write(%s, %s, %d) failed: %s\n", path, scribble, (int)strlen(scribble), strerror(errno)); fail++; } close(fd);