summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-12-02 23:06:48 +0300
committerAndrei Karas <akaras@inbox.ru>2011-12-02 23:06:48 +0300
commit5acadea119fc2a89e944dc9431e298e5e9544770 (patch)
tree5199e73d8b924cb4ca3324f0f17a1a6696301d77
parentbf41736950d9e22be8b2b201dcd4833a50b26a99 (diff)
downloadmanaplus-5acadea119fc2a89e944dc9431e298e5e9544770.tar.gz
manaplus-5acadea119fc2a89e944dc9431e298e5e9544770.tar.bz2
manaplus-5acadea119fc2a89e944dc9431e298e5e9544770.tar.xz
manaplus-5acadea119fc2a89e944dc9431e298e5e9544770.zip
Fix some issues after automatic code checking.
-rw-r--r--src/being.cpp3
-rw-r--r--src/gui/botcheckerwindow.cpp4
-rw-r--r--src/gui/widgets/chattab.cpp3
-rw-r--r--src/guichan/gui.cpp16
-rw-r--r--src/net/tmwa/playerhandler.cpp2
-rw-r--r--src/utils/base64.cpp3
6 files changed, 15 insertions, 16 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 31f1eac59..185891509 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -2527,10 +2527,9 @@ void Being::updatePercentHP()
{
if (!mMaxHP || !serverVersion)
return;
- unsigned num = 0;
if (mHP)
{
- num = mHP * 100 / mMaxHP;
+ unsigned num = mHP * 100 / mMaxHP;
if (num != mNumber)
{
mNumber = num;
diff --git a/src/gui/botcheckerwindow.cpp b/src/gui/botcheckerwindow.cpp
index bff9ad31a..2043b4fe3 100644
--- a/src/gui/botcheckerwindow.cpp
+++ b/src/gui/botcheckerwindow.cpp
@@ -193,14 +193,14 @@ public:
attackBot = true;
// attacking but not talking more than 2 minutes
- if (talk > 2 * 60 && talk > 2 * 60)
+ if (talk > 2 * 60)
{
talkBot = true;
str += toString((talk) / 60) + " ";
}
// attacking but not moving more than 2 minutes
- if (move > 2 * 60 && move > 2 * 60)
+ if (move > 2 * 60)
{
moveBot = true;
str += toString((move) / 60);
diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp
index 0a224605a..72af1b0b8 100644
--- a/src/gui/widgets/chattab.cpp
+++ b/src/gui/widgets/chattab.cpp
@@ -205,8 +205,7 @@ void ChatTab::chatLog(std::string line, Own own,
// if configured, move magic messages log to debug chat tab
if (localChatTab && this == localChatTab
- && ((config.getBoolValue("showMagicInDebug")
- && own == BY_PLAYER && tmp.text.length() > 1
+ && ((config.getBoolValue("showMagicInDebug") && own == BY_PLAYER
&& tmp.text.length() > 1 && tmp.text.at(0) == '#'
&& tmp.text.at(1) != '#')
|| (config.getBoolValue("serverMsgInDebug") && (own == BY_SERVER
diff --git a/src/guichan/gui.cpp b/src/guichan/gui.cpp
index 810a983c4..3f5581424 100644
--- a/src/guichan/gui.cpp
+++ b/src/guichan/gui.cpp
@@ -417,7 +417,7 @@ namespace gcn
while (parent)
{
- parent = (Widget*)widget->getParent();
+ parent = static_cast<Widget*>(widget->getParent());
// Check if the widget is present in the "widget with mouse" queue.
bool widgetIsPresentInQueue = false;
@@ -450,7 +450,7 @@ namespace gcn
Widget* swap = widget;
widget = parent;
- parent = (Widget*)swap->getParent();
+ parent = static_cast<Widget*>(swap->getParent());
}
if (mFocusHandler->getDraggedWidget())
@@ -683,7 +683,7 @@ namespace gcn
if (!Widget::widgetExists(widget))
break;
- parent = (Widget*)widget->getParent();
+ parent = static_cast<Widget*>(widget->getParent());
if (widget->isEnabled() || force)
{
@@ -742,7 +742,7 @@ namespace gcn
Widget* swap = widget;
widget = parent;
- parent = (Widget*)swap->getParent();
+ parent = static_cast<Widget*>(swap->getParent());
// If a non modal focused widget has been reach
// and we have modal focus cancel the distribution.
@@ -786,7 +786,7 @@ namespace gcn
if (!Widget::widgetExists(widget))
break;
- parent = (Widget*)widget->getParent();
+ parent = static_cast<Widget*>(widget->getParent());
if (widget->isEnabled())
{
@@ -815,7 +815,7 @@ namespace gcn
Widget* swap = widget;
widget = parent;
- parent = (Widget*)swap->getParent();
+ parent = static_cast<Widget*>(swap->getParent());
// If a non modal focused widget has been reach
// and we have modal focus cancel the distribution.
@@ -928,7 +928,7 @@ namespace gcn
while (parent)
{
- parent = (Widget*)widget->getParent();
+ parent = static_cast<Widget*>(widget->getParent());
// Check if the widget is present in the "widget with mouse" queue.
bool widgetIsPresentInQueue = false;
@@ -960,7 +960,7 @@ namespace gcn
Widget* swap = widget;
widget = parent;
- parent = (Widget*)swap->getParent();
+ parent = static_cast<Widget*>(swap->getParent());
}
}
}
diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp
index 20156d8cb..c678fe09d 100644
--- a/src/net/tmwa/playerhandler.cpp
+++ b/src/net/tmwa/playerhandler.cpp
@@ -232,7 +232,7 @@ void PlayerHandler::processOnlineList(Net::MessageIn &msg)
while (buf - start + 1 < size && *(buf + 1))
{
- char status = *buf; // now unused
+// char status = *buf; // now unused
buf ++;
arr.push_back(buf);
buf += strlen(buf) + 1;
diff --git a/src/utils/base64.cpp b/src/utils/base64.cpp
index 843a0b534..24a3a58e3 100644
--- a/src/utils/base64.cpp
+++ b/src/utils/base64.cpp
@@ -108,7 +108,8 @@ unsigned char *php3_base64_decode(const unsigned char *string,
/* run through the whole string, converting as we go */
while ((ch = *current++) != '\0')
{
- if (ch == base64_pad) break;
+ if (ch == base64_pad)
+ break;
/* When Base64 gets POSTed, all pluses are interpreted as spaces.
This line changes them back. It's not exactly the Base64 spec,