(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
This commit is contained in:
smatz
2008-06-24 09:15:45 +00:00
parent 40d5242f91
commit 96d880ea9e
3 changed files with 33 additions and 10 deletions

View File

@@ -8,7 +8,6 @@
#include "base.hpp"
#include "../debug.h"
#include "../string_func.h"
#include <string>
#include <map>
/**
@@ -16,8 +15,16 @@
*/
class BlitterFactoryBase {
private:
char *name;
typedef std::map<std::string, BlitterFactoryBase *> Blitters;
const char *name;
struct StringCompare {
bool operator () (const char *a, const char *b) const
{
return strcmp(a, b) < 0;
}
};
typedef std::map<const char *, BlitterFactoryBase *, StringCompare> Blitters;
static Blitters &GetBlitters()
{
@@ -58,7 +65,7 @@ public:
if (this->name == NULL) return;
GetBlitters().erase(this->name);
if (GetBlitters().empty()) delete &GetBlitters();
free(this->name);
free((void *)this->name);
}
/**