Closed GoogleCodeExporter closed 9 years ago
Hi, in both of these cases it is impossible to reach the use of uninitialized
variables.
In the first case, the code on line 414 will never be reached unless earfound
has been set to true previously, i.e.
earfound = false;
...
if(!earfound) {
earfound = true;
...
} else {
if(vertices[j].angle > ear->angle) {
ear = &(vertices[j]);
}
}
In the second case, the variable minweight will never be used if the variable
bestvertex has value -1.
However, I agree that the code should be modified to avoid false alerts from
the compiler.
Original comment by ivan.fra...@gmail.com
on 20 Oct 2012 at 5:29
Agreed.
Sorry, for "minweight", I suggest an initial value of "DBL_MAX", not a negative
value. But as you point out, it doesn't matter.
Original comment by gbburkha...@gmail.com
on 20 Oct 2012 at 12:27
Original comment by ivan.fra...@gmail.com
on 20 Oct 2012 at 6:39
Hi Ivan Fratric,
Thanks for your excellent code.
For the following case, the result seems to be wrong. Could you please help me
to take a look at it?
Thanks,
Tang Laoya
data:
2
4
1
-1.191966510797976E-003 0.202231151541577
8.150796829630741E-003 0.186049010752862
2.980143192424173E-002 0.198549010752862
2.045866858381302E-002 0.214731151541577
8
0
3.525591640424161E-002 0.213001949189431
4.514750408646251E-002 0.211126769678226
4.301140661905761E-002 0.181202914852858
-1.683630303167994E-002 0.185475109787668
-1.470020556427498E-002 0.215398964613036
-4.642556696250064E-003 0.215850079145971
1.537278144042436E-002 0.215352008559904
2.045866858381302E-002 0.214731151541577
Original comment by tanglaoy...@gmail.com
on 10 Nov 2012 at 6:54
Uninitialized variable issues were fixed a while ago.
Original comment by ivan.fra...@gmail.com
on 14 Sep 2014 at 10:53
Original issue reported on code.google.com by
gbburkha...@gmail.com
on 19 Oct 2012 at 4:10