Catch up with const'ification of <sys/disklabel.h> and quelch warnings.
This commit is contained in:
parent
b77b9b9a90
commit
674a5ae34f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=94181
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user