summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/being/playerrelations.cpp23
-rw-r--r--src/gui/widgets/emotepage.cpp4
-rw-r--r--src/gui/widgets/tabs/tab.cpp2
-rw-r--r--src/guild.cpp57
-rw-r--r--src/party.cpp47
-rw-r--r--src/resources/db/statdb.cpp6
-rw-r--r--src/resources/resourcemanager/resourcemanager_unittest.cc2
-rw-r--r--src/resources/sdlgfxblitfunc.cpp2
8 files changed, 68 insertions, 75 deletions
diff --git a/src/being/playerrelations.cpp b/src/being/playerrelations.cpp
index 2e4b4b68c..e45376137 100644
--- a/src/being/playerrelations.cpp
+++ b/src/being/playerrelations.cpp
@@ -44,18 +44,18 @@ typedef PlayerRelations::const_iterator PlayerRelationsCIter;
typedef std::list<PlayerRelationsListener *> PlayerRelationListeners;
typedef PlayerRelationListeners::const_iterator PlayerRelationListenersCIter;
-namespace
-{
- static const char *const PLAYER_IGNORE_STRATEGY_NOP = "nop";
- static const char *const PLAYER_IGNORE_STRATEGY_EMOTE0 = "emote0";
- static const char *const DEFAULT_IGNORE_STRATEGY
- = PLAYER_IGNORE_STRATEGY_EMOTE0;
+static const char *const PLAYER_IGNORE_STRATEGY_NOP = "nop";
+static const char *const PLAYER_IGNORE_STRATEGY_EMOTE0 = "emote0";
+static const char *const DEFAULT_IGNORE_STRATEGY =
+ PLAYER_IGNORE_STRATEGY_EMOTE0;
- static const char *const NAME = "name";
- static const char *const RELATION = "relation";
+static const char *const NAME = "name";
+static const char *const RELATION = "relation";
- static const unsigned int IGNORE_EMOTE_TIME = 100;
+static const unsigned int IGNORE_EMOTE_TIME = 100;
+namespace
+{
class SortPlayersFunctor final
{
public:
@@ -131,11 +131,10 @@ namespace
return container;
}
};
-
- static PlayerConfSerialiser player_conf_serialiser; // stateless singleton
-
} // namespace
+static PlayerConfSerialiser player_conf_serialiser; // stateless singleton
+
const unsigned int PlayerRelation::RELATION_PERMISSIONS[RELATIONS_NR] =
{
/* NEUTRAL */ 0, // we always fall back to the defaults anyway
diff --git a/src/gui/widgets/emotepage.cpp b/src/gui/widgets/emotepage.cpp
index 459e386a4..88f4addd4 100644
--- a/src/gui/widgets/emotepage.cpp
+++ b/src/gui/widgets/emotepage.cpp
@@ -34,8 +34,8 @@
namespace
{
- static const unsigned int emoteWidth = 17;
- static const unsigned int emoteHeight = 18;
+ const unsigned int emoteWidth = 17;
+ const unsigned int emoteHeight = 18;
} // namespace
EmotePage::EmotePage(const Widget2 *const widget) :
diff --git a/src/gui/widgets/tabs/tab.cpp b/src/gui/widgets/tabs/tab.cpp
index a4a2f583b..36c2a3f40 100644
--- a/src/gui/widgets/tabs/tab.cpp
+++ b/src/gui/widgets/tabs/tab.cpp
@@ -88,7 +88,7 @@ float Tab::mAlpha = 1.0;
namespace
{
- static std::string const data[Tab::TAB_COUNT] =
+ std::string const data[Tab::TAB_COUNT] =
{
"tab.xml",
"tab_highlighted.xml",
diff --git a/src/guild.cpp b/src/guild.cpp
index 87c06ec2f..575220cde 100644
--- a/src/guild.cpp
+++ b/src/guild.cpp
@@ -30,40 +30,37 @@
#include "debug.h"
-namespace
+static class SortGuildFunctor final
{
- static class SortGuildFunctor final
- {
- public:
- A_DEFAULT_COPY(SortGuildFunctor)
+ public:
+ A_DEFAULT_COPY(SortGuildFunctor)
- bool operator() (const GuildMember *const m1,
- const GuildMember *const m2) const
- {
- if ((m1 == nullptr) || (m2 == nullptr))
- return false;
-
- if (m1->getOnline() != m2->getOnline())
- {
- return static_cast<int>(m1->getOnline()) >
- static_cast<int>(m2->getOnline());
- }
-
- if (m1->getPos() != m2->getPos())
- return m1->getPos() > m2->getPos();
-
- if (m1->getName() != m2->getName())
- {
- std::string s1 = m1->getName();
- std::string s2 = m2->getName();
- toLower(s1);
- toLower(s2);
- return s1 < s2;
- }
+ bool operator() (const GuildMember *const m1,
+ const GuildMember *const m2) const
+ {
+ if ((m1 == nullptr) || (m2 == nullptr))
return false;
+
+ if (m1->getOnline() != m2->getOnline())
+ {
+ return static_cast<int>(m1->getOnline()) >
+ static_cast<int>(m2->getOnline());
}
- } guildSorter;
-} // namespace
+
+ if (m1->getPos() != m2->getPos())
+ return m1->getPos() > m2->getPos();
+
+ if (m1->getName() != m2->getName())
+ {
+ std::string s1 = m1->getName();
+ std::string s2 = m2->getName();
+ toLower(s1);
+ toLower(s2);
+ return s1 < s2;
+ }
+ return false;
+ }
+} guildSorter;
GuildMember::GuildMember(Guild *const guild,
const BeingId accountId,
diff --git a/src/party.cpp b/src/party.cpp
index 83c8bd12e..f28236e34 100644
--- a/src/party.cpp
+++ b/src/party.cpp
@@ -29,35 +29,32 @@
#include "debug.h"
-namespace
+static class SortPartyFunctor final
{
- static class SortPartyFunctor final
- {
- public:
- A_DEFAULT_COPY(SortPartyFunctor)
+ public:
+ A_DEFAULT_COPY(SortPartyFunctor)
- bool operator() (const PartyMember *const p1,
- const PartyMember *const p2) const
- {
- if ((p1 == nullptr) || (p2 == nullptr))
- return false;
- if (p1->getLeader())
- return true;
- if (p2->getLeader())
- return false;
-
- if (p1->getName() != p2->getName())
- {
- std::string s1 = p1->getName();
- std::string s2 = p2->getName();
- toLower(s1);
- toLower(s2);
- return s1 < s2;
- }
+ bool operator() (const PartyMember *const p1,
+ const PartyMember *const p2) const
+ {
+ if ((p1 == nullptr) || (p2 == nullptr))
+ return false;
+ if (p1->getLeader())
+ return true;
+ if (p2->getLeader())
return false;
+
+ if (p1->getName() != p2->getName())
+ {
+ std::string s1 = p1->getName();
+ std::string s2 = p2->getName();
+ toLower(s1);
+ toLower(s2);
+ return s1 < s2;
}
- } partySorter;
-} // namespace
+ return false;
+ }
+} partySorter;
PartyMember::PartyMember(Party *const party,
const BeingId id,
diff --git a/src/resources/db/statdb.cpp b/src/resources/db/statdb.cpp
index 7911009a3..26734bdb3 100644
--- a/src/resources/db/statdb.cpp
+++ b/src/resources/db/statdb.cpp
@@ -35,9 +35,9 @@
namespace
{
bool mLoaded = false;
- static std::vector<BasicStat> mBasicStats;
- static std::map<std::string, std::vector<BasicStat> > mStats;
- static std::vector<std::string> mPages;
+ std::vector<BasicStat> mBasicStats;
+ std::map<std::string, std::vector<BasicStat> > mStats;
+ std::vector<std::string> mPages;
} // namespace
void StatDb::addDefaultStats()
diff --git a/src/resources/resourcemanager/resourcemanager_unittest.cc b/src/resources/resourcemanager/resourcemanager_unittest.cc
index 801c8ae0d..231d5cfc0 100644
--- a/src/resources/resourcemanager/resourcemanager_unittest.cc
+++ b/src/resources/resourcemanager/resourcemanager_unittest.cc
@@ -48,7 +48,7 @@
namespace
{
- static int testResouceCounter = 0;
+ int testResouceCounter = 0;
class TestResource : public Resource
{
diff --git a/src/resources/sdlgfxblitfunc.cpp b/src/resources/sdlgfxblitfunc.cpp
index f419893a6..89fe0b21e 100644
--- a/src/resources/sdlgfxblitfunc.cpp
+++ b/src/resources/sdlgfxblitfunc.cpp
@@ -68,7 +68,7 @@ namespace
SDL_PixelFormat *dst;
};
- static unsigned int GFX_ALPHA_ADJUST_ARRAY[256] =
+ unsigned int GFX_ALPHA_ADJUST_ARRAY[256] =
{
0, /* 0 */
15, /* 1 */