]> granicus.if.org Git - curl/commitdiff
http: silence compile-time warnings without USE_NGHTTP2
authorKamil Dudka <kdudka@redhat.com>
Tue, 19 May 2015 10:51:40 +0000 (12:51 +0200)
committerKamil Dudka <kdudka@redhat.com>
Tue, 19 May 2015 10:53:30 +0000 (12:53 +0200)
Error: CLANG_WARNING:
lib/http.c:173:16: warning: Value stored to 'http' during its initialization is never read

Error: COMPILER_WARNING:
lib/http.c: scope_hint: In function ‘http_disconnect’
lib/http.c:173:16: warning: unused variable ‘http’ [-Wunused-variable]

lib/http.c

index 63b014896ad1a91daa8ce90486654dc7236027cd..b5bfd2c9bd082ad6cd61b553a9bac7619b4fe883 100644 (file)
@@ -170,14 +170,16 @@ CURLcode Curl_http_setup_conn(struct connectdata *conn)
 
 static CURLcode http_disconnect(struct connectdata *conn, bool dead_connection)
 {
-  struct HTTP *http = conn->data->req.protop;
-  (void)dead_connection;
 #ifdef USE_NGHTTP2
+  struct HTTP *http = conn->data->req.protop;
   if(http) {
     Curl_add_buffer_free(http->header_recvbuf);
     http->header_recvbuf = NULL; /* clear the pointer */
   }
+#else
+  (void)conn;
 #endif
+  (void)dead_connection;
   return CURLE_OK;
 }