]> jfr.im git - irc/ircd-hybrid/bopm.git/commitdiff
Mostly pedantry.
authorandy <redacted>
Sun, 22 Jun 2003 13:19:39 +0000 (13:19 +0000)
committerandy <redacted>
Sun, 22 Jun 2003 13:19:39 +0000 (13:19 +0000)
src/config-parser.y
src/defs.h [new file with mode: 0644]
src/firedns.c
src/irc.c
src/list.c
src/main.c
src/negcache.c
src/opercmd.c

index 904a43160f2f88816cdd4679d8fd8d5ed3a97ac0..5429037f12167135c39caab5e9fa8932314dc06a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002  Erik Fears
+ * Copyright (C) 2002-2003  Erik Fears
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -255,7 +255,7 @@ channel_entry:
    node_t *node;
    struct ChannelConf *item;
 
-   item = MyMalloc(sizeof(struct ChannelConf));
+   item = MyMalloc(sizeof *item);
 
    item->name = DupString("");
    item->key = DupString("");
@@ -306,7 +306,7 @@ user_entry:
    node_t *node;
    struct UserConf *item;
 
-   item = MyMalloc(sizeof(struct UserConf));
+   item = MyMalloc(sizeof *item);
 
    item->masks = list_create();
    item->scanners = list_create();
@@ -352,7 +352,7 @@ scanner_entry:
    node_t *node;
    struct ScannerConf *item, *olditem;
 
-   item = MyMalloc(sizeof(struct ScannerConf));
+   item = MyMalloc(sizeof *item);
 
    /* Setup ScannerConf defaults */
    item->name = DupString("undefined");
@@ -475,7 +475,7 @@ scanner_protocol: PROTOCOL '=' PROTOCOLTYPE ':' NUMBER ';'
 
    node_t *node;
  
-   item = MyMalloc(sizeof(struct ProtocolConf));
+   item = MyMalloc(sizeof *item);
    item->type = $3;
    item->port = $5;
 
@@ -524,7 +524,7 @@ opm_blacklist_entry:
    node_t *node;
    struct BlacklistConf *item;
 
-   item = MyMalloc(sizeof(struct BlacklistConf));
+   item = MyMalloc(sizeof *item);
 
    item->name = DupString("");
    item->kline = DupString("");
@@ -593,7 +593,7 @@ blacklist_reply_item: NUMBER '=' STRING ';'
    struct BlacklistConf *blacklist = tmp;
    node_t *node;
 
-   item = MyMalloc(sizeof(struct BlacklistReplyConf));
+   item = MyMalloc(sizeof *item);
 
    item->number = $1;
    item->type = DupString($3);
diff --git a/src/defs.h b/src/defs.h
new file mode 100644 (file)
index 0000000..b49e472
--- /dev/null
@@ -0,0 +1,11 @@
+/* vim: set shiftwidth=3 softtabstop=3 expandtab: */ 
+
+#ifndef OPM_H
+#define OPM_H
+
+/* Stuff to shut up warnings about rcsid being unused. */
+#define USE_VAR(var)    static char sizeof##var = sizeof(sizeof##var) + sizeof(var)
+/* RCS tag. */
+#define RCSID(x)        static char rcsid[] = x; USE_VAR(rcsid);
+
+#endif /* OPM_H */
index 9bbf8e857f5a9aa742ad107ddcb79d5ae8e77cec..b5326ea69f915e2d0bb39b60be25ed06cd676745 100644 (file)
@@ -46,6 +46,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #include "log.h"
 #include "dnsbl.h"
 
+RCSID("$Id$");
+
 #define FIREDNS_TRIES 3
 #define min(a,b) (a < b ? a : b)
 
@@ -749,7 +751,7 @@ void firedns_cycle(void)
       return;
 
    if(ufds == NULL)
-      ufds = MyMalloc(sizeof(*ufds) * OptionsItem->dns_fdlimit);
+      ufds = MyMalloc((sizeof *ufds) * OptionsItem->dns_fdlimit);
 
    time(&timenow);
    size = 0;
index 8b398e6c3cb68feae476982d3173da37bc96065a..9ea952bacf2e237a393c3cb9ff82d6da1fb594cd 100644 (file)
--- a/src/irc.c
+++ b/src/irc.c
@@ -1,7 +1,7 @@
 /* vim: set shiftwidth=3 softtabstop=3 expandtab: */ 
 
 /*
- * Copyright (C) 2002  Erik Fears
+ * Copyright (C) 2002-2003  Erik Fears
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -72,6 +72,8 @@
 #include "malloc.h"
 #include "main.h"
 
+RCSID("$Id$");
+
 static void irc_init(void);
 static void irc_connect(void);
 static void irc_reconnect(void);
@@ -738,7 +740,7 @@ static struct UserInfo *userinfo_create(char *source)
       return NULL;
    }
 
-   ret = MyMalloc(sizeof(struct UserInfo));
+   ret = MyMalloc(sizeof *ret);
 
    ret->irc_nick     = DupString(nick);
    ret->irc_username = DupString(username);
@@ -1006,7 +1008,7 @@ static void m_notice(char **parv, unsigned int parc, char *msg, struct UserInfo
    /* Compile the regular expression if it has not been already */
    if(preg == NULL)
    {
-      preg = MyMalloc(sizeof(regex_t));
+      preg = MyMalloc(sizeof *preg);
 
       if((errnum = regcomp(preg, IRCItem->connregex, REG_ICASE | REG_EXTENDED)) != 0)
       {
index 59f4353963c2dca39416eb8c6051af56275644d8..2d1ef96744e5fa9817f946d72114c03c58d7e2da 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002  Erik Fears
+ * Copyright (C) 2002-2003  Erik Fears
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
 
 #include "malloc.h"
 #include "list.h"
+#include "defs.h"
+
+RCSID("$Id$");
 
 node_t *node_create(void *data)
 {
-   node_t *node = MyMalloc(sizeof(node_t));
+   node_t *node = MyMalloc(sizeof *node);
    node->next = NULL;
    node->prev = NULL;
    node->data = (void *) data;
@@ -36,7 +39,7 @@ node_t *node_create(void *data)
 
 list_t *list_create()
 {
-   list_t *list = MyMalloc(sizeof(list_t));
+   list_t *list = MyMalloc(sizeof *list);
 
    list->head = NULL;
    list->tail = NULL;
index 965fa8a70c6edc886ce7badd6119e87c84a4d589..aadfbb4debb20cc5293e5ac9a8a97cbcfadde84b 100644 (file)
@@ -1,7 +1,7 @@
 /* vim: set shiftwidth=3 softtabstop=3 expandtab: */ 
 
 /*
-Copyright (C) 2002  Erik Fears
+Copyright (C) 2002-2003  Erik Fears
  
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -55,6 +55,8 @@ along with this program; if not, write to the Free Software
 #include "firedns.h"
 #include "main.h"
 
+RCSID("$Id$");
+
 static RETSIGTYPE do_signal(int signum);
 
 int RESTART = 0;             /* Flagged to restart on next cycle */
@@ -109,8 +111,8 @@ int main(int argc, char **argv)
    lenl = strlen(LOGDIR) + strlen(CONFNAME) + strlen(LOGEXT) + 3;
    lenp = strlen(LOGDIR) + strlen(CONFNAME) + strlen(PIDEXT) + 3;
 
-   CONFFILE = MyMalloc(lenc * sizeof(*CONFFILE));
-   LOGFILE = MyMalloc(lenl * sizeof(*LOGFILE));
+   CONFFILE = MyMalloc(lenc * sizeof *CONFFILE);
+   LOGFILE = MyMalloc(lenl * sizeof *LOGFILE);
 
    snprintf(CONFFILE, lenc, "%s/%s.%s", CONFDIR, CONFNAME, CONFEXT);
    snprintf(LOGFILE, lenl, "%s/%s.%s", LOGDIR, CONFNAME, LOGEXT);
index 6f9d023fc69ba7ef1fa96cbdfd57e1954e2a3020..83bff8111f57acc1ef470a2715e4cf5c529bab8c 100644 (file)
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2002 Andy Smith
+Copyright (C) 2002-2003 Andy Smith
  
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -63,6 +63,9 @@ along with this program; if not, write to:
 #include "config.h"
 #include "malloc.h"
 #include "log.h"
+#include "defs.h"
+
+RCSID("$Id$");
 
 extern unsigned int OPT_DEBUG;
 
@@ -92,7 +95,7 @@ void nc_init(struct cnode **head)
       return;
    }
 
-   *head = MyMalloc(sizeof(**head));
+   *head = MyMalloc(sizeof **head);
 
    maxb = (sizeof((*head)->ip) * 8);
    (*head)->ip = 0;
@@ -161,7 +164,7 @@ static struct cnode *nc_insert(struct cnode *head, const unsigned long ip)
       x = GETBIT(ip, x->b) ? x->r : x->l;
    }
 
-   t = MyMalloc(sizeof(*t));
+   t = MyMalloc(sizeof *t);
    t->ip = ip;
    t->b = i;
    t->l = GETBIT(ip, t->b) ? x : t;
index 2a5e75a744c2da153b2d85b5ddf080f12c2d9107..549371c090818e53508ff78a0a3831a1f5fc5198 100644 (file)
@@ -234,7 +234,7 @@ static struct Command *command_create(unsigned short type, char *param, char *ir
 {
    struct Command *ret;
 
-   ret = MyMalloc(sizeof(struct Command));
+   ret = MyMalloc(sizeof *ret);
 
    ret->type = type;