This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Speed-up character range regexes by up to 2x


> >>What follows the review of the "gawk guy"'s regex patch:
> >>
> >> > +#ifdef RE_ENABLE_I18N
> >> >    int icase = (dfa->mb_cur_max == 1 && (bufp->syntax & RE_ICASE));
> >> > +#else
> >> > +  int icase = (bufp->syntax & RE_ICASE);
> >> > +#endif
> >>
> >>This is unneeded.
> >>    
> >>
> I mean that you probably added these fixes when MB_CUR_MAX was used 
> because somebody got link errors for MB_CUR_MAX undefined; but now, 
> dfa->mb_cur_max cannot possibly be undefined and will always be 1 if 
> !RE_ENABLE_I18N.

You're missing my point.  Look again at the code.  If RE_ENABLE_I18N
isn't defined, there's no declaration at all for `icase'.  But `icase'
is used in plain code, outside of any #ifdef for RE_ENABLE_I18N.  It may
be that the correct patch is simply to use:

	int icase = (dfa->mb_cur_max == 1 && (bufp->syntax & RE_ICASE));

with no surrounding #ifdef.  If so, fine.

Thanks,

Arnold


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]