diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2014-01-08 22:30:33 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2014-01-08 22:30:33 +0000 |
commit | 0952790e2da3a472d1c83e1d025b7c8a47edb403 (patch) | |
tree | 2058afe94fb94ba9be965c8b17f1c75480c97580 /usr.bin/yacc/lr0.c | |
parent | 9b833aa007e8fe8cf8bedb7aa2a35a80d77e6571 (diff) |
Make allocate() take size_t and return void *. This lets us drop
some more useless casts. Also add missing arguments to a couple
of prototypes while here. OK matthew@ pelikan@
Diffstat (limited to 'usr.bin/yacc/lr0.c')
-rw-r--r-- | usr.bin/yacc/lr0.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/usr.bin/yacc/lr0.c b/usr.bin/yacc/lr0.c index a7632093898..10e4b2146c4 100644 --- a/usr.bin/yacc/lr0.c +++ b/usr.bin/yacc/lr0.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lr0.c,v 1.13 2014/01/08 21:40:25 millert Exp $ */ +/* $OpenBSD: lr0.c,v 1.14 2014/01/08 22:30:32 millert Exp $ */ /* $NetBSD: lr0.c,v 1.4 1996/03/19 03:21:35 jtc Exp $ */ /* @@ -343,7 +343,7 @@ new_state(int symbol) iend = kernel_end[symbol]; n = iend - isp1; - p = (core *) allocate((unsigned) (sizeof(core) + (n - 1) * sizeof(short))); + p = allocate(sizeof(core) + (n - 1) * sizeof(short)); p->accessing_symbol = symbol; p->number = nstates; p->nitems = n; @@ -369,8 +369,7 @@ save_shifts(void) short *sp2; short *send; - p = (shifts *) allocate((unsigned) (sizeof(shifts) + - (nshifts - 1) * sizeof(short))); + p = allocate(sizeof(shifts) + (nshifts - 1) * sizeof(short)); p->number = this_state->number; p->nshifts = nshifts; @@ -418,8 +417,7 @@ save_reductions(void) if (count) { - p = (reductions *) allocate((unsigned) (sizeof(reductions) + - (count - 1) * sizeof(short))); + p = allocate(sizeof(reductions) + (count - 1) * sizeof(short)); p->number = this_state->number; p->nreds = count; |