Remove "register" keywords.

Use newspeak functions definitions.
This commit is contained in:
Poul-Henning Kamp 2003-10-21 07:58:52 +00:00
parent bd781a1ed6
commit 4d169ae131
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=121299
6 changed files with 35 additions and 60 deletions

View File

@ -74,10 +74,7 @@ static const char *ftype(u_int);
}
int
compare(name, s, p)
char *name __unused;
register NODE *s;
register FTSENT *p;
compare(char *name __unused, NODE *s, FTSENT *p)
{
uint32_t val;
int fd, label;
@ -307,8 +304,7 @@ typeerr: LABEL;
}
const char *
inotype(type)
u_int type;
inotype(u_int type)
{
switch(type & S_IFMT) {
case S_IFBLK:
@ -332,8 +328,7 @@ inotype(type)
}
static const char *
ftype(type)
u_int type;
ftype(u_int type)
{
switch(type) {
case F_BLOCK:
@ -357,11 +352,10 @@ ftype(type)
}
char *
rlink(name)
char *name;
rlink(char *name)
{
static char lbuf[MAXPATHLEN];
register int len;
int len;
if ((len = readlink(name, lbuf, sizeof(lbuf) - 1)) == -1)
err(1, "line %d: %s", lineno, name);

View File

@ -85,10 +85,10 @@ static int statd(FTS *, FTSENT *, uid_t *, gid_t *, mode_t *, u_long *);
static void statf(int, FTSENT *);
void
cwalk()
cwalk(void)
{
register FTS *t;
register FTSENT *p;
FTS *t;
FTSENT *p;
time_t cl;
char *argv[2], host[MAXHOSTNAMELEN];
char dot[] = ".";
@ -145,9 +145,7 @@ cwalk()
}
static void
statf(indent, p)
int indent;
FTSENT *p;
statf(int indent, FTSENT *p)
{
struct group *gr;
struct passwd *pw;
@ -274,19 +272,13 @@ statf(indent, p)
#define MAXS 16
static int
statd(t, parent, puid, pgid, pmode, pflags)
FTS *t;
FTSENT *parent;
uid_t *puid;
gid_t *pgid;
mode_t *pmode;
u_long *pflags;
statd(FTS *t, FTSENT *parent, uid_t *puid, gid_t *pgid, mode_t *pmode, u_long *pflags)
{
register FTSENT *p;
register gid_t sgid;
register uid_t suid;
register mode_t smode;
register u_long sflags;
FTSENT *p;
gid_t sgid;
uid_t suid;
mode_t smode;
u_long sflags;
struct group *gr;
struct passwd *pw;
gid_t savegid = *pgid;
@ -397,8 +389,7 @@ statd(t, parent, puid, pgid, pmode, pflags)
}
static int
dsort(a, b)
const FTSENT * const *a, * const *b;
dsort(const FTSENT * const *a, const FTSENT * const *b)
{
if (S_ISDIR((*a)->fts_statp->st_mode)) {
if (!S_ISDIR((*b)->fts_statp->st_mode))

View File

@ -88,9 +88,7 @@ static KEY keylist[] = {
int keycompare(const void *, const void *);
u_int
parsekey(name, needvaluep)
char *name;
int *needvaluep;
parsekey(char *name, int *needvaluep)
{
KEY *k, tmp;
@ -106,15 +104,13 @@ parsekey(name, needvaluep)
}
int
keycompare(a, b)
const void *a, *b;
keycompare(const void *a, const void *b)
{
return (strcmp(((const KEY *)a)->name, ((const KEY *)b)->name));
}
char *
flags_to_string(fflags)
u_long fflags;
flags_to_string(u_long fflags)
{
char *string;

View File

@ -168,7 +168,7 @@ main(int argc, char *argv[])
}
static void
usage()
usage(void)
{
(void)fprintf(stderr,
"usage: mtree [-LPUcdeinqrux] [-f spec] [-K key] [-k key] [-p path] [-s seed]\n"

View File

@ -59,10 +59,10 @@ static void set(char *, NODE *);
static void unset(char *, NODE *);
NODE *
spec()
spec(void)
{
register NODE *centry, *last;
register char *p;
NODE *centry, *last;
char *p;
NODE ginfo, *root;
int c_cur, c_next;
char buf[2048];
@ -170,11 +170,9 @@ noparent: errx(1, "line %d: no parent node", lineno);
}
static void
set(t, ip)
char *t;
NODE *ip;
set(char *t, NODE *ip)
{
register int type;
int type;
char *kw, *val = NULL;
struct group *gr;
struct passwd *pw;
@ -312,11 +310,9 @@ set(t, ip)
}
static void
unset(t, ip)
char *t;
register NODE *ip;
unset(char *t, NODE *ip)
{
register char *p;
char *p;
while ((p = strtok(t, "\n\t ")))
ip->flags &= ~parsekey(p, NULL);

View File

@ -63,7 +63,7 @@ static void miss(NODE *, char *);
static int vwalk(void);
int
verify()
verify(void)
{
int rval;
@ -74,11 +74,11 @@ verify()
}
static int
vwalk()
vwalk(void)
{
register FTS *t;
register FTSENT *p;
register NODE *ep, *level;
FTS *t;
FTSENT *p;
NODE *ep, *level;
int specdepth, rval;
char *argv[2];
char dot[] = ".";
@ -159,12 +159,10 @@ extra:
}
static void
miss(p, tail)
register NODE *p;
register char *tail;
miss(NODE *p, char *tail)
{
register int create;
register char *tp;
int create;
char *tp;
const char *type;
for (; p; p = p->next) {