diff options
author | delphij <delphij@FreeBSD.org> | 2005-01-08 15:46:06 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2005-01-08 15:46:06 +0000 |
commit | 049c85627c463b094dc6fafd968dac0fc27d2d36 (patch) | |
tree | e7b7f4702f5752e13e6128d82e58a62e3c2805f7 /usr.sbin/fdwrite | |
parent | 99669f6c435eaf7942060ee1fa6c2da7de5a85d6 (diff) | |
download | FreeBSD-src-049c85627c463b094dc6fafd968dac0fc27d2d36.zip FreeBSD-src-049c85627c463b094dc6fafd968dac0fc27d2d36.tar.gz |
Cleanup usr.sbin/fd* so they can compile under WARNS=6.
fdcontrol/fdcontrol.c:
- Add const constraint to an intermediate value
which is not supposed to be changed elsewhere.
fdread/fdread.c:
- Use _devname in favor of devname to avoid name
conflicit.
- -1 is less than any positive number so in order
to get the block to function, we should get the
block a little earlier.
- Cast to remove signed when we are sure that a
return value is positive, or is compared with
an positive number (tracknumber of a floppy
disk is not likely to have UINT_MAX/2 anyway)
fdread/fdutil.c:
- Use more specific initializer
fdwrite/fdwrite.c:
- Use static on format_track since it's not
referenced in other places.
- Use const char* to represent string constant.
Bump WARNS accordingly.
Diffstat (limited to 'usr.sbin/fdwrite')
-rw-r--r-- | usr.sbin/fdwrite/Makefile | 1 | ||||
-rw-r--r-- | usr.sbin/fdwrite/fdwrite.c | 9 |
2 files changed, 6 insertions, 4 deletions
diff --git a/usr.sbin/fdwrite/Makefile b/usr.sbin/fdwrite/Makefile index b97bdd4..ba6f047 100644 --- a/usr.sbin/fdwrite/Makefile +++ b/usr.sbin/fdwrite/Makefile @@ -8,5 +8,6 @@ # $FreeBSD$ PROG= fdwrite +WARNS?= 6 .include <bsd.prog.mk> diff --git a/usr.sbin/fdwrite/fdwrite.c b/usr.sbin/fdwrite/fdwrite.c index b3ffb6e..3c22091 100644 --- a/usr.sbin/fdwrite/fdwrite.c +++ b/usr.sbin/fdwrite/fdwrite.c @@ -21,9 +21,9 @@ #include <sys/fdcio.h> -int +static int format_track(int fd, int cyl, int secs, int head, int rate, - int gaplen, int secsize, int fill,int interleave) + int gaplen, int secsize, int fill, int interleave) { struct fd_formb f; register int i,j; @@ -55,7 +55,7 @@ format_track(int fd, int cyl, int secs, int head, int rate, } static void -usage() +usage(void) { fprintf(stderr, "usage: fdwrite [-v] [-y] [-f inputfile] [-d device]\n"); exit(2); @@ -67,7 +67,8 @@ main(int argc, char **argv) int inputfd = -1, c, fdn = 0, i,j,fd; int bpt, verbose=1, nbytes=0, track; int interactive = 1, fdopts; - char *device= "/dev/fd0", *trackbuf = 0,*vrfybuf = 0; + const char *device= "/dev/fd0"; + char *trackbuf = 0,*vrfybuf = 0; struct fd_type fdt; FILE *tty; |