From 4f3c0fa94fcc4ce830c4765499a42261934c48e7 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 9 Mar 2020 12:49:41 +0000 Subject: Use more uppercase hex (e.g. 0xFF) in stead of lowercase (0xff) consistantly. --- ChangeLog | 2 +- ChangeLog.2005 | 2 +- changes | 2 +- doc/ParseCmd.3 | 2 +- doc/Tcl.n | 8 ++++---- doc/ToUpper.3 | 2 +- doc/Utf.3 | 2 +- doc/binary.n | 6 +++--- library/clock.tcl | 2 +- tools/loadICU.tcl | 2 +- tools/makeTestCases.tcl | 2 +- unix/configure | 2 +- unix/configure.in | 2 +- unix/tclUnixPort.h | 12 ++++++------ 14 files changed, 24 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7150045..50fbeec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1012,7 +1012,7 @@ a better first place to look now. * tools/uniClass.tcl: [FRQ 3473670]: Various Unicode-related * tools/uniParse.tcl: speedups/robustness. Enhanced tools to be - * generic/tclUniData.c: able to handle characters > 0xffff. Done in + * generic/tclUniData.c: able to handle characters > 0xFFFF. Done in * generic/tclUtf.c: all branches in order to simplify merges for * generic/regc_locale.c: new Unicode versions (such as 6.1) diff --git a/ChangeLog.2005 b/ChangeLog.2005 index 0d1d7cf..109ea8e 100644 --- a/ChangeLog.2005 +++ b/ChangeLog.2005 @@ -2913,7 +2913,7 @@ * generic/tclCompCmds.c: Updated callers to call new routine. * generic/tclDictObj.c: Updated callers to call new routine. * tests/obj.test: Corrected bad tests that actually expected - values like "47" and "0xac" to be accepted as booleans. + values like "47" and "0xAC" to be accepted as booleans. * generic/tclLiteral.c: Disabled the code that forces some literals into the "int" Tcl_ObjType during registration. We can re-enable it if diff --git a/changes b/changes index c25f582..88de973 100644 --- a/changes +++ b/changes @@ -2307,7 +2307,7 @@ to the standard channel, do not increment the refcount. The channel can be NULL if there is for example no standard input. (JL) 9/6/96 (portability improvement) Changed parsing of backslash sequences -like \n to translate directly to absolute values like 0xa instead of +like \n to translate directly to absolute values like 0xA instead of letting the compiler do the translation. This guarantees that the translation is done the same everywhere. (JO) diff --git a/doc/ParseCmd.3 b/doc/ParseCmd.3 index ff1be23..e1a8790 100644 --- a/doc/ParseCmd.3 +++ b/doc/ParseCmd.3 @@ -300,7 +300,7 @@ The token describes a range of literal text that is part of a word. The \fInumComponents\fR field is always 0. .TP \fBTCL_TOKEN_BS\fR -The token describes a backslash sequence such as \fB\en\fR or \fB\e0xa3\fR. +The token describes a backslash sequence such as \fB\en\fR or \fB\e0xA3\fR. The \fInumComponents\fR field is always 0. .TP \fBTCL_TOKEN_COMMAND\fR diff --git a/doc/Tcl.n b/doc/Tcl.n index 980d81f..5c09cb8 100644 --- a/doc/Tcl.n +++ b/doc/Tcl.n @@ -146,19 +146,19 @@ Audible alert (bell) (0x7). Backspace (0x8). .TP 7 \e\fBf\fR -Form feed (0xc). +Form feed (0xC). .TP 7 \e\fBn\fR -Newline (0xa). +Newline (0xA). .TP 7 \e\fBr\fR -Carriage-return (0xd). +Carriage-return (0xD). .TP 7 \e\fBt\fR Tab (0x9). .TP 7 \e\fBv\fR -Vertical tab (0xb). +Vertical tab (0xB). .TP 7 \e\fB\fIwhiteSpace\fR . diff --git a/doc/ToUpper.3 b/doc/ToUpper.3 index 587e76b..ef3e491 100644 --- a/doc/ToUpper.3 +++ b/doc/ToUpper.3 @@ -81,7 +81,7 @@ and all following characters into their lower-case equivalents. .SH BUGS .PP At this time, the case conversions are only defined for the ISO8859-1 -characters. Unicode characters above 0x00ff are not modified by these +characters. Unicode characters above 0x00FF are not modified by these routines. .SH KEYWORDS diff --git a/doc/Utf.3 b/doc/Utf.3 index 903fac7..5361f32 100644 --- a/doc/Utf.3 +++ b/doc/Utf.3 @@ -142,7 +142,7 @@ end and dereference non-existent or random memory; if the source buffer is known to be null-terminated, this will not happen. If the input is not in proper UTF-8 format, \fBTcl_UtfToUniChar\fR will store the first byte of \fIsrc\fR in \fI*chPtr\fR as a Tcl_UniChar between 0x0000 and -0x00ff and return 1. +0x00FF and return 1. .PP \fBTcl_UniCharToUtfDString\fR converts the given Unicode string to UTF-8, storing the result in a previously initialized \fBTcl_DString\fR. diff --git a/doc/binary.n b/doc/binary.n index ff800f0..5f1efaf 100644 --- a/doc/binary.n +++ b/doc/binary.n @@ -561,7 +561,7 @@ stored in \fIvar2\fR. Note that the integers returned are signed, but they can be converted to unsigned 8-bit quantities using an expression like: .CS -set num [expr { $num & 0xff }] +set num [expr { $num & 0xFF }] .CE .RE .IP \fBs\fR 5 @@ -580,7 +580,7 @@ stored in \fIvar2\fR. Note that the integers returned are signed, but they can be converted to unsigned 16-bit quantities using an expression like: .CS -set num [expr { $num & 0xffff }] +set num [expr { $num & 0xFFFF }] .CE .RE .IP \fBS\fR 5 @@ -619,7 +619,7 @@ stored in \fIvar2\fR. Note that the integers returned are signed, but they can be converted to unsigned 32-bit quantities using an expression like: .CS -set num [expr { $num & 0xffffffff }] +set num [expr { $num & 0xFFFFFFFF }] .CE .RE .IP \fBI\fR 5 diff --git a/library/clock.tcl b/library/clock.tcl index eb87251..3018a3b 100644 --- a/library/clock.tcl +++ b/library/clock.tcl @@ -3559,7 +3559,7 @@ proc ::tcl::clock::ReadZoneinfoFile {fileName fname} { set times [linsert $times 0 $MINWIDE] set codes {} foreach c $tempCodes { - lappend codes [expr { $c & 0xff }] + lappend codes [expr { $c & 0xFF }] } set codes [linsert $codes 0 0] diff --git a/tools/loadICU.tcl b/tools/loadICU.tcl index 5b09e2c..1cdd12f 100755 --- a/tools/loadICU.tcl +++ b/tools/loadICU.tcl @@ -588,7 +588,7 @@ proc backslashify { string } { set retval {} foreach char [split $string {}] { scan $char %c ccode - if { $ccode >= 0x0020 && $ccode < 0x007f && $char ne "\"" + if { $ccode >= 0x0020 && $ccode < 0x007F && $char ne "\"" && $char ne "\{" && $char ne "\}" && $char ne "\[" && $char ne "\]" && $char ne "\\" && $char ne "\$" } { append retval $char diff --git a/tools/makeTestCases.tcl b/tools/makeTestCases.tcl index d96a221..c230d57 100755 --- a/tools/makeTestCases.tcl +++ b/tools/makeTestCases.tcl @@ -592,7 +592,7 @@ proc testcases5 { f2 } { foreach { t offset isdst tzname } $row break if { $t > -4000000000000 } { set conds [list detroit] - if { $t > wide(0x7fffffff) } { + if { $t > wide(0x7FFFFFFF) } { set conds [list detroit y2038] } incr t -1 diff --git a/unix/configure b/unix/configure index a06ac5a..b02525b 100755 --- a/unix/configure +++ b/unix/configure @@ -18983,7 +18983,7 @@ echo "${ECHO_T}static library" >&6 TCL_SHLIB_LD_EXTRAS="-compatibility_version ${TCL_VERSION} -current_version ${TCL_VERSION}`echo ${TCL_PATCH_LEVEL} | awk '{match($0, "\\\.[0-9]+"); print substr($0,RSTART,RLENGTH)}'`" TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -install_name "${DYLIB_INSTALL_DIR}"/${TCL_LIB_FILE}' - echo "$LDFLAGS " | grep -q -- '-prebind ' && TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -seg1addr 0xa000000' + echo "$LDFLAGS " | grep -q -- '-prebind ' && TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -seg1addr 0xA000000' TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -sectcreate __TEXT __info_plist Tcl-Info.plist' EXTRA_TCLSH_LIBS='-sectcreate __TEXT __info_plist Tclsh-Info.plist' EXTRA_APP_CC_SWITCHES='-mdynamic-no-pic' diff --git a/unix/configure.in b/unix/configure.in index 92ba199..c110c21 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -767,7 +767,7 @@ if test "`uname -s`" = "Darwin" ; then SC_ENABLE_FRAMEWORK TCL_SHLIB_LD_EXTRAS="-compatibility_version ${TCL_VERSION} -current_version ${TCL_VERSION}`echo ${TCL_PATCH_LEVEL} | awk ['{match($0, "\\\.[0-9]+"); print substr($0,RSTART,RLENGTH)}']`" TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -install_name "${DYLIB_INSTALL_DIR}"/${TCL_LIB_FILE}' - echo "$LDFLAGS " | grep -q -- '-prebind ' && TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -seg1addr 0xa000000' + echo "$LDFLAGS " | grep -q -- '-prebind ' && TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -seg1addr 0xA000000' TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -sectcreate __TEXT __info_plist Tcl-Info.plist' EXTRA_TCLSH_LIBS='-sectcreate __TEXT __info_plist Tclsh-Info.plist' EXTRA_APP_CC_SWITCHES='-mdynamic-no-pic' diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h index 9a923ef..086dd91 100644 --- a/unix/tclUnixPort.h +++ b/unix/tclUnixPort.h @@ -227,27 +227,27 @@ extern int TclUnixSetBlockingMode(int fd, int mode); */ #ifndef WIFEXITED -# define WIFEXITED(stat) (((*((int *) &(stat))) & 0xff) == 0) +# define WIFEXITED(stat) (((*((int *) &(stat))) & 0xFF) == 0) #endif #ifndef WEXITSTATUS -# define WEXITSTATUS(stat) (((*((int *) &(stat))) >> 8) & 0xff) +# define WEXITSTATUS(stat) (((*((int *) &(stat))) >> 8) & 0xFF) #endif #ifndef WIFSIGNALED -# define WIFSIGNALED(stat) (((*((int *) &(stat)))) && ((*((int *) &(stat))) == ((*((int *) &(stat))) & 0x00ff))) +# define WIFSIGNALED(stat) (((*((int *) &(stat)))) && ((*((int *) &(stat))) == ((*((int *) &(stat))) & 0xFF))) #endif #ifndef WTERMSIG -# define WTERMSIG(stat) ((*((int *) &(stat))) & 0x7f) +# define WTERMSIG(stat) ((*((int *) &(stat))) & 0x7F) #endif #ifndef WIFSTOPPED -# define WIFSTOPPED(stat) (((*((int *) &(stat))) & 0xff) == 0177) +# define WIFSTOPPED(stat) (((*((int *) &(stat))) & 0xFF) == 0177) #endif #ifndef WSTOPSIG -# define WSTOPSIG(stat) (((*((int *) &(stat))) >> 8) & 0xff) +# define WSTOPSIG(stat) (((*((int *) &(stat))) >> 8) & 0xFF) #endif /* -- cgit v0.12 From 50eee151a907e29a58d8201f66988816ae14eae5 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 17 Mar 2020 16:19:17 +0000 Subject: Unicode 13 has a new range of characters from 0x30000 to 0x3134A, so generate those in the tables too. Add one reserved stub entry (Backported from 8.6) --- generic/regc_locale.c | 4 ++-- generic/tcl.decls | 5 ++++- generic/tclDecls.h | 9 ++++++--- generic/tclStubInit.c | 3 ++- generic/tclUniData.c | 21 +++++++++++++++++++-- tools/uniParse.tcl | 4 ++-- 6 files changed, 35 insertions(+), 11 deletions(-) diff --git a/generic/regc_locale.c b/generic/regc_locale.c index 6b2b2ea..28fd01f 100644 --- a/generic/regc_locale.c +++ b/generic/regc_locale.c @@ -244,7 +244,7 @@ static const crange alphaRangeTable[] = { {0x1EE74, 0x1EE77}, {0x1EE79, 0x1EE7C}, {0x1EE80, 0x1EE89}, {0x1EE8B, 0x1EE9B}, {0x1EEA1, 0x1EEA3}, {0x1EEA5, 0x1EEA9}, {0x1EEAB, 0x1EEBB}, {0x20000, 0x2A6DD}, {0x2A700, 0x2B734}, {0x2B740, 0x2B81D}, {0x2B820, 0x2CEA1}, {0x2CEB0, 0x2EBE0}, - {0x2F800, 0x2FA1D} + {0x2F800, 0x2FA1D}, {0x30000, 0x3134A} #endif }; @@ -769,7 +769,7 @@ static const crange graphRangeTable[] = { {0x1FA90, 0x1FAA8}, {0x1FAB0, 0x1FAB6}, {0x1FAC0, 0x1FAC2}, {0x1FAD0, 0x1FAD6}, {0x1FB00, 0x1FB92}, {0x1FB94, 0x1FBCA}, {0x1FBF0, 0x1FBF9}, {0x20000, 0x2A6DD}, {0x2A700, 0x2B734}, {0x2B740, 0x2B81D}, {0x2B820, 0x2CEA1}, {0x2CEB0, 0x2EBE0}, - {0x2F800, 0x2FA1D}, {0xE0100, 0xE01EF} + {0x2F800, 0x2FA1D}, {0x30000, 0x3134A}, {0xE0100, 0xE01EF} #endif }; diff --git a/generic/tcl.decls b/generic/tcl.decls index f811ab6..6510249 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -2107,7 +2107,10 @@ declare 578 { declare 579 { void Tcl_AppendPrintfToObj(Tcl_Obj *objPtr, const char *format, ...) } -declare 648 { + +# ----- BASELINE -- FOR -- 8.5.0 ----- # + +declare 649 { void TclUnusedStubEntry(void) } diff --git a/generic/tclDecls.h b/generic/tclDecls.h index a1dbb26..a5b7ec1 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -3480,9 +3480,10 @@ EXTERN void Tcl_AppendPrintfToObj(Tcl_Obj *objPtr, /* Slot 645 is reserved */ /* Slot 646 is reserved */ /* Slot 647 is reserved */ +/* Slot 648 is reserved */ #ifndef TclUnusedStubEntry_TCL_DECLARED #define TclUnusedStubEntry_TCL_DECLARED -/* 648 */ +/* 649 */ EXTERN void TclUnusedStubEntry(void); #endif @@ -4168,7 +4169,8 @@ typedef struct TclStubs { VOID *reserved645; VOID *reserved646; VOID *reserved647; - void (*tclUnusedStubEntry) (void); /* 648 */ + VOID *reserved648; + void (*tclUnusedStubEntry) (void); /* 649 */ } TclStubs; extern TclStubs *tclStubsPtr; @@ -6589,9 +6591,10 @@ extern TclStubs *tclStubsPtr; /* Slot 645 is reserved */ /* Slot 646 is reserved */ /* Slot 647 is reserved */ +/* Slot 648 is reserved */ #ifndef TclUnusedStubEntry #define TclUnusedStubEntry \ - (tclStubsPtr->tclUnusedStubEntry) /* 648 */ + (tclStubsPtr->tclUnusedStubEntry) /* 649 */ #endif #endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */ diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 239cf60..67cb68e 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -1443,7 +1443,8 @@ TclStubs tclStubs = { NULL, /* 645 */ NULL, /* 646 */ NULL, /* 647 */ - TclUnusedStubEntry, /* 648 */ + NULL, /* 648 */ + TclUnusedStubEntry, /* 649 */ }; /* !END!: Do not edit above this line. */ diff --git a/generic/tclUniData.c b/generic/tclUniData.c index 569e196..ad47dda 100644 --- a/generic/tclUniData.c +++ b/generic/tclUniData.c @@ -539,7 +539,24 @@ static const unsigned short pageMap[] = { 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, - 1344, 1344, 1344, 1344, 1344, 1344, 11360 + 1344, 1344, 1344, 1344, 1344, 1344, 11360, 1824, 1824, 1824, 1824, + 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, + 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, + 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, + 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, 1344, + 1344, 1344, 1344, 1344, 1344, 1792 #endif /* TCL_UTF_MAX > 3 */ }; @@ -1629,7 +1646,7 @@ static const int groups[] = { }; #if TCL_UTF_MAX > 3 || TCL_MAJOR_VERSION > 8 || TCL_MINOR_VERSION > 6 -# define UNICODE_OUT_OF_RANGE(ch) (((ch) & 0x1FFFFF) >= 0x2FA20) +# define UNICODE_OUT_OF_RANGE(ch) (((ch) & 0x1FFFFF) >= 0x31360) #else # define UNICODE_OUT_OF_RANGE(ch) (((ch) & 0x1F0000) != 0) #endif diff --git a/tools/uniParse.tcl b/tools/uniParse.tcl index 24be687..a451096 100644 --- a/tools/uniParse.tcl +++ b/tools/uniParse.tcl @@ -114,8 +114,8 @@ proc uni::buildTables {data} { set items [split $line \;] scan [lindex $items 0] %x index - if {$index > 0x2FFFF} then { - # Ignore non-BMP characters, as long as Tcl doesn't support them + if {$index > 0x3FFFF} then { + # Ignore characters > plane 3 continue } set index [format %d $index] -- cgit v0.12