From 0ddca9ccf5bf55a5b06b7b34d62701c18114f1c1 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 12 Apr 2024 15:12:45 +0000 Subject: Re-generate tclTomMath.h from tommath.h --- generic/tclTomMath.h | 72 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 31 deletions(-) diff --git a/generic/tclTomMath.h b/generic/tclTomMath.h index 00b6503..fa5863b 100644 --- a/generic/tclTomMath.h +++ b/generic/tclTomMath.h @@ -77,12 +77,11 @@ typedef unsigned int private_mp_word; typedef unsigned long long mp_digit; #define MP_DIGIT_DECLARED #endif +#if defined(__GNUC__) typedef unsigned long private_mp_word __attribute__((mode(TI))); +#endif # define MP_DIGIT_BIT 60 #else -/* this is the default case, 28-bit digits */ - -/* this is to make porting into LibTomCrypt easier :-) */ #ifndef MP_DIGIT_DECLARED typedef unsigned int mp_digit; #define MP_DIGIT_DECLARED @@ -402,7 +401,7 @@ uint64_t mp_get_mag_u64(const mp_int *a) MP_WUR; unsigned long mp_get_mag_ul(const mp_int *a) MP_WUR; */ /* -Tcl_WideUInt mp_get_mag_ull(const mp_int *a) MP_WUR; +MP_DEPRECATED(mp_get_mag_u64) Tcl_WideUInt mp_get_mag_ull(const mp_int *a) MP_WUR; */ /* get integer, set integer (long) */ @@ -427,22 +426,24 @@ mp_err mp_init_ul(mp_int *a, unsigned long b) MP_WUR; /* get integer, set integer (Tcl_WideInt) */ /* -Tcl_WideInt mp_get_ll(const mp_int *a) MP_WUR; +MP_DEPRECATED(mp_get_i64) Tcl_WideInt mp_get_ll(const mp_int *a) MP_WUR; */ /* -void mp_set_ll(mp_int *a, Tcl_WideInt b); +MP_DEPRECATED(mp_set_i64) void mp_set_ll(mp_int *a, Tcl_WideInt b); */ /* -mp_err mp_init_ll(mp_int *a, Tcl_WideInt b) MP_WUR; +MP_DEPRECATED(mp_init_i64) mp_err mp_init_ll(mp_int *a, Tcl_WideInt b) MP_WUR; */ /* get integer, set integer (Tcl_WideUInt) */ -#define mp_get_ull(a) ((Tcl_WideUInt)mp_get_ll(a)) /* -void mp_set_ull(mp_int *a, Tcl_WideUInt b); +#define mp_get_ull(a) (MP_DEPRECATED_PRAGMA("mp_get_ull() has been deprecated, use mp_get_u64()") ((Tcl_WideUInt)mp_get_ll(a))) */ /* -mp_err mp_init_ull(mp_int *a, Tcl_WideUInt b) MP_WUR; +MP_DEPRECATED(mp_set_u64) void mp_set_ull(mp_int *a, Tcl_WideUInt b); +*/ +/* +MP_DEPRECATED(mp_init_u64) mp_err mp_init_ull(mp_int *a, Tcl_WideUInt b) MP_WUR; */ /* set to single unsigned digit, up to MP_DIGIT_MAX */ @@ -461,7 +462,7 @@ MP_DEPRECATED(mp_get_mag_u32/mp_get_u32) unsigned long mp_get_int(const mp_int * MP_DEPRECATED(mp_get_mag_ul/mp_get_ul) unsigned long mp_get_long(const mp_int *a) MP_WUR; */ /* -MP_DEPRECATED(mp_get_mag_ull/mp_get_ull) Tcl_WideUInt mp_get_long_long(const mp_int *a) MP_WUR; +MP_DEPRECATED(mp_get_mag_u64/mp_get_u64) Tcl_WideUInt mp_get_long_long(const mp_int *a) MP_WUR; */ /* MP_DEPRECATED(mp_set_ul) mp_err mp_set_int(mp_int *a, unsigned long b); @@ -491,6 +492,7 @@ mp_err mp_init_copy(mp_int *a, const mp_int *b) MP_WUR; void mp_clamp(mp_int *a); */ + /* export binary data */ /* MP_DEPRECATED(mp_pack) mp_err mp_export(void *rop, size_t *countp, int order, size_t size, @@ -543,7 +545,7 @@ mp_err mp_div_2(const mp_int *a, mp_int *b) MP_WUR; /* a/3 => 3c + d == a */ /* -mp_err mp_div_3(const mp_int *a, mp_int *c, mp_digit *d) MP_WUR; +MP_DEPRECATED(mp_div_d) mp_err mp_div_3(const mp_int *a, mp_int *c, mp_digit *d) MP_WUR; */ /* c = a * 2**b, implemented as c = a << b */ @@ -778,18 +780,42 @@ mp_err mp_exteuclid(const mp_int *a, const mp_int *b, mp_int *U1, mp_int *U2, mp mp_err mp_lcm(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; */ +/* Integer logarithm to integer base */ +/* +mp_err mp_log_n(const mp_int *a, int base, int *c) MP_WUR; +*/ +/* +MP_DEPRECATED(mp_log_n) mp_err mp_log_u32(const mp_int *a, uint32_t base, uint32_t *c) MP_WUR; +*/ + +/* c = a**b */ +/* +mp_err mp_expt_n(const mp_int *a, int b, mp_int *c) MP_WUR; +*/ +/* +MP_DEPRECATED(mp_expt_n) mp_err mp_expt_u32(const mp_int *a, uint32_t b, mp_int *c) MP_WUR; +*/ +/* +MP_DEPRECATED(mp_expt_n) mp_err mp_expt_d(const mp_int *a, mp_digit b, mp_int *c) MP_WUR; +*/ +/* +MP_DEPRECATED(mp_expt_n) mp_err mp_expt_d_ex(const mp_int *a, mp_digit b, mp_int *c, int fast) MP_WUR; +*/ /* finds one of the b'th root of a, such that |c|**b <= |a| * * returns error if a < 0 and b is even */ + /* +mp_err mp_root_n(const mp_int *a, int b, mp_int *c) MP_WUR; +*/ /* -mp_err mp_root_u32(const mp_int *a, unsigned int b, mp_int *c) MP_WUR; +MP_DEPRECATED(mp_root_n) mp_err mp_root_u32(const mp_int *a, uint32_t b, mp_int *c) MP_WUR; */ /* -MP_DEPRECATED(mp_root_u32) mp_err mp_n_root(const mp_int *a, mp_digit b, mp_int *c) MP_WUR; +MP_DEPRECATED(mp_root_n) mp_err mp_n_root(const mp_int *a, mp_digit b, mp_int *c) MP_WUR; */ /* -MP_DEPRECATED(mp_root_u32) mp_err mp_n_root_ex(const mp_int *a, mp_digit b, mp_int *c, int fast) MP_WUR; +MP_DEPRECATED(mp_root_n) mp_err mp_n_root_ex(const mp_int *a, mp_digit b, mp_int *c, int fast) MP_WUR; */ /* special sqrt algo */ @@ -1012,22 +1038,6 @@ MP_DEPRECATED(mp_prime_rand) mp_err mp_prime_random_ex(mp_int *a, int t, int siz mp_err mp_prime_rand(mp_int *a, int t, int size, int flags) MP_WUR; */ -/* Integer logarithm to integer base */ -/* -mp_err mp_log_u32(const mp_int *a, unsigned int base, unsigned int *c) MP_WUR; -*/ - -/* c = a**b */ -/* -mp_err mp_expt_n(const mp_int *a, int b, mp_int *c) MP_WUR; -*/ -/* -MP_DEPRECATED(mp_expt_n) mp_err mp_expt_d(const mp_int *a, mp_digit b, mp_int *c) MP_WUR; -*/ -/* -MP_DEPRECATED(mp_expt_n) mp_err mp_expt_d_ex(const mp_int *a, mp_digit b, mp_int *c, int fast) MP_WUR; -*/ - /* ---> radix conversion <--- */ /* int mp_count_bits(const mp_int *a) MP_WUR; -- cgit v0.12 From 026e55816c3209f3832d084a963ebf210f7890d4 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 12 Apr 2024 15:14:43 +0000 Subject: Since all tools are in utf-8 (actually: ascii), make that explicit --- tools/makeTestCases.tcl | 2 +- tools/man2html.tcl | 4 ++-- tools/tcltk-man2html.tcl | 2 +- unix/Makefile.in | 10 +++++----- win/Makefile.in | 4 ++-- win/makefile.vc | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tools/makeTestCases.tcl b/tools/makeTestCases.tcl index 70213e0..1eae645 100755 --- a/tools/makeTestCases.tcl +++ b/tools/makeTestCases.tcl @@ -4,7 +4,7 @@ package require msgcat set d [file dirname [file dirname [info script]]] puts "getting transition data from [file join $d library tzdata America Detroit]" -source [file join $d library/tzdata/America/Detroit] +source -encoding utf-8 [file join $d library/tzdata/America/Detroit] namespace eval ::tcl::clock { ::msgcat::mcmset en_US_roman { diff --git a/tools/man2html.tcl b/tools/man2html.tcl index 28a6751..20ce7a0 100644 --- a/tools/man2html.tcl +++ b/tools/man2html.tcl @@ -143,7 +143,7 @@ proc main {argv} { # build hyperlink database arrays: NAME_file and KEY_file # puts "\nScanning man pages in $tcl_dir/$package/doc..." - uplevel \#0 [list source $homeDir/man2html1.tcl] + uplevel \#0 [list source -encoding utf-8 $homeDir/man2html1.tcl] doDir $tcl_dir/$package/doc @@ -168,7 +168,7 @@ proc main {argv} { # now translate the man pages to HTML pages # - uplevel \#0 [list source $homeDir/man2html2.tcl] + uplevel \#0 [list source -encoding utf-8 $homeDir/man2html2.tcl] puts "\nBuilding html pages from man pages in $tcl_dir/$package/doc..." doDir $tcl_dir/$package/doc diff --git a/tools/tcltk-man2html.tcl b/tools/tcltk-man2html.tcl index 6a47528..9116394 100755 --- a/tools/tcltk-man2html.tcl +++ b/tools/tcltk-man2html.tcl @@ -29,7 +29,7 @@ set ::CSSFILE "docs.css" ## Source the utility functions that provide most of the ## implementation of the transformation from nroff to html. ## -source [file join [file dirname [info script]] tcltk-man2html-utils.tcl] +source -encoding utf-8 [file join [file dirname [info script]] tcltk-man2html-utils.tcl] proc parse_command_line {} { global argv Version diff --git a/unix/Makefile.in b/unix/Makefile.in index b4d440d..814ec71 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -742,7 +742,7 @@ runtest: ${TCLTEST_EXE} # Useful target for running the test suite with an unwritable current # directory... ro-test: ${TCLTEST_EXE} - echo 'exec chmod -w .;package require tcltest;tcltest::temporaryDirectory /tmp;source ../tests/all.tcl;exec chmod +w .' | $(SHELL_ENV) ./${TCLTEST_EXE} + echo 'exec chmod -w .;package require tcltest;tcltest::temporaryDirectory /tmp;source -encoding utf-8 ../tests/all.tcl;exec chmod +w .' | $(SHELL_ENV) ./${TCLTEST_EXE} # The following target generates the shared libraries in dltest/ that are used # for testing; they are included as part of the "tcltest" target (via the @@ -1850,7 +1850,7 @@ gendate: # run (and the results checked) after updating to a new release of libtommath. gentommath_h: - $(NATIVE_TCLSH) "$(TOOL_DIR)/fix_tommath_h.tcl" \ + $(NATIVE_TCLSH) -encoding utf-8 "$(TOOL_DIR)/fix_tommath_h.tcl" \ "$(TOMMATH_DIR)/tommath.h" \ > "$(GENERIC_DIR)/tclTomMath.h" @@ -1870,10 +1870,10 @@ $(GENERIC_DIR)/tclOOStubInit.c: $(GENERIC_DIR)/tclOO.decls @echo "This warning can be safely ignored, do not report as a bug!" genstubs: - $(NATIVE_TCLSH) $(TOOL_DIR)/genStubs.tcl $(GENERIC_DIR) \ + $(NATIVE_TCLSH) -encoding utf-8 $(TOOL_DIR)/genStubs.tcl $(GENERIC_DIR) \ $(GENERIC_DIR)/tcl.decls $(GENERIC_DIR)/tclInt.decls \ $(GENERIC_DIR)/tclTomMath.decls - $(NATIVE_TCLSH) $(TOOL_DIR)/genStubs.tcl $(GENERIC_DIR) \ + $(NATIVE_TCLSH) -encoding utf-8 $(TOOL_DIR)/genStubs.tcl $(GENERIC_DIR) \ $(GENERIC_DIR)/tclOO.decls # @@ -2146,7 +2146,7 @@ html-tk: ${NATIVE_TCLSH} # from Makefile.in in the first place... HTML_VERSION = `basename $(TOP_DIR) | sed s/tcl//` BUILD_HTML = \ - @${NATIVE_TCLSH} $(TOOL_DIR)/tcltk-man2html.tcl \ + @${NATIVE_TCLSH} -encoding utf-8 $(TOOL_DIR)/tcltk-man2html.tcl \ --useversion=$(HTML_VERSION) --htmldir="$(HTML_INSTALL_DIR)" \ --srcdir=$(TOP_DIR)/.. $(BUILD_HTML_FLAGS) diff --git a/win/Makefile.in b/win/Makefile.in index b9d7e6a..a325ac3 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -924,12 +924,12 @@ $(GENERIC_DIR)/tclStubInit.c: $(GENERIC_DIR)/tcl.decls \ @echo "This warning can be safely ignored, do not report as a bug!" genstubs: - $(TCL_EXE) "$(ROOT_DIR_NATIVE)/tools/genStubs.tcl" \ + $(TCL_EXE) -encoding utf-8 "$(ROOT_DIR_NATIVE)/tools/genStubs.tcl" \ "$(GENERIC_DIR_NATIVE)" \ "$(GENERIC_DIR_NATIVE)/tcl.decls" \ "$(GENERIC_DIR_NATIVE)/tclInt.decls" \ "$(GENERIC_DIR_NATIVE)/tclTomMath.decls" - $(TCL_EXE) "$(ROOT_DIR_NATIVE)/tools/genStubs.tcl" \ + $(TCL_EXE) -encoding utf-8 "$(ROOT_DIR_NATIVE)/tools/genStubs.tcl" \ "$(GENERIC_DIR_NATIVE)" \ "$(GENERIC_DIR_NATIVE)/tclOO.decls" diff --git a/win/makefile.vc b/win/makefile.vc index de7f889..4d0bf70 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -583,10 +583,10 @@ genstubs: !if !exist($(TCLSH)) @echo Build tclsh first! !else - $(TCLSH) $(TOOLSDIR:\=/)/genStubs.tcl $(GENERICDIR:\=/) \ + $(TCLSH) -encoding utf-8 $(TOOLSDIR:\=/)/genStubs.tcl $(GENERICDIR:\=/) \ $(GENERICDIR:\=/)/tcl.decls $(GENERICDIR:\=/)/tclInt.decls \ $(GENERICDIR:\=/)/tclTomMath.decls - $(TCLSH) $(TOOLSDIR:\=/)/genStubs.tcl $(GENERICDIR:\=/) \ + $(TCLSH) -encoding utf-8 $(TOOLSDIR:\=/)/genStubs.tcl $(GENERICDIR:\=/) \ $(GENERICDIR:\=/)/tclOO.decls !endif -- cgit v0.12 From 8ab9d1f58931108c9dabb055d2921121ce7efc47 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 12 Apr 2024 15:16:50 +0000 Subject: Add lot's of "-encoding utf-8" to our own "source" commands: We are becoming more independant from the system encoding. --- library/auto.tcl | 4 ++-- library/init.tcl | 2 +- library/msgcat/pkgIndex.tcl | 2 +- library/opt/pkgIndex.tcl | 2 +- library/package.tcl | 8 ++++---- library/platform/pkgIndex.tcl | 4 ++-- library/platform/shell.tcl | 4 ++-- library/safe.tcl | 4 ++-- library/tcltest/pkgIndex.tcl | 2 +- library/tcltest/tcltest.tcl | 4 ++-- tests-perf/chan.perf.tcl | 2 +- tests-perf/clock.perf.tcl | 2 +- tests-perf/list.perf.tcl | 2 +- tests-perf/timer-event.perf.tcl | 2 +- tests/internals.tcl | 2 +- tests/pkgIndex.tcl | 2 +- 16 files changed, 24 insertions(+), 24 deletions(-) diff --git a/library/auto.tcl b/library/auto.tcl index f293a38..dd76c1a 100644 --- a/library/auto.tcl +++ b/library/auto.tcl @@ -141,7 +141,7 @@ proc tcl_findLibrary {basename version patch initScript enVarName varName} { # source command, but no file exists command if {[interp issafe] || [file exists $file]} { - if {![catch {uplevel #0 [list source $file]} msg opts]} { + if {![catch {uplevel #0 [list source -encoding utf-8 $file]} msg opts]} { return } append errors "$file: $msg\n" @@ -245,7 +245,7 @@ proc auto_mkindex_old {dir args} { if {[regexp {^proc[ ]+([^ ]*)} $line match procName]} { set procName [lindex [auto_qualify $procName "::"] 0] append index "set [list auto_index($procName)]" - append index " \[list source \[file join \$dir [list $file]\]\]\n" + append index " \[list source -encoding utf-8 \[file join \$dir [list $file]\]\]\n" } } close $f diff --git a/library/init.tcl b/library/init.tcl index e57c5ce..1107381 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -493,7 +493,7 @@ proc auto_load_index {} { set dir [lindex $auto_path $i] set f "" if {$issafe} { - catch {source [file join $dir tclIndex]} + catch {source -encoding utf-8 [file join $dir tclIndex]} } elseif {[catch {set f [open [file join $dir tclIndex]]}]} { continue } else { diff --git a/library/msgcat/pkgIndex.tcl b/library/msgcat/pkgIndex.tcl index 72c5dc0..5a55190 100644 --- a/library/msgcat/pkgIndex.tcl +++ b/library/msgcat/pkgIndex.tcl @@ -1,2 +1,2 @@ if {![package vsatisfies [package provide Tcl] 8.5-]} {return} -package ifneeded msgcat 1.6.1 [list source [file join $dir msgcat.tcl]] +package ifneeded msgcat 1.6.1 [list source -encoding utf-8 [file join $dir msgcat.tcl]] diff --git a/library/opt/pkgIndex.tcl b/library/opt/pkgIndex.tcl index c763a3d..aad00af 100644 --- a/library/opt/pkgIndex.tcl +++ b/library/opt/pkgIndex.tcl @@ -9,4 +9,4 @@ # full path name of this file's directory. if {![package vsatisfies [package provide Tcl] 8.5-]} {return} -package ifneeded opt 0.4.9 [list source [file join $dir optparse.tcl]] +package ifneeded opt 0.4.9 [list source -encoding utf-8 [file join $dir optparse.tcl]] diff --git a/library/package.tcl b/library/package.tcl index 4ccc20a..33ee7aa 100644 --- a/library/package.tcl +++ b/library/package.tcl @@ -291,7 +291,7 @@ proc pkg_mkIndex {args} { set ::tcl::type load } else { set ::tcl::debug sourcing - source [file join $::tcl::dir $::tcl::file] + source -encoding utf-8 [file join $::tcl::dir $::tcl::file] set ::tcl::type source } @@ -441,7 +441,7 @@ proc tclPkgSetup {dir pkg version files} { if {$type eq "load"} { set auto_index($cmd) [list load [file join $dir $f] $pkg] } else { - set auto_index($cmd) [list source [file join $dir $f]] + set auto_index($cmd) [list source -encoding utf-8 [file join $dir $f]] } } } @@ -491,7 +491,7 @@ proc tclPkgUnknown {name args} { set dir [file dirname $file] if {![info exists procdDirs($dir)]} { try { - source $file + source -encoding utf-8 $file } trap {POSIX EACCES} {} { # $file was not readable; silently ignore continue @@ -509,7 +509,7 @@ proc tclPkgUnknown {name args} { # safe interps usually don't have "file exists", if {([interp issafe] || [file exists $file])} { try { - source $file + source -encoding utf-8 $file } trap {POSIX EACCES} {} { # $file was not readable; silently ignore continue diff --git a/library/platform/pkgIndex.tcl b/library/platform/pkgIndex.tcl index e7029d0..4526c7e 100644 --- a/library/platform/pkgIndex.tcl +++ b/library/platform/pkgIndex.tcl @@ -1,3 +1,3 @@ -package ifneeded platform 1.0.19 [list source [file join $dir platform.tcl]] -package ifneeded platform::shell 1.1.4 [list source [file join $dir shell.tcl]] +package ifneeded platform 1.0.19 [list source -encoding utf-8 [file join $dir platform.tcl]] +package ifneeded platform::shell 1.1.4 [list source -encoding utf-8 [file join $dir shell.tcl]] diff --git a/library/platform/shell.tcl b/library/platform/shell.tcl index 1e43409..60d5b37 100644 --- a/library/platform/shell.tcl +++ b/library/platform/shell.tcl @@ -31,7 +31,7 @@ proc ::platform::shell::generic {shell} { # conflict with this one. lappend code {package forget platform} # Inject our platform package - lappend code [list source $base] + lappend code [list source -encoding utf-8 $base] # Query and print the architecture lappend code {puts [platform::generic]} # And done @@ -56,7 +56,7 @@ proc ::platform::shell::identify {shell} { # conflict with this one. lappend code {package forget platform} # Inject our platform package - lappend code [list source $base] + lappend code [list source -encoding utf-8 $base] # Query and print the architecture lappend code {puts [platform::identify]} # And done diff --git a/library/safe.tcl b/library/safe.tcl index 8c79abd..71c1e67 100644 --- a/library/safe.tcl +++ b/library/safe.tcl @@ -532,14 +532,14 @@ proc ::safe::InterpInit { # other procedures defined: if {[catch {::interp eval $child { - source [file join $tcl_library init.tcl] + source -encoding utf-8 [file join $tcl_library init.tcl] }} msg opt]} { Log $child "can't source init.tcl ($msg)" return -options $opt "can't source init.tcl into slave $child ($msg)" } if {[catch {::interp eval $child { - source [file join $tcl_library tm.tcl] + source -encoding utf-8 [file join $tcl_library tm.tcl] }} msg opt]} { Log $child "can't source tm.tcl ($msg)" return -options $opt "can't source tm.tcl into slave $child ($msg)" diff --git a/library/tcltest/pkgIndex.tcl b/library/tcltest/pkgIndex.tcl index 2fff5f4..9f51e64 100644 --- a/library/tcltest/pkgIndex.tcl +++ b/library/tcltest/pkgIndex.tcl @@ -9,4 +9,4 @@ # full path name of this file's directory. if {![package vsatisfies [package provide Tcl] 8.5-]} {return} -package ifneeded tcltest 2.5.8 [list source [file join $dir tcltest.tcl]] +package ifneeded tcltest 2.5.8 [list source -encoding utf-8 [file join $dir tcltest.tcl]] diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl index 12b0976..2fc5838 100644 --- a/library/tcltest/tcltest.tcl +++ b/library/tcltest/tcltest.tcl @@ -2923,7 +2923,7 @@ proc tcltest::runAllTests { {shell ""} } { if {[singleProcess]} { if {[catch { incr numTestFiles - uplevel 1 [list ::source $file] + uplevel 1 [list ::source -encoding utf-8 $file] } msg]} { puts [outputChannel] "Test file error: $msg" # append the name of the test to a list to be reported @@ -3008,7 +3008,7 @@ proc tcltest::runAllTests { {shell ""} } { puts [outputChannel] [string repeat ~ 44] puts [outputChannel] "$dir test began at [eval $timeCmd]\n" - uplevel 1 [list ::source [file join $directory all.tcl]] + uplevel 1 [list ::source -encoding utf-8 [file join $directory all.tcl]] set endTime [eval $timeCmd] puts [outputChannel] "\n$dir test ended at $endTime" diff --git a/tests-perf/chan.perf.tcl b/tests-perf/chan.perf.tcl index 2ef87cb..56acccf 100644 --- a/tests-perf/chan.perf.tcl +++ b/tests-perf/chan.perf.tcl @@ -17,7 +17,7 @@ if {![namespace exists ::tclTestPerf]} { - source [file join [file dirname [info script]] test-performance.tcl] + source -encoding utf-8 [file join [file dirname [info script]] test-performance.tcl] } diff --git a/tests-perf/clock.perf.tcl b/tests-perf/clock.perf.tcl index 35fe219..bbfdc67 100644 --- a/tests-perf/clock.perf.tcl +++ b/tests-perf/clock.perf.tcl @@ -22,7 +22,7 @@ if {[info exists ::argv0] && [file tail $::argv0] eq [file tail [info script]]} ## common test performance framework: if {![namespace exists ::tclTestPerf]} { - source [file join [file dirname [info script]] test-performance.tcl] + source -encoding utf-8 [file join [file dirname [info script]] test-performance.tcl] } namespace eval ::tclTestPerf-TclClock { diff --git a/tests-perf/list.perf.tcl b/tests-perf/list.perf.tcl index 121a922..564fad0 100644 --- a/tests-perf/list.perf.tcl +++ b/tests-perf/list.perf.tcl @@ -17,7 +17,7 @@ if {![namespace exists ::tclTestPerf]} { - source [file join [file dirname [info script]] test-performance.tcl] + source -encoding utf-8 [file join [file dirname [info script]] test-performance.tcl] } diff --git a/tests-perf/timer-event.perf.tcl b/tests-perf/timer-event.perf.tcl index f68a56a..8256a0e 100644 --- a/tests-perf/timer-event.perf.tcl +++ b/tests-perf/timer-event.perf.tcl @@ -17,7 +17,7 @@ if {![namespace exists ::tclTestPerf]} { - source [file join [file dirname [info script]] test-performance.tcl] + source -encoding utf-8 [file join [file dirname [info script]] test-performance.tcl] } diff --git a/tests/internals.tcl b/tests/internals.tcl index 43cafd5..9c2ead1 100644 --- a/tests/internals.tcl +++ b/tests/internals.tcl @@ -2,7 +2,7 @@ # # Source this file in the related tests to include from tcl-tests: # -# source [file join [file dirname [info script]] internals.tcl] +# source -encoding utf-8 [file join [file dirname [info script]] internals.tcl] # # Copyright (c) 2020 Sergey G. Brester (sebres). # diff --git a/tests/pkgIndex.tcl b/tests/pkgIndex.tcl index 9d89277..0f3bf49 100644 --- a/tests/pkgIndex.tcl +++ b/tests/pkgIndex.tcl @@ -1,3 +1,3 @@ #! /usr/bin/env tclsh -package ifneeded tcltests 0.1 [list source $dir/tcltests.tcl] +package ifneeded tcltests 0.1 [list source -encoding utf-8 $dir/tcltests.tcl] -- cgit v0.12 From f1d98185ed272bf66273010cf052cc5cbfeab625 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 12 Apr 2024 15:25:48 +0000 Subject: (cherry-pick): Clock not weak; clock strong! --- generic/tclClock.c | 2 +- generic/tclClockFmt.c | 18 +++++++++--------- generic/tclDate.h | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/generic/tclClock.c b/generic/tclClock.c index b1aefa8..5876114 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -3705,7 +3705,7 @@ ClockScanCommit( { /* If needed assemble julianDay using year, month, etc. */ if (info->flags & CLF_ASSEMBLE_JULIANDAY) { - if ((info->flags & CLF_ISO8601WEAK)) { + if (info->flags & CLF_ISO8601WEEK) { GetJulianDayFromEraYearWeekDay(&yydate, GREGORIAN_CHANGE_DATE); } else if (!(info->flags & CLF_DAYOFYEAR) /* no day of year */ || (info->flags & (CLF_DAYOFMONTH|CLF_MONTH)) /* yymmdd over yyddd */ diff --git a/generic/tclClockFmt.c b/generic/tclClockFmt.c index cbb935d..7517b72 100644 --- a/generic/tclClockFmt.c +++ b/generic/tclClockFmt.c @@ -2007,7 +2007,7 @@ static const ClockScanTokenMap ScnSTokenMap[] = { {CTOKT_INT, CLF_ISO8601YEAR | CLF_ISO8601CENTURY, 0, 4, 4, offsetof(DateInfo, date.iso8601Year), NULL, NULL}, /* %V */ - {CTOKT_INT, CLF_ISO8601WEAK, 0, 1, 2, offsetof(DateInfo, date.iso8601Week), + {CTOKT_INT, CLF_ISO8601WEEK, 0, 1, 2, offsetof(DateInfo, date.iso8601Week), NULL, NULL}, /* %a %A %u %w */ {CTOKT_PARSER, CLF_DAYOFWEEK, 0, 0, 0xffff, 0, @@ -2579,7 +2579,7 @@ ClockScan( case CLF_DAYOFYEAR: /* ddd over naked weekday */ if (!(flags & CLF_ISO8601YEAR)) { - flags &= ~CLF_ISO8601WEAK; + flags &= ~CLF_ISO8601WEEK; } break; case CLF_MONTH | CLF_DAYOFYEAR | CLF_DAYOFMONTH: @@ -2588,7 +2588,7 @@ ClockScan( case CLF_DAYOFMONTH: /* mmdd / dd over naked weekday */ if (!(flags & CLF_ISO8601YEAR)) { - flags &= ~CLF_ISO8601WEAK; + flags &= ~CLF_ISO8601WEEK; } break; /* neither mmdd nor ddd available */ @@ -2596,22 +2596,22 @@ ClockScan( /* but we have day of the week, which can be used */ if (flags & CLF_DAYOFWEEK) { /* prefer week based calculation of julianday */ - flags |= CLF_ISO8601WEAK; + flags |= CLF_ISO8601WEEK; } } /* YearWeekDay below YearMonthDay */ - if ((flags & CLF_ISO8601WEAK) + if ((flags & CLF_ISO8601WEEK) && ((flags & (CLF_YEAR | CLF_DAYOFYEAR)) == (CLF_YEAR | CLF_DAYOFYEAR) || (flags & (CLF_YEAR | CLF_DAYOFMONTH | CLF_MONTH)) == ( CLF_YEAR | CLF_DAYOFMONTH | CLF_MONTH))) { /* yy precedence below yyyy */ if (!(flags & CLF_ISO8601CENTURY) && (flags & CLF_CENTURY)) { /* normally precedence of ISO is higher, but no century - so put it down */ - flags &= ~CLF_ISO8601WEAK; + flags &= ~CLF_ISO8601WEEK; } else if (!(flags & CLF_ISO8601YEAR)) { /* yymmdd or yyddd over naked weekday */ - flags &= ~CLF_ISO8601WEAK; + flags &= ~CLF_ISO8601WEEK; } } @@ -2627,7 +2627,7 @@ ClockScan( } } } - if (flags & (CLF_ISO8601WEAK | CLF_ISO8601YEAR)) { + if (flags & (CLF_ISO8601WEEK | CLF_ISO8601YEAR)) { if ((flags & (CLF_ISO8601YEAR | CLF_YEAR)) == CLF_YEAR) { /* for calculations expected iso year */ info->date.iso8601Year = yyYear; @@ -2642,7 +2642,7 @@ ClockScan( } } if ((flags & (CLF_ISO8601YEAR | CLF_YEAR)) == CLF_ISO8601YEAR) { - /* for calculations expected year (e. g. CLF_ISO8601WEAK not set) */ + /* for calculations expected year (e. g. CLF_ISO8601WEEK not set) */ yyYear = info->date.iso8601Year; } } diff --git a/generic/tclDate.h b/generic/tclDate.h index 60e07ab..1657528 100644 --- a/generic/tclDate.h +++ b/generic/tclDate.h @@ -45,7 +45,7 @@ enum DateInfoFlags { CLF_YEAR = 1 << 10, CLF_DAYOFWEEK = 1 << 11, CLF_ISO8601YEAR = 1 << 12, - CLF_ISO8601WEAK = 1 << 13, + CLF_ISO8601WEEK = 1 << 13, CLF_ISO8601CENTURY = 1 << 14, CLF_SIGNED = 1 << 15, @@ -55,7 +55,7 @@ enum DateInfoFlags { CLF_HAVEDATE = (CLF_DAYOFMONTH | CLF_MONTH | CLF_YEAR), CLF_DATE = (CLF_JULIANDAY | CLF_DAYOFMONTH | CLF_DAYOFYEAR | CLF_MONTH | CLF_YEAR | CLF_ISO8601YEAR - | CLF_DAYOFWEEK | CLF_ISO8601WEAK), + | CLF_DAYOFWEEK | CLF_ISO8601WEEK), /* * Extra flags used outside of scan/format-tokens too (int, not a short). -- cgit v0.12