]> jfr.im git - solanum.git/commitdiff
Misc code cleanups
authorAaron Jones <redacted>
Fri, 27 Mar 2015 23:04:39 +0000 (23:04 +0000)
committerAaron Jones <redacted>
Fri, 27 Mar 2015 23:07:20 +0000 (23:07 +0000)
* src/packet.c: Remove a dead store
* src/res.c: Remove a dead store
* src/sslproc.c: Remove a dead store
* src/sslproc.c: Don't call the same accessor twice

These silence some fairly harmless compiler warnings

src/packet.c
src/res.c
src/sslproc.c

index 58d6d3db16b5af1af334062c1f8d033f1a3b65e8..fe18b1df8e24c52d2ca5c022037c50082c145981 100644 (file)
@@ -235,7 +235,6 @@ read_packet(rb_fde_t * F, void *data)
 {
        struct Client *client_p = data;
        int length = 0;
-       int lbuf_len;
 
        int binary = 0;
 #ifdef USE_IODEBUG_HOOKS
@@ -288,7 +287,7 @@ read_packet(rb_fde_t * F, void *data)
                if(IsHandshake(client_p) || IsUnknown(client_p))
                        binary = 1;
 
-               lbuf_len = rb_linebuf_parse(&client_p->localClient->buf_recvq, readBuf, length, binary);
+               (void) rb_linebuf_parse(&client_p->localClient->buf_recvq, readBuf, length, binary);
 
                if(IsAnyDead(client_p))
                        return;
index ee4fe790d25c9a51c3834ae5fc69a310f9c259c9..c330987c2c0758fd177d5c4648746893a8ff1e64 100644 (file)
--- a/src/res.c
+++ b/src/res.c
@@ -617,7 +617,6 @@ static int proc_answer(struct reslist *request, HEADER * header, char *buf, char
 {
        char hostbuf[IRCD_RES_HOSTLEN + 100];   /* working buffer */
        unsigned char *current; /* current position in buf */
-       int query_class;        /* answer class */
        int type;               /* answer type */
        int n;                  /* temp count */
        int rd_length;
@@ -674,7 +673,7 @@ static int proc_answer(struct reslist *request, HEADER * header, char *buf, char
                type = irc_ns_get16(current);
                current += TYPE_SIZE;
 
-               query_class = irc_ns_get16(current);
+               (void) irc_ns_get16(current);
                current += CLASS_SIZE;
 
                request->ttl = irc_ns_get32(current);
index 9d523e06f7fed63a654439f5ba38512a6f94896d..4f2de9793fb4aba83205cfda7ff4257770a43636 100644 (file)
@@ -339,9 +339,8 @@ ssl_process_zipstats(ssl_ctl_t * ctl, ssl_ctl_buf_t * ctl_buf)
 {
        struct Client *server;
        struct ZipStats *zips;
-       int parc;
        char *parv[7];
-       parc = rb_string_to_array(ctl_buf->buf, parv, 6);
+       (void) rb_string_to_array(ctl_buf->buf, parv, 6);
        server = find_server(NULL, parv[1]);
        if(server == NULL || server->localClient == NULL || !IsCapable(server, CAP_ZIP))
                return;
@@ -826,7 +825,7 @@ collect_zipstats(void *unused)
                        len = sizeof(uint8_t) + sizeof(uint32_t);
 
                        id = rb_get_fd(target_p->localClient->F);
-                       int32_to_buf(&buf[1], rb_get_fd(target_p->localClient->F));
+                       int32_to_buf(&buf[1], id);
                        rb_strlcpy(odata, target_p->name, (sizeof(buf) - len));
                        len += strlen(odata) + 1;       /* Get the \0 as well */
                        ssl_cmd_write_queue(target_p->localClient->z_ctl, NULL, 0, buf, len);