summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-07-13 13:49:25 +0300
committerAndrei Karas <akaras@inbox.ru>2014-07-14 02:14:18 +0300
commit72938b640199d03d6092366224d3927d5d2a33b9 (patch)
treec7e57d69da40085ba835d2e22d1a3d59ab201fe5
parentc4cef10f92a8ff3fc668e0644d38744dccd06392 (diff)
downloadplus-72938b640199d03d6092366224d3927d5d2a33b9.tar.gz
plus-72938b640199d03d6092366224d3927d5d2a33b9.tar.bz2
plus-72938b640199d03d6092366224d3927d5d2a33b9.tar.xz
plus-72938b640199d03d6092366224d3927d5d2a33b9.zip
Fix code style.
-rw-r--r--src/debug/debug_new.h2
-rw-r--r--src/gui/widgets/passwordfield.cpp3
-rw-r--r--src/net/sdltcpnet.cpp4
-rw-r--r--src/render/mgldefines.h12
-rw-r--r--src/resources/db/palettedb.cpp13
-rw-r--r--src/resources/map/maptype.h2
-rw-r--r--src/utils/glxhelper.cpp2
7 files changed, 32 insertions, 6 deletions
diff --git a/src/debug/debug_new.h b/src/debug/debug_new.h
index b441d79fa..39f2f59d1 100644
--- a/src/debug/debug_new.h
+++ b/src/debug/debug_new.h
@@ -43,7 +43,7 @@
#define M_DEBUG_NEW_H
#include <new>
-#include <stdio>
+#include <cstdio>
/**
* @def HAVE_PLACEMENT_DELETE
diff --git a/src/gui/widgets/passwordfield.cpp b/src/gui/widgets/passwordfield.cpp
index d6d310616..0d0303869 100644
--- a/src/gui/widgets/passwordfield.cpp
+++ b/src/gui/widgets/passwordfield.cpp
@@ -30,7 +30,8 @@ PasswordField::PasswordField(const Widget2 *const widget,
const std::string &text) :
TextField(widget, text),
mPasswordChar(mSkin ? static_cast<unsigned char>(
- mSkin->getOption("passwordChar", 42)) : 42U)
+ mSkin->getOption("passwordChar", 42))
+ : static_cast<unsigned char>(42U))
{
}
diff --git a/src/net/sdltcpnet.cpp b/src/net/sdltcpnet.cpp
index d42b533c4..2bbb9837a 100644
--- a/src/net/sdltcpnet.cpp
+++ b/src/net/sdltcpnet.cpp
@@ -90,8 +90,8 @@ TcpNet::Socket TcpNet::open(IPaddress *const ip)
{
const TcpNet::Socket sock = SDLNet_TCP_Open(ip);
#if !defined(__native_client__) \
- || defined(TCP_THIN_LINEAR_TIMEOUTS) \
- || defined(TCP_THIN_DUPACK)
+ && (defined(TCP_THIN_LINEAR_TIMEOUTS) \
+ || defined(TCP_THIN_DUPACK))
if (sock && ip)
{
const TCPsocketHack *const hack
diff --git a/src/render/mgldefines.h b/src/render/mgldefines.h
index 3185e856b..1adf0b211 100644
--- a/src/render/mgldefines.h
+++ b/src/render/mgldefines.h
@@ -98,6 +98,18 @@
#define GL_SAMPLE_MASK 0x8E51
#endif
+#ifndef GL_POLYGON_SMOOTH
+#define GL_POLYGON_SMOOTH 0x0B41
+#endif
+
+#ifndef GL_DEPTH_BOUNDS_TEST_EXT
+#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890
+#endif
+
+#ifndef GL_TEXTURE_COMPRESSION_HINT_ARB
+#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF
+#endif
+
#endif // USE_OPENGL
#endif // RENDER_MGLDEFINES_H
diff --git a/src/resources/db/palettedb.cpp b/src/resources/db/palettedb.cpp
index 08c8ec85d..1e2f56632 100644
--- a/src/resources/db/palettedb.cpp
+++ b/src/resources/db/palettedb.cpp
@@ -82,6 +82,18 @@ void PaletteDB::loadPalette()
if (line.empty() || line[0] == '#')
continue;
+#ifdef WIN32
+ unsigned int r;
+ unsigned int g;
+ unsigned int b;
+
+ if (sscanf(line.c_str(), "%10u %10u %10u\t%100s",
+ &r, &g, &b, name) == 4)
+ {
+ name[100] = 0;
+ mColors[name] = DyeColor(r, g, b);
+ }
+#else
unsigned char r;
unsigned char g;
unsigned char b;
@@ -92,6 +104,7 @@ void PaletteDB::loadPalette()
name[100] = 0;
mColors[name] = DyeColor(r, g, b);
}
+#endif
}
}
diff --git a/src/resources/map/maptype.h b/src/resources/map/maptype.h
index 9894fe631..ccaf7c601 100644
--- a/src/resources/map/maptype.h
+++ b/src/resources/map/maptype.h
@@ -35,6 +35,6 @@ namespace MapType
SPECIAL4 = 5,
BLACKWHITE = 6
};
-}
+} // namespace MapType
#endif // RESOURCES_MAP_MAPTYPE_H
diff --git a/src/utils/glxhelper.cpp b/src/utils/glxhelper.cpp
index 240e4b8d5..021e3cd64 100644
--- a/src/utils/glxhelper.cpp
+++ b/src/utils/glxhelper.cpp
@@ -45,7 +45,7 @@ void *GlxHelper::createContext(const unsigned long window,
{
Display *const display = static_cast<Display*>(display0);
XSync(display, false);
- int (*handler) (Display *, XErrorEvent *) = XSetErrorHandler(ErrorHandler);
+ int (*handler)(Display *, XErrorEvent *) = XSetErrorHandler(ErrorHandler);
void *context = mglXGetCurrentContext();
if (isGLNull(mglXGetCurrentContext)
|| isGLNull(mglXCreateContextAttribs)