- Style corrections
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>
Sun, 14 Jun 2015 17:29:51 +0000 (17:29 +0000)
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>
Sun, 14 Jun 2015 17:29:51 +0000 (17:29 +0000)
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/hopm/trunk@6149 82007160-df01-0410-b94d-b575c5fd34c7

src/config-parser.y
src/config.c
src/config.h
src/firedns.c
src/irc.c
src/libopm/src/libopm.c
src/opercmd.c
src/scan.c

index 858d83cd679a9d8fa87df7b377bb883bd69a5238..181b2cd13bb46902bfdd4f68452bbebf916f67ea 100644 (file)
@@ -304,7 +304,7 @@ channel_entry:
   node_t *node;
   struct ChannelConf *item;
 
-  item = xcalloc(sizeof *item);
+  item = xcalloc(sizeof(*item));
   item->name = xstrdup("");
   item->key = xstrdup("");
   item->invite = xstrdup("");
@@ -354,7 +354,7 @@ user_entry:
   node_t *node;
   struct UserConf *item;
 
-  item = xcalloc(sizeof *item);
+  item = xcalloc(sizeof(*item));
   item->masks = list_create();
   item->scanners = list_create();
 
@@ -399,7 +399,7 @@ scanner_entry:
   node_t *node;
   struct ScannerConf *item, *olditem;
 
-  item = xcalloc(sizeof *item);
+  item = xcalloc(sizeof(*item));
 
   /* Setup ScannerConf defaults */
   item->name = xstrdup("undefined");
@@ -524,10 +524,9 @@ scanner_protocol: PROTOCOL '=' PROTOCOLTYPE ':' NUMBER ';'
 {
   struct ProtocolConf *item;
   struct ScannerConf *item2;
-
   node_t *node;
 
-  item = xcalloc(sizeof *item);
+  item = xcalloc(sizeof(*item));
   item->type = $3;
   item->port = $5;
 
@@ -575,8 +574,7 @@ opm_blacklist_entry:
   node_t *node;
   struct BlacklistConf *item;
 
-  item = xcalloc(sizeof *item);
-
+  item = xcalloc(sizeof(*item));
   item->name = xstrdup("");
   item->kline = xstrdup("");
   item->ban_unknown = 0;
@@ -646,8 +644,7 @@ blacklist_reply_item: NUMBER '=' STRING ';'
   struct BlacklistConf *blacklist = tmp;
   node_t *node;
 
-  item = xcalloc(sizeof *item);
-
+  item = xcalloc(sizeof(*item));
   item->number = $1;
   item->type = xstrdup($3);
 
index 7009763cc9f67fc53985f62b6a3115280f1a9cf0..7655f8fc0b717d93e3d653eda35e682f3aaf9537 100644 (file)
@@ -50,16 +50,16 @@ static void
 config_init(void)
 {
   /* Init IRC block */
-  IRCItem = xcalloc(sizeof *IRCItem);
+  IRCItem = xcalloc(sizeof(*IRCItem));
   IRCItem->channels = list_create();
   IRCItem->performs = list_create();
   IRCItem->notices  = list_create();
 
   /* Init Options block */
-  OptionsItem = xcalloc(sizeof *OptionsItem);
+  OptionsItem = xcalloc(sizeof(*OptionsItem));
 
   /* Init OPM block */
-  OpmItem = xcalloc(sizeof *OpmItem);
+  OpmItem = xcalloc(sizeof(*OpmItem));
   OpmItem->blacklists = list_create();
 
   /* Init list of User blocks */
@@ -69,7 +69,7 @@ config_init(void)
   ScannerItemList = list_create();
 
   /* Init list of Exempts */
-  ExemptItem = xcalloc(sizeof *ExemptItem);
+  ExemptItem = xcalloc(sizeof(*ExemptItem));
   ExemptItem->masks = list_create();
 }
 
index a3972649f120df28c997348fcbdb59242ec9e560..223b7b1b1e44faf472147336ff2362d0d3a98ad1 100644 (file)
 extern char linebuf[512];
 extern unsigned int linenum;
 
-extern void yyerror(const char *);
-extern void config_load(const char *);
-
-
 struct IRCConf
 {
   char *nick;
@@ -141,4 +137,6 @@ extern struct ExemptConf *ExemptItem;
 extern list_t *UserItemList;
 extern list_t *ScannerItemList;
 
+extern void yyerror(const char *);
+extern void config_load(const char *);
 #endif /* CONFIG_H */
index b9ffa0db4d249f3db65ddf0029a995b05b731d71..aa10126dcfb38a3dc410e2f94d2671d0d3dca886 100644 (file)
@@ -356,7 +356,7 @@ firedns_add_query(void)
   struct s_connection *s;
 
   /* create new connection object */
-  s = xcalloc(sizeof *s);
+  s = xcalloc(sizeof(*s));
 
   /* verified by firedns_getresult() */
   s->id[0] = rand() % 255;
@@ -606,7 +606,7 @@ firedns_getresult(const int fd)
     return &result;
 
   /* query found -- we remove in cleanup */
-  l = recv(c->fd, &h,sizeof(struct s_header), 0);
+  l = recv(c->fd, &h, sizeof(struct s_header), 0);
   result.info = c->info;
   strlcpy(result.lookup, c->lookup, sizeof(result.lookup));
 
@@ -770,7 +770,7 @@ firedns_cycle(void)
     return;
 
   if (ufds == NULL)
-    ufds = xcalloc((sizeof *ufds) * OptionsItem->dns_fdlimit);
+    ufds = xcalloc(sizeof(*ufds) * OptionsItem->dns_fdlimit);
 
   time(&timenow);
   size = 0;
index 478f85d797b0e5e3870f896f9b4578f070adf556..702e859a503f4735954a67c7aeb584772d5abf01 100644 (file)
--- a/src/irc.c
+++ b/src/irc.c
@@ -617,7 +617,7 @@ userinfo_create(const char *source)
   if (username == NULL || hostname == NULL)
     return NULL;
 
-  ret = xcalloc(sizeof *ret);
+  ret = xcalloc(sizeof(*ret));
   ret->irc_nick     = xstrdup(nick);
   ret->irc_username = xstrdup(username);
   ret->irc_hostname = xstrdup(hostname);
@@ -846,7 +846,7 @@ m_notice(char *parv[], unsigned int parc, const char *msg, const struct UserInfo
   /* Compile the regular expression if it has not been already */
   if (preg == NULL)
   {
-    preg = xcalloc(sizeof *preg);
+    preg = xcalloc(sizeof(*preg));
 
     if ((errnum = regcomp(preg, IRCItem->connregex, REG_ICASE | REG_EXTENDED)))
     {
index 605fc973775190042e387a3160e145f74dae7f94..d78458e2d88ab6f3c41a04ed45df5b8b8072b276 100644 (file)
@@ -108,7 +108,7 @@ opm_create(void)
 {
   OPM_T *ret;
 
-  ret = xcalloc(sizeof *ret);
+  ret = xcalloc(sizeof(*ret));
   ret->config = libopm_config_create();
   ret->scans = libopm_list_create();
   ret->queue = libopm_list_create();
@@ -137,7 +137,7 @@ opm_remote_create(const char *ip)
 {
   OPM_REMOTE_T *ret;
 
-  ret = xcalloc(sizeof *ret);
+  ret = xcalloc(sizeof(*ret));
   ret->ip = libopm_xstrdup(ip);
   ret->protocols = libopm_list_create();  /* Setup protocol list */
 
@@ -360,7 +360,7 @@ OPM_ERR_T opm_remote_addtype(OPM_REMOTE_T *remote, int type, unsigned short int
 static OPM_PROTOCOL_T *libopm_protocol_create(void)
 {
   OPM_PROTOCOL_T *ret;
-  ret = xcalloc(sizeof(OPM_PROTOCOL_T));
+  ret = xcalloc(sizeof(*ret));
 
   ret->type           = 0;
   ret->write_function = NULL;
@@ -408,7 +408,7 @@ libopm_protocol_config_create(void)
 {
   OPM_PROTOCOL_CONFIG_T *ret;
 
-  ret = xcalloc(sizeof *ret);
+  ret = xcalloc(sizeof(*ret));
 
   return ret;
 }
@@ -596,7 +596,7 @@ libopm_scan_create(OPM_T *scanner, OPM_REMOTE_T *remote)
   OPM_CONNECTION_T *conn;
   OPM_NODE_T *node, *p;
 
-  ret = xcalloc(sizeof *ret);
+  ret = xcalloc(sizeof(*ret));
   ret->remote = remote;
   ret->connections = libopm_list_create();
 
@@ -674,7 +674,7 @@ libopm_connection_create(void)
 {
   OPM_CONNECTION_T *ret;
 
-  ret = xcalloc(sizeof *ret);
+  ret = xcalloc(sizeof(*ret));
   ret->state = OPM_STATE_UNESTABLISHED;
 
   return ret;
index 507e4bd89e6f241aa62651c691e57182ec2c74dc..bf029640f356a75602a61cfaa77bcea8e55eee71 100644 (file)
@@ -133,7 +133,7 @@ static struct Command *
 command_create(const struct OperCommandHash *tab, char *param, char *irc_nick,
                const struct ChannelConf *target)
 {
-  struct Command *command = xcalloc(sizeof *command);
+  struct Command *command = xcalloc(sizeof(*command));
 
   if (param)
     command->param = xstrdup(param);
@@ -238,9 +238,9 @@ command_parse(char *command, const struct ChannelConf *target,
     if (strcasecmp(command, tab->command) == 0)
     {
       /* Queue this command */
-      struct Command *cs = command_create(tab, param, source_p->irc_nick, target);
+      struct Command *command = command_create(tab, param, source_p->irc_nick, target);
 
-      list_add(COMMANDS, node_create(cs));
+      list_add(COMMANDS, node_create(command));
       break;
     }
   }
@@ -274,11 +274,11 @@ command_timer(void)
 
   LIST_FOREACH_SAFE(node, node_next, COMMANDS->head)
   {
-    struct Command *cs = node->data;
+    struct Command *command = node->data;
 
-    if ((present - cs->added) > COMMANDTIMEOUT)
+    if ((present - command->added) > COMMANDTIMEOUT)
     {
-      command_free(cs);
+      command_free(command);
       list_remove(COMMANDS, node);
       node_free(node);
     }
@@ -325,15 +325,15 @@ command_userhost(const char *reply)
   /* Find any queued commands that match this user */
   LIST_FOREACH_SAFE(node, node_next, COMMANDS->head)
   {
-    struct Command *cs = node->data;
+    struct Command *command = node->data;
 
-    if (strcmp(cs->irc_nick, reply) == 0)
+    if (strcmp(command->irc_nick, reply) == 0)
     {
       if (oper)
-        cs->tab->handler(cs->param, cs->target);
+        command->tab->handler(command->param, command->target);
 
       /* Cleanup the command */
-      command_free(cs);
+      command_free(command);
       list_remove(COMMANDS, node);
       node_free(node);
     }
index d39971e0918e9498cf869f02f1e09da415c4253d..76a0347a4aaf5f98e52751732a6e1cd8618e39dd 100644 (file)
@@ -187,7 +187,7 @@ scan_init(void)
   LIST_FOREACH(p, ScannerItemList->head)
   {
     sc = p->data;
-    scs = xcalloc(sizeof *scs);
+    scs = xcalloc(sizeof(*scs));
 
     if (OPT_DEBUG)
       log_printf("SCAN -> Setting up scanner [%s]", sc->name);
@@ -418,7 +418,7 @@ scan_connect(const char *user[], const char *msg)
 static struct scan_struct *
 scan_create(const char *user[], const char *msg)
 {
-  struct scan_struct *const ss = xcalloc(sizeof *ss);
+  struct scan_struct *ss = xcalloc(sizeof(*ss));
 
   ss->irc_nick = xstrdup(user[0]);
   ss->irc_username = xstrdup(user[1]);
@@ -902,7 +902,7 @@ scan_manual(char *param, const struct ChannelConf *target)
     return;
   }
 
-  ss = xcalloc(sizeof *ss);
+  ss = xcalloc(sizeof(*ss));
   ss->ip = xstrdup(ip);
   ss->remote = opm_remote_create(ss->ip);
   ss->remote->data = ss;