From 59aa88eb085c71e191802510804588a4f9edbe9b Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 4 Aug 2011 13:00:25 +0200 Subject: [PATCH] Remove variables and assignments with no effect As warned by newer GCC. --- src/seshigh.c | 9 +++------ src/session.h | 1 + src/srwutil.c | 7 +++---- src/statserv.c | 5 +++-- src/tcpdchk.c | 2 -- src/zoom-c.c | 2 +- util/srwtst.c | 8 +++----- 7 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/seshigh.c b/src/seshigh.c index 739c998..c2311bb 100644 --- a/src/seshigh.c +++ b/src/seshigh.c @@ -1879,7 +1879,6 @@ static void process_http_request(association *assoc, request *req) {0, 0, 0} }; char ctype[80]; - int ret; p = z_get_HTTP_Response(o, 200); hres = p->u.HTTP_Response; @@ -1890,9 +1889,9 @@ static void process_http_request(association *assoc, request *req) if (stylesheet && *stylesheet == '\0') stylesheet = 0; - ret = z_soap_codec_enc_xsl(assoc->encode, &soap_package, - &hres->content_buf, &hres->content_len, - soap_handlers, charset, stylesheet); + z_soap_codec_enc_xsl(assoc->encode, &soap_package, + &hres->content_buf, &hres->content_len, + soap_handlers, charset, stylesheet); hres->code = http_code; strcpy(ctype, "text/xml"); @@ -2860,7 +2859,6 @@ static Z_APDU *process_presentRequest(association *assoc, request *reqb) Odr_int *next; Odr_int *num; int errcode = 0; - const char *errstring = 0; yaz_log(log_requestdetail, "Got PresentRequest."); @@ -2889,7 +2887,6 @@ static Z_APDU *process_presentRequest(association *assoc, request *reqb) resp->records = diagrec(assoc, bprr->errcode, bprr->errstring); *resp->presentStatus = Z_PresentStatus_failure; errcode = bprr->errcode; - errstring = bprr->errstring; } } apdu = (Z_APDU *)odr_malloc(assoc->encode, sizeof(*apdu)); diff --git a/src/session.h b/src/session.h index 34f1ddb..af2d2ee 100644 --- a/src/session.h +++ b/src/session.h @@ -43,6 +43,7 @@ struct gfs_server { statserv_options_block cb; char *host; + char *id; int listen_ref; cql_transform_t cql_transform; CCL_bibset ccl_transform; diff --git a/src/srwutil.c b/src/srwutil.c index 9eff9aa..b906ec9 100644 --- a/src/srwutil.c +++ b/src/srwutil.c @@ -161,7 +161,7 @@ static void yaz_srw_decodeauth(Z_SRW_PDU *sr, Z_HTTP_Request *hreq, if (basic) { - int len, olen; + int len; char out[256]; char ubuf[256] = "", pbuf[256] = "", *p; if (strncmp(basic, "Basic ", 6)) @@ -170,7 +170,7 @@ static void yaz_srw_decodeauth(Z_SRW_PDU *sr, Z_HTTP_Request *hreq, len = strlen(basic); if (!len || len > 256) return; - olen = yaz_base64decode(basic, out); + yaz_base64decode(basic, out); /* Format of out should be username:password at this point */ strcpy(ubuf, out); if ((p = strchr(ubuf, ':'))) @@ -437,7 +437,6 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu, char *startRecord = 0; char *maximumTerms = 0; char *responsePosition = 0; - char *extraRequestData = 0; Z_SRW_extra_arg *extra_args = 0; #endif char **uri_name; @@ -500,7 +499,7 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu, else if (!strcmp(n, "responsePosition")) responsePosition = v; else if (!strcmp(n, "extraRequestData")) - extraRequestData = v; + ; /* ignoring extraRequestData */ else if (n[0] == 'x' && n[1] == '-') { Z_SRW_extra_arg **l = &extra_args; diff --git a/src/statserv.c b/src/statserv.c index a039251..4a469de 100644 --- a/src/statserv.c +++ b/src/statserv.c @@ -214,7 +214,7 @@ static char *nmem_dup_xml_content(NMEM n, xmlNodePtr ptr) #endif #if YAZ_HAVE_XML2 -static struct gfs_server * gfs_server_new(void) +static struct gfs_server * gfs_server_new(const char *id) { struct gfs_server *n = (struct gfs_server *) nmem_malloc(gfs_nmem, sizeof(*n)); @@ -228,6 +228,7 @@ static struct gfs_server * gfs_server_new(void) n->directory = 0; n->docpath = 0; n->stylesheet = 0; + n->id = nmem_strdup_null(gfs_nmem, id); n->retrieval = yaz_retrieval_create(); return n; } @@ -386,7 +387,7 @@ static void xml_config_read(void) else yaz_log(YLOG_WARN, "Unknown attribute '%s' for server", attr->name); - gfs = *gfsp = gfs_server_new(); + gfs = *gfsp = gfs_server_new(id); gfs->server_node_ptr = ptr_server; if (listenref) { diff --git a/src/tcpdchk.c b/src/tcpdchk.c index 26acb8e..f5885d1 100644 --- a/src/tcpdchk.c +++ b/src/tcpdchk.c @@ -71,7 +71,6 @@ int check_ip_tcpd(void *cd, const char *addr, int len, int type) #if HAVE_TCPD_H struct request_info request_info; int i; -#endif char *host_name = 0, *host_addr = 0; struct hostent *host; @@ -82,7 +81,6 @@ int check_ip_tcpd(void *cd, const char *addr, int len, int type) AF_INET))) host_name = (char*) host->h_name; host_addr = inet_ntoa(addr_in->sin_addr); -#if HAVE_TCPD_H if (host_addr) request_init(&request_info, RQ_DAEMON, daemon_name, RQ_CLIENT_NAME, host_name, diff --git a/src/zoom-c.c b/src/zoom-c.c index 3422afb..00158ec 100644 --- a/src/zoom-c.c +++ b/src/zoom-c.c @@ -1533,7 +1533,7 @@ static void handle_http(ZOOM_connection c, Z_HTTP_Response *hres) { zoom_ret cret = zoom_complete; int ret = -1; - const char *addinfo = 0; + char *addinfo = 0; const char *connection_head = z_HTTP_header_lookup(hres->headers, "Connection"); const char *location; diff --git a/util/srwtst.c b/util/srwtst.c index 2a1802f..2c9a229 100644 --- a/util/srwtst.c +++ b/util/srwtst.c @@ -20,7 +20,6 @@ int main(int argc, char **argv) char buf[163840]; char *content_buf = buf; int content_len; - int ret; size_t no; Z_SOAP *soap_package = 0; ODR decode, encode; @@ -37,8 +36,8 @@ int main(int argc, char **argv) decode = odr_createmem(ODR_DECODE); encode = odr_createmem(ODR_ENCODE); content_len = no; - ret = z_soap_codec(decode, &soap_package, - &content_buf, &content_len, h); + z_soap_codec(decode, &soap_package, + &content_buf, &content_len, h); if (!soap_package) { fprintf(stderr, "Decoding seriously failed\n"); @@ -88,8 +87,7 @@ int main(int argc, char **argv) } } - ret = z_soap_codec(encode, &soap_package, - &content_buf, &content_len, h); + z_soap_codec(encode, &soap_package, &content_buf, &content_len, h); if (content_buf && content_len) { printf("%.*s", content_len, content_buf); -- 1.7.10.4