fix compiler warnings

Include all nessecary headers, use the correct format strings and don't
redefine _GNU_SOURCE.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
This commit is contained in:
Christoph Hellwig
2008-12-31 12:52:05 +01:00
committed by Christoph Hellwig
parent 9890a9a98f
commit 68f67d9c74
8 changed files with 19 additions and 11 deletions
+1
View File
@@ -41,6 +41,7 @@
#include <string.h>
#include <errno.h>
#include <getopt.h>
#include <stdlib.h>
char * Progname;
+1 -1
View File
@@ -164,7 +164,7 @@ main(int argc, char *argv[])
for (j=0; j < nfiles; j += stride) {
if (ret[i].bs_ino == inodelist[j]) {
/* oops ... */
printf("failed. Unlinked inode %ld returned by bulkstat\n", inodelist[j]);
printf("failed. Unlinked inode %llu returned by bulkstat\n", (unsigned long long)inodelist[j]);
exit(1);
}
}
+3 -2
View File
@@ -160,9 +160,10 @@ main(int argc, char *argv[])
if ((ret[i].bs_ino == inodelist[j]) &&
(ret[i].bs_gen == genlist[j])) {
/* oops, the same inode with old gen number */
printf("Unlinked inode %ld with generation %d "
printf("Unlinked inode %llu with generation %d "
"returned by bulkstat\n",
inodelist[j], genlist[j]);
(unsigned long long)inodelist[j],
genlist[j]);
exit(1);
}
if ((ret[i].bs_ino == inodelist[j])) {
+2
View File
@@ -21,6 +21,8 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int
main(argc, argv)
+1 -1
View File
@@ -797,7 +797,7 @@ main(int argc, char *argv[])
int c;
struct sockaddr_in myAddr;
struct linger noLinger = {1, 0};
char *host;
char *host = NULL;
char *endnum;
int errflag = 0;
char *p;
-2
View File
@@ -28,8 +28,6 @@
/* dxm - 28/2/2 */
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
+7 -3
View File
@@ -119,7 +119,9 @@ main(int argc, char *argv[])
return 1;
}
if (verbose_opt) {
printf("truncating back to %lu\n", NUMHOLES_TO_SIZE(num_holes));
printf("truncating back to %llu\n",
(unsigned long long)
NUMHOLES_TO_SIZE(num_holes));
}
return 0;
}
@@ -128,7 +130,8 @@ main(int argc, char *argv[])
curr_holes = 0;
}
if (curr_holes != 0 && verbose_opt) {
printf("creating %lu more holes\n", num_holes - curr_holes);
printf("creating %llu more holes\n",
(unsigned long long)num_holes - curr_holes);
}
/* create holes by seeking and writing */
@@ -147,7 +150,8 @@ main(int argc, char *argv[])
}
if (verbose_opt && ((i+1) % status_num == 0)) {
printf("seeked and wrote %lu times\n", i+1);
printf("seeked and wrote %llu times\n",
(unsigned long long)i + 1);
}
}
+4 -2
View File
@@ -23,6 +23,8 @@
#include <errno.h>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define O_DIRECT 040000
@@ -65,10 +67,10 @@ while((c=getopt(argc,argv,"f:"))!=EOF) {
}
}
err = posix_memalign(&buf, ALIGNMENT, BUFSIZE);
err = posix_memalign((void **)&buf, ALIGNMENT, BUFSIZE);
if (err < 0) perror("posix_memalign failed");
err = posix_memalign(&goodbuf, ALIGNMENT, BUFSIZE);
err = posix_memalign((void **)&goodbuf, ALIGNMENT, BUFSIZE);
if (err < 0) perror("posix_memalign failed");
err = unlink(filename);