1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-29 14:00:49 +03:00

0023947: Eliminate trivial compiler warnings in MSVC++ with warning level 4

Fix first subset of warnings (about 100)
- while(1) and similar constructs replaced by for(;;)
- some uninitialized variables corrected
Got rid of Warning C4189: local variable is initialised but not referenced
Corrected mistakes after getting rid of C4189 compiler warning
Corrected some mistakes that led to compiling errors
Fixed test case because of improvement message - removed unnecessary TODO.
Small fix: tabs have been replaced with whitespaces.
Added TODO for Windows platform
removed last TODO
Corrected mistakes, returned some #ifdef DEB code, fixed test case .
Restoring a few places which have been modified too much
Small grammar fix
Deleted unnecessary puts in bugs/end
This commit is contained in:
omy
2013-07-12 12:37:38 +04:00
parent a8195d65ba
commit 302f96fb0d
189 changed files with 455 additions and 1010 deletions

View File

@@ -61,50 +61,50 @@ proc checkpoint {coord_x coord_y rd_ch gr_ch bl_ch} {
set mistake 0
set i 0
while { $mistake != 1 && $i <= 5 } {
set j 0
while { $mistake != 1 && $j <= 5 } {
set position_x [expr ${x_start} + $j]
set position_y [expr ${y_start} + $i]
puts $position_x
puts $position_y
global color2d
if { [info exists color2d] } {
set color [ QAAISGetPixelColor2d ${position_x} ${position_y} ]
} else {
set color [ QAGetPixelColor ${position_x} ${position_y} ]
}
regexp {RED +: +([-0-9.+eE]+)} $color full rd
regexp {GREEN +: +([-0-9.+eE]+)} $color full gr
regexp {BLUE +: +([-0-9.+eE]+)} $color full bl
set rd_int [expr int($rd * 1.e+05)]
set gr_int [expr int($gr * 1.e+05)]
set bl_int [expr int($bl * 1.e+05)]
if { $rd_ch != 0 } {
set tol_rd [expr abs($rd_ch - $rd_int)/$rd_ch]
} else {
set tol_rd $rd_int
}
if { $gr_ch != 0 } {
set tol_gr [expr abs($gr_ch - $gr_int)/$gr_ch]
} else {
set tol_gr $gr_int
}
if { $bl_ch != 0 } {
set tol_bl [expr abs($bl_ch - $bl_int)/$bl_ch]
} else {
set tol_bl $bl_int
}
set j 0
while { $mistake != 1 && $j <= 5 } {
set position_x [expr ${x_start} + $j]
set position_y [expr ${y_start} + $i]
puts $position_x
puts $position_y
global color2d
if { [info exists color2d] } {
set color [ QAAISGetPixelColor2d ${position_x} ${position_y} ]
} else {
set color [ QAGetPixelColor ${position_x} ${position_y} ]
}
regexp {RED +: +([-0-9.+eE]+)} $color full rd
regexp {GREEN +: +([-0-9.+eE]+)} $color full gr
regexp {BLUE +: +([-0-9.+eE]+)} $color full bl
set rd_int [expr int($rd * 1.e+05)]
set gr_int [expr int($gr * 1.e+05)]
set bl_int [expr int($bl * 1.e+05)]
if { $rd_ch != 0 } {
set tol_rd [expr abs($rd_ch - $rd_int)/$rd_ch]
} else {
set tol_rd $rd_int
}
if { $gr_ch != 0 } {
set tol_gr [expr abs($gr_ch - $gr_int)/$gr_ch]
} else {
set tol_gr $gr_int
}
if { $bl_ch != 0 } {
set tol_bl [expr abs($bl_ch - $bl_int)/$bl_ch]
} else {
set tol_bl $bl_int
}
if { $tol_rd > 0.2 || $tol_gr > 0.2 || $tol_bl > 0.2 } {
puts "Warning : Point with true color was not found near default coordinates"
set mistake 0
} else {
set mistake 1
}
incr j
}
incr i
if { $tol_rd > 0.2 || $tol_gr > 0.2 || $tol_bl > 0.2 } {
puts "Warning : Point with true color was not found near default coordinates"
set mistake 0
} else {
set mistake 1
}
incr j
}
incr i
}
return $mistake
}
@@ -118,15 +118,15 @@ proc checkcolor { coord_x coord_y rd_get gr_get bl_get } {
puts "BLUE color of RGB is $bl_get"
if { $coord_x <= 1 || $coord_y <= 1 } {
puts "Error : minimal coordinate is x = 2, y = 2. But we have x = $coord_x y = $coord_y"
return -1
puts "Error : minimal coordinate is x = 2, y = 2. But we have x = $coord_x y = $coord_y"
return -1
}
global color2d
if { [info exists color2d] } {
set color [ QAAISGetPixelColor2d ${coord_x} ${coord_y} ]
} else {
set color [ QAGetPixelColor ${coord_x} ${coord_y} ]
}
if { [info exists color2d] } {
set color [ QAAISGetPixelColor2d ${coord_x} ${coord_y} ]
} else {
set color [ QAGetPixelColor ${coord_x} ${coord_y} ]
}
regexp {RED +: +([-0-9.+eE]+)} $color full rd
regexp {GREEN +: +([-0-9.+eE]+)} $color full gr
@@ -139,51 +139,51 @@ proc checkcolor { coord_x coord_y rd_get gr_get bl_get } {
set bl_ch [expr int($bl_get * 1.e+05)]
if { $rd_ch != 0 } {
set tol_rd [expr abs($rd_ch - $rd_int)/$rd_ch]
set tol_rd [expr abs($rd_ch - $rd_int)/$rd_ch]
} else {
set tol_rd $rd_int
set tol_rd $rd_int
}
if { $gr_ch != 0 } {
set tol_gr [expr abs($gr_ch - $gr_int)/$gr_ch]
set tol_gr [expr abs($gr_ch - $gr_int)/$gr_ch]
} else {
set tol_gr $gr_int
set tol_gr $gr_int
}
if { $bl_ch != 0 } {
set tol_bl [expr abs($bl_ch - $bl_int)/$bl_ch]
set tol_bl [expr abs($bl_ch - $bl_int)/$bl_ch]
} else {
set tol_bl $bl_int
set tol_bl $bl_int
}
set status 0
if { $tol_rd > 0.2 } {
puts "Warning : RED light of additive color model RGB is invalid"
set status 1
puts "Warning : RED light of additive color model RGB is invalid"
set status 1
}
if { $tol_gr > 0.2 } {
puts "Warning : GREEN light of additive color model RGB is invalid"
set status 1
puts "Warning : GREEN light of additive color model RGB is invalid"
set status 1
}
if { $tol_bl > 0.2 } {
puts "Warning : BLUE light of additive color model RGB is invalid"
set status 1
puts "Warning : BLUE light of additive color model RGB is invalid"
set status 1
}
if { $status != 0 } {
puts "Warning : Colors of default coordinate are not equal"
puts "Warning : Colors of default coordinate are not equal"
}
global stat
if { $tol_rd > 0.2 || $tol_gr > 0.2 || $tol_bl > 0.2 } {
set info [checkpoint $coord_x $coord_y $rd_ch $gr_ch $bl_ch]
set stat [lindex $info end]
if { ${stat} != 1 } {
puts "Error : Colors are not equal in default coordinate and in the near coordinates too"
return $stat
} else {
puts "Point with valid color was found"
return $stat
}
set info [checkpoint $coord_x $coord_y $rd_ch $gr_ch $bl_ch]
set stat [lindex $info end]
if { ${stat} != 1 } {
puts "Error : Colors are not equal in default coordinate and in the near coordinates too"
return $stat
} else {
puts "Point with valid color was found"
return $stat
}
} else {
set stat 1
set stat 1
}
}

View File

@@ -2,9 +2,9 @@ if { [info exists square] } {
set prop "square"
set mass $square
if { [info exists tol_square] } {
regexp {Mass +: +([-0-9.+eE]+)} [sprops result $tol_square] full m
regexp {Mass +: +([-0-9.+eE]+)} [sprops result $tol_square] full m
} else {
regexp {Mass +: +([-0-9.+eE]+)} [sprops result] full m
regexp {Mass +: +([-0-9.+eE]+)} [sprops result] full m
}
}
if { [info exists length] } {
@@ -19,34 +19,34 @@ if { [info exists length] } {
#if mass (length or square) is empty in test case then result should be an empty shape.
if { [info exists mass] } {
if { [string compare $subgroup "moddata"] != 0 } {
puts "checkshape"
checkshape result
puts "checkshape"
checkshape result
}
if { [string compare "$mass" "empty"] != 0 } {
if { $m == 0 } {
puts "Error : The command is not valid. The $prop is 0."
}
if { $mass > 0 } {
puts "The expected $prop is $mass"
}
#check of change of square is < 1%
if { ($mass != 0 && [expr 1.*abs($mass - $m)/$mass] > 0.01) || ($mass == 0 && $m != 0) } {
puts "Error : The $prop of result shape is $m"
}
if { $m == 0 } {
puts "Error : The command is not valid. The $prop is 0."
}
if { $mass > 0 } {
puts "The expected $prop is $mass"
}
#check of change of square is < 1%
if { ($mass != 0 && [expr 1.*abs($mass - $m)/$mass] > 0.01) || ($mass == 0 && $m != 0) } {
puts "Error : The $prop of result shape is $m"
}
} else {
if { $m != 0 } {
puts "Error : The command is not valid. The $prop is $m"
}
if { $m != 0 } {
puts "Error : The command is not valid. The $prop is $m"
}
}
}
set glob_inf [info global nb_*_good]
if { [regexp "nb_.*_good" $glob_inf] == 1 } {
if { [info exists nbsh_t] } {
set nb_info [nbshapes result -t]
set nb_info [nbshapes result -t]
} else {
set nb_info [nbshapes result]
set nb_info [nbshapes result]
}
}
@@ -146,18 +146,18 @@ if { [info exists rel_tol] } {
puts "Error : area by triangles differs from the actual area by $rel_err %"
} else {
if { $rel_tol > 1 && $rel_tol < 100 } {
puts "Error: Improvement: The current area difference is $rel_err instead of $rel_tol"
puts "Error: Improvement: The current area difference is $rel_err instead of $rel_tol"
}
}
}
if { [isdraw result] } {
if { [info exists 2dviewer] } {
clear
smallview
donly result
fit
xwd $imagedir/${test_image}.png
clear
smallview
donly result
fit
xwd $imagedir/${test_image}.png
}
if { [info exists 3dviewer] } {
#for multiview support: dump result from all opened views

View File

@@ -1,7 +1,4 @@
puts "TODO OCC12345 ALL: Faulty shapes in variables faulty_1 to faulty_"
puts "TODO OCC12345 ALL: Faulty : mistakes are found in checked shape by checkshape command"
puts "TODO OCC12345 ALL: Error : The square of result shape is"
puts "TODO OCC12345 windows: Faulty shapes in variables faulty_1 to faulty_"
puts "=========="
puts "BUC60462"
@@ -15,12 +12,7 @@ puts "Fuse begin"
bfuse result a b
puts "Fuse end"
set che [checkshape result r]
if { [regexp {OK} $che] != 1 } {
puts "Faulty : mistakes are found in checked shape by checkshape command"
} else {
puts "Checking by checkshape - OK"
}
checkshape result r
set square 0
set square 89562.1
set 2dviewer 0