From: Aaron Jones Date: Fri, 27 Mar 2015 23:04:39 +0000 (+0000) Subject: Misc code cleanups X-Git-Url: https://jfr.im/git/solanum.git/commitdiff_plain/32fb589528d37351964ae987b0a1249e6aa7799f Misc code cleanups * 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 --- diff --git a/src/packet.c b/src/packet.c index 58d6d3db..fe18b1df 100644 --- a/src/packet.c +++ b/src/packet.c @@ -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; diff --git a/src/res.c b/src/res.c index ee4fe790..c330987c 100644 --- 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); diff --git a/src/sslproc.c b/src/sslproc.c index 9d523e06..4f2de979 100644 --- a/src/sslproc.c +++ b/src/sslproc.c @@ -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);