From: Paul Eggert Date: Fri, 30 Dec 2016 08:57:21 +0000 (-0800) Subject: dfa: shorten sbit, success X-Git-Tag: v1.0~6438 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=b724c4e6aa38373a61ef1c70ee9508c3f103955e;p=gnulib.git dfa: shorten sbit, success * lib/dfa.c (struct regex_syntax.sbit): (struct dfa.success): Use char, not int, for array elements, since they are all in the range 0..7. --- diff --git a/ChangeLog b/ChangeLog index db2817fd38..6dfa3c7e8a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2016-12-30 Paul Eggert + dfa: shorten sbit, success + * lib/dfa.c (struct regex_syntax.sbit): + (struct dfa.success): Use char, not int, for array elements, since + they are all in the range 0..7. + dfa: simplify multibyte_prop etc. This follows up on a change made when dfa.c was in grep, namely grep commit c797046c7c13c2647182b919a79a4c5b4ecf82b1 diff --git a/lib/dfa.c b/lib/dfa.c index c5c1d7f942..41be5a9433 100644 --- a/lib/dfa.c +++ b/lib/dfa.c @@ -353,7 +353,7 @@ struct regex_syntax unsigned char eolbyte; /* Cache of char-context values. */ - int sbit[NOTCHAR]; + char sbit[NOTCHAR]; /* If never_trail[B], the byte B cannot be a non-initial byte in a multibyte character. */ @@ -501,7 +501,7 @@ struct dfa on a state that potentially could do so. If trans[i] is non-null, fails[i] must be null. */ - int *success; /* Table of acceptance conditions used in + char *success; /* Table of acceptance conditions used in dfaexec and computed in build_state. */ state_num *newlines; /* Transitions on newlines. The entry for a newline in any transition table is always