summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-09-09 19:41:31 +0300
committerAndrei Karas <akaras@inbox.ru>2016-09-09 19:41:31 +0300
commit97943710d847ddb2b52099330f1961bda127e37b (patch)
treeab2522aab524c3393a6dd4f1d51811d3eac9984e
parent22d0a32e03656262a7a5cccb3769aed59bfe0a5b (diff)
downloadplus-97943710d847ddb2b52099330f1961bda127e37b.tar.gz
plus-97943710d847ddb2b52099330f1961bda127e37b.tar.bz2
plus-97943710d847ddb2b52099330f1961bda127e37b.tar.xz
plus-97943710d847ddb2b52099330f1961bda127e37b.zip
Fix code style.
-rw-r--r--src/actions/actions.cpp4
-rw-r--r--src/being/beingcacheentry.h6
-rw-r--r--src/being/flooritem.cpp4
-rw-r--r--src/being/flooritem.h2
-rw-r--r--src/being/localplayer.cpp2
-rw-r--r--src/being/localplayer.h2
-rw-r--r--src/effectmanager.cpp4
-rw-r--r--src/effectmanager.h4
-rw-r--r--src/game.h2
-rw-r--r--src/net/packetcounters.cpp2
-rw-r--r--src/particle/particletimer.h4
-rw-r--r--src/resources/sprite/animatedsprite_unittest.cc6
12 files changed, 21 insertions, 21 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp
index f855deb05..cb829445c 100644
--- a/src/actions/actions.cpp
+++ b/src/actions/actions.cpp
@@ -118,7 +118,7 @@
extern std::string tradePartnerName;
extern QuitDialog *quitDialog;
-extern int start_time;
+extern time_t start_time;
extern char **environ;
namespace Actions
@@ -1214,7 +1214,7 @@ impHandler0(uptime)
{
// TRANSLATORS: uptime command
debugChatTab->chatLog(strprintf(_("Client uptime: %s"),
- timeDiffToString(cur_time - start_time).c_str()),
+ timeDiffToString(CAST_S32(cur_time - start_time)).c_str()),
ChatMsgType::BY_SERVER);
}
return true;
diff --git a/src/being/beingcacheentry.h b/src/being/beingcacheentry.h
index 4da40f2c2..c1a45120a 100644
--- a/src/being/beingcacheentry.h
+++ b/src/being/beingcacheentry.h
@@ -85,10 +85,10 @@ class BeingCacheEntry final
int getLevel() const
{ return mLevel; }
- void setTime(const int n)
+ void setTime(const time_t n)
{ mTime = n; }
- int getTime() const
+ time_t getTime() const
{ return mTime; }
unsigned getPvpRank() const
@@ -129,7 +129,7 @@ class BeingCacheEntry final
BeingId mId; /**< Unique sprite id */
int mLevel;
unsigned int mPvpRank;
- int mTime;
+ time_t mTime;
int mFlags;
uint16_t mTeamId;
bool mIsAdvanced;
diff --git a/src/being/flooritem.cpp b/src/being/flooritem.cpp
index 83857d043..586fb044a 100644
--- a/src/being/flooritem.cpp
+++ b/src/being/flooritem.cpp
@@ -178,14 +178,14 @@ void FloorItem::draw(Graphics *const graphics,
&& curTime < mDropTime + 28)
{
graphics->setColor(Color(200, 80, 20,
- 80 + 10 * (curTime - mDropTime - 18)));
+ 80 + 10 * CAST_S32(curTime - mDropTime - 18)));
graphics->fillRectangle(Rect(
x, y, dx, dy));
}
else if (curTime > mDropTime && curTime < mDropTime + 20)
{
graphics->setColor(Color(20, 20, 255,
- 7 * (curTime - mDropTime)));
+ 7 * CAST_S32(curTime - mDropTime)));
graphics->fillRectangle(Rect(x, y, dx, dy));
}
}
diff --git a/src/being/flooritem.h b/src/being/flooritem.h
index 60e5d953d..23c32f446 100644
--- a/src/being/flooritem.h
+++ b/src/being/flooritem.h
@@ -136,7 +136,7 @@ class FloorItem final : public ActorSprite
int mCards[maxCards];
int mItemId;
int mX, mY;
- int mDropTime;
+ time_t mDropTime;
int mAmount;
int mRefine;
int mHeightPosDiff;
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp
index 2766a31b1..007a3d88e 100644
--- a/src/being/localplayer.cpp
+++ b/src/being/localplayer.cpp
@@ -287,7 +287,7 @@ void LocalPlayer::logic()
{
if (mMessageTime == 0)
{
- MessagePair info = mMessages.front();
+ const MessagePair info = mMessages.front();
if (particleEngine && gui)
{
diff --git a/src/being/localplayer.h b/src/being/localplayer.h
index a3d4814e5..d74481298 100644
--- a/src/being/localplayer.h
+++ b/src/being/localplayer.h
@@ -500,7 +500,7 @@ class LocalPlayer final : public Being,
std::string mLastHitFrom;
std::string mWaitFor;
- int mAdvertTime;
+ time_t mAdvertTime;
Particle *mTestParticle;
std::string mTestParticleName;
time_t mTestParticleTime;
diff --git a/src/effectmanager.cpp b/src/effectmanager.cpp
index c4241c29f..1a8fd7b53 100644
--- a/src/effectmanager.cpp
+++ b/src/effectmanager.cpp
@@ -180,7 +180,7 @@ Particle *EffectManager::triggerReturn(const int id,
bool EffectManager::trigger(const int id,
const int x, const int y,
- const int endTime,
+ const time_t endTime,
const int rotation)
{
if (!particleEngine || id == -1)
@@ -226,7 +226,7 @@ void EffectManager::triggerDefault(int effectId,
void EffectManager::triggerDefault(int effectId,
const int x,
const int y,
- const int endTime,
+ const time_t endTime,
const int defaultEffectId)
{
if (effectId == -1)
diff --git a/src/effectmanager.h b/src/effectmanager.h
index 4c30f2690..d439ebf21 100644
--- a/src/effectmanager.h
+++ b/src/effectmanager.h
@@ -73,7 +73,7 @@ class EffectManager final
*/
bool trigger(const int id,
const int x, const int y,
- const int endTime,
+ const time_t endTime,
const int rotation = 0);
void triggerDefault(int effectId,
@@ -83,7 +83,7 @@ class EffectManager final
void triggerDefault(int effectId,
const int x,
const int y,
- const int endTime,
+ const time_t endTime,
const int defaultEffectId);
void logic();
diff --git a/src/game.h b/src/game.h
index 551378ef2..05b2574f9 100644
--- a/src/game.h
+++ b/src/game.h
@@ -40,7 +40,7 @@ class Map;
struct LastKey final
{
InputActionT key;
- int time;
+ time_t time;
int cnt;
};
diff --git a/src/net/packetcounters.cpp b/src/net/packetcounters.cpp
index f29bb890c..7d28ab3be 100644
--- a/src/net/packetcounters.cpp
+++ b/src/net/packetcounters.cpp
@@ -108,7 +108,7 @@ void PacketCounters::updateCounter(int &restrict currentSec,
int &restrict calc,
int &restrict counter)
{
- const time_t idx = cur_time % 60;
+ const int idx = CAST_S32(cur_time % 60);
if (currentSec != idx)
{
currentSec = idx;
diff --git a/src/particle/particletimer.h b/src/particle/particletimer.h
index 1550935d8..fa4b86458 100644
--- a/src/particle/particletimer.h
+++ b/src/particle/particletimer.h
@@ -28,14 +28,14 @@ class Particle;
struct ParticleTimer final
{
ParticleTimer(Particle *const particle0,
- const int endTime0) A_NONNULL(2) :
+ const time_t endTime0) A_NONNULL(2) :
particle(particle0),
endTime(endTime0)
{
}
Particle *const particle;
- const int endTime;
+ const time_t endTime;
};
#endif // PARTICLE_PARTICLETIMER_H
diff --git a/src/resources/sprite/animatedsprite_unittest.cc b/src/resources/sprite/animatedsprite_unittest.cc
index b59b4dbbb..9111434b2 100644
--- a/src/resources/sprite/animatedsprite_unittest.cc
+++ b/src/resources/sprite/animatedsprite_unittest.cc
@@ -89,7 +89,7 @@ TEST_CASE("AnimatedSprite tests", "animatedsprite")
REQUIRE(false == sprite->update(11));
REQUIRE(10 == sprite->getFrameTime());
REQUIRE(0 == sprite->getFrameIndex());
- delete(sprite);
+ delete sprite;
}
SECTION("basic test 2")
@@ -150,7 +150,7 @@ TEST_CASE("AnimatedSprite tests", "animatedsprite")
REQUIRE(true == sprite->update(1 + 10 + 20 + 10 + 25 + 10 + 10 + 1));
REQUIRE(4 == sprite->getFrameIndex());
REQUIRE(1 == sprite->getFrameTime());
- delete(sprite);
+ delete sprite;
}
SECTION("basic test 3")
@@ -168,7 +168,7 @@ TEST_CASE("AnimatedSprite tests", "animatedsprite")
REQUIRE(true == sprite2->update(1 + 10 + 20 + 10 + 25 + 10 + 10 + 1));
REQUIRE(1 == sprite2->getFrameIndex());
REQUIRE(1 == sprite2->getFrameTime());
- delete(sprite2);
+ delete sprite2;
}
delete client;