From 13f5fd77bbc528862f295f9e7196f3ff709d185a Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sun, 21 Jun 2026 21:42:12 +0200 Subject: Unicode builds now expect UTF-8 strings * They are built with `-DREGEX_UTF8` instead of `-DREGEX_WCHAR`. Functions are called reg_ucomp() and reg_uexec() instead for consistency. The library is now called libhsurex.so instead of libhswrex.so. * The `chr` type is now always `unsigned char`. As a result many other uses of the `chr` type had to be changed to pchr (which is always large enough to hold a byte or wide character). Generally we try to keep code changes as small as possible since we may have to backport changes from the Tcl codebase or contribute patches to the Tcl project. --- regc_cvec.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'regc_cvec.c') diff --git a/regc_cvec.c b/regc_cvec.c index 0247521..b9fba9d 100644 --- a/regc_cvec.c +++ b/regc_cvec.c @@ -44,14 +44,14 @@ newcvec( int nranges) /* ... and this many ranges... */ { size_t nc = (size_t)nchrs + (size_t)nranges*2; - size_t n = sizeof(struct cvec) + nc*sizeof(chr); + size_t n = sizeof(struct cvec) + nc*sizeof(pchr); struct cvec *cv = (struct cvec *) MALLOC(n); if (cv == NULL) { return NULL; } cv->chrspace = nchrs; - cv->chrs = (chr *)(((char *)cv)+sizeof(struct cvec)); + cv->chrs = (pchr *)(((char *)cv)+sizeof(struct cvec)); cv->ranges = cv->chrs + nchrs; cv->rangespace = nranges; return clearcvec(cv); @@ -81,7 +81,7 @@ addchr( struct cvec *cv, /* character vector */ pchr c) /* character to add */ { - cv->chrs[cv->nchrs++] = (chr)c; + cv->chrs[cv->nchrs++] = c; } /* @@ -95,8 +95,8 @@ addrange( pchr to) /* last character of range */ { assert(cv->nranges < cv->rangespace); - cv->ranges[cv->nranges*2] = (chr)from; - cv->ranges[cv->nranges*2 + 1] = (chr)to; + cv->ranges[cv->nranges*2] = from; + cv->ranges[cv->nranges*2 + 1] = to; cv->nranges++; } -- cgit v1.2.3