Index: openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl,v diff -u -N -r1.27 -r1.27.8.1 --- openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl 7 Feb 2009 20:32:54 -0000 1.27 +++ openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl 5 Sep 2013 11:50:59 -0000 1.27.8.1 @@ -951,7 +951,7 @@ while {$curchar != "\$" && $curchar != "\[" && ($curchar ne "\{" || !$found_regexp)} { if {$curchar eq "\{"} {set found_regexp 1} - if {[string match "-start" [string range $data $i [expr {$i+5}]]]} { + if {[string range $data $i $i+5] eq "-start"} { incr i [length_exp [string range $data $i end]] ;# -start incr i [length_exp [string range $data $i end]] ;# spaces incr i [length_exp [string range $data $i end]] ;# expression - it could be a var Index: openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl,v diff -u -N -r1.87.4.1 -r1.87.4.2 --- openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl 25 Aug 2013 20:04:46 -0000 1.87.4.1 +++ openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl 5 Sep 2013 11:50:59 -0000 1.87.4.2 @@ -64,7 +64,7 @@ # set user_agent [string tolower [ns_set get [ns_conn headers] User-Agent]] # ns_log notice "URL have url, len=[string length $return_url] $user_agent" - if {[expr {[string length $return_url] > 2083}]} { + if {[string length $return_url] > 2083} { set message "Your login expired and the computed URL for automated continuation is too long. " append message "If you were editing a from, please use the back button after logging in and resubmit the form." set return_url [ad_get_login_url] Index: openacs-4/packages/acs-bootstrap-installer/tcl/00-proc-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/tcl/00-proc-procs.tcl,v diff -u -N -r1.41.2.3 -r1.41.2.4 --- openacs-4/packages/acs-bootstrap-installer/tcl/00-proc-procs.tcl 25 Aug 2013 19:54:34 -0000 1.41.2.3 +++ openacs-4/packages/acs-bootstrap-installer/tcl/00-proc-procs.tcl 5 Sep 2013 11:50:59 -0000 1.41.2.4 @@ -38,8 +38,8 @@ proc ad_make_relative_path { path } { set root_length [string length [acs_root_dir]] - if { ![string compare [acs_root_dir] [string range $path 0 [expr { $root_length - 1 }]]] } { - return [string range $path [expr { $root_length + 1 }] [string length $path]] + if { ![string compare [acs_root_dir] [string range $path 0 $root_length-1]] } { + return [string range $path $root_length+1 [string length $path]] } error "$path is not under the path root ([acs_root_dir])" } @@ -403,8 +403,8 @@ set root_dir [nsv_get acs_properties root_directory] set script [info script] set root_length [string length $root_dir] - if { ![string compare $root_dir [string range $script 0 [expr { $root_length - 1 }]]] } { - set script [string range $script [expr { $root_length + 1 }] end] + if { ![string compare $root_dir [string range $script 0 $root_length-1]] } { + set script [string range $script $root_length+1 end] } set doc_elements(script) $script Index: openacs-4/packages/acs-bootstrap-installer/tcl/40-db-query-dispatcher-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/tcl/40-db-query-dispatcher-procs.tcl,v diff -u -N -r1.42.2.1 -r1.42.2.2 --- openacs-4/packages/acs-bootstrap-installer/tcl/40-db-query-dispatcher-procs.tcl 27 Aug 2013 11:01:48 -0000 1.42.2.1 +++ openacs-4/packages/acs-bootstrap-installer/tcl/40-db-query-dispatcher-procs.tcl 5 Sep 2013 11:50:59 -0000 1.42.2.2 @@ -802,7 +802,7 @@ set root_path_length [string length $root_path] # Check if the path starts with the root - if {[string range $path 0 [expr {$root_path_length - 1}]] == $root_path} { + if {[string range $path 0 $root_path_length-1] eq $root_path} { return 0 } else { return 1 Index: openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs.tcl,v diff -u -N -r1.42 -r1.42.6.1 --- openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs.tcl 9 Nov 2008 23:29:22 -0000 1.42 +++ openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs.tcl 5 Sep 2013 11:50:59 -0000 1.42.6.1 @@ -485,7 +485,7 @@ set old_item_type $item_type - if {[expr $flip % 2] == 0} { + if {$flip % 2 == 0} { set z_class odd } else { set z_class even Index: openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl,v diff -u -N -r1.86.2.2 -r1.86.2.3 --- openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl 3 Sep 2013 19:35:59 -0000 1.86.2.2 +++ openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl 5 Sep 2013 11:50:59 -0000 1.86.2.3 @@ -848,7 +848,7 @@ } { foreach {quote_start_idx quote_end_idx} [db_get_quote_indices $sql] { - if { [expr {$bind_start_idx > $quote_start_idx}] && [expr {$bind_end_idx < $quote_end_idx}]} { + if { $bind_start_idx > $quote_start_idx && $bind_end_idx < $quote_end_idx } { return 1 } } @@ -1063,7 +1063,7 @@ # JCD: we log the clicks, dbname, query time, and statement to catch long running queries. # If we took more than 5 seconds yack about it. - if { [expr {[clock clicks -milliseconds] - $start_time}] > 5000} { + if { [clock clicks -milliseconds] - $start_time > 5000 } { ns_log Warning "db_exec: longdb [expr {[clock seconds] - $start_time_fine}] seconds $db $type $statement_name" } else { ns_log Debug "db_exec: timing [expr {[clock seconds] - $start_time_fine}] seconds $db $type $statement_name" @@ -2437,12 +2437,12 @@ } set first_colon_pos [string first ":" $datasource] - if { $first_colon_pos == $last_colon_pos || [expr {$last_colon_pos - $first_colon_pos}] == 1 } { + if { $first_colon_pos == $last_colon_pos || ($last_colon_pos - $first_colon_pos) == 1 } { # No port specified return "" } - return [string range $datasource [expr {$first_colon_pos + 1}] [expr {$last_colon_pos - 1}] ] + return [string range $datasource $first_colon_pos+1 $last_colon_pos-1] } Index: openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl,v diff -u -N -r1.108.2.1 -r1.108.2.2 --- openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl 27 Aug 2013 11:01:48 -0000 1.108.2.1 +++ openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl 5 Sep 2013 11:51:00 -0000 1.108.2.2 @@ -1986,7 +1986,7 @@ @author Lars Pind } { - if { [expr {[llength $spec] % 3}] != 0 } { + if { [llength $spec] % 3 != 0 } { error "The length of spec should be dividable by 3" } @@ -2396,7 +2396,7 @@ if { $maturity ne "" } { if { ![regexp {^-?[0-9]+$} $maturity] } { set error_message "Maturity must be integer" - } elseif { [expr {$maturity < -1 || $maturity > 3}] } { + } elseif { $maturity < -1 || $maturity > 3 } { set error_message "Maturity must be integer between -1 and 3" } } Index: openacs-4/packages/acs-tcl/tcl/apm-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-procs.tcl,v diff -u -N -r1.94.2.1 -r1.94.2.2 --- openacs-4/packages/acs-tcl/tcl/apm-procs.tcl 27 Aug 2013 11:01:48 -0000 1.94.2.1 +++ openacs-4/packages/acs-tcl/tcl/apm-procs.tcl 5 Sep 2013 11:51:00 -0000 1.94.2.2 @@ -689,7 +689,7 @@ # !( 1 ^ 0 ) = Nope # !( 1 ^ 1 ) = Yep # - if {![expr {$test_queries_p ^ $is_test_file_p}] && + if {!($test_queries_p ^ $is_test_file_p) && $file_type eq "query_file" && ($file_db_type eq "" || $file_db_type eq [db_type])} { db_qd_load_query_file $file Index: openacs-4/packages/acs-tcl/tcl/tcl-documentation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/tcl-documentation-procs.tcl,v diff -u -N -r1.30.2.1 -r1.30.2.2 --- openacs-4/packages/acs-tcl/tcl/tcl-documentation-procs.tcl 27 Aug 2013 11:01:49 -0000 1.30.2.1 +++ openacs-4/packages/acs-tcl/tcl/tcl-documentation-procs.tcl 5 Sep 2013 11:51:00 -0000 1.30.2.2 @@ -629,7 +629,7 @@ return -code error "Missing or misplaced end parenthesis for flag '$flag' on argument '$name'" } set flag_parameters [string range $flag [expr {$left_paren + 1}] [expr {[string length $flag]-2}]] - set flag [string range $flag 0 [expr {$left_paren - 1}]] + set flag [string range $flag 0 $left_paren-1] lappend flag_list $flag foreach flag_parameter [split $flag_parameters "|"] { @@ -715,8 +715,8 @@ set root_dir [nsv_get acs_properties root_directory] set script [info script] set root_length [string length $root_dir] - if { ![string compare $root_dir [string range $script 0 [expr { $root_length - 1 }]]] } { - set script [string range $script [expr { $root_length + 1 }] end] + if { ![string compare $root_dir [string range $script 0 $root_length-1 ]] } { + set script [string range $script $root_length+1 end] } error [array get doc_elements] "ad_page_contract documentation" Index: openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl,v diff -u -N -r1.65.6.2 -r1.65.6.3 --- openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 27 Aug 2013 17:05:58 -0000 1.65.6.2 +++ openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 5 Sep 2013 11:51:00 -0000 1.65.6.3 @@ -404,20 +404,20 @@ if { ! $discard } { # figure out if we can break with the pretag chunk if { $break_soft } { - if {! $nobr && [expr {[string length $pretag] + $out_len}] > $break_soft } { + if {! $nobr && [string length $pretag] + $out_len > $break_soft } { # first chop pretag to the right length set pretag [string range $pretag 0 [expr {$break_soft - $out_len - [string length $ellipsis]}]] # clip the last word regsub "\[^ \t\n\r]*$" $pretag {} pretag append out [string range $pretag 0 $break_soft] set broken_p 1 break - } elseif { $nobr && [expr {[string length $pretag] + $out_len}] > $break_hard } { + } elseif { $nobr && [string length $pretag] + $out_len > $break_hard } { # we are in a nonbreaking tag and are past the hard break # so chop back to the point we got the nobr tag... set tagptr $nobr_tagptr if { $nobr_out_point > 0 } { - set out [string range $out 0 [expr {$nobr_out_point - 1}]] + set out [string range $out 0 $nobr_out_point-1] } else { # here maybe we should decide if we should keep the tag anyway # if zero length result would be the result... @@ -649,7 +649,7 @@ if { [incr count] > 1000 } { error "There appears to be a programming bug in ad_parse_html_attributes_upvar: We've entered an infinite loop. We are here: \noffset $i: [string range $html $i [expr {$i + 60}]]" } - if { [string equal [string range $html $i [expr { $i + 1 }]] "/>"] } { + if { [string range $html $i $i+1] eq "/>" } { # This is an XML-style tag ending: <... /> break } @@ -857,16 +857,16 @@ # - alpha or # - a slash, and then alpha # Otherwise, it's probably just a lone < character - if { $i >= [expr {$length-1}] || \ - (![string is alpha [string index $html [expr {$i + 1}]]] && \ - [string index $html [expr {$i + 1}]] ne "!" && \ - (![string equal "/" [string index $html [expr {$i + 1}]]] || \ - ![string is alpha [string index $html [expr {$i + 2}]]])) } { + if { $i >= $length - 1 || \ + (![string is alpha [string index $html $i+1]] && \ + [string index $html $i+1] ne "!" && \ + ("/" ne [string index $html $i+1] || \ + ![string is alpha [string index $html $i+2]])) } { # Output the < and continue with next character ad_html_to_text_put_text output "<" set last_tag_end [incr i] continue - } elseif {[string match "!--*" [string range $html [expr {$i + 1}] end]]} { + } elseif {[string match "!--*" [string range $html $i+1 end]]} { # handle HTML comments, I can't beleive noone noticed this before. # this code maybe not be elegant but it works @@ -1215,7 +1215,7 @@ } } default { - if { [expr {$output(linelen) + $wordlen}] > $output(maxlen) && $output(maxlen) != 0 } { + if { $output(linelen) + $wordlen > $output(maxlen) && $output(maxlen) != 0 } { ad_html_to_text_put_newline output } append output(text) "$word" @@ -1353,7 +1353,7 @@ set start_of_line_index [expr {$start_of_line_index + $first_new_line_pos + 1}] continue } - if { [expr {$start_of_line_index + $threshold + 1}] >= [string length $input] } { + if { $start_of_line_index + $threshold + 1 >= [string length $input] } { # we're on the last line and it is < threshold so just return it lappend result_rows $this_line return [join $result_rows "\n"] @@ -1692,7 +1692,7 @@ set end_index [expr $len-[string length $ellipsis]-1] # Back up to the nearest whitespace - if { ![string is space [string index $string [expr {$end_index + 1}]]] } { + if { ![string is space [string index $string $end_index+1]] } { while { $end_index >= 0 && ![string is space [string index $string $end_index]] } { incr end_index -1 } Index: openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl,v diff -u -N -r1.133.2.3 -r1.133.2.4 --- openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 3 Sep 2013 08:07:24 -0000 1.133.2.3 +++ openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 5 Sep 2013 11:51:00 -0000 1.133.2.4 @@ -4053,7 +4053,7 @@ #
 } {
-    if { [catch {expr 1.0 * $value}] } {
+    if { [catch {expr {1.0 * $value}}] } {
         return 0
     } else {
         return 1
@@ -4224,7 +4224,7 @@
 } {
     set output {}
     foreach { elm val } $list {
-        if { [llength $val] > 1 && [expr {[llength $val] % 2}] == 0  } {
+        if { [llength $val] > 1 && [llength $val] % 2 == 0  } {
             append output [string repeat " " $indent] "$elm \{" \n
 
             append output [util::array_list_spec_pretty $val [expr {$indent + 4}]]
@@ -4307,10 +4307,10 @@
         set age_seconds 60
     }
 
-   if { $age_seconds < [expr {$hours_limit * 60 * 60}] } {
+   if { $age_seconds < $hours_limit * 60 * 60 } {
         set hours [expr {abs($age_seconds / 3600)}]
         set minutes [expr {round(($age_seconds% 3600)/60.0)}]
-        if {[expr {$hours < 24}]} {
+        if {$hours < 24} {
             switch $hours {
                 0 { set result "" }
                 1 { set result "One hour " }
@@ -4330,7 +4330,7 @@
         }
 
         append result "ago"
-    } elseif { $age_seconds < [expr {$days_limit * 60 * 60 * 24}] } {
+    } elseif { $age_seconds < $days_limit * 60 * 60 * 24 } {
         set result [lc_time_fmt $timestamp_ansi $mode_2_fmt $locale]
     } else {
         set result [lc_time_fmt $timestamp_ansi $mode_3_fmt $locale]
Index: openacs-4/packages/acs-tcl/tcl/widgets-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/widgets-procs.tcl,v
diff -u -N -r1.17 -r1.17.2.1
--- openacs-4/packages/acs-tcl/tcl/widgets-procs.tcl	20 May 2011 08:26:58 -0000	1.17
+++ openacs-4/packages/acs-tcl/tcl/widgets-procs.tcl	5 Sep 2013 11:51:00 -0000	1.17.2.1
@@ -162,7 +162,7 @@
     # take care of cases like 09 for month
     regsub "^0" $month "" month
     for {set i 0} {$i < 12} {incr i} {
-	if { $month ne "" && $i == [expr {$month - 1}] } {
+	if { $month ne "" && $i == $month - 1 } {
 	    append output "\n"
 	} else {
 	    append output "\n"
Index: openacs-4/packages/acs-tcl/tcl/xml-1-dom-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/xml-1-dom-procs.tcl,v
diff -u -N -r1.3 -r1.3.10.1
--- openacs-4/packages/acs-tcl/tcl/xml-1-dom-procs.tcl	10 Jan 2007 21:22:12 -0000	1.3
+++ openacs-4/packages/acs-tcl/tcl/xml-1-dom-procs.tcl	5 Sep 2013 11:51:00 -0000	1.3.10.1
@@ -394,7 +394,7 @@
 	configure {
 	    if {[llength $args] == 1} {
 		return [document cget $token [lindex $args 0]]
-	    } elseif {[expr {[llength $args] % 2}]} {
+	    } elseif {[llength $args] % 2} {
 		return -code error "no value specified for option \"[lindex $args end]\""
 	    } else {
 		foreach {option value} $args {
@@ -866,7 +866,7 @@
 
 	    if {[llength $args] == 1} {
 		return [document cget $token [lindex $args 0]]
-	    } elseif {[expr {[llength $args] % 2}]} {
+	    } elseif {[llength $args] % 2} {
 		return -code error "no value specified for option \"[lindex $args end]\""
 	    } else {
 		foreach {option value} $args {
@@ -1204,7 +1204,7 @@
 	configure {
 	    if {[llength $args] == 1} {
 		return [document cget $token [lindex $args 0]]
-	    } elseif {[expr {[llength $args] % 2}]} {
+	    } elseif {[llength $args] % 2} {
 		return -code error "no value specified for option \"[lindex $args end]\""
 	    } else {
 		foreach {option value} $args {
@@ -1438,7 +1438,7 @@
 	configure {
 	    if {[llength $args] == 1} {
 		return [document cget $token [lindex $args 0]]
-	    } elseif {[expr {[llength $args] % 2}]} {
+	    } elseif {[llength $args] % 2} {
 		return -code error "no value specified for option \"[lindex $args end]\""
 	    } else {
 		foreach {option value} $args {
Index: openacs-4/packages/categories/tcl/category-trees-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/categories/tcl/category-trees-procs.tcl,v
diff -u -N -r1.25 -r1.25.4.1
--- openacs-4/packages/categories/tcl/category-trees-procs.tcl	21 Dec 2008 18:05:35 -0000	1.25
+++ openacs-4/packages/categories/tcl/category-trees-procs.tcl	5 Sep 2013 11:51:00 -0000	1.25.4.1
@@ -360,7 +360,7 @@
             }
             set tree_id_old $tree_id
             lappend tree [list $category_id [ad_decode "$invalid_p$deprecated_p" "" f t] $cur_level]
-            if { [expr {$right_ind - $left_ind}] > 1} {
+            if { $right_ind - $left_ind > 1} {
                 incr cur_level 1
                 set invalid_p "$invalid_p$deprecated_p"
                 set stack [linsert $stack 0 [list $right_ind $invalid_p]]