]> Savannah Git Hosting - gnulib.git/commit
dfa: fix glitches with on-demand states
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 25 Nov 2016 18:43:38 +0000 (10:43 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 25 Nov 2016 19:00:08 +0000 (11:00 -0800)
commit42fe9d2b277fe524f87c1773a99b674c68109208
tree344bdc252cc130068c1920803150f9e8e10e9f27
parent403adf1b40897ba108075008c10bd38d937e1539
dfa: fix glitches with on-demand states

Also, adjust commentary to better match new code.
Some of these glitches predate the recent change.
* lib/dfa.c (dfaanalyze): Clear trcount here, so that it counts
only non-initial states.
(dfastate): Rename locals to better match new roles.
Move them into nested scopes if this is easy.
Omit unnecessary cdalls to zeroset.
Simplify test for whether to throw in the positions of state 0.
Omit C99-ism (decl after statement) since Gawk still wants C89.
(build_state): Omit unnecessary test and assignment.
Fix some confusion that counted transition tables inaccurately
and could cause a memory leak.
(dfaexec_main): Redo to make it clearer to the compiler that
-1 and -2 are the only negative state numbers here.
ChangeLog
lib/dfa.c