--- deliantra/server/common/shstr.C 2006/09/12 19:20:06 1.17 +++ deliantra/server/common/shstr.C 2006/09/14 18:13:01 1.20 @@ -1,4 +1,3 @@ - /* * shstr.C */ @@ -12,7 +11,7 @@ #include "global.h" -typedef std::tr1::unordered_set HT; +typedef std::tr1::unordered_set , true> HT; static HT ht; @@ -21,7 +20,7 @@ { int len = strlen (s); - const char *v = (const char *) (2 + (int *) g_slice_alloc (sizeof (int) * 2 + len + 1)); + const char *v = (const char *) (2 + (int *)g_slice_alloc (sizeof (int) * 2 + len + 1)); shstr::length (v) = len; shstr::refcnt (v) = 1; @@ -47,7 +46,7 @@ if (!s) return s; - HT::iterator i = ht.find (s); + AUTODECL (i, ht.find (s)); return i != ht.end ()? *i : 0; } @@ -74,12 +73,9 @@ void shstr::gc () { -return; //D -//D currently disabled: some datastructures might still store them -//D but their pointers will become invalidated static const char *curpos; - HT::iterator i = curpos ? ht.find (curpos) : ht.begin (); + AUTODECL (i, curpos ? ht.find (curpos) : ht.begin ()); if (i == ht.end ()) i = ht.begin (); @@ -98,7 +94,7 @@ break; else if (!refcnt (*i)) { - HT::iterator o = i++; + AUTODECL (o, i++); const char *s = *o; ht.erase (o);