]> jfr.im git - solanum.git/blobdiff - src/parse.c
implement configurable channel modes (closes #31)
[solanum.git] / src / parse.c
index 44dfd64e4bbc5c834e8400a9e48f196151db1318..190c9f08a10263533e197bdce80cc2cfba16a800 100644 (file)
@@ -49,7 +49,7 @@ struct Dictionary *alias_dict = NULL;
 /* parv[0] is not used, and parv[LAST] == NULL */
 static char *para[MAXPARA + 2];
 
-static void cancel_clients(struct Client *, struct Client *, char *);
+static void cancel_clients(struct Client *, struct Client *);
 static void remove_unknown(struct Client *, char *, char *);
 
 static void do_numeric(char[], struct Client *, struct Client *, int, char **);
@@ -169,7 +169,7 @@ parse(struct Client *client_p, char *pbuffer, char *bufend)
                        if(from->from != client_p)
                        {
                                ServerStats.is_wrdi++;
-                               cancel_clients(client_p, from, pbuffer);
+                               cancel_clients(client_p, from);
                                return;
                        }
                }
@@ -269,7 +269,7 @@ parse(struct Client *client_p, char *pbuffer, char *bufend)
                return;
        }
 
-       if(handle_command(mptr, client_p, from, i, /* XXX discards const!!! */ (const char **)para) < -1)
+       if(handle_command(mptr, client_p, from, i, /* XXX discards const!!! */ (const char **)(void *)para) < -1)
        {
                char *p;
                for (p = pbuffer; p <= end; p += 8)
@@ -339,14 +339,14 @@ handle_command(struct Message *mptr, struct Client *client_p,
        handler = ehandler.handler;
 
        /* check right amount of params is passed... --is */
-       if(i < ehandler.min_para || 
+       if(i < ehandler.min_para ||
           (ehandler.min_para && EmptyString(hpara[ehandler.min_para - 1])))
        {
                if(!IsServer(client_p))
                {
                        sendto_one(client_p, form_str(ERR_NEEDMOREPARAMS),
-                                  me.name, 
-                                  EmptyString(client_p->name) ? "*" : client_p->name, 
+                                  me.name,
+                                  EmptyString(client_p->name) ? "*" : client_p->name,
                                   mptr->cmd);
                        if(MyClient(client_p))
                                return (1);
@@ -380,8 +380,6 @@ handle_encap(struct Client *client_p, struct Client *source_p,
        struct MessageEntry ehandler;
        MessageHandler handler = 0;
 
-       parv[0] = source_p->name;
-
        mptr = irc_dictionary_retrieve(cmd_dict, command);
 
        if(mptr == NULL || mptr->cmd == NULL)
@@ -390,7 +388,7 @@ handle_encap(struct Client *client_p, struct Client *source_p,
        ehandler = mptr->handlers[ENCAP_HANDLER];
        handler = ehandler.handler;
 
-       if(parc < ehandler.min_para || 
+       if(parc < ehandler.min_para ||
           (ehandler.min_para && EmptyString(parv[ehandler.min_para - 1])))
                return;
 
@@ -471,9 +469,9 @@ report_messages(struct Client *source_p)
        DICTIONARY_FOREACH(msg, &iter, cmd_dict)
        {
                s_assert(msg->cmd != NULL);
-               sendto_one_numeric(source_p, RPL_STATSCOMMANDS, 
+               sendto_one_numeric(source_p, RPL_STATSCOMMANDS,
                                   form_str(RPL_STATSCOMMANDS),
-                                  msg->cmd, msg->count, 
+                                  msg->cmd, msg->count,
                                   msg->bytes, msg->rcount);
        }
 
@@ -482,19 +480,19 @@ report_messages(struct Client *source_p)
                s_assert(amsg->name != NULL);
                sendto_one_numeric(source_p, RPL_STATSCOMMANDS,
                                   form_str(RPL_STATSCOMMANDS),
-                                  amsg->name, amsg->hits, 0, 0);
+                                  amsg->name, amsg->hits, 0L, 0);
        }
 }
 
 /* cancel_clients()
  *
  * inputs      - client who sent us the message, client with fake
- *               direction, command
+ *               direction
  * outputs     - a given warning about the fake direction
  * side effects -
  */
 static void
-cancel_clients(struct Client *client_p, struct Client *source_p, char *cmd)
+cancel_clients(struct Client *client_p, struct Client *source_p)
 {
        /* ok, fake prefix happens naturally during a burst on a nick
         * collision with TS5, we cant kill them because one client has to
@@ -522,7 +520,7 @@ cancel_clients(struct Client *client_p, struct Client *source_p, char *cmd)
 /* remove_unknown()
  *
  * inputs      - client who gave us message, supposed sender, buffer
- * output      - 
+ * output      -
  * side effects        - kills issued for clients, squits for servers
  */
 static void
@@ -537,7 +535,7 @@ remove_unknown(struct Client *client_p, char *lsender, char *lbuffer)
         * #XX          is a SID (SQUIT)
         * meep.foo     is a server (SQUIT)
         */
-       if((IsDigit(lsender[0]) && slen == 3) || 
+       if((IsDigit(lsender[0]) && slen == 3) ||
           (strchr(lsender, '.') != NULL))
        {
                sendto_realops_snomask(SNO_DEBUG, L_ALL,
@@ -546,7 +544,7 @@ remove_unknown(struct Client *client_p, char *lsender, char *lbuffer)
 
                sendto_one(client_p,
                           ":%s SQUIT %s :(Unknown prefix (%s) from %s)",
-                          get_id(&me, client_p), lsender, 
+                          get_id(&me, client_p), lsender,
                           lbuffer, client_p->name);
        }
        else if(!IsDigit(lsender[0]))
@@ -561,7 +559,7 @@ remove_unknown(struct Client *client_p, char *lsender, char *lbuffer)
                sid[3] = '\0';
                server = find_server(NULL, sid);
                if (server != NULL && server->from == client_p)
-                       sendto_one(client_p, ":%s KILL %s :%s (Unknown Client)", 
+                       sendto_one(client_p, ":%s KILL %s :%s (Unknown Client)",
                                        get_id(&me, client_p), lsender, me.name);
        }
 }
@@ -629,7 +627,7 @@ do_numeric(char numeric[], struct Client *client_p, struct Client *source_p, int
                         * because it will have been already killed by the local server.
                         *
                         * unfortunately, as we cant guarantee other servers will do the
-                        * "right thing" on a nick collision, we have to keep both kills.  
+                        * "right thing" on a nick collision, we have to keep both kills.
                         * ergo we need to ignore ERR_NOSUCHNICK. --fl_
                         */
                        /* quick comment. This _was_ tried. i.e. assume the other servers
@@ -660,8 +658,8 @@ do_numeric(char numeric[], struct Client *client_p, struct Client *source_p, int
                        return;
 
                /* Fake it for server hiding, if its our client */
-               sendto_one(target_p, ":%s %s %s%s", 
-                          get_id(source_p, target_p), numeric, 
+               sendto_one(target_p, ":%s %s %s%s",
+                          get_id(source_p, target_p), numeric,
                           get_id(target_p, target_p), buffer);
                return;
        }