diff options
author | phk <phk@FreeBSD.org> | 2002-04-08 08:57:21 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2002-04-08 08:57:21 +0000 |
commit | f0ca71273ec5cada05bedea3198c9abcf27d3c2a (patch) | |
tree | 3a88498bfe1587d0bea127c43a29ba86463d220a /lib | |
parent | cc26525bb5d76e058c2c6546f6d1154c86124b25 (diff) | |
download | FreeBSD-src-f0ca71273ec5cada05bedea3198c9abcf27d3c2a.zip FreeBSD-src-f0ca71273ec5cada05bedea3198c9abcf27d3c2a.tar.gz |
Catch up with const'ification of <sys/disklabel.h> and quelch warnings.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/gen/disklabel.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/lib/libc/gen/disklabel.c b/lib/libc/gen/disklabel.c index 9e4e395..aa406d4 100644 --- a/lib/libc/gen/disklabel.c +++ b/lib/libc/gen/disklabel.c @@ -50,11 +50,21 @@ __FBSDID("$FreeBSD$"); #include <unistd.h> #include <ctype.h> -static int gettype(char *, char **); +static int +gettype(char *t, const char **names) +{ + const char **nm; + + for (nm = names; *nm; nm++) + if (strcasecmp(t, *nm) == 0) + return (nm - names); + if (isdigit((unsigned char)*t)) + return (atoi(t)); + return (0); +} struct disklabel * -getdiskbyname(name) - const char *name; +getdiskbyname(const char *name) { static struct disklabel disk; struct disklabel *dp = &disk; @@ -152,18 +162,3 @@ getdiskbyname(name) free(buf); return (dp); } - -static int -gettype(t, names) - char *t; - char **names; -{ - char **nm; - - for (nm = names; *nm; nm++) - if (strcasecmp(t, *nm) == 0) - return (nm - names); - if (isdigit((unsigned char)*t)) - return (atoi(t)); - return (0); -} |