summaryrefslogtreecommitdiff
path: root/usr.bin/yacc
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2011-04-01 21:21:40 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2011-04-01 21:21:40 +0000
commit21c90d555a27321fca29f9b7466d57b5585b54b5 (patch)
tree94912e435ee3ffed3d115ca72223b124068194e2 /usr.bin/yacc
parent13d9c1d52488002d7a24c749e8614d67658510c9 (diff)
Add calls to some existing but previously unused free functions. Also
replace a loop with a memset. From Michael W Bombardieri. ok millert
Diffstat (limited to 'usr.bin/yacc')
-rw-r--r--usr.bin/yacc/defs.h4
-rw-r--r--usr.bin/yacc/lalr.c4
-rw-r--r--usr.bin/yacc/lr0.c7
3 files changed, 8 insertions, 7 deletions
diff --git a/usr.bin/yacc/defs.h b/usr.bin/yacc/defs.h
index 9708a43c065..32fe6082c15 100644
--- a/usr.bin/yacc/defs.h
+++ b/usr.bin/yacc/defs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: defs.h,v 1.11 2005/06/08 03:18:59 pvalchev Exp $ */
+/* $OpenBSD: defs.h,v 1.12 2011/04/01 21:21:39 nicm Exp $ */
/* $NetBSD: defs.h,v 1.6 1996/03/19 03:21:30 jtc Exp $ */
/*
@@ -358,6 +358,8 @@ extern void lalr(void);
extern void reader(void);
extern void lr0(void);
+extern void free_nullable(void);
+extern void free_derives(void);
extern void make_parser(void);
extern void verbose(void);
extern void output(void);
diff --git a/usr.bin/yacc/lalr.c b/usr.bin/yacc/lalr.c
index 4e9a391c392..1be57b60b37 100644
--- a/usr.bin/yacc/lalr.c
+++ b/usr.bin/yacc/lalr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lalr.c,v 1.9 2009/10/27 23:59:50 deraadt Exp $ */
+/* $OpenBSD: lalr.c,v 1.10 2011/04/01 21:21:39 nicm Exp $ */
/* $NetBSD: lalr.c,v 1.4 1996/03/19 03:21:33 jtc Exp $ */
/*
@@ -99,6 +99,8 @@ lalr(void)
build_relations();
compute_FOLLOWS();
compute_lookaheads();
+ free_derives();
+ free_nullable();
}
diff --git a/usr.bin/yacc/lr0.c b/usr.bin/yacc/lr0.c
index 7333a5d15e9..7cbb221a956 100644
--- a/usr.bin/yacc/lr0.c
+++ b/usr.bin/yacc/lr0.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lr0.c,v 1.9 2009/10/27 23:59:50 deraadt Exp $ */
+/* $OpenBSD: lr0.c,v 1.10 2011/04/01 21:21:39 nicm Exp $ */
/* $NetBSD: lr0.c,v 1.4 1996/03/19 03:21:35 jtc Exp $ */
/*
@@ -63,8 +63,6 @@ void save_reductions(void);
void set_derives(void);
void print_derives(void);
void set_nullable(void);
-void free_derives(void);
-void free_nullable(void);
static core **state_set;
static core *this_state;
@@ -602,8 +600,7 @@ set_nullable(void)
nullable = MALLOC(nsyms);
if (nullable == 0) no_space();
- for (i = 0; i < nsyms; ++i)
- nullable[i] = 0;
+ memset(nullable, 0, nsyms);
done = 0;
while (!done)