From 72938b640199d03d6092366224d3927d5d2a33b9 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 13 Jul 2014 13:49:25 +0300 Subject: Fix code style. --- src/debug/debug_new.h | 2 +- src/gui/widgets/passwordfield.cpp | 3 ++- src/net/sdltcpnet.cpp | 4 ++-- src/render/mgldefines.h | 12 ++++++++++++ src/resources/db/palettedb.cpp | 13 +++++++++++++ src/resources/map/maptype.h | 2 +- src/utils/glxhelper.cpp | 2 +- 7 files changed, 32 insertions(+), 6 deletions(-) (limited to 'src') 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 -#include +#include /** * @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( - mSkin->getOption("passwordChar", 42)) : 42U) + mSkin->getOption("passwordChar", 42)) + : static_cast(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(display0); XSync(display, false); - int (*handler) (Display *, XErrorEvent *) = XSetErrorHandler(ErrorHandler); + int (*handler)(Display *, XErrorEvent *) = XSetErrorHandler(ErrorHandler); void *context = mglXGetCurrentContext(); if (isGLNull(mglXGetCurrentContext) || isGLNull(mglXCreateContextAttribs) -- cgit v1.2.3-70-g09d2