1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-03 14:10:33 +03:00

0023348: Expression 'ii >= 0' is always true. Unsigned type value is always >= 0.

Redesigned the loop to work correctly with unsigned variables.
Treatment of path to source file is rewritten using OSD_Path for more clarity
Command getsourcefile corrected to return its result as Tcl string, and simplified
Error in treatment of optional arguments in substituted puts is fixed in src/DrawResources/TestCommands.tcl
Test case added: demo draw getsource
This commit is contained in:
Pawel Kowalski
2012-08-03 13:28:27 +04:00
parent 3b4c36f540
commit d33dea30d5
4 changed files with 29 additions and 48 deletions

View File

@@ -96,17 +96,16 @@ proc getsourcefile {{command ""}} {
global Draw_Helps Draw_Groups Draw_Files
set out {}
if {$command == ""} {
# help general
foreach h [lsort [array names Draw_Groups]] {
puts ""
puts ""
puts $h
lappend out "" "" "$h"
set i 0
foreach f [lsort $Draw_Groups($h)] {
if {$i == 0} {
puts " "
lappend out ""
}
incr i
#
@@ -114,18 +113,7 @@ proc getsourcefile {{command ""}} {
#
foreach command_that_has_file [array names Draw_Files] {
if {($command_that_has_file == $f)} {
#
# compute the length of the string to have the right spacing
# with tabs
#
set ll [string length $f]
if {($ll >= 1) && ($ll < 8)} {
puts "$f\t\t: $Draw_Files($f) "
}
if {($ll >= 8)} {
puts "$f\t: $Draw_Files($f) "
}
lappend out [format {%-20s %s} $f $Draw_Files($f)]
}
}
}
@@ -136,17 +124,12 @@ proc getsourcefile {{command ""}} {
append command "*"
foreach f [lsort [array names Draw_Files]] {
if {[string match $command $f]} {
puts -nonewline $f
for {set j [string length $f]} {$j < 15} {incr j} {
puts -nonewline " "
}
puts " $Draw_Files($f)"
lappend out [format {%-20s %s} $f $Draw_Files($f)]
}
}
}
flush stdout
return [join $out "\n"]
}
help getsourcefile {getsourcefile, or getsourcefile command } {DRAW General Commands}

View File

@@ -496,8 +496,8 @@ proc _run_test {scriptsdir group gridname casefile} {
# log only output to stdout and stderr, not to file!
if {[llength $args] > 1} {
set optvarg [lindex $args end-1]
if { $optarg == stdout || $optarg == stderr || $optarg == -newline } {
set optarg [lindex $args end-1]
if { $optarg == "stdout" || $optarg == "stderr" || $optarg == "-newline" } {
dlog add [lindex $args end]
}
} else {