From: Theodore Ts'o Date: Fri, 27 Feb 2004 02:08:06 +0000 (-0500) Subject: filefrag.c: Fix gcc -Wall nits. X-Git-Tag: E2FSPROGS-1_35~5 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=6b394c1cd36f5aef40d9b17fa0b76cf0a9fd3cc6;p=tools%2Fe2fsprogs.git filefrag.c: Fix gcc -Wall nits. --- diff --git a/misc/ChangeLog b/misc/ChangeLog index bf5d709..30f2e4e 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,5 +1,7 @@ 2004-02-26 Theodore Ts'o + * filefrag.c: Fix gcc -Wall nits. + * badblocks.c (pattern_fill): Fix bug accidentally added when fixing up gcc -Wall nits. badblocks -t random was not getting handled properly because ~0 needed to be cast to diff --git a/misc/filefrag.c b/misc/filefrag.c index 90137aa..e40941d 100644 --- a/misc/filefrag.c +++ b/misc/filefrag.c @@ -27,6 +27,12 @@ int main(void) { #include #include #include +#ifdef HAVE_GETOPT_H +#include +#else +extern char *optarg; +extern int optind; +#endif #include #include #include @@ -57,11 +63,11 @@ static unsigned long get_bmap(int fd, unsigned long block) #define EXT2_DIRECT 12 -void frag_report(const char *filename) +static void frag_report(const char *filename) { struct statfs fsinfo; struct stat64 fileinfo; - long i, fd, bs, block, last_block, numblocks; + long i, fd, bs, block, last_block = 0, numblocks; long bpib; /* Blocks per indirect block */ long cylgroups; int discont = 0, expected; @@ -138,7 +144,7 @@ void frag_report(const char *filename) } -void usage(const char *progname) +static void usage(const char *progname) { fprintf(stderr, "Usage: %s [-v] file ...\n", progname); exit(1);