summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-09-09 03:57:07 +0300
committerAndrei Karas <akaras@inbox.ru>2018-09-09 03:57:07 +0300
commit82aebd59872d5d59327c73fe4c52dbef312bbef9 (patch)
tree417de7a129db939d2ec03bbb3ed586a9953aa215
parent27ccf1fb1fc7bf587cace186c18fbbcf3141b548 (diff)
downloadmanaplus-82aebd59872d5d59327c73fe4c52dbef312bbef9.tar.gz
manaplus-82aebd59872d5d59327c73fe4c52dbef312bbef9.tar.bz2
manaplus-82aebd59872d5d59327c73fe4c52dbef312bbef9.tar.xz
manaplus-82aebd59872d5d59327c73fe4c52dbef312bbef9.zip
Fix code style.
-rw-r--r--src/const/utils/perfstat.h6
-rw-r--r--src/gui/widgets/tabs/statdebugtab.cpp14
-rw-r--r--src/utils/perfstat.cpp2
3 files changed, 10 insertions, 12 deletions
diff --git a/src/const/utils/perfstat.h b/src/const/utils/perfstat.h
index fac9f7382..48ca611af 100644
--- a/src/const/utils/perfstat.h
+++ b/src/const/utils/perfstat.h
@@ -23,8 +23,8 @@
#include "localconsts.h"
-static const int PERFSTAT_MAX = 120;
-static const int PERFSTAT_LAST_STAT = 13;
-static const int PERFSTAT_FPS_STAT = 12;
+static const size_t PERFSTAT_MAX = 120U;
+static const size_t PERFSTAT_LAST_STAT = 13U;
+static const size_t PERFSTAT_FPS_STAT = 12U;
#endif // CONST_UTILS_PERFSTAT_H
diff --git a/src/gui/widgets/tabs/statdebugtab.cpp b/src/gui/widgets/tabs/statdebugtab.cpp
index 1ad858800..a2aee6eb6 100644
--- a/src/gui/widgets/tabs/statdebugtab.cpp
+++ b/src/gui/widgets/tabs/statdebugtab.cpp
@@ -57,11 +57,11 @@ StatDebugTab::StatDebugTab(const Widget2 *const widget) :
place(0, 0, mLPSLabel, 2, 1);
place(0, 1, mResetButton, 1, 1);
place(1, 1, mCopyButton, 1, 1);
- for (int f = 1; f < PERFSTAT_LAST_STAT; f ++)
+ for (size_t f = 1; f < PERFSTAT_LAST_STAT; f ++)
{
mStatLabels[f - 1] = new Label(this,
// TRANSLATORS: debug window stat label
- strprintf(_("stat%d: %d ms"), f, 1000));
+ strprintf(_("stat%u: %d ms"), CAST_U32(f), 1000));
mStatLabels[f - 1]->adjustSize();
mWorseStatLabels[f - 1] = new Label(this,
// TRANSLATORS: debug window stat label
@@ -79,12 +79,12 @@ void StatDebugTab::logic()
// TRANSLATORS: debug window label, logic per second
mLPSLabel->setCaption(strprintf(_("LPS: %d"), lps));
- for (int f = 1; f < PERFSTAT_LAST_STAT; f ++)
+ for (size_t f = 1; f < PERFSTAT_LAST_STAT; f ++)
{
mStatLabels[f - 1]->setCaption(
// TRANSLATORS: debug window stat label
- strprintf(_("stat%d: %d ms"),
- f,
+ strprintf(_("stat%u: %d ms"),
+ CAST_U32(f),
Perf::getTime(prevPerfFrameId, f) * MILLISECONDS_IN_A_TICK));
mWorseStatLabels[f - 1]->setCaption(
// TRANSLATORS: debug window stat label
@@ -105,13 +105,13 @@ void StatDebugTab::action(const ActionEvent &event)
else if (eventId == "copy")
{
std::string data("perf:");
- for (int f = 1; f < PERFSTAT_LAST_STAT; f ++)
+ for (size_t f = 1; f < PERFSTAT_LAST_STAT; f ++)
{
data.append(strprintf(" %d",
Perf::getTime(mDrawIndex, f) * MILLISECONDS_IN_A_TICK));
}
data.append(",");
- for (int f = 1; f < PERFSTAT_LAST_STAT; f ++)
+ for (size_t f = 1; f < PERFSTAT_LAST_STAT; f ++)
{
data.append(strprintf(" %d",
Perf::getWorstTime(f) * MILLISECONDS_IN_A_TICK));
diff --git a/src/utils/perfstat.cpp b/src/utils/perfstat.cpp
index 2e069c7f9..d8f3d1e67 100644
--- a/src/utils/perfstat.cpp
+++ b/src/utils/perfstat.cpp
@@ -22,8 +22,6 @@
#include "logger.h"
-#include "utils/timer.h"
-
#include "debug.h"
PerfStats perfStats[PERFSTAT_MAX];