summaryrefslogtreecommitdiff
path: root/usr.bin/lex
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2015-11-19 23:04:52 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2015-11-19 23:04:52 +0000
commitf6bbde5af99b6ea1b326e9f1c8951f69a7e23d1f (patch)
treeaa98b31424d868612c7f5e58353129fab3803b49 /usr.bin/lex
parent0daedde609e7dd5ad9c2a4a92992d554be6653cc (diff)
it should be safe to assume the presence of memset these days instead of
implementing a local version.
Diffstat (limited to 'usr.bin/lex')
-rw-r--r--usr.bin/lex/flexdef.h6
-rw-r--r--usr.bin/lex/misc.c21
-rw-r--r--usr.bin/lex/tblcmp.c9
3 files changed, 5 insertions, 31 deletions
diff --git a/usr.bin/lex/flexdef.h b/usr.bin/lex/flexdef.h
index 650f2526197..9a946437f37 100644
--- a/usr.bin/lex/flexdef.h
+++ b/usr.bin/lex/flexdef.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: flexdef.h,v 1.10 2015/11/19 22:58:59 tedu Exp $ */
+/* $OpenBSD: flexdef.h,v 1.11 2015/11/19 23:04:51 tedu Exp $ */
/* flexdef - definitions file for flex */
@@ -952,10 +952,6 @@ extern void transition_struct_out PROTO ((int, int));
/* Only needed when using certain broken versions of bison to build parse.c. */
extern void *yy_flex_xmalloc PROTO ((int));
-/* Set a region of memory to 0. */
-extern void zero_out PROTO ((char *, size_t));
-
-
/* from file nfa.c */
/* Add an accepting state to a machine. */
diff --git a/usr.bin/lex/misc.c b/usr.bin/lex/misc.c
index 539be6d3277..beb46d69148 100644
--- a/usr.bin/lex/misc.c
+++ b/usr.bin/lex/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.16 2015/11/19 22:52:40 tedu Exp $ */
+/* $OpenBSD: misc.c,v 1.17 2015/11/19 23:04:51 tedu Exp $ */
/* misc - miscellaneous flex routines */
@@ -1009,25 +1009,6 @@ yy_flex_xmalloc(size)
}
-/* zero_out - set a region of memory to 0
- *
- * Sets region_ptr[0] through region_ptr[size_in_bytes - 1] to zero.
- */
-
-void
-zero_out(region_ptr, size_in_bytes)
- char *region_ptr;
- size_t size_in_bytes;
-{
- char *rp, *rp_end;
-
- rp = region_ptr;
- rp_end = region_ptr + size_in_bytes;
-
- while (rp < rp_end)
- *rp++ = 0;
-}
-
/* Remove all '\n' and '\r' characters, if any, from the end of str.
* str can be any null-terminated string, or NULL.
* returns str. */
diff --git a/usr.bin/lex/tblcmp.c b/usr.bin/lex/tblcmp.c
index 36ad171707f..e03dc853549 100644
--- a/usr.bin/lex/tblcmp.c
+++ b/usr.bin/lex/tblcmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tblcmp.c,v 1.8 2015/11/19 22:55:13 tedu Exp $ */
+/* $OpenBSD: tblcmp.c,v 1.9 2015/11/19 23:04:51 tedu Exp $ */
/* tblcmp - table compression routines */
@@ -310,8 +310,7 @@ expand_nxt_chk()
nxt = reallocate_integer_array(nxt, current_max_xpairs);
chk = reallocate_integer_array(chk, current_max_xpairs);
- zero_out((char *) (chk + old_max),
- (size_t) (MAX_XPAIRS_INCREMENT * sizeof(int)));
+ memset((chk + old_max), 0, MAX_XPAIRS_INCREMENT * sizeof(int));
}
@@ -440,9 +439,7 @@ inittbl()
{
int i;
- zero_out((char *) chk,
-
- (size_t) (current_max_xpairs * sizeof(int)));
+ memset(chk, 0, current_max_xpairs * sizeof(int));
tblend = 0;
firstfree = tblend + 1;