]> jfr.im git - irc/evilnet/x3.git/commitdiff
Finally fixed all those pesky warnings
authorMatthew Beeching <redacted>
Thu, 1 Sep 2022 07:09:00 +0000 (08:09 +0100)
committerMatthew Beeching <redacted>
Thu, 1 Sep 2022 07:09:00 +0000 (08:09 +0100)
src/helpfile.c
src/hosthiding.c
src/ioset.c
src/log.c
src/mod-helpserv.c
src/mod-memoserv.c
src/modcmd.c
src/opserv.c
src/proto-p10.c
src/spamserv.c

index 91e8f2891c543b46d093b2d6be6794efa59c565d..caee9765ee4d0d4ead8b4b784da4d9d6c300e50a 100644 (file)
@@ -454,7 +454,7 @@ vsend_message(const char *dest, struct userNode *src, struct handle_info *handle
     void (*irc_send)(struct userNode *from, const char *to, const char *msg);
     static struct string_buffer input;
     unsigned int size, ipos, pos, length, chars_sent, use_color;
-    unsigned int expand_pos, expand_ipos, newline_ipos;
+    unsigned int expand_ipos, newline_ipos;
     char line[MAX_LINE_SIZE];
     struct service *service;
     static char* trigger = NULL;
@@ -513,7 +513,7 @@ vsend_message(const char *dest, struct userNode *src, struct handle_info *handle
      * that requires a very big intermediate buffer.
      */
     expand_ipos = newline_ipos = ipos = 0;
-    expand_pos = pos = 0;
+    pos = 0;
     chars_sent = 0;
     while (input.list[ipos]) {
        char ch, *value = NULL, *free_value;
@@ -730,12 +730,10 @@ vsend_message(const char *dest, struct userNode *src, struct handle_info *handle
             free(free_value);
        pos += length;
         if ((pos < size-1) && input.list[ipos]) {
-            expand_pos = pos;
             expand_ipos = ipos;
             continue;
         }
       send_line:
-        expand_pos = pos;
         expand_ipos = ipos;
         SEND_LINE(0);
 #undef SEND_LINE
index 850cdaa8be401b2aab99c323882b9639af0f1883..42104701b831549a8e8acf6e7449465557e206bb 100644 (file)
@@ -185,7 +185,7 @@ make_virthost (char *curr, char *host, char *virt)
 {
   static char mask[HOSTLEN + 1];
   char *parv[HOSTLEN + 1], *parv2[HOSTLEN + 1], s[HOSTLEN + 1], s2[HOSTLEN + 2];
-  int parc = 0, parc2 = 0, len = 0;
+  int parc2 = 0, len = 0;
   unsigned int hash[8];
 
   if ((strlen(host) < 3) || (strlen(curr) < 3))
@@ -194,7 +194,6 @@ make_virthost (char *curr, char *host, char *virt)
   strncpy (s, curr, HOSTLEN);
   strncpy (s2, host, HOSTLEN);
 
-  parc = str2arr (parv, s, ".");
   parc2 = str2arr (parv2, s2, ".");
 
   check_keys();
@@ -248,7 +247,7 @@ make_virtip (char *curr, char *host, char *virt)
 {
   static char mask[HOSTLEN + 1];
   char *parv[HOSTLEN + 1], *parv2[HOSTLEN + 1], s[HOSTLEN + 1], s2[HOSTLEN + 2];
-  int parc = 0, parc2 = 0, len = 0;
+  int parc2 = 0, len = 0;
   unsigned int hash[8];
 
   if ((strlen(host) < 3) || (strlen(curr) < 3))
@@ -257,7 +256,6 @@ make_virtip (char *curr, char *host, char *virt)
   strncpy (s, curr, HOSTLEN);
   strncpy (s2, host, HOSTLEN);
 
-  parc = str2arr (parv, s, ".");
   parc2 = str2arr (parv2, s2, ".");
 
   check_keys();
@@ -295,7 +293,7 @@ make_ipv6virthost (char *curr, char *host, char *new)
   static char mask[HOSTLEN + 1];
   char *parv[HOSTLEN + 1], *parv2[HOSTLEN + 1], s[HOSTLEN + 1],
     s2[HOSTLEN + 2], s3[HOSTLEN + 2];
-  int parc = 0, parc2 = 0;
+  int parc2 = 0;
   unsigned int hash[8];
 
   if ((strlen(host) < 3) || (strlen(curr) < 3))
@@ -306,7 +304,6 @@ make_ipv6virthost (char *curr, char *host, char *new)
 
   ip62arr (s, s3);
 
-  parc = str2arr (parv, s3, ":");
   parc2 = str2arr (parv2, s2, ".");
 
   check_keys();
index b6269ac2755516b6493f8c89abf46a12faa37935..1ae3aefb9a8b561d66c6ab6c9fe55959815b439b 100644 (file)
@@ -438,7 +438,7 @@ ioset_find_line_length(struct io_fd *fd) {
 
 static void
 ioset_buffered_read(struct io_fd *fd) {
-    int put_avail, nbr, fdnum;
+    int put_avail, nbr;
 
     if (!(put_avail = ioq_put_avail(&fd->recv)))
         put_avail = ioq_grow(&fd->recv);
@@ -473,7 +473,6 @@ ioset_buffered_read(struct io_fd *fd) {
         fd->recv.put += nbr;
         if (fd->recv.put == fd->recv.size)
             fd->recv.put = 0;
-        fdnum = fd->fd;
         while (fd->line_len > 0) {
             struct io_fd *old_active;
             int died = 0;
index 660a79513b0c65d0aec9dbe854f05d169b9cf81c..54d9ce37f78745d552c3b062b1aafd4f19a69154 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -745,12 +745,11 @@ log_entry_search(struct logSearch *discrim, entry_search_func esf, void *data)
     unsigned int matched = 0;
 
     if (discrim->type) {
-        static volatile struct logEntry *last;
         struct logEntry *entry;
 
-        for (entry = discrim->type->log_oldest, last = NULL;
+        for (entry = discrim->type->log_oldest;
              entry;
-             last = entry, entry = entry->next) {
+             entry = entry->next) {
             verify(entry);
             if (entry_match(discrim, entry)) {
                 esf(entry, data);
@@ -1068,7 +1067,6 @@ int parselog(char *LogLine, struct userNode *user, struct chanNode *cptr, char *
    char*  mynuh;
    char*  mynick;
    char*  myacc;
-   char*  mynuhtemp;
    char* mycommand;
    char*  myrest;
    char*  datestr;
@@ -1085,8 +1083,8 @@ int parselog(char *LogLine, struct userNode *user, struct chanNode *cptr, char *
       mynuh =   (char *) mysep(&LogLine, " ");
    else {
       mynick =    (char *) mysep(&LogLine, "!");
-      mynuhtemp = (char *) mysep(&LogLine, "@");
-      mynuhtemp = (char *) mysep(&LogLine, ":");
+      mysep(&LogLine, "@");
+      mysep(&LogLine, ":");
       myacc =     (char *) mysep(&LogLine, " ");
       sprintf(mynuhbuf, "%s:%s", mynick, myacc);
       mynuh = mynuhbuf;
index 5726a8ed7fa6af94aa97f9040b76b0f9576d86e5..23d0e7e05505216d2950361bbf9010f682a59023 100644 (file)
@@ -527,7 +527,7 @@ struct helpserv_bot {
     enum notification_type notify;
 
     /* This is a default; it can be changed on a per-request basis */
-    enum persistence_type persist_types[PERSIST_T_COUNT];
+    enum persistence_length persist_types[PERSIST_T_COUNT];
 
     dict_t users; /* indexed by handle */
 
@@ -1471,7 +1471,7 @@ static void helpserv_del_user(struct helpserv_bot *hs, struct helpserv_user *hs_
 }
 
 static int cmd_add_user(struct helpserv_bot *hs, int from_opserv, struct userNode *user, enum helpserv_level level, int argc, char *argv[]) {
-    struct helpserv_user *actor, *new_user;
+    struct helpserv_user *actor;
     struct handle_info *handle;
 
     REQUIRE_PARMS(2);
@@ -1499,7 +1499,7 @@ static int cmd_add_user(struct helpserv_bot *hs, int from_opserv, struct userNod
         return 0;
     }
 
-    new_user = helpserv_add_user(hs, handle, level);
+    helpserv_add_user(hs, handle, level);
 
     helpserv_notice(user, "HSMSG_ADDED_USER", helpserv_level2str(level), handle->handle);
     return 1;
index 0900687158d9679cfccd920713f6d62d19e67f6e..036902a1616fd06e58fd33f5999d8a906a352979 100644 (file)
@@ -315,7 +315,6 @@ static struct memo*
 add_memo(time_t sent, struct memo_account *recipient, struct memo_account *sender, char *message, int nfrom_read)
 {
     struct memo *memo;
-    struct history *history;
 
     memo = calloc(1, sizeof(*memo));
     if (!memo)
@@ -336,7 +335,7 @@ add_memo(time_t sent, struct memo_account *recipient, struct memo_account *sende
     memoCount++;
 
     if (nfrom_read)
-        history = add_history(sent, recipient, sender, memo->id);
+        add_history(sent, recipient, sender, memo->id);
 
     return memo;
 }
@@ -1113,7 +1112,6 @@ memoserv_history_read(const char *key, struct record_data *hir)
 {
     char *str;
     struct handle_info *sender, *recipient;
-    struct history *history;
     unsigned long id;
     time_t sent;
 
@@ -1151,7 +1149,7 @@ memoserv_history_read(const char *key, struct record_data *hir)
         return 0;
     }
 
-    history = add_history(sent, memoserv_get_account(recipient), memoserv_get_account(sender), id);
+    add_history(sent, memoserv_get_account(recipient), memoserv_get_account(sender), id);
 
     return 0;
 }
index 943580c0b8fa9d22263e95d78e35d6483717b994..f3a8f53d3c328e3b5f3f3476b1ff5ea16bdb93f2 100644 (file)
@@ -1136,9 +1136,8 @@ check_alias_args(char *argv[], unsigned int argc) {
             continue;
         } else if (isdigit(argv[arg][1])) {
             char *end_num;
-            unsigned long tmp;
 
-            tmp = strtoul(argv[arg]+1, &end_num, 10);
+            strtoul(argv[arg]+1, &end_num, 10);
             switch (end_num[0]) {
             case 0:
                 continue;
index 0f24c5a2c7355977044979b6182434a99093d38e..69fff832f0ad23fec57c1f4b24f7868e46a3f2b0 100644 (file)
@@ -1533,7 +1533,7 @@ opserv_shun(struct userNode *target, char *src_handle, char *reason, unsigned lo
 }
 
 static void
-opserv_tempshun(struct userNode *target, char *src_handle, char *reason)
+opserv_tempshun(struct userNode *target, UNUSED_ARG(char *src_handle), char *reason)
 {
     irc_tempshun(opserv, target, 0, reason);
 }
@@ -1581,7 +1581,7 @@ static MODCMD_FUNC(cmd_sblock)
         if(!svccmd_can_invoke(user, cmd->parent->bot, shun_cmd, channel, SVCCMD_NOISY))
             return 0;
     }
-    reason = (argc > 2) ? unsplit_string(argv+2, argc-2, NULL) : NULL;
+    reason = (argc > offset) ? unsplit_string(argv+offset, argc-offset, NULL) : NULL;
     shun = opserv_shun(target, user->handle_info->handle, reason, duration);
     reply("OSMSG_SHUN_ISSUED", shun->target);
     return 1;
@@ -5825,68 +5825,68 @@ discrim_match(discrim_t discrim, struct userNode *user)
                     matches++;
                     break;
                 case 'O':
-                    if(IsOper(user) != 0 != negate) matches++;
+                    if((IsOper(user) != 0) != negate) matches++;
                     break;
                 case 'o':
-                    if(IsOper(user) != 0 != negate) matches++;
+                    if((IsOper(user) != 0) != negate) matches++;
                     break;
                 case 'i':
-                    if(IsInvisible(user) != 0 != negate) matches++;
+                    if((IsInvisible(user) != 0) != negate) matches++;
                     break;
                 case 'w':
-                    if(IsWallOp(user) != 0 != negate) matches++;
+                    if((IsWallOp(user) != 0) != negate) matches++;
                     break;
                 case 'd':
-                    if(IsDeaf(user) != 0 != negate) matches++;
+                    if((IsDeaf(user) != 0) != negate) matches++;
                     break;
                 case 'k':
-                    if(IsService(user) != 0 != negate) matches++;
+                    if((IsService(user) != 0) != negate) matches++;
                     break;
                 case 'g':
-                    if(IsGlobal(user) != 0 != negate) matches++;
+                    if((IsGlobal(user) != 0) != negate) matches++;
                     break;
                 case 'h':
-                    if(IsSetHost(user) != 0 != negate) matches++;
+                    if((IsSetHost(user) != 0) != negate) matches++;
                     break;
                 case 'B':
-                    if(IsBotM(user) != 0 != negate) matches++;
+                    if((IsBotM(user) != 0) != negate) matches++;
                     break;
                 case 'p':
                 case 'n':
-                    if(IsHideChans(user) != 0 != negate) matches++;
+                    if((IsHideChans(user) != 0) != negate) matches++;
                     break;
                 case 'I':
-                    if(IsHideIdle(user) != 0 != negate) matches++;
+                    if((IsHideIdle(user) != 0) != negate) matches++;
                     break;
                 case 'X':
-                    if(IsXtraOp(user) != 0 != negate) matches++;
+                    if((IsXtraOp(user) != 0) != negate) matches++;
                     break;
                 case 'x':
-                    if(IsHiddenHost(user) != 0 != negate) matches++;
+                    if((IsHiddenHost(user) != 0) != negate) matches++;
                     break;
                 case 'a':
-                    if(IsAdmin(user) != 0 != negate) matches++;
+                    if((IsAdmin(user) != 0) != negate) matches++;
                     break;
                 case 'z':
-                    if(IsSSL(user) != 0 != negate) matches++;
+                    if((IsSSL(user) != 0) != negate) matches++;
                     break;
                 case 'D':
-                    if(IsPrivDeaf(user) != 0 != negate) matches++;
+                    if((IsPrivDeaf(user) != 0) != negate) matches++;
                     break;
                 case 'R':
-                    if(IsAccountOnly(user) != 0 != negate) matches++;
+                    if((IsAccountOnly(user) != 0) != negate) matches++;
                     break;
                 case 'W':
-                    if(IsWhoisNotice(user) != 0 != negate) matches++;
+                    if((IsWhoisNotice(user) != 0) != negate) matches++;
                     break;
                 case 'H':
-                    if(IsHideOper(user) != 0 != negate) matches++;
+                    if((IsHideOper(user) != 0) != negate) matches++;
                     break;
                 case 'L':
-                    if(IsHideOper(user) != 0 != negate) matches++;
+                    if((IsHideOper(user) != 0) != negate) matches++;
                     break;
                 case 'q':
-                    if(IsCommonChansOnly(user) != 0 != negate) matches++;
+                    if((IsCommonChansOnly(user) != 0) != negate) matches++;
                     break;
             }
         }
index d64b1a5d2f0104f6183d11aa44443a974f44b966..65a566b417061f9f1a24f45cd59109f478ed62b6 100644 (file)
@@ -1628,7 +1628,6 @@ static CMD_FUNC(cmd_nick)
         NickChange(user, argv[1], 1);
     } else {
         struct server *serv;
-        struct userNode *nuser;
         char modes[MAXLEN];
         /* new nick */
         if (argc < 9)
@@ -1638,7 +1637,7 @@ static CMD_FUNC(cmd_nick)
             unsplit_string(argv+6, argc-9, modes);
         else
             strcpy(modes, "+");
-        nuser = AddUser(serv, argv[1], argv[4], argv[5], modes, argv[argc-2], argv[argc-1], atoi(argv[3]), argv[argc-3]);
+        AddUser(serv, argv[1], argv[4], argv[5], modes, argv[argc-2], argv[argc-1], atoi(argv[3]), argv[argc-3]);
     }
     return 1;
 }
@@ -2218,7 +2217,7 @@ static CMD_FUNC(cmd_clearmode)
 static CMD_FUNC(cmd_topic)
 {
     struct chanNode *cn;
-    time_t chan_ts, topic_ts;
+    time_t topic_ts;
     struct userNode *user;
 
     if (argc < 3)
@@ -2231,15 +2230,12 @@ static CMD_FUNC(cmd_topic)
 
     if (argc == 5) {              /* Asuka / Topic Bursting IRCu's */
         user = GetUserH(origin);
-        chan_ts = atoi(argv[2]);
         topic_ts = atoi(argv[3]);
     } else if (argc >= 6) {       /* Nefarious 0.5.0 */
         user = GetUserH(strtok(argv[2], "!"));
-        chan_ts = atoi(argv[3]);
         topic_ts = atoi(argv[4]);
     } else {                      /* Regular IRCu (No Topic Bursting)*/
         user = GetUserH(origin);
-        chan_ts = cn->timestamp;
         topic_ts = now;
     }
 
@@ -2483,14 +2479,11 @@ static CMD_FUNC(cmd_notice)
 {
     struct privmsg_desc pd;
     struct server *srv;
-    int nuser = 0;
 
     if (argc != 3)
         return 0;
 
     pd.user = GetUserH(origin);
-    if(!pd.user)
-        nuser = 1;
     if (!pd.user || (IsGagged(pd.user) && !IsOper(pd.user))) {
     }
     else {
index a452614284eefd2e492fb764d8a25b74e91bea86..6d703bd6fef5f9c4867f4cb42518ea2013db77a6 100644 (file)
@@ -2156,7 +2156,7 @@ static SPAMSERV_FUNC(cmd_oaddtrust)
         cInfo = get_chanInfo(channel->name);
         cData = channel->channel_info;
 
-        if (!cInfo || !channel->channel_info) {
+        if (!cInfo || !cData) {
             ss_reply("SSMSG_NOT_REGISTERED", channel->name);
             return 0;
         }
@@ -2290,7 +2290,7 @@ static SPAMSERV_FUNC(cmd_odeltrust)
         cInfo = get_chanInfo(channel->name);
         cData = channel->channel_info;
 
-        if (!cInfo || !channel->channel_info) {
+        if (!cInfo || !cData) {
             ss_reply("SSMSG_NOT_REGISTERED", channel->name);
             return 0;
         }