#ifdef unused
static int error(int);
#endif // unused
-static int gettype(char *, char **);
+static int gettype(const char *, const char **);
struct disklabel *
getdiskbyname(const char *name)
dp->d_flags |= D_BADSECT;
#define getnumdflt(field, dname, dflt) \
- { long f; (field) = (cgetnum(buf, dname, &f) == -1) ? (dflt) : f; }
+ { long f; (field) = (typeof(field))((cgetnum(buf, dname, &f) == -1) ? (dflt) : f); }
getnumdflt(dp->d_secsize, "se", DEV_BSIZE);
cgetnum(buf, "nt",(long *) &dp->d_ntracks);
}
static int
-gettype(t, names)
- char *t;
- char **names;
+gettype(const char *t, const char **names)
{
- register char **nm;
+ const char **nm;
for (nm = names; *nm; nm++)
if (strcasecmp(t, *nm) == 0)
- return (nm - names);
+ return (int)(nm - names);
if (isdigit(*t))
return (atoi(t));
return (0);