summaryrefslogtreecommitdiff
path: root/src/eventsmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-06 23:34:34 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-07 19:23:40 +0300
commit36ba43d6ea38062b17f7e63ef659962bfc51c64d (patch)
tree190156cb88b13a38a6d13c69ee0742cc078065a1 /src/eventsmanager.cpp
parentf1518dd8476c968a43fa57cfb06198e290a4f77a (diff)
downloadplus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.gz
plus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.bz2
plus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.xz
plus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.zip
Fix clang-tidy check readability-implicit-bool-cast.
Diffstat (limited to 'src/eventsmanager.cpp')
-rw-r--r--src/eventsmanager.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/eventsmanager.cpp b/src/eventsmanager.cpp
index fa34821e2..2db3e8869 100644
--- a/src/eventsmanager.cpp
+++ b/src/eventsmanager.cpp
@@ -127,7 +127,7 @@ bool EventsManager::handleEvents() const
{
BLOCK_START("EventsManager::handleEvents")
#ifndef DYECMD
- if (Game::instance())
+ if (Game::instance() != nullptr)
{
// Let the game handle the events while it is active
Game::instance()->handleInput();
@@ -517,13 +517,13 @@ void EventsManager::handleActive(const SDL_Event &event)
const bool inGame = (client->getState() == State::GAME);
#endif // DYECMD
- if (event.active.state & SDL_APPACTIVE)
+ if ((event.active.state & SDL_APPACTIVE) != 0)
{
- if (event.active.gain)
+ if (event.active.gain != 0u)
{ // window restore
WindowManager::setIsMinimized(false);
#ifndef DYECMD
- if (inGame && localPlayer)
+ if (inGame && (localPlayer != nullptr))
{
if (!settings.awayMode)
fpsLimit = config.getIntValue("fpslimit");
@@ -540,7 +540,7 @@ void EventsManager::handleActive(const SDL_Event &event)
#else // ANDROID
WindowManager::setIsMinimized(true);
#ifndef DYECMD
- if (inGame && localPlayer && !settings.awayMode)
+ if (inGame && (localPlayer != nullptr) && !settings.awayMode)
{
fpsLimit = config.getIntValue("altfpslimit");
localPlayer->setHalfAway(true);
@@ -551,19 +551,19 @@ void EventsManager::handleActive(const SDL_Event &event)
#endif // ANDROID
}
#ifndef DYECMD
- if (inGame && localPlayer)
+ if (inGame && (localPlayer != nullptr))
localPlayer->updateStatus();
#endif // DYECMD
}
#ifndef DYECMD
- if (inGame && localPlayer)
+ if (inGame && (localPlayer != nullptr))
localPlayer->updateName();
#endif // DYECMD
- if (event.active.state & SDL_APPINPUTFOCUS)
- settings.inputFocused = event.active.gain;
- if (event.active.state & SDL_APPMOUSEFOCUS)
- settings.mouseFocused = event.active.gain;
+ if ((event.active.state & SDL_APPINPUTFOCUS) != 0)
+ settings.inputFocused = (event.active.gain != 0u);
+ if ((event.active.state & SDL_APPMOUSEFOCUS) != 0)
+ settings.mouseFocused = (event.active.gain != 0u);
#ifndef DYECMD
if (inGame)
Game::instance()->updateFrameRate(fpsLimit);