One more time Coverity

When you fix the complaint about implicitly converting a long long to a double you get a complaint about implicity discarding the remainder from an integer division.

Mumble. Grumble. Glare at Coverity.

Closes CID 1382228
This commit is contained in:
Gregory A Lundberg 2017-11-01 10:15:18 -05:00
parent df4e424db0
commit 631acb2bb8

View file

@ -145,7 +145,7 @@ void statistics_dialog::add_damage_row(
std::ostringstream str;
str << damage << " / "
<< static_cast<double>(((expected * 20) + shift) / (2 * shift)) * 0.1
<< static_cast<double>(static_cast<long long>(((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>(((turn_expected * 20) + shift) / (2 * shift)) * 0.1
<< static_cast<double>(static_cast<long long>(((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) << '%';