(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:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user