diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-11-30 22:27:23 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-11-30 22:27:23 +0000 |
commit | c2526493455dac1f11c0d1851e1e329d2b7fbe89 (patch) | |
tree | d017884cd0553c2776085b794994499128dd0953 /src/modules/m_spanningtree.cpp | |
parent | 95370659256b7fd32da2510292b36552614c7ad9 (diff) |
Typecasting is ugly.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2074 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree.cpp')
-rw-r--r-- | src/modules/m_spanningtree.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index f98edbd3c..431d03111 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -42,7 +42,8 @@ using namespace std; #define nspace std #endif -static Module* TreeProtocolModule; +class ModuleSpanningTree; +static ModuleSpanningTree* TreeProtocolModule; extern std::vector<Module*> modules; extern std::vector<ircd_module*> factory; @@ -610,7 +611,7 @@ class TreeSocket : public InspSocket snprintf(data,MAXBUF,":%s FMODE %s +b %s",Srv->GetServerName().c_str(),c->second->name,b->data); this->WriteLine(data); } - FOREACH_MOD OnSyncChannel(c->second,TreeProtocolModule,this); + FOREACH_MOD OnSyncChannel(c->second,(Module*)TreeProtocolModule,(void*)this); } } @@ -633,7 +634,7 @@ class TreeSocket : public InspSocket { this->WriteLine(":"+std::string(u->second->nick)+" FJOIN "+std::string(chl)); } - FOREACH_MOD OnSyncUser(u->second,TreeProtocolModule,this); + FOREACH_MOD OnSyncUser(u->second,(Module*)TreeProtocolModule,(void*)this); } } } @@ -1647,12 +1648,12 @@ class ModuleSpanningTree : public Module if (target_type == TYPE_USER) { userrec* u = (userrec*)target; - opaque->WriteLine(":"+s->GetName()+" FMODE "+u->nick+" "+modeline); + s->WriteLine(":"+s->GetName()+" FMODE "+u->nick+" "+modeline); } else { chanrec* c = (chanrec*)target; - opaque->WriteLine(":"+s->GetName()+" FMODE "+c->name+" "+modeline); + s->WriteLine(":"+s->GetName()+" FMODE "+c->name+" "+modeline); } } } @@ -1682,7 +1683,8 @@ class ModuleSpanningTreeFactory : public ModuleFactory virtual Module * CreateModule() { - return new ModuleSpanningTree; + TreeProtocolModule = new ModuleSpanningTree; + return TreeProtocolModule; } }; @@ -1690,7 +1692,6 @@ class ModuleSpanningTreeFactory : public ModuleFactory extern "C" void * init_module( void ) { - TreeProtocolModule = new ModuleSpanningTreeFactory; - return TreeProtocolModule; + return new ModuleSpanningTreeFactory; } |