diff options
author | dgp <dgp@users.sourceforge.net> | 2016-06-16 16:27:01 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2016-06-16 16:27:01 (GMT) |
commit | 3cbd3b2bede59c6fd03330ac014e626a0a776522 (patch) | |
tree | 8e125264e32e68a389be074bfb8795cd212b9114 /generic/regc_color.c | |
parent | 95fb48bf07be37ad0717475514d2c444602a0a6c (diff) | |
parent | 4fac9b8d0fb5648943635cf4c956c9518e610921 (diff) | |
download | tcl-bug_16828b3744.zip tcl-bug_16828b3744.tar.gz tcl-bug_16828b3744.tar.bz2 |
Merge tip of core-8-6-branchbug_16828b3744
Diffstat (limited to 'generic/regc_color.c')
-rw-r--r-- | generic/regc_color.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/generic/regc_color.c b/generic/regc_color.c index f5d6dfd..92e0aad 100644 --- a/generic/regc_color.c +++ b/generic/regc_color.c @@ -259,7 +259,7 @@ newcolor( return COLORLESS; /* too many colors */ } n = cm->ncds * 2; - if (n < MAX_COLOR + 1) { + if (n > MAX_COLOR + 1) { n = MAX_COLOR + 1; } if (cm->cd == cm->cdspace) { @@ -777,18 +777,19 @@ dumpcolors( } /* - * It's hard to do this more efficiently. + * Unfortunately, it's hard to do this next bit more efficiently. + * + * Spencer's original coding has the loop iterating from CHR_MIN + * to CHR_MAX, but that's utterly unusable for 32-bit chr, or + * even 16-bit. For debugging purposes it seems fine to print + * only chr codes up to 1000 or so. */ - for (c=CHR_MIN ; c<CHR_MAX ; c++) { + for (c=CHR_MIN ; c<1000 ; c++) { if (GETCOLOR(cm, c) == co) { dumpchr(c, f); } } - assert(c == CHR_MAX); - if (GETCOLOR(cm, c) == co) { - dumpchr(c, f); - } fprintf(f, "\n"); } } |