]> jfr.im git - irc/quakenet/newserv.git/blobdiff - channel/channel.c
Merge pull request #1 from meeb/meeb
[irc/quakenet/newserv.git] / channel / channel.c
index 6531ce89f026a7fd856dee7650c11a306aa27f1f..b5cd2ad6c652b23c7a92fe824ab1d4642983ddbc 100644 (file)
@@ -16,7 +16,7 @@
 
 MODULE_VERSION("");
 
-#define channelhash(x)  (crc32i(x)%CHANNELHASHSIZE)
+#define channelhash(x)  (irc_crc32i(x)%CHANNELHASHSIZE)
 
 unsigned long nouser;
 
@@ -43,9 +43,6 @@ void channelstats(int hooknum, void *arg);
 void sendchanburst(int hooknum, void *arg);
 
 void _init() {
-  /* Initialise internal structures */
-  initchannelalloc();
-
   /* Set up the nouser marker according to our own numeric */
   nouser=(mylongnum<<18)|CU_NOUSERMASK;
   
@@ -53,7 +50,7 @@ void _init() {
    * before we register all our hooks which would otherwise get called
    * during the disconnect. */
   if (connected) { 
-    irc_send("%s SQ %s 0 :Resync [adding channel support]",mynumeric->content,myserver->content); irc_disconnected();
+    irc_send("%s SQ %s 0 :Resync [adding channel support]",mynumeric->content,myserver->content); irc_disconnected(0);
   }
 
   /* Set up our hooks */
@@ -161,7 +158,7 @@ void delnickfromchannel(channel *cp, long numeric, int updateuser) {
   void *args[2];
   
   if ((np=getnickbynumeric(numeric&CU_NUMERICMASK))==NULL) {
-    Error("channel",ERR_ERROR,"Trying to remove non-existent nick %d from channel %s",numeric,cp->index->name);
+    Error("channel",ERR_ERROR,"Trying to remove non-existent nick %lu from channel %s",numeric,cp->index->name->content);
     return;
   }
   
@@ -418,7 +415,7 @@ unsigned int countuniquehosts(channel *cp) {
       continue;
       
     if ((np=getnickbynumeric(cp->users->content[i]))==NULL) {
-      Error("channel",ERR_ERROR,"Found unknown numeric %u on channel %s",cp->users->content[i],cp->index->name->content);
+      Error("channel",ERR_ERROR,"Found unknown numeric %lu on channel %s",cp->users->content[i],cp->index->name->content);
       continue;
     }
     
@@ -440,7 +437,7 @@ unsigned int countuniquehosts(channel *cp) {
  * Unlike ircu we don't check against KEYLEN here, this is done elsewhere.
  */
 void clean_key(char *key) {
-  while (*key) {
+  for (;*key;key++) {
     if (*key<=32 || *key==':' || *key==',') {
       *key=0;
       return;