aboutsummaryrefslogtreecommitdiff
path: root/regc_color.c
diff options
context:
space:
mode:
authorRobin Haberkorn <rhaberkorn@fmsbw.de>2026-06-21 21:42:12 +0200
committerRobin Haberkorn <rhaberkorn@fmsbw.de>2026-06-21 22:05:37 +0200
commit13f5fd77bbc528862f295f9e7196f3ff709d185a (patch)
tree9f9ce051bc8adf61e5ae2b4e94ccb1331bfdbfa5 /regc_color.c
parent10b47c9226b6267e5a4be4e79fe79314bf969025 (diff)
downloadterex-13f5fd77bbc528862f295f9e7196f3ff709d185a.tar.gz
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.
Diffstat (limited to 'regc_color.c')
-rw-r--r--regc_color.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/regc_color.c b/regc_color.c
index 7a98dcb..c1d4b21 100644
--- a/regc_color.c
+++ b/regc_color.c
@@ -157,7 +157,7 @@ setcolor(
pchr c,
pcolor co)
{
- uchr uc = c;
+ pchr uc = c;
int shift;
int level;
int b;
@@ -433,7 +433,7 @@ subrange(
struct state *lp,
struct state *rp)
{
- uchr uf;
+ pchr uf;
int i;
assert(from <= to);
@@ -442,8 +442,8 @@ subrange(
* First, align "from" on a tree-block boundary
*/
- uf = (uchr) from;
- i = (int) (((uf + BYTTAB - 1) & (uchr) ~BYTMASK) - uf);
+ uf = from;
+ i = (int) (((uf + BYTTAB - 1) & (pchr) ~BYTMASK) - uf);
for (; from<=to && i>0; i--, from++) {
newarc(v->nfa, PLAIN, subcolor(v->cm, from), lp, rp);
}
@@ -479,7 +479,7 @@ subblock(
struct state *lp,
struct state *rp)
{
- uchr uc = start;
+ pchr uc = start;
struct colormap *cm = v->cm;
int shift;
int level;
@@ -751,7 +751,7 @@ dumpcolors(
struct colordesc *cd;
struct colordesc *end;
color co;
- chr c;
+ uchr c;
char *has;
fprintf(f, "max %ld\n", (long) cm->max);