diff options
-rw-r--r-- | doc/timerate.n | 4 | ||||
-rw-r--r-- | generic/regc_locale.c | 2 | ||||
-rw-r--r-- | generic/tclCmdMZ.c | 2 | ||||
-rw-r--r-- | generic/tclExecute.c | 2 | ||||
-rw-r--r-- | generic/tclIO.c | 6 | ||||
-rw-r--r-- | generic/tclStringObj.c | 2 | ||||
-rw-r--r-- | tests-perf/clock.perf.tcl | 14 | ||||
-rw-r--r-- | tests-perf/test-performance.tcl | 10 | ||||
-rw-r--r-- | tests-perf/timer-event.perf.tcl | 16 | ||||
-rw-r--r-- | tests/util.test | 2 |
10 files changed, 30 insertions, 30 deletions
diff --git a/doc/timerate.n b/doc/timerate.n index 3c764c8..5820d27 100644 --- a/doc/timerate.n +++ b/doc/timerate.n @@ -56,8 +56,8 @@ To measure very fast scripts as exact as posible the calibration process may be required. The \fI-calibrate\fR option is used to calibrate timerate, calculating the -estimated overhead of the given script as the default overhead for future -invocations of the \fBtimerate\fR command. If the \fItime\fR parameter is not +estimated overhead of the given script as the default overhead for future +invocations of the \fBtimerate\fR command. If the \fItime\fR parameter is not specified, the calibrate procedure runs for up to 10 seconds. .TP \fI-overhead double\fR diff --git a/generic/regc_locale.c b/generic/regc_locale.c index 3fa9b04..afe6298 100644 --- a/generic/regc_locale.c +++ b/generic/regc_locale.c @@ -833,7 +833,7 @@ element( */ Tcl_DStringInit(&ds); - np = Tcl_UniCharToUtfDString(startp, (int)len, &ds); + np = Tcl_UniCharToUtfDString(startp, len, &ds); for (cn=cnames; cn->name!=NULL; cn++) { if (strlen(cn->name)==len && strncmp(cn->name, np, len)==0) { break; /* NOTE BREAK OUT */ diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 01d9c27..8767ca6 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -1445,7 +1445,7 @@ StringIndexCmd( Tcl_SetObjResult(interp, Tcl_NewByteArrayObj(&uch, 1)); } else { - char buf[TCL_UTF_MAX] = ""; + char buf[4] = ""; length = Tcl_UniCharToUtf(ch, buf); if ((ch >= 0xD800) && (length < 3)) { diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 7693fd2..903e8d7 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -5215,7 +5215,7 @@ TEBCresume( objResultPtr = Tcl_NewStringObj((const char *) valuePtr->bytes+index, 1); } else { - char buf[TCL_UTF_MAX] = ""; + char buf[4] = ""; int ch = Tcl_GetUniChar(valuePtr, index); /* diff --git a/generic/tclIO.c b/generic/tclIO.c index 3879aa9..cf91307 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -6216,7 +6216,7 @@ ReadChars( * and do not encounter the eof char this time. */ - dstLimit = dstRead - 1 + TCL_UTF_MAX; + dstLimit = dstRead + (TCL_UTF_MAX - 1); statePtr->flags = savedFlags; statePtr->inputEncodingFlags = savedIEFlags; statePtr->inputEncodingState = savedState; @@ -6241,7 +6241,7 @@ ReadChars( * here in this call. */ - dstLimit = dstRead - 1 + TCL_UTF_MAX; + dstLimit = dstRead + (TCL_UTF_MAX - 1); statePtr->flags = savedFlags; statePtr->inputEncodingFlags = savedIEFlags; statePtr->inputEncodingState = savedState; @@ -6334,7 +6334,7 @@ ReadChars( * bytes demanded by the Tcl_ExternalToUtf() call! */ - dstLimit = Tcl_UtfAtIndex(dst, charsToRead) - 1 + TCL_UTF_MAX - dst; + dstLimit = Tcl_UtfAtIndex(dst, charsToRead) - dst + (TCL_UTF_MAX - 1); statePtr->flags = savedFlags; statePtr->inputEncodingFlags = savedIEFlags; statePtr->inputEncodingState = savedState; diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index ee0a3c3..4dd334d 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -2041,7 +2041,7 @@ Tcl_AppendFormatToObj( } break; case 'c': { - char buf[TCL_UTF_MAX] = ""; + char buf[4] = ""; int code, length; if (TclGetIntFromObj(interp, segment, &code) != TCL_OK) { diff --git a/tests-perf/clock.perf.tcl b/tests-perf/clock.perf.tcl index d574c2c..f80746f 100644 --- a/tests-perf/clock.perf.tcl +++ b/tests-perf/clock.perf.tcl @@ -2,18 +2,18 @@ # ------------------------------------------------------------------------ # # test-performance.tcl -- -# +# # This file provides common performance tests for comparison of tcl-speed # degradation by switching between branches. # (currently for clock ensemble only) # # ------------------------------------------------------------------------ -# +# # Copyright (c) 2014 Serg G. Brester (aka sebres) -# +# # See the file "license.terms" for information on usage and redistribution # of this file. -# +# array set in {-time 500} if {[info exists ::argv0] && [file tail $::argv0] eq [file tail [info script]]} { @@ -215,7 +215,7 @@ proc test-freescan {{reptime 1000}} { {clock scan "next January" -base 0 -gmt 1} # FreeScan : relative week {clock scan "next Fri" -base 0 -gmt 1} - # FreeScan : relative weekday and week offset + # FreeScan : relative weekday and week offset {clock scan "next January + 2 week" -base 0 -gmt 1} # FreeScan : time only with base {clock scan "19:18:30" -base 148863600 -gmt 1} @@ -300,7 +300,7 @@ proc test-convert {{reptime 1000}} { {clock format [clock scan "19:18:30 EST" -base 148863600] -format "%H:%M:%S %z" -timezone EST} # Format locale 1x: comparison values - {clock format 0 -gmt 1 -locale en} + {clock format 0 -gmt 1 -locale en} {clock format 0 -gmt 1 -locale de} {clock format 0 -gmt 1 -locale fr} # Format locale 2x: without switching locale (en, en) @@ -340,7 +340,7 @@ proc test-convert {{reptime 1000}} { {clock scan "19:18:30 MST" -base 148863600; clock scan "19:18:30 EST" -base 148863600} # FreeScan TZ 2x (+1 gmt, +1 system-default) {clock scan "19:18:30 MST" -base 148863600 -gmt 1; clock scan "19:18:30 EST" -base 148863600} - + # Scan TZ: comparison included in scan string vs. given {clock scan "2009-06-30T18:30:00 CEST" -format "%Y-%m-%dT%H:%M:%S %z"} {clock scan "2009-06-30T18:30:00 CET" -format "%Y-%m-%dT%H:%M:%S %z"} diff --git a/tests-perf/test-performance.tcl b/tests-perf/test-performance.tcl index 4629cd4..1ddecb5 100644 --- a/tests-perf/test-performance.tcl +++ b/tests-perf/test-performance.tcl @@ -1,19 +1,19 @@ # ------------------------------------------------------------------------ # # test-performance.tcl -- -# +# # This file provides common performance tests for comparison of tcl-speed # degradation or regression by switching between branches. # # To execute test case evaluate direct corresponding file "tests-perf\*.perf.tcl". # # ------------------------------------------------------------------------ -# +# # Copyright (c) 2014 Serg G. Brester (aka sebres) -# +# # See the file "license.terms" for information on usage and redistribution # of this file. -# +# namespace eval ::tclTestPerf { # warm-up interpeter compiler env, calibrate timerate measurement functionality: @@ -33,7 +33,7 @@ if {[lindex [timerate {} 10] 6] >= (10-1)} { } proc {**STOP**} {args} { - return -code error -level 4 "**STOP** in [info level [expr {[info level]-2}]] [join $args { }]" + return -code error -level 4 "**STOP** in [info level [expr {[info level]-2}]] [join $args { }]" } proc _test_get_commands {lst} { diff --git a/tests-perf/timer-event.perf.tcl b/tests-perf/timer-event.perf.tcl index c5a7d45..f68a56a 100644 --- a/tests-perf/timer-event.perf.tcl +++ b/tests-perf/timer-event.perf.tcl @@ -3,17 +3,17 @@ # ------------------------------------------------------------------------ # # timer-event.perf.tcl -- -# +# # This file provides performance tests for comparison of tcl-speed # of timer events (event-driven tcl-handling). # # ------------------------------------------------------------------------ -# +# # Copyright (c) 2014 Serg G. Brester (aka sebres) -# +# # See the file "license.terms" for information on usage and redistribution # of this file. -# +# if {![namespace exists ::tclTestPerf]} { @@ -40,7 +40,7 @@ proc test-queue {{reptime {1000 10000}}} { {after idle {set foo bar}} # update / after idle: {update; if {![llength [after info]]} break} - + # generate up to $howmuch idle-events: {after idle {set foo bar}} # update idletasks / after idle: @@ -50,7 +50,7 @@ proc test-queue {{reptime {1000 10000}}} { {after 0 {set foo bar}} # update / after 0: {update; if {![llength [after info]]} break} - + # generate up to $howmuch 1-ms events: {after 1 {set foo bar}} setup {after 1} @@ -83,7 +83,7 @@ proc test-queue {{reptime {1000 10000}}} { setup {set le $i; incr i; list $le .. 1; # cancel up to $howmuch events} {after cancel $ev([incr i -1]); if {$i <= 1} break} cleanup {update; unset -nocomplain ev} - + # end $howmuch events. cleanup {if [llength [after info]] {error "unexpected: [llength [after info]] events are still there."}} }] @@ -149,7 +149,7 @@ proc test-long {{reptime 1000}} { {time {after idle {after 30}} 10; after 1 {set important 1}; vwait important;} cleanup {foreach i [after info] {after cancel $i}} # in-between important event (of new generation) by amount of idle events: - {time {after idle {after 30}} 10; after 1 {after 0 {set important 1}}; vwait important;} + {time {after idle {after 30}} 10; after 1 {after 0 {set important 1}}; vwait important;} cleanup {foreach i [after info] {after cancel $i}} } } diff --git a/tests/util.test b/tests/util.test index a4cb8c5..2b2ceb2 100644 --- a/tests/util.test +++ b/tests/util.test @@ -4130,7 +4130,7 @@ test util-18.12 {Tcl_ObjPrintf} {testprint} { } {65537 65537} if {[catch {set ::tcl_precision $saved_precision}]} { - unset ::tcl_precision + unset ::tcl_precision } # cleanup |