Selaa lähdekoodia

Additional compiler warnings fixes.

Evgeny Grin (Karlson2k) 8 vuotta sitten
vanhempi
sitoutus
424abcd21d

+ 1 - 0
src/examples/demo.c

@@ -832,6 +832,7 @@ generate_page (void *cls,
 static void
 catcher (int sig)
 {
+  (void)sig;	/* Unused. Silent compiler warning. */
   /* do nothing */
 }
 

+ 2 - 1
src/examples/demo_https.c

@@ -831,6 +831,7 @@ generate_page (void *cls,
 static void
 catcher (int sig)
 {
+  (void)sig;	/* Unused. Silent compiler warning. */
   /* do nothing */
 }
 
@@ -839,7 +840,7 @@ catcher (int sig)
  * setup handlers to ignore SIGPIPE.
  */
 static void
-ignore_sigpipe ()
+ignore_sigpipe (void)
 {
   struct sigaction oldsig;
   struct sigaction sig;

+ 3 - 3
src/testcurl/https/tls_test_common.c

@@ -27,8 +27,6 @@
 #include "tls_test_keys.h"
 
 
-int curl_check_version (const char *req_version, ...);
-
 FILE *
 setup_ca_cert ()
 {
@@ -278,13 +276,15 @@ gen_test_file_url (char *url,
   int ret = 0;
   char *doc_path;
   size_t doc_path_len;
-  size_t i;
   /* setup test file path, url */
 #ifdef PATH_MAX
   doc_path_len = PATH_MAX > 4096 ? 4096 : PATH_MAX;
 #else  /* ! PATH_MAX */
   doc_path_len = 4096;
 #endif /* ! PATH_MAX */
+#ifdef WINDOWS
+  size_t i;
+#endif /* ! WINDOWS */
   if (NULL == (doc_path = malloc (doc_path_len)))
     {
       fprintf (stderr, MHD_E_MEM);

+ 1 - 1
src/testcurl/test_digestauth.c

@@ -170,7 +170,7 @@ testDigestAuth ()
   while (off < 8)
     {
       len = read(fd, rnd, 8);
-      if (len == -1)
+      if (len == (size_t)-1)
         {
           fprintf(stderr, "Failed to read `%s': %s\n",
                   "/dev/urandom",

+ 1 - 1
src/testcurl/test_digestauth_with_arguments.c

@@ -165,7 +165,7 @@ testDigestAuth ()
   while (off < 8)
 	{
 	  len = read(fd, rnd, 8);
-	  if (len == -1)
+	  if (len == (size_t)-1)
 	    {
 		  fprintf(stderr, "Failed to read `%s': %s\n",
 		       "/dev/urandom",

+ 4 - 0
src/testcurl/test_get_response_cleanup.c

@@ -95,6 +95,8 @@ kill_curl (pid_t pid)
 static ssize_t
 push_callback (void *cls, uint64_t pos, char *buf, size_t max)
 {
+  (void)cls;(void)pos;	/* Unused. Silent compiler warning. */
+
   if (max == 0)
     return 0;
   buf[0] = 'd';
@@ -125,6 +127,8 @@ ahc_echo (void *cls,
   const char *me = cls;
   struct MHD_Response *response;
   int ret;
+  (void)url;(void)version;                      /* Unused. Silent compiler warning. */
+  (void)upload_data;(void)upload_data_size;     /* Unused. Silent compiler warning. */
 
   //fprintf (stderr, "In CB: %s!\n", method);
   if (0 != strcmp (me, method))