diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | library/http/http.tcl | 8 | ||||
-rw-r--r-- | library/http1.0/http.tcl | 8 | ||||
-rw-r--r-- | library/msgcat/msgcat.tcl | 26 | ||||
-rw-r--r-- | library/opt/optparse.tcl | 20 | ||||
-rw-r--r-- | library/platform/platform.tcl | 2 | ||||
-rwxr-xr-x | tools/tclZIC.tcl | 12 | ||||
-rwxr-xr-x | tools/tcltk-man2html.tcl | 10 | ||||
-rw-r--r-- | tools/tsdPerf.c | 10 |
9 files changed, 57 insertions, 49 deletions
@@ -1,10 +1,18 @@ 2009-11-18 Jan Nijtmans <nijtmans@users.sf.net> - * library/auto.tcl Eliminate "then" keyword + * library/auto.tcl Eliminate "then" keyword * library/clock.tcl * library/history.tcl * library/safe.tcl * library/tm.tcl + * library/http/http.tcl Eliminate unneccessary spaces + * library/http1.0/http.tcl + * library/msgcat/msgcat.tcl + * library/opt/optparse.tcl + * library/platform/platform.tcl + * tools/tcltk-man2html.tcl + * tools/tclZIC.tcl + * tools/tsdPerf.c 2009-11-17 Andreas Kupries <andreask@activestate.com> diff --git a/library/http/http.tcl b/library/http/http.tcl index 6ec2a54..e02ec3f 100644 --- a/library/http/http.tcl +++ b/library/http/http.tcl @@ -8,7 +8,7 @@ # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: http.tcl,v 1.78 2009/11/11 06:49:05 nijtmans Exp $ +# RCS: @(#) $Id: http.tcl,v 1.79 2009/11/18 21:45:38 nijtmans Exp $ package require Tcl 8.6 # Keep this in sync with pkgIndex.tcl and with the install directories in @@ -1283,18 +1283,18 @@ proc http::Eof {token {force 0}} { Log "error doing $coding '$state(body)'" return [Finish $token $err] } - + if {!$state(binary)} { # If we are getting text, set the incoming channel's encoding # correctly. iso8859-1 is the RFC default, but this could be any IANA # charset. However, we only know how to convert what we have # encodings for. - + set enc [CharsetToEncoding $state(charset)] if {$enc ne "binary"} { set state(body) [encoding convertfrom $enc $state(body)] } - + # Translate text line endings. set state(body) [string map {\r\n \n \r \n} $state(body)] } diff --git a/library/http1.0/http.tcl b/library/http1.0/http.tcl index 2c548bb..99efe6b 100644 --- a/library/http1.0/http.tcl +++ b/library/http1.0/http.tcl @@ -5,7 +5,7 @@ # These procedures use a callback interface to avoid using vwait, # which is not defined in the safe base. # -# RCS: @(#) $Id: http.tcl,v 1.4 2000/02/01 11:48:30 hobbs Exp $ +# RCS: @(#) $Id: http.tcl,v 1.5 2009/11/18 21:45:38 nijtmans Exp $ # # See the http.n man page for documentation @@ -341,12 +341,12 @@ proc http_formatQuery {args} { # 2 Convert every other character to an array lookup # 3 Escape constructs that are "special" to the tcl parser # 4 "subst" the result, doing all the array substitutions - + proc httpMapReply {string} { global httpFormMap set alphanumeric a-zA-Z0-9 if {![info exists httpFormMap]} { - + for {set i 1} {$i <= 256} {incr i} { set c [format %c $i] if {![string match \[$alphanumeric\] $c]} { @@ -365,7 +365,7 @@ proc http_formatQuery {args} { return [subst $string] } -# Default proxy filter. +# Default proxy filter. proc httpProxyRequired {host} { global http if {[info exists http(-proxyhost)] && [string length $http(-proxyhost)]} { diff --git a/library/msgcat/msgcat.tcl b/library/msgcat/msgcat.tcl index ccf4054..660d435 100644 --- a/library/msgcat/msgcat.tcl +++ b/library/msgcat/msgcat.tcl @@ -9,8 +9,8 @@ # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# RCS: @(#) $Id: msgcat.tcl,v 1.26 2006/11/03 00:34:52 hobbs Exp $ +# +# RCS: @(#) $Id: msgcat.tcl,v 1.27 2009/11/18 21:45:36 nijtmans Exp $ package require Tcl 8.5 # When the version number changes, be sure to update the pkgIndex.tcl file, @@ -177,7 +177,7 @@ namespace eval msgcat { # args Args to pass to the format command # # Results: -# Returns the translated string. Propagates errors thrown by the +# Returns the translated string. Propagates errors thrown by the # format command. proc msgcat::mc {src args} { @@ -189,7 +189,7 @@ proc msgcat::mc {src args} { variable Locale set ns [uplevel 1 [list ::namespace current]] - + while {$ns != ""} { foreach loc $Loclist { if {[dict exists $Msgs $loc $ns $src]} { @@ -312,12 +312,12 @@ proc msgcat::mcset {locale src {dest ""}} { } set ns [uplevel 1 [list ::namespace current]] - + set locale [string tolower $locale] - + # create nested dictionaries if they do not exist if {![dict exists $Msgs $locale]} { - dict set Msgs $locale [dict create] + dict set Msgs $locale [dict create] } if {![dict exists $Msgs $locale $ns]} { dict set Msgs $locale $ns [dict create] @@ -345,17 +345,17 @@ proc msgcat::mcmset {locale pairs } { return -code error "bad translation list:\ should be \"[lindex [info level 0] 0] locale {src dest ...}\"" } - + set locale [string tolower $locale] set ns [uplevel 1 [list ::namespace current]] # create nested dictionaries if they do not exist if {![dict exists $Msgs $locale]} { - dict set Msgs $locale [dict create] + dict set Msgs $locale [dict create] } if {![dict exists $Msgs $locale $ns]} { dict set Msgs $locale $ns [dict create] - } + } foreach {src dest} $pairs { dict set Msgs $locale $ns $src $dest } @@ -368,7 +368,7 @@ proc msgcat::mcmset {locale pairs } { # This routine is called by msgcat::mc if a translation cannot # be found for a string. This routine is intended to be replaced # by an application specific routine for error reporting -# purposes. The default behavior is to return the source string. +# purposes. The default behavior is to return the source string. # If additional args are specified, the format command will be used # to work them into the traslated string. # @@ -390,7 +390,7 @@ proc msgcat::mcunknown {locale src args} { # msgcat::mcmax -- # -# Calculates the maximum length of the translated strings of the given +# Calculates the maximum length of the translated strings of the given # list. # # Arguments: @@ -475,7 +475,7 @@ proc msgcat::Init {} { } # # On Windows, try to set locale depending on registry settings, - # or fall back on locale of "C". + # or fall back on locale of "C". # set key {HKEY_CURRENT_USER\Control Panel\International} if {[catch {package require registry}] \ diff --git a/library/opt/optparse.tcl b/library/opt/optparse.tcl index 4622bde..67f3cc1 100644 --- a/library/opt/optparse.tcl +++ b/library/opt/optparse.tcl @@ -8,7 +8,7 @@ # on it. If your code does rely on this package you # may directly incorporate this code into your application. # -# RCS: @(#) $Id: optparse.tcl,v 1.10 2003/09/10 20:27:30 dgp Exp $ +# RCS: @(#) $Id: optparse.tcl,v 1.11 2009/11/18 21:45:37 nijtmans Exp $ package require Tcl 8.2 # When this version number changes, update the pkgIndex.tcl file @@ -35,7 +35,7 @@ namespace eval ::tcl { # Every OptProc give usage information on "procname -help". # Try "tcl::OptParseTest -help" and "tcl::OptParseTest -a" and # then other arguments. - # + # # example of 'valid' call: # ::tcl::OptParseTest save -4 -pr 23 -libsok SybTcl\ # -nostatics false ch1 @@ -86,8 +86,8 @@ namespace eval ::tcl { # # The general structure of a "program" is # notation (pseudo bnf like) -# name :== definition defines "name" as being "definition" -# { x y z } means list of x, y, and z +# name :== definition defines "name" as being "definition" +# { x y z } means list of x, y, and z # x* means x repeated 0 or more time # x+ means "x x*" # x? means optionally x @@ -112,7 +112,7 @@ namespace eval ::tcl { # # And for this application: # -# singleStep :== { instruction varname {hasBeenSet currentValue} type +# singleStep :== { instruction varname {hasBeenSet currentValue} type # typeArgs help } # instruction :== "flags" | "value" # type :== knowType | anyword @@ -345,7 +345,7 @@ proc ::tcl::OptProcArgGiven {argname} { proc OptState {item} { lindex $item 0 } - + # current state proc OptCurState {descriptions} { OptState [OptCurDesc $descriptions]; @@ -537,7 +537,7 @@ proc ::tcl::OptKeyParse {descKey arglist} { if {![Lempty $arglist]} { return -code error [OptTooManyArgs $desc $arglist]; } - + # Analyse the result # Walk through the tree: OptTreeVars $desc "#[expr {[info level]-1}]" ; @@ -783,7 +783,7 @@ proc ::tcl::OptCheckType {arg type {typeArgs ""}} { 3 { # varname type value # varname value comment - + if {[regexp {^-(.+)$} $arg1 x type]} { # flags/optValue as they are optional, need a "value", # on the contrary, for a variable (non optional), @@ -921,7 +921,7 @@ proc ::tcl::OptError {prefix desc {header 0}} { set desc [concat $h $desc] } OptLengths $desc nl tl dl - # actually output + # actually output return "$prefix[OptTree $desc $nl $tl $dl]" } @@ -954,7 +954,7 @@ proc ::tcl::Lget {list indexLst} { # it would be even slower... needs to be written in C !) # (nb: there is a non trivial recursive problem with indexes 0, # which appear because there is no difference between a list -# of 1 element and 1 element alone : [list "a"] == "a" while +# of 1 element and 1 element alone : [list "a"] == "a" while # it should be {a} and [listp a] should be 0 while [listp {a b}] would be 1 # and [listp "a b"] maybe 0. listp does not exist either...) proc ::tcl::Lvarset {listName indexLst newValue} { diff --git a/library/platform/platform.tcl b/library/platform/platform.tcl index 1a454cd..1e47f5d 100644 --- a/library/platform/platform.tcl +++ b/library/platform/platform.tcl @@ -254,7 +254,7 @@ proc ::platform::patterns {id} { } } macosx*-* { - # 10.5+ + # 10.5+ if {[regexp {macosx([^-]*)-(.*)} $id -> v cpu]} { if {$v ne ""} { foreach {major minor} [split $v .] break diff --git a/tools/tclZIC.tcl b/tools/tclZIC.tcl index 8355a8a..d66f5e4 100755 --- a/tools/tclZIC.tcl +++ b/tools/tclZIC.tcl @@ -29,7 +29,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: tclZIC.tcl,v 1.10 2009/04/09 20:07:18 kennykb Exp $ +# RCS: @(#) $Id: tclZIC.tcl,v 1.11 2009/11/18 21:45:36 nijtmans Exp $ # #---------------------------------------------------------------------- @@ -361,7 +361,7 @@ proc parseON {on} { # third possibility - lastWeekday - field 5 last([[:alpha:]]+) )$ - } $on -> dom1 wday2 dir2 num2 wday3]} then { + } $on -> dom1 wday2 dir2 num2 wday3]} { error "can't parse ON field \"$on\"" } if {$dom1 ne ""} { @@ -509,7 +509,7 @@ proc parseTOD {tod} { (?: ([wsugz]) # field 4 - type indicator )? - } $tod -> hour minute second ind]} then { + } $tod -> hour minute second ind]} { puts stderr "$fileName:$lno:can't parse time field \"$tod\"" incr errorCount } @@ -558,7 +558,7 @@ proc parseOffsetTime {offset} { :([[:digit:]]{2}) # field 4 - second )? )? - } $offset -> signum hour minute second]} then { + } $offset -> signum hour minute second]} { puts stderr "$fileName:$lno:can't parse offset time \"$offset\"" incr errorCount } @@ -940,7 +940,7 @@ proc applyRules {ruleSet year startSecs stdGMTOffset DSTOffset nextGMTOffset if { $earliestSecs > $startSecs && ($until eq "" || $earliestSecs < $untilSecs) - } then { + } { # Test if the initial transition has been done. # If not, do it now. @@ -989,7 +989,7 @@ proc applyRules {ruleSet year startSecs stdGMTOffset DSTOffset nextGMTOffset set date [::tcl::clock::GetJulianDayFromEraYearMonthDay \ [dict create era CE year $year month 1 dayOfMonth 1] 2361222] set startSecs [expr { - [dict get $date julianDay] * wide(86400) - 210866803200 + [dict get $date julianDay] * wide(86400) - 210866803200 - $stdGMTOffset - $DSTOffset }] diff --git a/tools/tcltk-man2html.tcl b/tools/tcltk-man2html.tcl index 23b0d30..4b669ad 100755 --- a/tools/tcltk-man2html.tcl +++ b/tools/tcltk-man2html.tcl @@ -392,7 +392,7 @@ proc process-text {text} { {\1\\fI\2\3} ntext] || [regsub {^([^\\]*)\\fR([^\\]*)\\fR(.*)$} $text \ {\1\\fR\2\3} ntext] - } then { + } { manerror "impotent font change: $text" set text $ntext continue @@ -1164,7 +1164,7 @@ proc output-directive {line} { [next-op-is .nf rest] || [next-op-is .br rest] || [next-op-is .fi rest] - } then { + } { continue } if { @@ -1172,7 +1172,7 @@ proc output-directive {line} { || [next-op-is .SS rest] || [next-op-is .BE rest] || [next-op-is .SO rest] - } then { + } { backup-text 1 break } @@ -1432,7 +1432,7 @@ proc output-directive {line} { } ## ## merge copyright listings -## +## proc merge-copyrights {l1 l2} { set merge {} set re1 {^Copyright +(?:\(c\)|\\\(co|©) +(\w.*?)(?:all rights reserved)?(?:\. )*$} @@ -1912,7 +1912,7 @@ proc make-man-pages {html args} { CrtPhImgFmt DoOneEvent GetBitmap GetColor GetCursor GetDash GetJustify GetPixels GetVisual ParseArgv QueueEvent } - } then { + } { foreach item $toc { puts $outfd $item } diff --git a/tools/tsdPerf.c b/tools/tsdPerf.c index a6a84df..9399b3b 100644 --- a/tools/tsdPerf.c +++ b/tools/tsdPerf.c @@ -3,7 +3,7 @@ static Tcl_ThreadDataKey key; typedef struct { - int value; + int value; } TsdPerf; @@ -20,16 +20,16 @@ tsdPerfSetObjCmd(ClientData cdata, Tcl_Interp *interp, int objc, Tcl_Obj *const if (TCL_OK != Tcl_GetIntFromObj(interp, objv[1], &i)) { return TCL_ERROR; } - + perf->value = i; - + return TCL_OK; } int tsdPerfGetObjCmd(ClientData cdata, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { TsdPerf *perf = Tcl_GetThreadData(&key, sizeof(TsdPerf)); - + Tcl_SetObjResult(interp, Tcl_NewIntObj(perf->value)); return TCL_OK; @@ -41,7 +41,7 @@ Tsdperf_Init (Tcl_Interp *interp) { if (NULL == Tcl_InitStubs(interp, TCL_VERSION, 0)) { return TCL_ERROR; } - + Tcl_CreateObjCommand(interp, "tsdPerfSet", tsdPerfSetObjCmd, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); |