From 24a4453874a81029c9b09d90a842c2809a5ed4eb Mon Sep 17 00:00:00 2001 From: michael Date: Mon, 22 Dec 2014 19:57:43 +0000 Subject: [PATCH] - Removed USE_VAR cruft git-svn-id: svn://svn.ircd-hybrid.org/svnroot/hopm/trunk@5084 82007160-df01-0410-b94d-b575c5fd34c7 --- src/defs.h | 3 --- src/irc.c | 37 +++++-------------------------------- src/libopm/src/opm.h | 4 ---- src/libopm/src/proxy.c | 7 ------- src/libopm/src/test.c | 18 ------------------ src/opercmd.c | 17 +++-------------- src/scan.c | 14 -------------- 7 files changed, 8 insertions(+), 92 deletions(-) diff --git a/src/defs.h b/src/defs.h index 8d6e721..531a495 100644 --- a/src/defs.h +++ b/src/defs.h @@ -3,7 +3,4 @@ #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) - #endif /* OPM_H */ diff --git a/src/irc.c b/src/irc.c index a207e39..f6a4cc0 100644 --- a/src/irc.c +++ b/src/irc.c @@ -795,11 +795,6 @@ static void m_perform(char **parv, unsigned int parc, char *msg, struct UserInfo node_t *node; struct ChannelConf *channel; - USE_VAR(parv); - USE_VAR(parc); - USE_VAR(msg); - USE_VAR(notused); - log_printf("IRC -> Connected to %s:%d", IRCItem->server, IRCItem->port); /* Identify to nickserv if needed */ @@ -847,9 +842,6 @@ static void m_perform(char **parv, unsigned int parc, char *msg, struct UserInfo */ static void m_ping(char **parv, unsigned int parc, char *msg, struct UserInfo *source_p) { - USE_VAR(msg); - USE_VAR(source_p); - if(parc < 3) return; @@ -877,9 +869,6 @@ static void m_invite(char **parv, unsigned int parc, char *msg, struct UserInfo { struct ChannelConf *channel; - USE_VAR(msg); - USE_VAR(source_p); - if(parc < 4) return; @@ -960,14 +949,9 @@ static void m_privmsg(char **parv, unsigned int parc, char *msg, struct UserInfo static void m_ctcp(char **parv, unsigned int parc, char *msg, struct UserInfo *source_p) { - USE_VAR(parc); - USE_VAR(msg); - - if(strncasecmp(parv[3], "\001VERSION\001", 9) == 0) - { - irc_send("NOTICE %s :\001VERSION Hybrid Open Proxy Monitor %s\001", - source_p->irc_nick, VERSION); - } + if (strncasecmp(parv[3], "\001VERSION\001", 9) == 0) + irc_send("NOTICE %s :\001VERSION Hybrid Open Proxy Monitor %s\001", + source_p->irc_nick, VERSION); } @@ -1083,9 +1067,6 @@ static void m_notice(char **parv, unsigned int parc, char *msg, struct UserInfo static void m_userhost(char **parv, unsigned int parc, char *msg, struct UserInfo *source_p) { - USE_VAR(msg); - USE_VAR(source_p); - if(parc < 4) return; @@ -1107,9 +1088,6 @@ static void m_cannot_join(char **parv, unsigned int parc, char *msg, { struct ChannelConf *channel; - USE_VAR(msg); - USE_VAR(source_p); - if(parc < 5) return; @@ -1136,11 +1114,6 @@ static void m_cannot_join(char **parv, unsigned int parc, char *msg, static void m_kill(char **parv, unsigned int parc, char *msg, struct UserInfo *source_p) { - USE_VAR(parv); - USE_VAR(parc); - USE_VAR(msg); - USE_VAR(source_p); - - /* Restart hopm to rehash */ - main_restart(); + /* Restart hopm to rehash */ + main_restart(); } diff --git a/src/libopm/src/opm.h b/src/libopm/src/opm.h index 06d15c3..7b3422a 100644 --- a/src/libopm/src/opm.h +++ b/src/libopm/src/opm.h @@ -11,10 +11,6 @@ #include "opm_common.h" -/* Stuff to shut up warnings about rcsid being unused. */ -#define USE_VAR(var) static char sizeof##var = sizeof(sizeof##var) + sizeof(var) - - typedef struct _OPM_CONFIG OPM_CONFIG_T; typedef struct _OPM OPM_T; typedef struct _OPM_REMOTE OPM_REMOTE_T; diff --git a/src/libopm/src/proxy.c b/src/libopm/src/proxy.c index a7745da..42d5dfb 100644 --- a/src/libopm/src/proxy.c +++ b/src/libopm/src/proxy.c @@ -45,8 +45,6 @@ static char SENDBUF[SENDBUFLEN + 1]; int libopm_proxy_http_write(OPM_T *scanner, OPM_SCAN_T *scan, OPM_CONNECTION_T *conn) { - USE_VAR(scan); - snprintf(SENDBUF, SENDBUFLEN, "CONNECT %s:%d HTTP/1.0\r\n\r\n", (char *) libopm_config(scanner->config, OPM_CONFIG_SCAN_IP), *(int *) libopm_config(scanner->config, OPM_CONFIG_SCAN_PORT)); @@ -75,7 +73,6 @@ int libopm_proxy_socks4_write(OPM_T *scanner, OPM_SCAN_T *scan, OPM_CONNECTION_T unsigned long laddr; int len, scan_port; char *scan_ip; - USE_VAR(scan); scan_ip = (char *) libopm_config(scanner->config, OPM_CONFIG_SCAN_IP); scan_port = *(int *) libopm_config(scanner->config, OPM_CONFIG_SCAN_PORT); @@ -143,7 +140,6 @@ int libopm_proxy_socks5_write(OPM_T *scanner, OPM_SCAN_T *scan, OPM_CONNECTION_T unsigned long laddr; int len, scan_port; char *scan_ip; - USE_VAR(scan); scan_ip = (char *) libopm_config(scanner->config, OPM_CONFIG_SCAN_IP); scan_port = *(int *) libopm_config(scanner->config, OPM_CONFIG_SCAN_PORT); @@ -183,7 +179,6 @@ int libopm_proxy_wingate_write(OPM_T *scanner, OPM_SCAN_T *scan, OPM_CONNECTION_ { int scan_port, len; char *scan_ip; - USE_VAR(scan); scan_ip = (char *) libopm_config(scanner->config, OPM_CONFIG_SCAN_IP); scan_port = *(int *) libopm_config(scanner->config, OPM_CONFIG_SCAN_PORT); @@ -207,7 +202,6 @@ int libopm_proxy_router_write(OPM_T *scanner, OPM_SCAN_T *scan, OPM_CONNECTION_T { int len, scan_port; char *scan_ip; - USE_VAR(scan); scan_ip = (char *) libopm_config(scanner->config, OPM_CONFIG_SCAN_IP); scan_port = *(int *) libopm_config(scanner->config, OPM_CONFIG_SCAN_PORT); @@ -231,7 +225,6 @@ int libopm_proxy_httppost_write(OPM_T *scanner, OPM_SCAN_T *scan, OPM_CONNECTION { int len, scan_port; char *scan_ip; - USE_VAR(scan); scan_ip = (char *) libopm_config(scanner->config, OPM_CONFIG_SCAN_IP); scan_port = *(int *) libopm_config(scanner->config, OPM_CONFIG_SCAN_PORT); diff --git a/src/libopm/src/test.c b/src/libopm/src/test.c index 4ef0145..ec94620 100644 --- a/src/libopm/src/test.c +++ b/src/libopm/src/test.c @@ -160,9 +160,6 @@ int main(int argc, char **argv) void open_proxy(OPM_T *scanner, OPM_REMOTE_T *remote, int notused, void *data) { - USE_VAR(notused); - USE_VAR(data); - printf("Open proxy on %s:%d [%d bytes read]\n", remote->ip, remote->port, remote->bytes_read); opm_end(scanner, remote); @@ -171,29 +168,17 @@ void open_proxy(OPM_T *scanner, OPM_REMOTE_T *remote, int notused, void negotiation_failed(OPM_T *scanner, OPM_REMOTE_T *remote, int notused, void *data) { - USE_VAR(scanner); - USE_VAR(notused); - USE_VAR(data); - printf("Negotiation on %s:%d failed [%d bytes read]\n", remote->ip, remote->port, remote->bytes_read); } void timeout(OPM_T *scanner, OPM_REMOTE_T *remote, int notused, void *data) { - USE_VAR(scanner); - USE_VAR(notused); - USE_VAR(data); - printf("Negotiation timed out on %s:%d\n", remote->ip, remote->port); } void end(OPM_T *scanner, OPM_REMOTE_T *remote, int notused, void *data) { - USE_VAR(scanner); - USE_VAR(notused); - USE_VAR(data); - printf("Scan on %s has ended\n", remote->ip); opm_remote_free(remote); complete = 1; @@ -201,9 +186,6 @@ void end(OPM_T *scanner, OPM_REMOTE_T *remote, int notused, void *data) void handle_error(OPM_T *scanner, OPM_REMOTE_T *remote, int err, void *data) { - USE_VAR(scanner); - USE_VAR(data); - switch(err) { case OPM_ERR_MAX_READ: diff --git a/src/opercmd.c b/src/opercmd.c index 22fa0b4..536b59a 100644 --- a/src/opercmd.c +++ b/src/opercmd.c @@ -147,12 +147,9 @@ void command_parse(char *command, char *msg, struct ChannelConf *target, { unsigned int i; char *param; /* Parsed parameters */ - struct Command *cs; node_t *node; - USE_VAR(msg); - if(OPT_DEBUG) { log_printf("COMMAND -> Parsing command (%s) from %s [%s]", command, @@ -342,9 +339,7 @@ void command_userhost(char *reply) static void cmd_check(char *param, char *source, struct ChannelConf *target) { - USE_VAR(source); - - scan_manual(param, target); + scan_manual(param, target); } @@ -361,10 +356,7 @@ static void cmd_check(char *param, char *source, struct ChannelConf *target) static void cmd_stat(char *param, char *source, struct ChannelConf *target) { - USE_VAR(param); - USE_VAR(source); - - stats_output(target->name); + stats_output(target->name); } @@ -380,8 +372,5 @@ static void cmd_stat(char *param, char *source, struct ChannelConf *target) static void cmd_fdstat(char *param, char *source, struct ChannelConf *target) { - USE_VAR(param); - USE_VAR(source); - - fdstats_output(target->name); + fdstats_output(target->name); } diff --git a/src/scan.c b/src/scan.c index 57c840b..6d318cd 100644 --- a/src/scan.c +++ b/src/scan.c @@ -616,9 +616,6 @@ void scan_open_proxy(OPM_T *scanner, OPM_REMOTE_T *remote, int notused, struct scan_struct *ss; struct scanner_struct *scs; - USE_VAR(scanner); - USE_VAR(notused); - /* Record that a scan happened */ scan_log(remote); @@ -677,9 +674,6 @@ void scan_negotiation_failed(OPM_T *scanner, OPM_REMOTE_T *remote, // struct scan_struct *ss; struct scanner_struct *scs; - USE_VAR(scanner); - USE_VAR(notused); - /* Record that a scan happened */ scan_log(remote); @@ -723,9 +717,6 @@ static void scan_timeout(OPM_T *scanner, OPM_REMOTE_T *remote, int notused, // struct scan_struct *ss; struct scanner_struct *scs; - USE_VAR(scanner); - USE_VAR(notused); - /* Record that a scan happened */ scan_log(remote); @@ -771,9 +762,6 @@ static void scan_end(OPM_T *scanner, OPM_REMOTE_T *remote, int notused, struct scan_struct *ss; struct scanner_struct *scs; - USE_VAR(scanner); - USE_VAR(notused); - scs = (struct scanner_struct *) data; ss = (struct scan_struct *) remote->data; @@ -808,8 +796,6 @@ static void scan_handle_error(OPM_T *scanner, OPM_REMOTE_T *remote, struct scan_struct *ss; struct scanner_struct *scs; - USE_VAR(scanner); - scs = (struct scanner_struct *) data; ss = (struct scan_struct *) remote->data; -- 2.30.2