src/blitter/factory.hpp
branchnoai
changeset 11126 72d4c9314c72
parent 11044 097ea3e7ec56
--- a/src/blitter/factory.hpp	Mon Jun 30 21:31:23 2008 +0000
+++ b/src/blitter/factory.hpp	Wed Jul 09 13:32:13 2008 +0000
@@ -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 @@
 		if (this->name == NULL) return;
 		GetBlitters().erase(this->name);
 		if (GetBlitters().empty()) delete &GetBlitters();
-		free(this->name);
+		free((void *)this->name);
 	}
 
 	/**