Remove variables and assignments with no effect
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 4 Aug 2011 11:00:25 +0000 (13:00 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 4 Aug 2011 11:00:25 +0000 (13:00 +0200)
As warned by newer GCC.

src/seshigh.c
src/session.h
src/srwutil.c
src/statserv.c
src/tcpdchk.c
src/zoom-c.c
util/srwtst.c

index 739c998..c2311bb 100644 (file)
@@ -1879,7 +1879,6 @@ static void process_http_request(association *assoc, request *req)
                 {0, 0, 0}
             };
             char ctype[80];
                 {0, 0, 0}
             };
             char ctype[80];
-            int ret;
             p = z_get_HTTP_Response(o, 200);
             hres = p->u.HTTP_Response;
 
             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;
 
             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");
             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;
     Odr_int *next;
     Odr_int *num;
     int errcode = 0;
-    const char *errstring = 0;
 
     yaz_log(log_requestdetail, "Got PresentRequest.");
 
 
     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;
             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));
         }
     }
     apdu = (Z_APDU *)odr_malloc(assoc->encode, sizeof(*apdu));
index 34f1ddb..af2d2ee 100644 (file)
@@ -43,6 +43,7 @@
 struct gfs_server {
     statserv_options_block cb;
     char *host;
 struct gfs_server {
     statserv_options_block cb;
     char *host;
+    char *id;
     int listen_ref;
     cql_transform_t cql_transform;
     CCL_bibset ccl_transform;
     int listen_ref;
     cql_transform_t cql_transform;
     CCL_bibset ccl_transform;
index 9eff9aa..b906ec9 100644 (file)
@@ -161,7 +161,7 @@ static void yaz_srw_decodeauth(Z_SRW_PDU *sr, Z_HTTP_Request *hreq,
 
     if (basic)
     {
 
     if (basic)
     {
-        int len, olen;
+        int len;
         char out[256];
         char ubuf[256] = "", pbuf[256] = "", *p;
         if (strncmp(basic, "Basic ", 6))
         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;
         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, ':')))
         /* 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 *startRecord = 0;
         char *maximumTerms = 0;
         char *responsePosition = 0;
-        char *extraRequestData = 0;
         Z_SRW_extra_arg *extra_args = 0;
 #endif
         char **uri_name;
         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"))
                 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;
                 else if (n[0] == 'x' && n[1] == '-')
                 {
                     Z_SRW_extra_arg **l = &extra_args;
index a039251..4a469de 100644 (file)
@@ -214,7 +214,7 @@ static char *nmem_dup_xml_content(NMEM n, xmlNodePtr ptr)
 #endif
 
 #if YAZ_HAVE_XML2
 #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));
 {
     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->directory = 0;
     n->docpath = 0;
     n->stylesheet = 0;
+    n->id = nmem_strdup_null(gfs_nmem, id);
     n->retrieval = yaz_retrieval_create();
     return n;
 }
     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);
                 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)
             {
             gfs->server_node_ptr = ptr_server;
             if (listenref)
             {
index 26acb8e..f5885d1 100644 (file)
@@ -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;
 #if HAVE_TCPD_H
             struct request_info request_info;
             int i;
-#endif
             char *host_name = 0, *host_addr = 0;
             struct hostent *host;
 
             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);
                                       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,
             if (host_addr)
                 request_init(&request_info, RQ_DAEMON, daemon_name,
                              RQ_CLIENT_NAME, host_name,
index 3422afb..00158ec 100644 (file)
@@ -1533,7 +1533,7 @@ static void handle_http(ZOOM_connection c, Z_HTTP_Response *hres)
 {
     zoom_ret cret = zoom_complete;
     int ret = -1;
 {
     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;
     const char *connection_head = z_HTTP_header_lookup(hres->headers,
                                                        "Connection");
     const char *location;
index 2a1802f..2c9a229 100644 (file)
@@ -20,7 +20,6 @@ int main(int argc, char **argv)
     char buf[163840];
     char *content_buf = buf;
     int content_len;
     char buf[163840];
     char *content_buf = buf;
     int content_len;
-    int ret;
     size_t no;
     Z_SOAP *soap_package = 0;
     ODR decode, encode;
     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;
     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");
     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);
     if (content_buf && content_len)
     {
         printf("%.*s", content_len, content_buf);