mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-14 10:09:48 +00:00
ISO C does not allow unnamed union members.
This commit is contained in:
parent
77a9f6dd96
commit
c508bf7a54
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=144818
@ -502,25 +502,25 @@ ifconfig(int argc, char *const *argv, const struct afswtch *afp)
|
||||
*/
|
||||
p = (setaddr ? &setifdstaddr_cmd : &setifaddr_cmd);
|
||||
}
|
||||
if (p->c_func || p->c_func2) {
|
||||
if (p->c_u.c_func || p->c_u.c_func2) {
|
||||
if (p->c_parameter == NEXTARG) {
|
||||
if (argv[1] == NULL)
|
||||
errx(1, "'%s' requires argument",
|
||||
p->c_name);
|
||||
p->c_func(argv[1], 0, s, afp);
|
||||
p->c_u.c_func(argv[1], 0, s, afp);
|
||||
argc--, argv++;
|
||||
} else if (p->c_parameter == OPTARG) {
|
||||
p->c_func(argv[1], 0, s, afp);
|
||||
p->c_u.c_func(argv[1], 0, s, afp);
|
||||
if (argv[1] != NULL)
|
||||
argc--, argv++;
|
||||
} else if (p->c_parameter == NEXTARG2) {
|
||||
if (argc < 3)
|
||||
errx(1, "'%s' requires 2 arguments",
|
||||
p->c_name);
|
||||
p->c_func2(argv[1], argv[2], s, afp);
|
||||
p->c_u.c_func2(argv[1], argv[2], s, afp);
|
||||
argc -= 2, argv += 2;
|
||||
} else
|
||||
p->c_func(*argv, p->c_parameter, s, afp);
|
||||
p->c_u.c_func(*argv, p->c_parameter, s, afp);
|
||||
}
|
||||
argc--, argv++;
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ struct cmd {
|
||||
union {
|
||||
c_func *c_func;
|
||||
c_func2 *c_func2;
|
||||
};
|
||||
} c_u;
|
||||
struct cmd *c_next;
|
||||
};
|
||||
void cmd_register(struct cmd *);
|
||||
|
Loading…
Reference in New Issue
Block a user