Make WARNS=5 clean.

Prodded by:	Stefan Farfeleder <stefan@fafoe.narf.at>
This commit is contained in:
Poul-Henning Kamp 2004-04-05 08:15:04 +00:00
parent 740a734c33
commit cbf67506f6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=127884
2 changed files with 9 additions and 6 deletions

View File

@ -3,6 +3,8 @@
PROG= diskinfo PROG= diskinfo
MAN= diskinfo.8 MAN= diskinfo.8
WARNS?= 5
.include <bsd.prog.mk> .include <bsd.prog.mk>
test: ${PROG} test: ${PROG}

View File

@ -31,12 +31,14 @@
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
#include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <paths.h> #include <paths.h>
#include <err.h> #include <err.h>
#include <sys/disk.h> #include <sys/disk.h>
#include <sys/time.h>
static void static void
usage(void) usage(void)
@ -47,7 +49,7 @@ usage(void)
static int opt_t, opt_v; static int opt_t, opt_v;
static void speeddisk(const char *name, int fd, off_t mediasize, u_int sectorsize); static void speeddisk(int fd, off_t mediasize, u_int sectorsize);
int int
main(int argc, char **argv) main(int argc, char **argv)
@ -123,7 +125,7 @@ main(int argc, char **argv)
} }
printf("\n"); printf("\n");
if (opt_t) if (opt_t)
speeddisk(argv[i], fd, mediasize, sectorsize); speeddisk(fd, mediasize, sectorsize);
close(fd); close(fd);
} }
exit (0); exit (0);
@ -140,7 +142,7 @@ rdsect(int fd, u_int blockno, u_int sectorsize)
lseek(fd, (off_t)blockno * sectorsize, SEEK_SET); lseek(fd, (off_t)blockno * sectorsize, SEEK_SET);
error = read(fd, sector, sectorsize); error = read(fd, sector, sectorsize);
if (error != sectorsize) if (error != (int)sectorsize)
err(1, "read error or disk too small for test."); err(1, "read error or disk too small for test.");
} }
@ -193,12 +195,11 @@ TR(double count)
} }
static void static void
speeddisk(const char *name, int fd, off_t mediasize, u_int sectorsize) speeddisk(int fd, off_t mediasize, u_int sectorsize)
{ {
int error, i; int i;
uint b0, b1, sectorcount; uint b0, b1, sectorcount;
off_t size;
sectorcount = mediasize / sectorsize; sectorcount = mediasize / sectorsize;
printf("Seek times:\n"); printf("Seek times:\n");