From 8f22144e8ed1b1eacb74183a73af70e884873c3a Mon Sep 17 00:00:00 2001 From: Gregory A Lundberg Date: Thu, 25 Jan 2018 21:11:07 -0600 Subject: [PATCH] clarify ^ vs ?: cppcheck (via Codacy) points out the operator precidence is unclearn. Added parentheses to fix that. --- src/gui/dialogs/statistics_dialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/dialogs/statistics_dialog.cpp b/src/gui/dialogs/statistics_dialog.cpp index f1b0dcb9b77..11ce5be2154 100644 --- a/src/gui/dialogs/statistics_dialog.cpp +++ b/src/gui/dialogs/statistics_dialog.cpp @@ -148,7 +148,7 @@ void statistics_dialog::add_damage_row( str << damage << " / " << static_cast(shifted) * 0.1 << " " // TODO: should probably make this two columns - << ((dsa < 0) ^ (expected < 0) ? "" : "+") + << (((dsa < 0) ^ (expected < 0)) ? "" : "+") << (expected == 0 ? 0 : 100 * dsa / expected) << '%'; item["label"] = str.str(); @@ -161,7 +161,7 @@ void statistics_dialog::add_damage_row( str << turn_damage << " / " << static_cast(turn_shifted) * 0.1 << " " // TODO: should probably make this two columns - << ((dst < 0) ^ (turn_expected < 0) ? "" : "+") + << (((dst < 0) ^ (turn_expected < 0)) ? "" : "+") << (turn_expected == 0 ? 0 : 100 * dst / turn_expected) << '%'; item["label"] = str.str();