From: William F. D. <wil...@th...> - 2006-08-28 14:38:45
|
Making text be const char * is a definite improvement. Thanks. Would it work to avoid the cast by doing this in the body: const char *s = (c ? strchr(text,c) : text-1), *e = strrchr(text,c); Will On Sun, 2006-08-27 at 20:46 +0000, Martin Quinson wrote: > Update of /cvsroot/flexml/flexml > In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv5268 > > Modified Files: > skel > Log Message: > Circumvent constentness warnings in produced flexers (I use -Werror) > > Index: skel > =================================================================== > RCS file: /cvsroot/flexml/flexml/skel,v > retrieving revision 1.35 > retrieving revision 1.36 > diff -u -d -r1.35 -r1.36 > --- skel 24 Aug 2006 20:39:39 -0000 1.35 > +++ skel 27 Aug 2006 20:46:36 -0000 1.36 > @@ -123,9 +123,9 @@ > } > > #ifdef FLEXML_NEED_BUFFERLIT > -static void bufferliteral(char c, int* pp, char* text) > +static void bufferliteral(char c, int* pp, const char* text) > { > - char *s = (c ? strchr(text,c) : text-1), *e = strrchr(text,c); > + char *s = (c ? strchr(text,c) : (char*)text-1), *e = strrchr(text,c); > assert(s <= e); BUFFERSET(*pp); > while (++s<e) { > if (isspace(*s) && c) { BUFFERPUTC(' '); while (isspace(*s)) ++s; } > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Flexml-commits mailing list > Fle...@li... > https://lists.sourceforge.net/lists/listinfo/flexml-commits -- William F Dowling wil...@th... www.scientific.thomson.com |