summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-31 22:27:26 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-31 22:46:08 +0300
commit82ace39b426a843382a6a809e7b66487c1412494 (patch)
treec8434c5465d0f0a44aa1a4b438dbe4dfbce317f6
parentf355fe070293a3f80b33ee0bc0154b2fe767fc4d (diff)
downloadplus-82ace39b426a843382a6a809e7b66487c1412494.tar.gz
plus-82ace39b426a843382a6a809e7b66487c1412494.tar.bz2
plus-82ace39b426a843382a6a809e7b66487c1412494.tar.xz
plus-82ace39b426a843382a6a809e7b66487c1412494.zip
Fix code style and compilation under windows.
-rw-r--r--src/actionmanager.cpp3
-rw-r--r--src/client.cpp4
-rw-r--r--src/gui/setup_touch.cpp2
-rw-r--r--src/gui/widgets/browserbox.cpp7
-rw-r--r--src/gui/widgets/setuptouchitem.cpp9
-rw-r--r--src/gui/widgets/setuptouchitem.h4
-rw-r--r--src/textparticle.cpp2
-rw-r--r--src/touchmanager.cpp1
8 files changed, 21 insertions, 11 deletions
diff --git a/src/actionmanager.cpp b/src/actionmanager.cpp
index 761825f03..337fc4102 100644
--- a/src/actionmanager.cpp
+++ b/src/actionmanager.cpp
@@ -1073,6 +1073,9 @@ impHandler0(showKeyboard)
{
#ifdef ANDROID
SDL_ANDROID_ToggleScreenKeyboardTextInput(nullptr);
+ return true;
+#else
+ return false;
#endif
}
diff --git a/src/client.cpp b/src/client.cpp
index b21aa6970..ce265ee15 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -707,7 +707,11 @@ void Client::setEnv(const char *const name, const char *const value)
{
if (!name || !value)
return;
+#ifdef WIN32
+ if (putenv((char*)(std::string(name) + "=" + value).c_str()))
+#else
if (setenv(name, value, 1))
+#endif
logger->log("setenv failed: %s=%s", name, value);
}
diff --git a/src/gui/setup_touch.cpp b/src/gui/setup_touch.cpp
index bd8214232..744be43d7 100644
--- a/src/gui/setup_touch.cpp
+++ b/src/gui/setup_touch.cpp
@@ -25,8 +25,6 @@
#include "configuration.h"
-#include "utils/gettext.h"
-
#include "debug.h"
static const int sizeListSize = 4;
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp
index 1551ae81d..26d446060 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -536,8 +536,11 @@ int BrowserBox::calcHeight()
const signed char c = row.at(start + 2);
bool valid;
- const gcn::Color col[2] = {getThemeCharColor(c, valid),
- getThemeCharColor(c | 0x80, valid)};
+ const gcn::Color col[2] =
+ {
+ getThemeCharColor(c, valid),
+ getThemeCharColor(c | 0x80, valid)
+ };
if (c == '>')
{
diff --git a/src/gui/widgets/setuptouchitem.cpp b/src/gui/widgets/setuptouchitem.cpp
index 06faf7b19..8fea0478e 100644
--- a/src/gui/widgets/setuptouchitem.cpp
+++ b/src/gui/widgets/setuptouchitem.cpp
@@ -39,7 +39,8 @@ class SortTouchActionFunctor final
}
} touchActionSorter;
-TouchActionsModel::TouchActionsModel()
+TouchActionsModel::TouchActionsModel() :
+ NamesModel()
{
std::vector<SetupActionData*> data;
@@ -66,14 +67,14 @@ TouchActionsModel::TouchActionsModel()
}
}
-int TouchActionsModel::getActionFromSelection(int sel)
+int TouchActionsModel::getActionFromSelection(const int sel) const
{
- if (sel < 0 || sel > mActionId.size())
+ if (sel < 0 || sel > static_cast<signed int>(mActionId.size()))
return -1;
return mActionId[sel];
}
-int TouchActionsModel::getSelectionFromAction(int action)
+int TouchActionsModel::getSelectionFromAction(const int action) const
{
std::map<int, int>::const_iterator it
= mActionToSelection.find(action);
diff --git a/src/gui/widgets/setuptouchitem.h b/src/gui/widgets/setuptouchitem.h
index 77eff2ae6..36770ae63 100644
--- a/src/gui/widgets/setuptouchitem.h
+++ b/src/gui/widgets/setuptouchitem.h
@@ -38,9 +38,9 @@ class TouchActionsModel final : public NamesModel
virtual ~TouchActionsModel()
{ }
- int getActionFromSelection(int sel);
+ int getActionFromSelection(const int sel) const;
- int getSelectionFromAction(int action);
+ int getSelectionFromAction(const int action) const;
private:
std::vector<int> mActionId;
diff --git a/src/textparticle.cpp b/src/textparticle.cpp
index 178a6a086..85d0d6738 100644
--- a/src/textparticle.cpp
+++ b/src/textparticle.cpp
@@ -71,7 +71,7 @@ bool TextParticle::draw(Graphics *graphics, int offsetX, int offsetY) const
}
gcn::Color color = *mColor;
- color.a = (int)alpha;
+ color.a = static_cast<int>(alpha);
graphics->setColor(color);
if (mOutline)
diff --git a/src/touchmanager.cpp b/src/touchmanager.cpp
index c70baace8..4d7c78db6 100644
--- a/src/touchmanager.cpp
+++ b/src/touchmanager.cpp
@@ -39,6 +39,7 @@ TouchManager::TouchManager() :
mKeyboard(nullptr),
mPad(nullptr),
mAttack(nullptr),
+ mCancel(nullptr),
mVertexes(new ImageCollection),
mRedraw(true),
mShowJoystick(false),