summaryrefslogtreecommitdiff
path: root/usr.bin/yacc/closure.c
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2014-03-13 01:18:23 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2014-03-13 01:18:23 +0000
commit93ff803031ce4e8faa440f10206a7c772ebb919a (patch)
tree3df027802b7e94aa0d347d30adda1355364828f0 /usr.bin/yacc/closure.c
parente6fd37871e59a0a101e0133296ad38b5b4f2964f (diff)
collapse variable declarations
Diffstat (limited to 'usr.bin/yacc/closure.c')
-rw-r--r--usr.bin/yacc/closure.c50
1 files changed, 15 insertions, 35 deletions
diff --git a/usr.bin/yacc/closure.c b/usr.bin/yacc/closure.c
index 44205154f04..05858178348 100644
--- a/usr.bin/yacc/closure.c
+++ b/usr.bin/yacc/closure.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: closure.c,v 1.12 2014/03/08 00:44:14 tedu Exp $ */
+/* $OpenBSD: closure.c,v 1.13 2014/03/13 01:18:22 tedu Exp $ */
/* $NetBSD: closure.c,v 1.4 1996/03/19 03:21:29 jtc Exp $ */
/*
@@ -46,12 +46,9 @@ static unsigned *EFF;
void
set_EFF(void)
{
- unsigned *row;
- int symbol;
+ unsigned int *row;
+ int symbol, rowsize, i, rule;
short *sp;
- int rowsize;
- int i;
- int rule;
rowsize = WORDSIZE(nvars);
EFF = NEW2(nvars * rowsize, unsigned);
@@ -80,18 +77,11 @@ set_EFF(void)
void
set_first_derives(void)
{
- unsigned *rrow;
- unsigned *vrow;
- int j;
- unsigned k;
- unsigned cword = 0;
+ unsigned int *rrow, *vrow;
+ unsigned int k, cword = 0;
+ int i, j, rule, rulesetsize, varsetsize;
short *rp;
- int rule;
- int i;
- int rulesetsize;
- int varsetsize;
-
rulesetsize = WORDSIZE(nrules);
varsetsize = WORDSIZE(nvars);
first_derives = NEW2(nvars * rulesetsize, unsigned) - ntokens * rulesetsize;
@@ -131,18 +121,11 @@ set_first_derives(void)
void
closure(short *nucleus, int n)
{
- int ruleno;
- unsigned word;
- unsigned i;
- short *csp;
- unsigned *dsp;
- unsigned *rsp;
+ unsigned int i, word;
+ short *csp, *csend;
+ unsigned int *dsp, *rsp, *rsend;
int rulesetsize;
-
- short *csend;
- unsigned *rsend;
- int symbol;
- int itemno;
+ int ruleno, symbol, itemno;
rulesetsize = WORDSIZE(nrules);
rsend = ruleset + rulesetsize;
@@ -214,9 +197,8 @@ void
print_EFF(void)
{
int i, j;
- unsigned *rowp;
- unsigned word;
- unsigned k;
+ unsigned int *rowp;
+ unsigned int k, word;
printf("\n\nEpsilon Free Firsts\n");
@@ -241,11 +223,9 @@ print_EFF(void)
void
print_first_derives(void)
{
- int i;
- int j;
- unsigned *rp;
- unsigned cword = 0;
- unsigned k;
+ int i, j;
+ unsigned int *rp;
+ unsigned int k, cword = 0;
printf("\n\n\nFirst Derives\n");