aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMax Horn2009-12-30 23:01:36 +0000
committerMax Horn2009-12-30 23:01:36 +0000
commitb0e02675e79b2102f9d05de3d9f549b5438dfdcb (patch)
tree0c18ed16f9776e34ce808498fede580a628f6ca7 /common
parenta753f606ec105a287b6eda5ffbfa2b4d6342bb84 (diff)
downloadscummvm-rg350-b0e02675e79b2102f9d05de3d9f549b5438dfdcb.tar.gz
scummvm-rg350-b0e02675e79b2102f9d05de3d9f549b5438dfdcb.tar.bz2
scummvm-rg350-b0e02675e79b2102f9d05de3d9f549b5438dfdcb.zip
Get rid of Common::String::emptyString, and also of some port specific hackery (getting rid of certain global C++ objs)
svn-id: r46781
Diffstat (limited to 'common')
-rw-r--r--common/config-manager.cpp32
-rw-r--r--common/config-manager.h18
-rw-r--r--common/str.cpp7
-rw-r--r--common/str.h6
4 files changed, 6 insertions, 57 deletions
diff --git a/common/config-manager.cpp b/common/config-manager.cpp
index 268fac5d2e..5934f32012 100644
--- a/common/config-manager.cpp
+++ b/common/config-manager.cpp
@@ -40,17 +40,6 @@ static bool isValidDomainName(const Common::String &domName) {
namespace Common {
-#if !(defined(PALMOS_ARM) || defined(PALMOS_DEBUG) || defined(__GP32__))
-
-const String ConfigManager::kApplicationDomain("scummvm");
-const String ConfigManager::kTransientDomain("__TRANSIENT");
-
-#ifdef ENABLE_KEYMAPPER
-const String ConfigManager::kKeymapperDomain("keymapper");
-#endif
-
-#else
-
const char *ConfigManager::kApplicationDomain = "scummvm";
const char *ConfigManager::kTransientDomain = "__TRANSIENT";
@@ -58,13 +47,10 @@ const char *ConfigManager::kTransientDomain = "__TRANSIENT";
const char *ConfigManager::kKeymapperDomain = "keymapper";
#endif
-#endif
-
#pragma mark -
-ConfigManager::ConfigManager()
- : _activeDomain(0) {
+ConfigManager::ConfigManager() : _activeDomain(0) {
}
@@ -407,11 +393,7 @@ const String & ConfigManager::get(const String &key) const {
else if (_defaultsDomain.contains(key))
return _defaultsDomain[key];
-#if !(defined(PALMOS_ARM) || defined(PALMOS_DEBUG) || defined(__GP32__))
- return String::emptyString;
-#else
- return ConfMan._emptyString;
-#endif
+ return _emptyString;
}
const String & ConfigManager::get(const String &key, const String &domName) const {
@@ -434,11 +416,7 @@ const String & ConfigManager::get(const String &key, const String &domName) cons
if (!domain->contains(key)) {
#if 1
-#if !(defined(PALMOS_ARM) || defined(PALMOS_DEBUG) || defined(__GP32__))
- return String::emptyString;
-#else
- return ConfMan._emptyString;
-#endif
+ return _emptyString;
#else
error("ConfigManager::get(%s,%s) called on non-existent key",
key.c_str(), domName.c_str());
@@ -641,11 +619,7 @@ const String &ConfigManager::Domain::get(const String &key) const {
if (iter != end())
return iter->_value;
-#if !(defined(PALMOS_ARM) || defined(PALMOS_DEBUG) || defined(__GP32__))
- return String::emptyString;
-#else
return ConfMan._emptyString;
-#endif
}
void ConfigManager::Domain::setDomainComment(const String &comment) {
diff --git a/common/config-manager.h b/common/config-manager.h
index 75e6ee6449..699774dfcd 100644
--- a/common/config-manager.h
+++ b/common/config-manager.h
@@ -68,31 +68,17 @@ public:
typedef HashMap<String, Domain, IgnoreCase_Hash, IgnoreCase_EqualTo> DomainMap;
-#if !(defined(PALMOS_ARM) || defined(PALMOS_DEBUG) || defined(__GP32__))
/** The name of the application domain (normally 'scummvm'). */
- static const String kApplicationDomain;
+ static const char *kApplicationDomain;
/** The transient (pseudo) domain. */
- static const String kTransientDomain;
-
-#ifdef ENABLE_KEYMAPPER
- /** The name of keymapper domain used to store the key maps */
- static const String kKeymapperDomain;
-#endif
-
-#else
- static const char *kApplicationDomain;
static const char *kTransientDomain;
- const String _emptyString;
-
#ifdef ENABLE_KEYMAPPER
/** The name of keymapper domain used to store the key maps */
static const char *kKeymapperDomain;
#endif
-#endif
-
void loadDefaultConfigFile();
void loadConfigFile(const String &filename);
@@ -179,6 +165,8 @@ private:
Domain * _activeDomain;
String _filename;
+
+ const String _emptyString;
};
} // End of namespace Common
diff --git a/common/str.cpp b/common/str.cpp
index 2f657d2890..6dd5d911a7 100644
--- a/common/str.cpp
+++ b/common/str.cpp
@@ -37,13 +37,6 @@
namespace Common {
-#if !(defined(PALMOS_ARM) || defined(PALMOS_DEBUG) || defined(__GP32__))
-const String String::emptyString;
-#else
-const char *String::emptyString = "";
-#endif
-
-
MemoryPool *g_refCountPool = 0; // FIXME: This is never freed right now
static uint32 computeCapacity(uint32 len) {
diff --git a/common/str.h b/common/str.h
index f69fc268e1..60103e0242 100644
--- a/common/str.h
+++ b/common/str.h
@@ -90,12 +90,6 @@ protected:
}
public:
-#if !(defined(PALMOS_ARM) || defined(PALMOS_DEBUG) || defined(__GP32__))
- static const String emptyString;
-#else
- static const char *emptyString;
-#endif
-
/** Construct a new empty string. */
String() : _size(0), _str(_storage) { _storage[0] = 0; }