Index: trunk/pdns/pdns/sillyrecords.cc
===================================================================
--- trunk/pdns/pdns/sillyrecords.cc (revision 477)
+++ trunk/pdns/pdns/sillyrecords.cc (revision 612)
@@ -100,8 +100,8 @@
 
 /* converts ascii size/precision X * 10**Y(cm) to 0xXY. moves pointer.*/
-static u_int8_t precsize_aton(const char **strptr)
+static uint8_t precsize_aton(const char **strptr)
 {
   unsigned int mval = 0, cmval = 0;
-  u_int8_t retval = 0;
+  uint8_t retval = 0;
   const char *cp;
   int exponent;
@@ -244,7 +244,7 @@
   uint32_t lltemp1 = 0, lltemp2 = 0;
   int altmeters = 0, altfrac = 0, altsign = 1;
-  u_int8_t hp = 0x16;    /* default = 1e6 cm = 10000.00m = 10km */
-  u_int8_t vp = 0x13;    /* default = 1e3 cm = 10.00m */
-  u_int8_t siz = 0x12;   /* default = 1e2 cm = 1.00m */
+  uint8_t hp = 0x16;    /* default = 1e6 cm = 10000.00m = 10km */
+  uint8_t vp = 0x13;    /* default = 1e3 cm = 10.00m */
+  uint8_t siz = 0x12;   /* default = 1e2 cm = 1.00m */
   int which1 = 0, which2 = 0;
 
Index: trunk/pdns/pdns/dnsparser.hh
===================================================================
--- trunk/pdns/pdns/dnsparser.hh (revision 579)
+++ trunk/pdns/pdns/dnsparser.hh (revision 612)
@@ -180,14 +180,14 @@
   {
     if(f)
-      typemap[make_pair(cl,ty)]=f;
+      getTypemap()[make_pair(cl,ty)]=f;
     if(z)
-      zmakermap[make_pair(cl,ty)]=z;
-
-    namemap[make_pair(cl,ty)]=name;
+      getZmakermap()[make_pair(cl,ty)]=z;
+
+    getNamemap()[make_pair(cl,ty)]=name;
   }
 
   static uint16_t TypeToNumber(const string& name)
   {
-    for(namemap_t::const_iterator i=namemap.begin(); i!=namemap.end();++i)
+    for(namemap_t::const_iterator i=getNamemap().begin(); i!=getNamemap().end();++i)
       if(!strcasecmp(i->second.c_str(), name.c_str()))
 	return i->first.second;
@@ -198,8 +198,8 @@
   static const string NumberToType(uint16_t num)
   {
-    if(!namemap.count(make_pair(1,num)))
+    if(!getNamemap().count(make_pair(1,num)))
       return "#" + lexical_cast<string>(num);
       //      throw runtime_error("Unknown DNS type with numerical id "+lexical_cast<string>(num));
-    return namemap[make_pair(1,num)];
+    return getNamemap()[make_pair(1,num)];
   }
 
@@ -210,11 +210,10 @@
 protected:
   typedef std::map<std::pair<uint16_t, uint16_t>, makerfunc_t* > typemap_t;
-  static typemap_t typemap;
-
   typedef std::map<std::pair<uint16_t, uint16_t>, zmakerfunc_t* > zmakermap_t;
-  static zmakermap_t zmakermap;
-
   typedef std::map<std::pair<uint16_t, uint16_t>, string > namemap_t;
-  static namemap_t namemap;
+
+  static typemap_t& getTypemap();
+  static namemap_t& getNamemap();
+  static zmakermap_t& getZmakermap();
 };
 
Index: trunk/pdns/pdns/dnsparser.cc
===================================================================
--- trunk/pdns/pdns/dnsparser.cc (revision 611)
+++ trunk/pdns/pdns/dnsparser.cc (revision 612)
@@ -127,6 +127,6 @@
 					       PacketReader& pr)
 {
-  typemap_t::const_iterator i=typemap.find(make_pair(dr.d_class, dr.d_type));
-  if(i==typemap.end() || !i->second) {
+  typemap_t::const_iterator i=getTypemap().find(make_pair(dr.d_class, dr.d_type));
+  if(i==getTypemap().end() || !i->second) {
     return new UnknownRecordContent(dr, pr);
   }
@@ -138,6 +138,6 @@
 					       const string& content)
 {
-  zmakermap_t::const_iterator i=zmakermap.find(make_pair(qclass, qtype));
-  if(i==zmakermap.end()) {
+  zmakermap_t::const_iterator i=getZmakermap().find(make_pair(qclass, qtype));
+  if(i==getZmakermap().end()) {
     return new UnknownRecordContent(content);
   }
@@ -147,7 +147,23 @@
 
 
-DNSRecordContent::typemap_t DNSRecordContent::typemap __attribute__((init_priority(1000)));
-DNSRecordContent::namemap_t DNSRecordContent::namemap __attribute__((init_priority(1000)));
-DNSRecordContent::zmakermap_t DNSRecordContent::zmakermap __attribute__((init_priority(1000)));
+DNSRecordContent::typemap_t& DNSRecordContent::getTypemap()
+{
+  static DNSRecordContent::typemap_t typemap;
+  return typemap;
+}
+
+DNSRecordContent::namemap_t& DNSRecordContent::getNamemap()
+{
+  static DNSRecordContent::namemap_t namemap;
+  return namemap;
+}
+
+DNSRecordContent::zmakermap_t& DNSRecordContent::getZmakermap()
+{
+  static DNSRecordContent::zmakermap_t zmakermap;
+  return zmakermap;
+}
+
+
 
 void MOADNSParser::init(const char *packet, unsigned int len)
@@ -309,5 +325,5 @@
 }
 
-u_int8_t PacketReader::get8BitInt()
+uint8_t PacketReader::get8BitInt()
 {
   return d_content.at(d_pos++);
@@ -334,5 +350,5 @@
 }
 
-void PacketReader::getLabelFromContent(const vector<u_int8_t>& content, uint16_t& frompos, string& ret, int recurs) 
+void PacketReader::getLabelFromContent(const vector<uint8_t>& content, uint16_t& frompos, string& ret, int recurs) 
 {
   if(recurs > 10)
Index: trunk/pdns/pdns/recursor_cache.cc
===================================================================
--- trunk/pdns/pdns/recursor_cache.cc (revision 610)
+++ trunk/pdns/pdns/recursor_cache.cc (revision 612)
@@ -85,5 +85,5 @@
   string key(toLowerCanonic(qname)); key.append(1,'|'); key.append((char*)&code, ((char*)&code)+2);
   cache_t::const_iterator j=d_cache.find(key);
-  //  cerr<<"looking up "<< toLowerCanonic(qname)+"|"+qt.getName() << endl;
+  //  cerr<<"looking up "<< toLowerCanonic(qname)+"|"+qt.getName() << " ("<<key<<", "<<code<<")\n";
   if(res)
     res->clear();
@@ -93,5 +93,4 @@
       for(vector<StoredRecord>::const_iterator k=j->d_records.begin(); k != j->d_records.end(); ++k) {
 	DNSResourceRecord rr=String2DNSRR(qname, qt,  k->d_string, ttd=k->d_ttd); 
-	//	cerr<<"Returning '"<<rr.content<<"'\n";
 	res->insert(rr);
       }
@@ -110,5 +109,5 @@
 void MemRecursorCache::replace(const string &qname, const QType& qt,  const set<DNSResourceRecord>& content)
 {
-  int code=qt.getCode();
+  uint16_t code=qt.getCode();
   string key(toLowerCanonic(qname)); key.append(1,'|'); key.append((char*)&code, ((char*)&code)+2);
   cache_t::iterator stored=d_cache.find(key);
