summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-05-26 19:18:44 +0300
committerAndrei Karas <akaras@inbox.ru>2017-05-26 19:18:44 +0300
commita854f6b6aa81e7b387bce2293e9c84e0e96dfbd6 (patch)
tree16b6a47b8d94e117abf570ad0268a11ffb833cfd /src
parentcd94be3d8356e713cf5b72c64d22ec5baf5cae4a (diff)
downloadplus-a854f6b6aa81e7b387bce2293e9c84e0e96dfbd6.tar.gz
plus-a854f6b6aa81e7b387bce2293e9c84e0e96dfbd6.tar.bz2
plus-a854f6b6aa81e7b387bce2293e9c84e0e96dfbd6.tar.xz
plus-a854f6b6aa81e7b387bce2293e9c84e0e96dfbd6.zip
Fix code style.
Diffstat (limited to 'src')
-rw-r--r--src/fs/files.cpp3
-rw-r--r--src/gui/sdlinput.cpp2
-rw-r--r--src/test/testlauncher.cpp13
3 files changed, 12 insertions, 6 deletions
diff --git a/src/fs/files.cpp b/src/fs/files.cpp
index 7cefef985..9d7bfd125 100644
--- a/src/fs/files.cpp
+++ b/src/fs/files.cpp
@@ -287,11 +287,11 @@ void Files::enumFiles(StringVect &files,
{
if (findLast(path, dirSeparator) == false)
path += dirSeparator;
- const struct dirent *next_file = nullptr;
DIR *const dir = opendir(path.c_str());
if (dir)
{
+ const struct dirent *next_file = nullptr;
while ((next_file = readdir(dir)))
{
const std::string file = next_file->d_name;
@@ -313,4 +313,3 @@ void Files::enumFiles(StringVect &files,
closedir(dir);
}
}
-
diff --git a/src/gui/sdlinput.cpp b/src/gui/sdlinput.cpp
index 86f2a1b37..ead88bf6a 100644
--- a/src/gui/sdlinput.cpp
+++ b/src/gui/sdlinput.cpp
@@ -367,7 +367,7 @@ void SDLInput::simulateKey(const int guiKey,
keyInput.setType(KeyEventType::PRESSED);
#ifdef USE_SDL2
char str[2];
- str[0] = guiKey;
+ str[0] = CAST_S8(guiKey);
str[1] = 0;
keyInput.setKey(Key(KeyValue::TEXTINPUT));
diff --git a/src/test/testlauncher.cpp b/src/test/testlauncher.cpp
index c8ed805a4..27516417b 100644
--- a/src/test/testlauncher.cpp
+++ b/src/test/testlauncher.cpp
@@ -46,7 +46,11 @@
#include "resources/wallpaper.h"
#include "resources/dye/dye.h"
+#if defined __linux__ || defined __linux
+#ifdef SIMD_SUPPORTED
#include "resources/dye/dyepalette.h"
+#endif // SIMD_SUPPORTED
+#endif // defined __linux__ || defined __linux
#include "resources/image/image.h"
@@ -645,14 +649,15 @@ int TestLauncher::testDraw()
img[0] = Theme::getImageFromTheme("graphics/sprites/arrow_left.png");
img[1] = Theme::getImageFromTheme("graphics/sprites/arrow_right.png");
img[2] = Theme::getImageFromTheme("graphics/sprites/arrow_up.png");
+ Skin *skin = theme->load("button.xml", "button.xml");
+ if (!skin)
+ return 0;
+
ImageCollection *const col = new ImageCollection;
ImageCollection *const col2 = new ImageCollection;
ImageVertexes *const vert = new ImageVertexes;
vert->image = img[2];
- Skin *skin = theme->load("button.xml", "button.xml");
- if (!skin)
- return 0;
mainGraphics->pushClipArea(Rect(10, 20, 790, 580));
mainGraphics->setColor(Color(0xFFU, 0xFFU, 0x00U, 0xFFU));
mainGraphics->drawRectangle(Rect(0, 0, 400, 200));
@@ -712,6 +717,8 @@ int TestLauncher::testDraw()
sleep(10);
delete col;
+ delete col2;
+ delete vert;
return 0;
}