diff options
author | smatz <smatz@openttd.org> | 2008-06-24 09:15:45 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-06-24 09:15:45 +0000 |
commit | 61847389d6a372dc8ae936d0d0b7a010e471340a (patch) | |
tree | 434b9d9480c094ea3ab6aebd08d1b5005f4bcc1e /src/driver.h | |
parent | fee2adb299270756d44e2a4f55a3b45b0935c4c7 (diff) | |
download | openttd-61847389d6a372dc8ae936d0d0b7a010e471340a.tar.xz |
(svn r13619) -Codechange: use 'const char *' instead of std::string for blitter and driver names
Removes indirect dependency on <string> for 20 files, reduces binary size by 16kB
Diffstat (limited to 'src/driver.h')
-rw-r--r-- | src/driver.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/driver.h b/src/driver.h index af98e0fa5..e4d9e4627 100644 --- a/src/driver.h +++ b/src/driver.h @@ -8,7 +8,6 @@ #include "debug.h" #include "core/enum_type.hpp" #include "string_func.h" -#include <string> #include <map> bool GetDriverParamBool(const char * const *parm, const char *name); @@ -37,9 +36,17 @@ DECLARE_POSTFIX_INCREMENT(Driver::Type); class DriverFactoryBase { private: Driver::Type type; - char *name; + const char *name; int priority; - typedef std::map<std::string, DriverFactoryBase *> Drivers; + + struct StringCompare { + bool operator () (const char *a, const char *b) const + { + return strcmp(a, b) < 0; + } + }; + + typedef std::map<const char *, DriverFactoryBase *, StringCompare> Drivers; static Drivers &GetDrivers() { |