From 869c7fe8852248f03849c930c894d8fa218631b5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 1 Feb 2013 22:19:21 +0300 Subject: Fix code style. --- src/actorspritemanager.cpp | 6 +++--- src/client.cpp | 2 +- src/gui/buydialog.cpp | 12 ++++++------ src/gui/sdlfont.cpp | 5 +++-- src/gui/socialwindow.cpp | 2 +- src/gui/whoisonline.cpp | 1 - src/gui/widgets/itemcontainer.cpp | 10 +++++----- src/gui/widgets/setuptab.cpp | 5 ++--- src/gui/widgets/setuptabscroll.cpp | 2 +- src/gui/widgets/setuptouchitem.cpp | 2 +- src/guild.cpp | 2 +- src/inputmanager.cpp | 2 +- src/localplayer.cpp | 3 +-- src/party.cpp | 2 +- src/playerrelations.cpp | 2 +- src/resources/npcdb.cpp | 3 ++- 16 files changed, 30 insertions(+), 31 deletions(-) (limited to 'src') diff --git a/src/actorspritemanager.cpp b/src/actorspritemanager.cpp index 94ec49f8e..af73ad897 100644 --- a/src/actorspritemanager.cpp +++ b/src/actorspritemanager.cpp @@ -51,7 +51,7 @@ #define for_actors for (ActorSpritesConstIterator it = mActors.begin(), \ it_end = mActors.end() ; it != it_end; ++it) -class FindBeingFunctor final +static class FindBeingFunctor final { public: bool operator() (const ActorSprite *const actor) const @@ -77,7 +77,7 @@ class FindBeingFunctor final ActorSprite::Type type; } beingFinder; -class FindBeingEqualFunctor final +static class FindBeingEqualFunctor final { public: bool operator() (const Being *const being) const @@ -90,7 +90,7 @@ class FindBeingEqualFunctor final Being *findBeing; } beingEqualFinder; -class SortBeingFunctor final +static class SortBeingFunctor final { public: bool operator() (const Being *const being1, diff --git a/src/client.cpp b/src/client.cpp index 17a846b86..f4967a2d0 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -2902,7 +2902,7 @@ void Client::windowRemoved(const Window *const window) instance()->mCurrentDialog = nullptr; } -void Client::updateScreenKeyboard(int height) +void Client::updateScreenKeyboard(int height A_UNUSED) { // logger->log("keyboard height: %d", height); } diff --git a/src/gui/buydialog.cpp b/src/gui/buydialog.cpp index 2fc49d240..40e7648a6 100644 --- a/src/gui/buydialog.cpp +++ b/src/gui/buydialog.cpp @@ -78,7 +78,7 @@ public: } }; -static class SortItemPriceFunctor final +static const class SortItemPriceFunctor final { public: bool operator() (const ShopItem *const item1, @@ -95,7 +95,7 @@ static class SortItemPriceFunctor final } } itemPriceSorter; -static class SortItemNameFunctor final +static const class SortItemNameFunctor final { public: bool operator() (const ShopItem *const item1, @@ -112,7 +112,7 @@ static class SortItemNameFunctor final } } itemNameSorter; -static class SortItemIdFunctor final +static const class SortItemIdFunctor final { public: bool operator() (const ShopItem *const item1, @@ -129,7 +129,7 @@ static class SortItemIdFunctor final } } itemIdSorter; -static class SortItemWeightFunctor final +static const class SortItemWeightFunctor final { public: bool operator() (const ShopItem *const item1, @@ -146,7 +146,7 @@ static class SortItemWeightFunctor final } } itemWeightSorter; -static class SortItemAmountFunctor final +static const class SortItemAmountFunctor final { public: bool operator() (const ShopItem *const item1, @@ -163,7 +163,7 @@ static class SortItemAmountFunctor final } } itemAmountSorter; -static class SortItemTypeFunctor final +static const class SortItemTypeFunctor final { public: bool operator() (const ShopItem *const item1, diff --git a/src/gui/sdlfont.cpp b/src/gui/sdlfont.cpp index a205bbdc0..3a8f4a0b8 100644 --- a/src/gui/sdlfont.cpp +++ b/src/gui/sdlfont.cpp @@ -79,8 +79,6 @@ class SDLTextChunk final SDL_Surface *surface = TTF_RenderUTF8_Blended( font, strBuf, sdlCol); - const int width = surface->w; - const int height = surface->h; if (!surface) { @@ -89,6 +87,9 @@ class SDLTextChunk final return; } + const int width = surface->w; + const int height = surface->h; + if (color.r != color2.r || color.g != color2.g || color.b != color2.b) { // outlining diff --git a/src/gui/socialwindow.cpp b/src/gui/socialwindow.cpp index f3b907cb2..2abdf8286 100644 --- a/src/gui/socialwindow.cpp +++ b/src/gui/socialwindow.cpp @@ -54,7 +54,7 @@ #include "debug.h" -class SortFriendsFunctor final +static const class SortFriendsFunctor final { public: bool operator() (const Avatar *const m1, const Avatar *const m2) const diff --git a/src/gui/whoisonline.cpp b/src/gui/whoisonline.cpp index 170f5ba9e..ed3d038a7 100644 --- a/src/gui/whoisonline.cpp +++ b/src/gui/whoisonline.cpp @@ -44,7 +44,6 @@ #include "net/net.h" #include "net/playerhandler.h" -#include "utils/dtor.h" #include "utils/gettext.h" #include diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index e11e27fd6..0764aee08 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -62,7 +62,7 @@ class ItemIdPair final Item* mItem; }; -class SortItemAlphaFunctor final +static const class SortItemAlphaFunctor final { public: bool operator() (const ItemIdPair *const pair1, @@ -76,7 +76,7 @@ class SortItemAlphaFunctor final } } itemAlphaSorter; -class SortItemIdFunctor final +static const class SortItemIdFunctor final { public: bool operator() (const ItemIdPair *const pair1, @@ -89,7 +89,7 @@ class SortItemIdFunctor final } } itemIdSorter; -class SortItemWeightFunctor final +static const class SortItemWeightFunctor final { public: bool operator() (const ItemIdPair *const pair1, @@ -109,7 +109,7 @@ class SortItemWeightFunctor final } } itemWeightSorter; -class SortItemAmountFunctor final +static const class SortItemAmountFunctor final { public: bool operator() (const ItemIdPair *const pair1, @@ -129,7 +129,7 @@ class SortItemAmountFunctor final } } itemAmountSorter; -class SortItemTypeFunctor final +static const class SortItemTypeFunctor final { public: bool operator() (const ItemIdPair *const pair1, diff --git a/src/gui/widgets/setuptab.cpp b/src/gui/widgets/setuptab.cpp index 227b74d98..9aeec73dc 100644 --- a/src/gui/widgets/setuptab.cpp +++ b/src/gui/widgets/setuptab.cpp @@ -22,13 +22,12 @@ #include "gui/widgets/setuptab.h" -#include "logger.h" - #include "debug.h" SetupTab::SetupTab(const Widget2 *const widget) : Container(widget), - gcn::ActionListener() + gcn::ActionListener(), + gcn::WidgetListener() { setOpaque(false); addWidgetListener(this); diff --git a/src/gui/widgets/setuptabscroll.cpp b/src/gui/widgets/setuptabscroll.cpp index 64060aaad..89077dd8c 100644 --- a/src/gui/widgets/setuptabscroll.cpp +++ b/src/gui/widgets/setuptabscroll.cpp @@ -119,7 +119,7 @@ void SetupTabScroll::externalUpdated() } } -void SetupTabScroll::widgetResized(const gcn::Event &event) +void SetupTabScroll::widgetResized(const gcn::Event &event A_UNUSED) { mScroll->setWidth(getWidth() - 12); mScroll->setHeight(getHeight() - 12 - 12); diff --git a/src/gui/widgets/setuptouchitem.cpp b/src/gui/widgets/setuptouchitem.cpp index 8f8ec500c..e75b0a724 100644 --- a/src/gui/widgets/setuptouchitem.cpp +++ b/src/gui/widgets/setuptouchitem.cpp @@ -27,7 +27,7 @@ #include "debug.h" -class SortTouchActionFunctor final +static const class SortTouchActionFunctor final { public: bool operator() (const SetupActionData *const data1, diff --git a/src/guild.cpp b/src/guild.cpp index b0c42921e..36f9afc53 100644 --- a/src/guild.cpp +++ b/src/guild.cpp @@ -26,7 +26,7 @@ #include "debug.h" -class SortGuildFunctor final +static const class SortGuildFunctor final { public: bool operator() (const GuildMember *const m1, diff --git a/src/inputmanager.cpp b/src/inputmanager.cpp index cd72f0ad5..314b866e8 100644 --- a/src/inputmanager.cpp +++ b/src/inputmanager.cpp @@ -51,7 +51,7 @@ InputManager inputManager; extern QuitDialog *quitDialog; -class KeyFunctor final +static class KeyFunctor final { public: bool operator() (const int key1, const int key2) const diff --git a/src/localplayer.cpp b/src/localplayer.cpp index a4104ce03..99ef5a242 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -3455,7 +3455,6 @@ void LocalPlayer::pingRequest() std::string LocalPlayer::getPingTime() const { - int time = 0; std::string str; if (!mWaitPing) { @@ -3466,7 +3465,7 @@ std::string LocalPlayer::getPingTime() const } else { - time = tick_time; + int time = tick_time; if (time > mPingSendTick) time -= mPingSendTick; else diff --git a/src/party.cpp b/src/party.cpp index 514fa3dc6..ab4e921d1 100644 --- a/src/party.cpp +++ b/src/party.cpp @@ -25,7 +25,7 @@ #include "debug.h" -class SortPartyFunctor final +static const class SortPartyFunctor final { public: bool operator() (const PartyMember *const p1, diff --git a/src/playerrelations.cpp b/src/playerrelations.cpp index 7d7716c3e..24969d4ec 100644 --- a/src/playerrelations.cpp +++ b/src/playerrelations.cpp @@ -49,7 +49,7 @@ typedef PlayerRelations::const_iterator PlayerRelationsCIter; typedef std::list PlayerRelationListeners; typedef PlayerRelationListeners::const_iterator PlayerRelationListenersCIter; -class SortPlayersFunctor final +static const class SortPlayersFunctor final { public: bool operator() (const std::string &str1, diff --git a/src/resources/npcdb.cpp b/src/resources/npcdb.cpp index f8e1e2340..f2b3f7d2b 100644 --- a/src/resources/npcdb.cpp +++ b/src/resources/npcdb.cpp @@ -95,7 +95,8 @@ void NPCDB::load() currentInfo->setDeadSortOffsetY(XML::getProperty(npcNode, "deadSortOffsetY", 31)); - currentInfo->setAvatarId(XML::getProperty(npcNode, "avatar", 0)); + currentInfo->setAvatarId(static_cast(XML::getProperty( + npcNode, "avatar", 0))); SpriteDisplay display; for_each_xml_child_node(spriteNode, npcNode) -- cgit v1.2.3-70-g09d2