diff options
author | Michael McConville <mmcconville@mykolab.com> | 2015-12-09 16:22:11 -0500 |
---|---|---|
committer | Will Estes <westes575@gmail.com> | 2015-12-09 17:44:33 -0500 |
commit | 8205442c7c850f59799a76def5df2f46c76ff307 (patch) | |
tree | 002b7543af823591d437d60053de88b11d86b0d5 /to.do | |
parent | 3d08a0129229e99e1bcaa33d024e9cb0c27d903c (diff) |
Replace zero_out() with stdlib's memset.
Diffstat (limited to 'to.do')
-rw-r--r-- | to.do/unicode/flexdef.h | 3 | ||||
-rw-r--r-- | to.do/unicode/misc.c | 19 | ||||
-rw-r--r-- | to.do/unicode/tblcmp.c | 5 |
3 files changed, 2 insertions, 25 deletions
diff --git a/to.do/unicode/flexdef.h b/to.do/unicode/flexdef.h index 74db308..8e44c26 100644 --- a/to.do/unicode/flexdef.h +++ b/to.do/unicode/flexdef.h @@ -913,9 +913,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 */ diff --git a/to.do/unicode/misc.c b/to.do/unicode/misc.c index 340707e..f107415 100644 --- a/to.do/unicode/misc.c +++ b/to.do/unicode/misc.c @@ -824,22 +824,3 @@ int size; return result; } - - -/* 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; - { - register char *rp, *rp_end; - - rp = region_ptr; - rp_end = region_ptr + size_in_bytes; - - while ( rp < rp_end ) - *rp++ = 0; - } diff --git a/to.do/unicode/tblcmp.c b/to.do/unicode/tblcmp.c index c21d9be..f2d4366 100644 --- a/to.do/unicode/tblcmp.c +++ b/to.do/unicode/tblcmp.c @@ -309,8 +309,7 @@ void 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)); } @@ -436,7 +435,7 @@ void inittbl() { register 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; |