This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [PATCH] Speed-up character range regexes by up to 2x
- From: Aharon Robbins <arnold at skeeve dot com>
- To: bonzini at gnu dot org
- Cc: libc-alpha at sources dot redhat dot com
- Date: Mon, 12 Jan 2004 15:54:22 +0200
- Subject: 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