diff options
author | 2015-02-08 06:09:50 +0000 | |
---|---|---|
committer | 2015-02-08 06:09:50 +0000 | |
commit | d29fd0a028ca5fa859a07b81d8a4bda5ea2b83fc (patch) | |
tree | 4033200321aab1aa8fefaf8d2a829f2e56692754 | |
parent | Convert wirless devices to if_input(), tested with iwn(4) and urtwn(4). (diff) | |
download | wireguard-openbsd-d29fd0a028ca5fa859a07b81d8a4bda5ea2b83fc.tar.xz wireguard-openbsd-d29fd0a028ca5fa859a07b81d8a4bda5ea2b83fc.zip |
delete tons more casts
-rw-r--r-- | bin/csh/dir.c | 8 | ||||
-rw-r--r-- | bin/csh/exp.c | 5 | ||||
-rw-r--r-- | bin/csh/func.c | 7 | ||||
-rw-r--r-- | bin/csh/lex.c | 13 | ||||
-rw-r--r-- | bin/csh/misc.c | 10 | ||||
-rw-r--r-- | bin/csh/parse.c | 18 | ||||
-rw-r--r-- | bin/csh/proc.c | 4 |
7 files changed, 30 insertions, 35 deletions
diff --git a/bin/csh/dir.c b/bin/csh/dir.c index bdf299c8bdc..fdee8eae971 100644 --- a/bin/csh/dir.c +++ b/bin/csh/dir.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dir.c,v 1.19 2015/02/08 05:51:37 tedu Exp $ */ +/* $OpenBSD: dir.c,v 1.20 2015/02/08 06:09:50 tedu Exp $ */ /* $NetBSD: dir.c,v 1.9 1995/03/21 09:02:42 cgd Exp $ */ /*- @@ -116,7 +116,7 @@ dinit(Char *hp) } } - dp = (struct directory *) xcalloc(1, sizeof(struct directory)); + dp = xcalloc(1, sizeof(struct directory)); dp->di_name = Strsave(cp); dp->di_count = 0; dhead.di_next = dhead.di_prev = dp; @@ -351,7 +351,7 @@ dochngd(Char **v, struct command *t) } else cp = dfollow(*v); - dp = (struct directory *) xcalloc(1, sizeof(struct directory)); + dp = xcalloc(1, sizeof(struct directory)); dp->di_name = cp; dp->di_count = 0; dp->di_next = dcwd->di_next; @@ -502,7 +502,7 @@ dopushd(Char **v, struct command *t) Char *ccp; ccp = dfollow(*v); - dp = (struct directory *) xcalloc(1, sizeof(struct directory)); + dp = xcalloc(1, sizeof(struct directory)); dp->di_name = ccp; dp->di_count = 0; dp->di_prev = dcwd; diff --git a/bin/csh/exp.c b/bin/csh/exp.c index 36e926db879..66fd55fd63d 100644 --- a/bin/csh/exp.c +++ b/bin/csh/exp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exp.c,v 1.11 2015/02/08 05:51:37 tedu Exp $ */ +/* $OpenBSD: exp.c,v 1.12 2015/02/08 06:09:50 tedu Exp $ */ /* $NetBSD: exp.c,v 1.6 1995/03/21 09:02:51 cgd Exp $ */ /*- @@ -585,8 +585,7 @@ evalav(Char **v) hp->prev = hp->next = hp; hp->word = STRNULL; while (*v) { - struct wordent *new = - (struct wordent *) xcalloc(1, sizeof *wdp); + struct wordent *new = xcalloc(1, sizeof *wdp); new->prev = wdp; new->next = hp; diff --git a/bin/csh/func.c b/bin/csh/func.c index 36cd8371a41..54fa044f253 100644 --- a/bin/csh/func.c +++ b/bin/csh/func.c @@ -1,4 +1,4 @@ -/* $OpenBSD: func.c,v 1.27 2015/02/08 05:47:28 tedu Exp $ */ +/* $OpenBSD: func.c,v 1.28 2015/02/08 06:09:50 tedu Exp $ */ /* $NetBSD: func.c,v 1.11 1996/02/09 02:28:29 christos Exp $ */ /*- @@ -399,7 +399,7 @@ doforeach(Char **v, struct command *t) v = globall(v); if (v == 0) stderror(ERR_NAME | ERR_NOMATCH); - nwp = (struct whyle *) xcalloc(1, sizeof *nwp); + nwp = xcalloc(1, sizeof *nwp); nwp->w_fe = nwp->w_fe0 = v; gargv = 0; btell(&nwp->w_start); @@ -436,8 +436,7 @@ dowhile(Char **v, struct command *t) if (*v) stderror(ERR_NAME | ERR_EXPRESSION); if (!again) { - struct whyle *nwp = - (struct whyle *) xcalloc(1, sizeof(*nwp)); + struct whyle *nwp = xcalloc(1, sizeof(*nwp)); nwp->w_start = lineloc; nwp->w_end.type = F_SEEK; diff --git a/bin/csh/lex.c b/bin/csh/lex.c index 34b5e26b59e..7376579055c 100644 --- a/bin/csh/lex.c +++ b/bin/csh/lex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lex.c,v 1.15 2015/02/08 05:47:28 tedu Exp $ */ +/* $OpenBSD: lex.c,v 1.16 2015/02/08 06:09:50 tedu Exp $ */ /* $NetBSD: lex.c,v 1.9 1995/09/27 00:38:46 jtc Exp $ */ /*- @@ -155,7 +155,7 @@ lex(struct wordent *hp) do { struct wordent *new; - new = (struct wordent *) xmalloc((size_t) sizeof(*wdp)); + new = xmalloc((size_t) sizeof(*wdp)); new->word = 0; new->prev = wdp; new->next = hp; @@ -192,7 +192,7 @@ copylex(struct wordent *hp, struct wordent *fp) do { struct wordent *new; - new = (struct wordent *) xmalloc((size_t) sizeof(*wdp)); + new = xmalloc((size_t) sizeof(*wdp)); new->prev = wdp; new->next = hp; wdp->next = new; @@ -843,8 +843,7 @@ dosub(int sc, struct wordent *en, bool global) wdp = hp; while (--i >= 0) { - struct wordent *new = - (struct wordent *) xcalloc(1, sizeof *wdp); + struct wordent *new = xcalloc(1, sizeof *wdp); new->word = 0; new->prev = wdp; @@ -1584,9 +1583,9 @@ settell(void) return; if (lseek(SHIN, (off_t) 0, SEEK_CUR) < 0 || errno == ESPIPE) return; - fbuf = (Char **) xcalloc(2, sizeof(Char **)); + fbuf = xcalloc(2, sizeof(Char **)); fblocks = 1; - fbuf[0] = (Char *) xcalloc(BUFSIZ, sizeof(Char)); + fbuf[0] = xcalloc(BUFSIZ, sizeof(Char)); fseekp = fbobp = feobp = lseek(SHIN, (off_t) 0, SEEK_CUR); cantell = 1; } diff --git a/bin/csh/misc.c b/bin/csh/misc.c index 86fbf4d1e25..6b55b7133ba 100644 --- a/bin/csh/misc.c +++ b/bin/csh/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.14 2015/02/08 05:51:37 tedu Exp $ */ +/* $OpenBSD: misc.c,v 1.15 2015/02/08 06:09:50 tedu Exp $ */ /* $NetBSD: misc.c,v 1.6 1995/03/21 09:03:09 cgd Exp $ */ /*- @@ -131,8 +131,7 @@ blkfree(Char **av0) Char ** saveblk(Char **v) { - Char **newv = - (Char **) xcalloc((size_t) (blklen(v) + 1), sizeof(Char **)); + Char **newv = xcalloc((size_t) (blklen(v) + 1), sizeof(Char **)); Char **onewv = newv; while (*v) @@ -186,8 +185,7 @@ strspl(char *cp, char *dp) Char ** blkspl(Char **up, Char **vp) { - Char **wp = - (Char **) xcalloc((size_t) (blklen(up) + blklen(vp) + 1), + Char **wp = xcalloc((size_t) (blklen(up) + blklen(vp) + 1), sizeof(Char **)); (void) blkcpy(wp, up); @@ -320,7 +318,7 @@ number(Char *cp) Char ** copyblk(Char **v) { - Char **nv = (Char **) xcalloc((size_t) (blklen(v) + 1), sizeof(Char **)); + Char **nv = xcalloc((size_t) (blklen(v) + 1), sizeof(Char **)); return (blkcpy(nv, v)); } diff --git a/bin/csh/parse.c b/bin/csh/parse.c index 754482e1f35..ec86c7c8d29 100644 --- a/bin/csh/parse.c +++ b/bin/csh/parse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.c,v 1.10 2015/02/08 05:47:28 tedu Exp $ */ +/* $OpenBSD: parse.c,v 1.11 2015/02/08 06:09:50 tedu Exp $ */ /* $NetBSD: parse.c,v 1.6 1995/03/21 09:03:10 cgd Exp $ */ /*- @@ -266,7 +266,7 @@ syn0(struct wordent *p1, struct wordent *p2, int flags) if (t1->t_dtyp == NODE_LIST || t1->t_dtyp == NODE_AND || t1->t_dtyp == NODE_OR) { - t = (struct command *) xcalloc(1, sizeof(*t)); + t = xcalloc(1, sizeof(*t)); t->t_dtyp = NODE_PAREN; t->t_dflg = F_AMPERSAND | F_NOINTERRUPT; t->t_dspr = t1; @@ -274,7 +274,7 @@ syn0(struct wordent *p1, struct wordent *p2, int flags) } else t1->t_dflg |= F_AMPERSAND | F_NOINTERRUPT; - t = (struct command *) xcalloc(1, sizeof(*t)); + t = xcalloc(1, sizeof(*t)); t->t_dtyp = NODE_LIST; t->t_dflg = 0; t->t_dcar = t1; @@ -315,7 +315,7 @@ syn1(struct wordent *p1, struct wordent *p2, int flags) case '\n': if (l != 0) break; - t = (struct command *) xcalloc(1, sizeof(*t)); + t = xcalloc(1, sizeof(*t)); t->t_dtyp = NODE_LIST; t->t_dcar = syn1a(p1, p, flags); t->t_dcdr = syntax(p->next, p2, flags); @@ -353,7 +353,7 @@ syn1a(struct wordent *p1, struct wordent *p2, int flags) if (p->word[1] != '|') continue; if (l == 0) { - t = (struct command *) xcalloc(1, sizeof(*t)); + t = xcalloc(1, sizeof(*t)); t->t_dtyp = NODE_OR; t->t_dcar = syn1b(p1, p, flags); t->t_dcdr = syn1a(p->next, p2, flags); @@ -390,7 +390,7 @@ syn1b(struct wordent *p1, struct wordent *p2, int flags) case '&': if (p->word[1] == '&' && l == 0) { - t = (struct command *) xcalloc(1, sizeof(*t)); + t = xcalloc(1, sizeof(*t)); t->t_dtyp = NODE_AND; t->t_dcar = syn2(p1, p, flags); t->t_dcdr = syn1b(p->next, p2, flags); @@ -430,7 +430,7 @@ syn2(struct wordent *p1, struct wordent *p2, int flags) case '|': if (l != 0) continue; - t = (struct command *) xcalloc(1, sizeof(*t)); + t = xcalloc(1, sizeof(*t)); f = flags | POUT; pn = p->next; if (pn != p2 && pn->word[0] == '&') { @@ -529,8 +529,8 @@ again: } if (n < 0) n = 0; - t = (struct command *) xcalloc(1, sizeof(*t)); - av = (Char **) xcalloc((size_t) (n + 1), sizeof(Char **)); + t = xcalloc(1, sizeof(*t)); + av = xcalloc((size_t) (n + 1), sizeof(Char **)); t->t_dcom = av; n = 0; if (p2->word[0] == ')') diff --git a/bin/csh/proc.c b/bin/csh/proc.c index 0be398c2e9c..b77197e1943 100644 --- a/bin/csh/proc.c +++ b/bin/csh/proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.c,v 1.25 2015/02/08 05:51:37 tedu Exp $ */ +/* $OpenBSD: proc.c,v 1.26 2015/02/08 06:09:50 tedu Exp $ */ /* $NetBSD: proc.c,v 1.9 1995/04/29 23:21:33 mycroft Exp $ */ /*- @@ -444,7 +444,7 @@ palloc(int pid, struct command *t) struct process *pp; int i; - pp = (struct process *) xcalloc(1, (size_t) sizeof(struct process)); + pp = xcalloc(1, (size_t) sizeof(struct process)); pp->p_pid = pid; pp->p_flags = t->t_dflg & F_AMPERSAND ? PRUNNING : PRUNNING | PFOREGND; if (t->t_dflg & F_TIME) |