From: Olly B. <ol...@us...> - 2006-09-23 22:36:27
|
Update of /cvsroot/swig/SWIG/Source/Swig In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv13684/Source/Swig Modified Files: misc.c naming.c typemap.c typesys.c wrapfunc.c Log Message: Use Strchr/strchr instead of Strstr/strstr when searching for a single character. Index: typemap.c =================================================================== RCS file: /cvsroot/swig/SWIG/Source/Swig/typemap.c,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** typemap.c 6 Mar 2006 22:51:00 -0000 1.70 --- typemap.c 23 Sep 2006 22:36:23 -0000 1.71 *************** *** 1665,1669 **** args = NewList(); ! c = strstr(Char(s),"("); c++; --- 1665,1669 ---- args = NewList(); ! c = strchr(Char(s),'('); c++; *************** *** 1704,1708 **** char *c; ! eq = strstr(Char(s),"="); if (!eq) { *name = 0; --- 1704,1708 ---- char *c; ! eq = strchr(Char(s),'='); if (!eq) { *name = 0; Index: misc.c =================================================================== RCS file: /cvsroot/swig/SWIG/Source/Swig/misc.c,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** misc.c 12 Apr 2006 19:34:01 -0000 1.59 --- misc.c 23 Sep 2006 22:36:23 -0000 1.60 *************** *** 893,897 **** char *spos = 0; res = NewStringWithSize(cb, ce - cb); ! spos = Strstr(res,"@"); while (spos) { char cd = *(++spos); --- 893,897 ---- char *spos = 0; res = NewStringWithSize(cb, ce - cb); ! spos = Strchr(res,'@'); while (spos) { char cd = *(++spos); *************** *** 909,915 **** Replaceall(res,arg,""); } ! spos = Strstr(res,"@"); } else if (cd == '@') { ! spos = strstr(spos + 1,"@"); } } --- 909,915 ---- Replaceall(res,arg,""); } ! spos = Strchr(res,'@'); } else if (cd == '@') { ! spos = strchr(spos + 1,'@'); } } Index: naming.c =================================================================== RCS file: /cvsroot/swig/SWIG/Source/Swig/naming.c,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** naming.c 6 Mar 2006 22:51:00 -0000 1.50 --- naming.c 23 Sep 2006 22:36:23 -0000 1.51 *************** *** 998,1005 **** static List *Swig_make_attrlist(const char *ckey) { List *list = NewList(); ! const char *cattr = strstr(ckey,"$"); if (cattr) { String *nattr; ! const char *rattr = strstr(++cattr,"$"); while (rattr) { nattr = NewStringWithSize(cattr, rattr-cattr); --- 998,1005 ---- static List *Swig_make_attrlist(const char *ckey) { List *list = NewList(); ! const char *cattr = strchr(ckey,'$'); if (cattr) { String *nattr; ! const char *rattr = strchr(++cattr,'$'); while (rattr) { nattr = NewStringWithSize(cattr, rattr-cattr); *************** *** 1007,1011 **** Delete(nattr); cattr = rattr + 1; ! rattr = strstr(cattr,"$"); } nattr = NewString(cattr); --- 1007,1011 ---- Delete(nattr); cattr = rattr + 1; ! rattr = strchr(cattr,'$'); } nattr = NewString(cattr); *************** *** 1159,1163 **** char *cvalue = Char(value); char *cmvalue = Char(mvalue); ! char *sep = strstr(cmvalue,"|"); while (sep && !match) { match = strncmp(cvalue,cmvalue, sep - cmvalue) == 0; --- 1159,1163 ---- char *cvalue = Char(value); char *cmvalue = Char(mvalue); ! char *sep = strchr(cmvalue,'|'); while (sep && !match) { match = strncmp(cvalue,cmvalue, sep - cmvalue) == 0; *************** *** 1166,1170 **** #endif cmvalue = sep + 1; ! sep = strstr(cmvalue,"|"); } if (!match) { --- 1166,1170 ---- #endif cmvalue = sep + 1; ! sep = strchr(cmvalue,'|'); } if (!match) { *************** *** 1415,1419 **** String *fmt = newname; /* use name as a fmt, but avoid C++ "%" and "%=" operators */ ! if (Len(newname) > 1 && strstr(cnewname,"%") && !(strcmp(cnewname,"%=") == 0)) { if (fullname && prefix) { result = NewStringf(fmt,prefix,name); --- 1415,1419 ---- String *fmt = newname; /* use name as a fmt, but avoid C++ "%" and "%=" operators */ ! if (Len(newname) > 1 && strchr(cnewname,'%') && !(strcmp(cnewname,"%=") == 0)) { if (fullname && prefix) { result = NewStringf(fmt,prefix,name); Index: wrapfunc.c =================================================================== RCS file: /cvsroot/swig/SWIG/Source/Swig/wrapfunc.c,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** wrapfunc.c 6 Mar 2006 22:51:01 -0000 1.32 --- wrapfunc.c 23 Sep 2006 22:36:23 -0000 1.33 *************** *** 105,109 **** Putc(c,ts); if ((c = Getc(str)) == '\n') { ! if (!empty && !strstr(Char(ts),"?")) label = 1; } Ungetc(c,str); --- 105,109 ---- Putc(c,ts); if ((c = Getc(str)) == '\n') { ! if (!empty && !strchr(Char(ts),'?')) label = 1; } Ungetc(c,str); Index: typesys.c =================================================================== RCS file: /cvsroot/swig/SWIG/Source/Swig/typesys.c,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** typesys.c 20 Sep 2006 11:52:56 -0000 1.61 --- typesys.c 23 Sep 2006 22:36:23 -0000 1.62 *************** *** 1438,1442 **** if (t) { char *ct = Char(t); ! if (strstr(ct,"<") && !(strstr(ct,"<("))) { Printf(stdout,"Bad template type passed to SwigType_remember: %s\n", t); assert(0); --- 1438,1442 ---- if (t) { char *ct = Char(t); ! if (strchr(ct,'<') && !(strstr(ct,"<("))) { Printf(stdout,"Bad template type passed to SwigType_remember: %s\n", t); assert(0); |