]> jfr.im git - irc/ircd-hybrid/bopm.git/commitdiff
bopchecker.c:
authorandy <redacted>
Sun, 28 Apr 2002 17:35:54 +0000 (17:35 +0000)
committerandy <redacted>
Sun, 28 Apr 2002 17:35:54 +0000 (17:35 +0000)
Hacks to avoid unused variable warnings.
config.c:
Code cleanups.
extern.h:
Code cleanups.
irc.c:
Code cleanups.
main.c:
Merged singal handlers into one function, code cleanups.
misc.c:
Code cleanups.
opercmd.c, opercmd.h:
2nd parameter of checkoper was never used.
scan.c:
Code cleanups.
stats.c:
Code cleanups.

bopchecker.c
config.c
extern.h
irc.c
main.c
misc.c
opercmd.c
opercmd.h
scan.c
stats.c

index 040f778149d0ec50daf228c7f260b5d3c9b2c917..307485310ac92c19122fdab797311e198033cf9c 100644 (file)
@@ -213,18 +213,27 @@ void log(char *data,...)
 
 void irc_kline(char *addr, char *ip)
 {
+       /* Just enough to shut gcc up */
+       if (addr || ip)
+               return;
 }
 
 void dnsbl_report(struct scan_struct *ss)
 {
+       if (ss)
+               return;
 }
 
 void irc_send(char *data, ...)
 {
+       if (data)
+               return;
 }
 
 int dnsbl_check(const char *addr, const char *irc_nick,
                const char *irc_user, char *irc_addr)
 {
+       if (addr || irc_nick || irc_user || irc_addr)
+               return(0);
        return(0);
 }
index c6fc2c893922a78268067675daee9ae8d018df7a..1f2d3df69e5926df5edb3951600a041431521546 100644 (file)
--- a/config.c
+++ b/config.c
@@ -61,9 +61,9 @@ char *CONF_AWAY            = 0;
 char *CONF_TARGET_STRING   = 0;
 string_list *CONF_EXCLUDE  = 0;
 
-int  CONF_SCANPORT         = 0;
-int  CONF_PORT             = 0;
-int  CONF_FDLIMIT          = 0;
+unsigned int  CONF_SCANPORT         = 0;
+unsigned int  CONF_PORT             = 0;
+unsigned int  CONF_FDLIMIT          = 0;
 
 /* Configuration Hash , Hashes Config Params to their Function Handlers*/
 /*      NAME                  , TYPE   , REQ, REQMET, PTR TO VAR        */
@@ -111,7 +111,7 @@ void config_load(char *filename)
 
     string_list *list, *oldlist, *nextlist;
 
-    int i;
+    size_t i;
 
     if(!(in = fopen(filename, "r")))
      {
@@ -221,7 +221,7 @@ void config_load(char *filename)
 
 void config_checkreq()
 {
-      int i;
+      size_t i;
       int errfnd = 0;
       string_list *list;
 
index 2738151fb50032b54a8b89ef2e7154fa1083a7d7..214b1b9fb4125dc4873dcabaa956e80dfebcc91a 100644 (file)
--- a/extern.h
+++ b/extern.h
     extern char *CONF_TARGET_STRING;
     extern string_list *CONF_EXCLUDE;
 
-    extern int   CONF_PORT;
-    extern int   CONF_SCANPORT;
-    extern int   CONF_FDLIMIT;
+    extern unsigned int CONF_PORT;
+    extern unsigned int CONF_SCANPORT;
+    extern unsigned int CONF_FDLIMIT;
 
-    extern int   OPT_DEBUG;
+    extern unsigned int OPT_DEBUG;
  
-    extern    time_t STAT_START_TIME;
-    extern    int STAT_NUM_CONNECTS;
+    extern time_t STAT_START_TIME;
+    extern unsigned int STAT_NUM_CONNECTS;
 #endif    
diff --git a/irc.c b/irc.c
index 4690ebbd456989aecff28ee50ffdf3c96891dbbb..b7ea256fdfb4c75905df6d1b08d367f8bf9897aa 100644 (file)
--- a/irc.c
+++ b/irc.c
@@ -385,9 +385,9 @@ void irc_parse()
 
    char *token[32];
    int   tokens = 0;
-   int   i, h, len;
    time_t present;
    char *key;
+   size_t i, h, len;
 
    time(&IRC_LAST); /*     Update timeout tracking    */ 
 
@@ -720,6 +720,10 @@ void do_hybrid_connect(int tokens, char **token)
        char *irc_nick;
        char conn_notice[MSGLENMAX];
 
+       /* Paranoia. */
+       if (tokens < 11)
+               return;
+
        STAT_NUM_CONNECTS++;
 
        /* take a copy of the original connect notice now in case we need it
@@ -765,6 +769,10 @@ void do_trircd_connect(int tokens, char **token)
        char *irc_nick;
        char conn_notice[MSGLENMAX];
 
+       /* Paranoia. */
+       if (tokens < 9)
+               return;
+
        STAT_NUM_CONNECTS++;
 
        /* take a copy of the original connect notice now in case we need it
@@ -810,6 +818,10 @@ void do_ultimateircd_connect(int tokens, char **token)
        char *irc_nick;
        char conn_notice[MSGLENMAX];
 
+       /* Paranoia. */
+       if (tokens < 17)
+               return;
+
        STAT_NUM_CONNECTS++;
 
        /* take a copy of the original connect notice now in case we need it
@@ -859,6 +871,10 @@ void do_xnet_connect(int tokens, char **token)
        char *irc_nick;
        char conn_notice[MSGLENMAX];
 
+       /* Paranoia. */
+       if (tokens < 11)
+               return;
+
        STAT_NUM_CONNECTS++;
 
        /* take a copy of the original connect notice now in case we need
@@ -900,9 +916,9 @@ void do_xnet_connect(int tokens, char **token)
  */
 static char *get_chan_key(const char *channel)
 {
-       size_t len;
-       int i, h, ci, ki;
+       int ci, ki;
        char *kp;
+       size_t i, h, len;
 
        ci = 0;
        
diff --git a/main.c b/main.c
index 4a0bbae26df1bd60313e9f7ff5fb0c4f97166ee5..d614536799a7970654569e3e031456882fdddd44 100644 (file)
--- a/main.c
+++ b/main.c
@@ -47,12 +47,11 @@ along with this program; if not, write to the Free Software
 #include "options.h"
 #include "version.h"
 
-RETSIGTYPE do_alarm(int);
-RETSIGTYPE do_int(int);
+RETSIGTYPE do_signal(int signum);
 
 int ALARMED = 0;
 
-int OPT_DEBUG = 0;
+unsigned int OPT_DEBUG = 0;
 char *CONFNAME = DEFAULTNAME;
 
 char *CONFDIR = VARDIR;
@@ -160,9 +159,9 @@ int main(int argc, char **argv)
 
     /* Setup alarm & int handlers */
  
-    ALARMACTION.sa_handler = &(do_alarm);  
+    ALARMACTION.sa_handler = &(do_signal);  
     ALARMACTION.sa_flags = SA_RESTART;
-    INTACTION.sa_handler = &(do_int);
+    INTACTION.sa_handler = &(do_signal);
     
     sigaction(SIGALRM, &ALARMACTION, 0);
     sigaction(SIGINT, &INTACTION, 0);
@@ -190,15 +189,16 @@ int main(int argc, char **argv)
     return 0;
 }
 
-
-void do_alarm(int notused)
+void do_signal(int signum)
 {
-   ALARMED = 1;
-   alarm(1);
-}
-
-void do_int(int notused)
-{
-   log("MAIN -> Caught SIGINT, bye!");
-   exit(0);
+       switch (signum) {
+       case SIGALRM:
+               ALARMED = 1;
+               alarm(1);
+               break;
+       case SIGINT:
+               log("MAIN -> Caught SIGINT, bye!");
+               exit(0);
+               break;
+       }
 }
diff --git a/misc.c b/misc.c
index c3001f6de5560d42b0fade0368f988f66741b5ea..730b8120e6b229680bf53f90bef19a95a92cd830 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -127,7 +127,7 @@ char *dissect_time(time_t time)
 char *clean(char *str)
 {
 
-    int i;
+    size_t i;
     int lastnon;  /* Position of last non space */
     int firstnon; /* Position of first non space */
 
index fce552217bf306d69fe590f689daa843d8daf5c0..a8155c8aba37d3e446453be591cf0bf3199acc0e 100644 (file)
--- a/opercmd.c
+++ b/opercmd.c
@@ -50,7 +50,7 @@ void do_oper_cmd(const char *nick, const char *cmd, const char *param,
                  "checking, yo.", target, nick);
         return;
        }
-      checkoper(nick, cmd, param, target, CMD_CHECK);
+      checkoper(nick, param, target, CMD_CHECK);
     }
    else
     {
@@ -60,8 +60,8 @@ void do_oper_cmd(const char *nick, const char *cmd, const char *param,
    return;
 }
 
-void checkoper(const char *nick, const char *cmd, const char *param,
-              const char *target, unsigned int cmd_type)
+void checkoper(const char *nick, const char *param, const char *target,
+    unsigned int cmd_type)
 {
    int i;
 
index 8d7d1df122e7381b3af46da848cf0b9e266aa502..e9e43913f4765dec7f5f61b6f72ff5ad5144a940 100644 (file)
--- a/opercmd.h
+++ b/opercmd.h
@@ -36,9 +36,8 @@
 
        void do_oper_cmd(const char *nick, const char *cmd,
                         const char *param, const char *target);
-       void checkoper(const char *nick, const char *cmd,
-                      const char *param, const char *target,
-                      unsigned int cmd_type);
+       void checkoper(const char *nick, const char *param,
+           const char *target, unsigned int cmd_type);
        void check_userhost(const char *userhost);
        void delete_command(unsigned int index);
        void reap_commands(time_t present);
diff --git a/scan.c b/scan.c
index 5f2cfd634e5d82c777f5cfdb3687f92e137b3092..bdc00ebb4bbfebe959141bf408c768837371292b 100644 (file)
--- a/scan.c
+++ b/scan.c
@@ -116,7 +116,7 @@ void scan_connect(char *addr, char *irc_addr, char *irc_nick,
                  char *irc_user, int verbose, char *conn_notice)
 {
 
-      int i;                
+      size_t i;                
       scan_struct *newconn; 
 
       if(OPT_DEBUG)
@@ -258,8 +258,7 @@ void scan_check()
 
 #ifdef HAVE_SYS_POLL_H
     static struct pollfd ufds[MAX_POLL];  /* MAX_POLL is defined in options.h */
-    int i;
-    unsigned long size;
+    unsigned long size, i;
 #else /* select() */
     fd_set w_fdset;
     fd_set r_fdset;
diff --git a/stats.c b/stats.c
index 2c0ae3ca0e17213e2403d56b859971af62d276c0..2f0e01c2db037d76291a70e0cd4edaaa44fda778 100644 (file)
--- a/stats.c
+++ b/stats.c
@@ -40,7 +40,7 @@ along with this program; if not, write to the Free Software
 #include "stats.h"
 
 time_t STAT_START_TIME;
-int STAT_NUM_CONNECTS;
+unsigned int STAT_NUM_CONNECTS;
 unsigned int STAT_DNSBL_MATCHES;
 
 extern protocol_hash SCAN_PROTOCOLS[];
@@ -54,7 +54,7 @@ void do_stats_init()
 
 void do_stats(const char *target)
 {
-   int i;
+   size_t i;
    time_t now = time(NULL);
    time_t uptime = now - STAT_START_TIME;