From 35cfd460655878c9a615abc8ea1cb2f7577a7f3b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 21 Apr 2013 18:57:48 +0300 Subject: some other fixes from cpplint. --- src/gui/botcheckerwindow.h | 4 ++-- src/gui/chatwindow.h | 4 ++-- src/gui/sdlfont.cpp | 3 +-- src/gui/serverdialog.cpp | 6 +++--- src/gui/textdialog.cpp | 4 ++-- 5 files changed, 10 insertions(+), 11 deletions(-) (limited to 'src/gui') diff --git a/src/gui/botcheckerwindow.h b/src/gui/botcheckerwindow.h index 36ca41a24..7bc75e2fb 100644 --- a/src/gui/botcheckerwindow.h +++ b/src/gui/botcheckerwindow.h @@ -33,8 +33,8 @@ struct BOTCHK final { - short id; /**< Index into "botchecker_db" array */ - short lv, sp; + int16_t id; /**< Index into "botchecker_db" array */ + int16_t lv, sp; }; class Button; diff --git a/src/gui/chatwindow.h b/src/gui/chatwindow.h index 2961d7de4..f658a7757 100644 --- a/src/gui/chatwindow.h +++ b/src/gui/chatwindow.h @@ -354,8 +354,8 @@ class ChatWindow final : public Window, History mCommands; /**< Command list. */ History mCustomWords; - bool mReturnToggles; // Marks whether toggles the chat log - // or not + bool mReturnToggles; // Marks whether toggles the chat log + // or not StringVect mTradeFilter; diff --git a/src/gui/sdlfont.cpp b/src/gui/sdlfont.cpp index f3d904059..1acb50720 100644 --- a/src/gui/sdlfont.cpp +++ b/src/gui/sdlfont.cpp @@ -245,8 +245,7 @@ void SDLFont::loadFont(std::string filename, const int size, const int style) void SDLFont::clear() { - for (unsigned short f = 0; f < static_cast( - CACHES_NUMBER); f ++) + for (size_t f = 0; f < CACHES_NUMBER; f ++) { mCache[f].clear(); } diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp index ee879f2a8..56ce6528a 100644 --- a/src/gui/serverdialog.cpp +++ b/src/gui/serverdialog.cpp @@ -86,7 +86,7 @@ static std::string serverTypeToString(const ServerInfo::Type type) } } -static unsigned short defaultPortForServerType(const ServerInfo::Type type) +static uint16_t defaultPortForServerType(const ServerInfo::Type type) { switch (type) { @@ -616,7 +616,7 @@ void ServerDialog::loadServers(const bool addNew) if (xmlNameEqual(subNode, "connection")) { server.hostname = XML::getProperty(subNode, "hostname", ""); - server.port = static_cast( + server.port = static_cast( XML::getProperty(subNode, "port", 0)); if (server.port == 0) @@ -685,7 +685,7 @@ void ServerDialog::loadCustomServers() server.type = ServerInfo::parseType(config.getValue(typeKey, "")); const int defaultPort = defaultPortForServerType(server.type); - server.port = static_cast( + server.port = static_cast( config.getValue(portKey, defaultPort)); // skip invalid server diff --git a/src/gui/textdialog.cpp b/src/gui/textdialog.cpp index d598cb37c..146bcede5 100644 --- a/src/gui/textdialog.cpp +++ b/src/gui/textdialog.cpp @@ -70,11 +70,11 @@ TextDialog::TextDialog(const std::string &title, const std::string &msg, int width = font->getWidth(title); if (width < textLabel->getWidth()) width = textLabel->getWidth(); - reflowLayout(static_cast(width + 20)); + reflowLayout(static_cast(width + 20)); } else { - reflowLayout(static_cast(textLabel->getWidth() + 20)); + reflowLayout(static_cast(textLabel->getWidth() + 20)); } if (getParent()) -- cgit v1.2.3-60-g2f50