Give up on Coverity for this

Coverity wants a cast to double. Add it and it wants a cast to long long. Add THAT and Coverity and GCC both complain.

I suppose there might be a way to rewrite things to make everyone happy. But it's easier to tell Coverity it's a false positive and force the issue closed.
This commit is contained in:
Gregory A Lundberg 2017-11-02 17:45:14 -05:00
parent 23b98e2827
commit e0366b1352

View file

@ -145,7 +145,7 @@ void statistics_dialog::add_damage_row(
std::ostringstream str;
str << damage << " / "
<< static_cast<double>(static_cast<long long>(((expected * 20) + shift) / (2 * shift))) * 0.1
<< (((expected * 20) + shift) / (2 * shift)) * 0.1
<< " " // TODO: should probably make this two columns
<< ((dsa < 0) ^ (expected < 0) ? "" : "+")
<< (expected == 0 ? 0 : 100 * dsa / expected) << '%';
@ -157,7 +157,7 @@ void statistics_dialog::add_damage_row(
if(show_this_turn) {
str << turn_damage << " / "
<< static_cast<double>(static_cast<long long>(((turn_expected * 20) + shift) / (2 * shift))) * 0.1
<< (((turn_expected * 20) + shift) / (2 * shift)) * 0.1
<< " " // TODO: should probably make this two columns
<< ((dst < 0) ^ (turn_expected < 0) ? "" : "+")
<< (turn_expected == 0 ? 0 : 100 * dst / turn_expected) << '%';