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/fdcontrol | |
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/fdcontrol')
-rw-r--r-- | usr.sbin/fdcontrol/Makefile | 2 | ||||
-rw-r--r-- | usr.sbin/fdcontrol/fdcontrol.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/fdcontrol/Makefile b/usr.sbin/fdcontrol/Makefile index 4696abd..e2b54aa 100644 --- a/usr.sbin/fdcontrol/Makefile +++ b/usr.sbin/fdcontrol/Makefile @@ -4,7 +4,7 @@ PROG= fdcontrol SRCS= fdcontrol.c fdutil.c -WARNS?= 2 +WARNS?= 6 CFLAGS+= -I${.CURDIR}/../fdread MAN= fdcontrol.8 diff --git a/usr.sbin/fdcontrol/fdcontrol.c b/usr.sbin/fdcontrol/fdcontrol.c index ff0f90b..559ce02 100644 --- a/usr.sbin/fdcontrol/fdcontrol.c +++ b/usr.sbin/fdcontrol/fdcontrol.c @@ -157,7 +157,7 @@ mode = O_RDONLY | O_NONBLOCK; if (showfmt) { if (verbose) { - char *s; + const char *s; printf("%s: %d KB media type\n", argv[0], (128 << ft.secsize) * ft.size / 1024); |