Răsfoiți Sursa

* More unneeded stack pointers

svn: 1290
Bryan Drewery 22 ani în urmă
părinte
comite
249537cbf5
4 a modificat fișierele cu 27 adăugiri și 27 ștergeri
  1. 2 2
      src/botcmd.c
  2. 7 7
      src/botmsg.c
  3. 16 16
      src/cmds.c
  4. 2 2
      src/tandem.h

+ 2 - 2
src/botcmd.c

@@ -160,11 +160,11 @@ void bot_remotecmd(int idx, char *par) {
   if (!strcmp(tbot, conf.bot->nick)) {
     gotremotecmd(tbot, fbot, fhnd, fidx, par);
   } else if (!strcmp(tbot, "*")) {
-    botnet_send_cmd_broad(idx, fbot, fhnd, atoi(fidx), par);
+    botnet_send_cmd_broad(idx, fbot, atoi(fidx), par);
     gotremotecmd(tbot, fbot, fhnd, fidx, par);
   } else {
     if (nextbot(tbot) != idx)
-      botnet_send_cmd(fbot, tbot, fhnd, atoi(fidx), par);
+      botnet_send_cmd(fbot, tbot, atoi(fidx), par);
   }
 }
 

+ 7 - 7
src/botmsg.c

@@ -180,32 +180,32 @@ void botnet_send_cmdpass(int idx, char *cmd, char *pass)
   }
 }
 
-int botnet_send_cmd(char * fbot, char * bot, char * from, int fromidx, char * cmd) {
+int botnet_send_cmd(char * fbot, char * bot, int fromidx, char * cmd) {
   int i = nextbot(bot);
 
   if (i >= 0) {
-    simple_sprintf(OBUF, "rc %s %s %s %i %s\n", bot, fbot, from, fromidx, cmd);
+    simple_sprintf(OBUF, "rc %s %s %s %i %s\n", bot, fbot, dcc[fromidx].nick, fromidx, cmd);
     tputs(dcc[i].sock, OBUF, strlen(OBUF));
     return 1;
   } else if (!strcmp(bot, conf.bot->nick)) {
     char tmp[24] = "";
 
     sprintf(tmp, "%i", fromidx);
-    gotremotecmd(conf.bot->nick, conf.bot->nick, from, tmp, cmd);
+    gotremotecmd(conf.bot->nick, conf.bot->nick, dcc[fromidx].nick, tmp, cmd);
   }
   return 0;
 }
 
-void botnet_send_cmd_broad(int idx, char * fbot, char * from, int fromidx, char * cmd) {
+void botnet_send_cmd_broad(int idx, char * fbot, int fromidx, char * cmd) {
   if (tands > 0) {
-    egg_snprintf(OBUF, sizeof OBUF, "rc * %s %s %i %s\n", fbot, from, fromidx, cmd);
+    egg_snprintf(OBUF, sizeof OBUF, "rc * %s %s %i %s\n", fbot, dcc[fromidx].nick, fromidx, cmd);
     send_tand_but(idx, OBUF, strlen(OBUF));
   }
-  if (idx<0) {
+  if (idx < 0) {
     char tmp[24] = "";
 
     sprintf(tmp, "%i", fromidx);
-    gotremotecmd("*", conf.bot->nick, from, tmp, cmd);
+    gotremotecmd("*", conf.bot->nick, dcc[fromidx].nick, tmp, cmd);
   }
 }
 

+ 16 - 16
src/cmds.c

@@ -3599,7 +3599,7 @@ static void cmd_mns_host(int idx, char *par)
 /* netserver */
 static void cmd_netserver(int idx, char * par) {
   putlog(LOG_CMDS, "*", "#%s# netserver", dcc[idx].nick);
-  botnet_send_cmd_broad(-1, conf.bot->nick, dcc[idx].nick, idx, "cursrv");
+  botnet_send_cmd_broad(-1, conf.bot->nick, idx, "cursrv");
 }
 
 static void cmd_botserver(int idx, char * par) {
@@ -3611,7 +3611,7 @@ static void cmd_botserver(int idx, char * par) {
   if (nextbot(par)<0) {
     dprintf(idx, "%s isn't a linked bot\n", par);
   }
-  botnet_send_cmd(conf.bot->nick, par, dcc[idx].nick, idx, "cursrv");
+  botnet_send_cmd(conf.bot->nick, par, idx, "cursrv");
 }
 
 
@@ -3633,7 +3633,7 @@ static void cmd_timesync(int idx, char *par) {
 
   putlog(LOG_CMDS, "*", "#%s# timesync", dcc[idx].nick);
   sprintf(tmp, "timesync %li", timesync + now);
-  botnet_send_cmd_broad(-1, conf.bot->nick, dcc[idx].nick, idx, tmp);
+  botnet_send_cmd_broad(-1, conf.bot->nick, idx, tmp);
 }
 
 static void rcmd_timesync(char *frombot, char *fromhand, char *fromidx, char *par) {
@@ -3649,7 +3649,7 @@ static void rcmd_timesync(char *frombot, char *fromhand, char *fromidx, char *pa
 /* netversion */
 static void cmd_netversion(int idx, char * par) {
   putlog(LOG_CMDS, "*", "#%s# netversion", dcc[idx].nick);
-  botnet_send_cmd_broad(-1, conf.bot->nick, dcc[idx].nick, idx, "ver");
+  botnet_send_cmd_broad(-1, conf.bot->nick, idx, "ver");
 }
 
 static void cmd_botversion(int idx, char * par) {
@@ -3661,7 +3661,7 @@ static void cmd_botversion(int idx, char * par) {
   if (nextbot(par)<0) {
     dprintf(idx, "%s isn't a linked bot\n", par);
   }
-  botnet_send_cmd(conf.bot->nick, par, dcc[idx].nick, idx, "ver");
+  botnet_send_cmd(conf.bot->nick, par, idx, "ver");
 }
 #endif /* HUB */
 
@@ -3682,7 +3682,7 @@ static void rcmd_ver(char * fbot, char * fhand, char * fidx) {
 /* netnick, botnick */
 static void cmd_netnick (int idx, char *par) {
   putlog(LOG_CMDS, "*", "#%s# netnick", dcc[idx].nick);
-  botnet_send_cmd_broad(-1, conf.bot->nick, dcc[idx].nick, idx, "curnick");
+  botnet_send_cmd_broad(-1, conf.bot->nick, idx, "curnick");
 }
 
 static void cmd_botnick(int idx, char * par) {
@@ -3694,7 +3694,7 @@ static void cmd_botnick(int idx, char * par) {
   if (nextbot(par) < 0) {
     dprintf(idx, "%s isn't a linked bot\n", par);
   }
-  botnet_send_cmd(conf.bot->nick, par, dcc[idx].nick, idx, "curnick");
+  botnet_send_cmd(conf.bot->nick, par, idx, "curnick");
 }
 
 static void rcmd_curnick(char * fbot, char * fhand, char * fidx) {
@@ -3728,7 +3728,7 @@ static void cmd_botmsg(int idx, char * par) {
     return;
   }
   egg_snprintf(tmp, sizeof tmp, "msg %s %s", tnick, par);
-  botnet_send_cmd(conf.bot->nick, tbot, dcc[idx].nick, idx, tmp);
+  botnet_send_cmd(conf.bot->nick, tbot, idx, tmp);
 }
 
 static void cmd_netmsg(int idx, char * par) {
@@ -3741,7 +3741,7 @@ static void cmd_netmsg(int idx, char * par) {
     return;
   }
   egg_snprintf(tmp, sizeof tmp, "msg %s %s", tnick, par);
-  botnet_send_cmd_broad(-1, conf.bot->nick, dcc[idx].nick, idx, tmp);
+  botnet_send_cmd_broad(-1, conf.bot->nick, idx, tmp);
 }
 
 static void rcmd_msg(char * tobot, char * frombot, char * fromhand, char * fromidx, char * par) {
@@ -3770,7 +3770,7 @@ static void cmd_netlag(int idx, char * par) {
   tm = (tv.sec % 10000) * 100 + (tv.usec * 100) / (1000000);
   sprintf(tmp, "ping %li", tm);
   dprintf(idx, "Sent ping to all linked bots\n");
-  botnet_send_cmd_broad(-1, conf.bot->nick, dcc[idx].nick, idx, tmp);
+  botnet_send_cmd_broad(-1, conf.bot->nick, idx, tmp);
 }
 #endif /* HUB */
 
@@ -3778,7 +3778,7 @@ static void rcmd_ping(char * frombot, char *fromhand, char * fromidx, char * par
   char tmp[64] = "";
 
   egg_snprintf(tmp, sizeof tmp, "pong %s", par);
-  botnet_send_cmd(conf.bot->nick, frombot, fromhand, atoi(fromidx), tmp);
+  botnet_send_cmd(conf.bot->nick, frombot, atoi(fromidx), tmp);
 }
 
 static void rcmd_pong(char *frombot, char *fromhand, char *fromidx, char *par) {
@@ -3801,7 +3801,7 @@ static void cmd_netw(int idx, char * par) {
 
   putlog(LOG_CMDS, "*", "#%s# netw", dcc[idx].nick);
   strcpy(tmp, "exec w");
-  botnet_send_cmd_broad(-1, conf.bot->nick, dcc[idx].nick, idx, tmp);
+  botnet_send_cmd_broad(-1, conf.bot->nick, idx, tmp);
 }
 
 static void cmd_netps(int idx, char * par) {
@@ -3814,7 +3814,7 @@ static void cmd_netps(int idx, char * par) {
     return;
   }
   egg_snprintf(buf, sizeof par, "exec ps %s", par);
-  botnet_send_cmd_broad(-1, conf.bot->nick, dcc[idx].nick, idx, buf);
+  botnet_send_cmd_broad(-1, conf.bot->nick, idx, buf);
 }
 
 static void cmd_netlast(int idx, char * par) {
@@ -3827,7 +3827,7 @@ static void cmd_netlast(int idx, char * par) {
     return;
   }
   egg_snprintf(buf, sizeof par, "exec last %s", par);
-  botnet_send_cmd_broad(-1, conf.bot->nick, dcc[idx].nick, idx, buf);
+  botnet_send_cmd_broad(-1, conf.bot->nick, idx, buf);
 }
 #endif /* HUB */
 
@@ -3898,7 +3898,7 @@ static void cmd_netcrontab(int idx, char * par) {
     return;
   }
   egg_snprintf(buf, sizeof buf, "exec crontab %s %s", cmd, par);
-  botnet_send_cmd_broad(-1, conf.bot->nick, dcc[idx].nick, idx, buf);
+  botnet_send_cmd_broad(-1, conf.bot->nick, idx, buf);
 }
 #endif /* HUB */
 
@@ -4008,7 +4008,7 @@ static void cmd_botjump(int idx, char * par) {
     return;
   }
   egg_snprintf(buf, sizeof buf, "jump %s", par);
-  botnet_send_cmd(conf.bot->nick, tbot, dcc[idx].nick, idx, buf);
+  botnet_send_cmd(conf.bot->nick, tbot, idx, buf);
 }
 
 static void rcmd_jump(char * frombot, char * fromhand, char * fromidx, char * par) {

+ 2 - 2
src/tandem.h

@@ -71,8 +71,8 @@ void botnet_send_nkch_part(int, int, char *);
 void botnet_send_nkch(int, char *);
 int bots_in_subtree(tand_t *);
 int users_in_subtree(tand_t *);
-int botnet_send_cmd(char * fbot, char * bot, char * from, int fromidx, char * cmd);
-void botnet_send_cmd_broad(int idx, char * fbot, char * from, int fromidx, char * cmd);
+int botnet_send_cmd(char * fbot, char * bot, int fromidx, char * cmd);
+void botnet_send_cmd_broad(int idx, char * fbot, int fromidx, char * cmd);
 void botnet_send_cmdreply(char * fbot, char * bot, char * to, char * toidx, char * ln);
 
 #define b_status(a)	(dcc[a].status)