bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/3] dfa: simplify dfainit


From: Paolo Bonzini
Subject: [PATCH 1/3] dfa: simplify dfainit
Date: Sat, 17 Apr 2010 03:34:52 +0200

* src/dfa.c (dfainit): Use memset.
---
 src/dfa.c |   17 ++---------------
 1 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/src/dfa.c b/src/dfa.c
index f3f8c60..fefd650 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -3276,13 +3276,13 @@ free_mbdata (struct dfa *d)
 void
 dfainit (struct dfa *d)
 {
+  memset (d, 0, sizeof *d);
+
   d->calloc = 1;
   MALLOC(d->charclasses, charclass, d->calloc);
-  d->cindex = 0;
 
   d->talloc = 1;
   MALLOC(d->tokens, token, d->talloc);
-  d->tindex = d->depth = d->nleaves = d->nregexps = 0;
 
 #if MBS_SUPPORT
   d->mb_cur_max = MB_CUR_MAX;
@@ -3290,23 +3290,10 @@ dfainit (struct dfa *d)
     {
       d->nmultibyte_prop = 1;
       MALLOC(d->multibyte_prop, int, d->nmultibyte_prop);
-      d->nmbcsets = 0;
       d->mbcsets_alloc = 1;
       MALLOC(d->mbcsets, struct mb_char_classes, d->mbcsets_alloc);
     }
 #endif
-
-  d->searchflag = 0;
-  d->tralloc = 0;
-
-  d->musts = 0;
-  d->realtrans = 0;
-  d->fails = 0;
-  d->newlines = 0;
-  d->success = 0;
-#ifdef GAWK
-  d->broken = 0;
-#endif
 }
 
 #if MBS_SUPPORT
-- 
1.6.6.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]