Tcl Source Code

Check-in [c38fd94d09]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Make "struct regmatch_t" match "Tcl_RegExpIndices" (again). Win64 build was broken because of this. Other platforms were OK.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: c38fd94d09e87668cf9919f5d8ab72582a090928b1cfb5d8507f5208f99ab968
User & Date: jan.nijtmans 2019-03-13 20:43:05
Context
2019-03-13
20:44
Eliminate many (mostly harmless) MSVC warning messages. Tcl 9 compiles warning-free now on MSVC. check-in: cf865c6e2b user: jan.nijtmans tags: trunk
20:43
Make "struct regmatch_t" match "Tcl_RegExpIndices" (again). Win64 build was broken because of this. ... check-in: c38fd94d09 user: jan.nijtmans tags: trunk
2019-03-11
20:56
Merge 8.7 check-in: 13fd8a4647 user: jan.nijtmans tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to generic/regex.h.

   138    138       /* the rest is opaque pointers to hidden innards */
   139    139       char *re_guts;		/* `char *' is more portable than `void *' */
   140    140       char *re_fns;
   141    141   } regex_t;
   142    142   
   143    143   /* result reporting (may acquire more fields later) */
   144    144   typedef struct {
   145         -    size_t rm_so;		/* start of substring */
   146         -    size_t rm_eo;		/* end of substring */
          145  +    long rm_so;		/* start of substring */
          146  +    long rm_eo;		/* end of substring */
   147    147   } regmatch_t;
   148    148   
   149    149   /* supplementary control and reporting */
   150    150   typedef struct {
   151    151       regmatch_t rm_extend;	/* see REG_EXPECT */
   152    152   } rm_detail_t;
   153    153   

Changes to generic/regexec.c.

   885    885       assert(t->op == 'b');
   886    886       assert(n >= 0);
   887    887       assert((size_t)n < v->nmatch);
   888    888   
   889    889       MDEBUG(("cbackref n%d %d{%d-%d}\n", t->id, n, min, max));
   890    890   
   891    891       /* get the backreferenced string */
   892         -    if (v->pmatch[n].rm_so == (size_t)-1) {
          892  +    if (v->pmatch[n].rm_so == -1) {
   893    893   	return REG_NOMATCH;
   894    894       }
   895    895       brstring = v->start + v->pmatch[n].rm_so;
   896    896       brlen = v->pmatch[n].rm_eo - v->pmatch[n].rm_so;
   897    897   
   898    898       /* special cases for zero-length strings */
   899    899       if (brlen == 0) {

Changes to generic/tclRegexp.c.

   260    260   				 * in (sub-)range here. */
   261    261   {
   262    262       TclRegexp *regexpPtr = (TclRegexp *) re;
   263    263       const char *string;
   264    264   
   265    265       if (index > regexpPtr->re.re_nsub) {
   266    266   	*startPtr = *endPtr = NULL;
   267         -    } else if (regexpPtr->matches[index].rm_so == (size_t)-1) {
          267  +    } else if (regexpPtr->matches[index].rm_so == -1) {
   268    268   	*startPtr = *endPtr = NULL;
   269    269       } else {
   270    270   	if (regexpPtr->objPtr) {
   271    271   	    string = TclGetString(regexpPtr->objPtr);
   272    272   	} else {
   273    273   	    string = regexpPtr->string;
   274    274   	}