avoid compiler warning in regex matcher

Corinna Vinschen vinschen@redhat.com
Wed Feb 29 07:57:00 GMT 2012


On Feb 28 06:05, Eric Blake wrote:
> On 02/28/2012 05:12 AM, Schwarz, Konrad wrote:
> >> @@ -198,7 +198,7 @@ int eflags;
> >>
> >>  				/* Jump to next possible match */
> >>  				mj = matchjump[pp - mustfirst];
> >> -				cj = charjump[*dp];
> >> +				cj = charjump[(unsigned char)*dp];
> >>  				dp += (cj < mj ? mj : cj);
> >>  				pp = mustlast;
> >>  			}
> > 
> > Wouldn't it be less source and object code to define dp as
> > an unsigned char *?
> 
> Perhaps; I'll work up that counter-proposal patch, and we can see which
> one looks better before I push anything (my fear is that changing the
> type of dp may have ripple effects on how many lines of code need touching).

Yeah, that doesn't look good.  It's a lot of char * shuffeling so you
probably have to convert all local vars to unsigned char * and then
still have to cast in a couple of places...


Corinna

-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat



More information about the Newlib mailing list