gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [libmicrohttpd] 03/04: Muted compiler warnings in examples.


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] 03/04: Muted compiler warnings in examples.
Date: Fri, 29 Sep 2017 22:06:05 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit a5b63e992bb1d45982269cd4be4d8990414acc17
Author: Evgeny Grin (Karlson2k) <address@hidden>
AuthorDate: Fri Sep 29 13:29:23 2017 +0300

    Muted compiler warnings in examples.
---
 doc/examples/basicauthentication.c                |  7 ++++++-
 doc/examples/hellobrowser.c                       | 11 +++++++++--
 doc/examples/largepost.c                          | 11 +++++++++++
 doc/examples/logging.c                            |  7 +++++++
 doc/examples/responseheaders.c                    |  6 ++++++
 doc/examples/sessions.c                           | 11 +++++++++++
 doc/examples/simplepost.c                         | 12 ++++++++++++
 doc/examples/tlsauthentication.c                  | 10 ++++++++--
 src/examples/authorization_example.c              |  4 ++++
 src/examples/benchmark.c                          | 12 ++++++++++++
 src/examples/benchmark_https.c                    | 12 ++++++++++++
 src/examples/chunked_example.c                    |  5 +++++
 src/examples/demo.c                               | 11 ++++++++++-
 src/examples/demo_https.c                         | 11 ++++++++++-
 src/examples/digest_auth_example.c                |  7 +++++++
 src/examples/dual_stack_example.c                 |  4 ++++
 src/examples/fileserver_example.c                 |  4 ++++
 src/examples/fileserver_example_dirs.c            |  5 +++++
 src/examples/fileserver_example_external_select.c |  4 ++++
 src/examples/https_fileserver_example.c           |  4 ++++
 src/examples/minimal_example.c                    | 12 ++++++++----
 src/examples/minimal_example_comet.c              |  7 +++++++
 src/examples/post_example.c                       | 13 +++++++++++++
 src/examples/querystring_example.c                |  4 ++++
 src/examples/refuse_post_example.c                |  5 +++++
 src/examples/timeout.c                            | 10 ++++++++--
 src/examples/upgrade_example.c                    |  8 ++++++++
 27 files changed, 204 insertions(+), 13 deletions(-)

diff --git a/doc/examples/basicauthentication.c 
b/doc/examples/basicauthentication.c
index 22873d8c..0e13a2ee 100644
--- a/doc/examples/basicauthentication.c
+++ b/doc/examples/basicauthentication.c
@@ -28,6 +28,11 @@ answer_to_connection (void *cls, struct MHD_Connection 
*connection,
   int fail;
   int ret;
   struct MHD_Response *response;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, "GET"))
     return MHD_NO;
@@ -67,7 +72,7 @@ answer_to_connection (void *cls, struct MHD_Connection 
*connection,
 
 
 int
-main ()
+main (void)
 {
   struct MHD_Daemon *daemon;
 
diff --git a/doc/examples/hellobrowser.c b/doc/examples/hellobrowser.c
index 381a51e0..dce4ee6d 100644
--- a/doc/examples/hellobrowser.c
+++ b/doc/examples/hellobrowser.c
@@ -23,7 +23,14 @@ answer_to_connection (void *cls, struct MHD_Connection 
*connection,
   const char *page = "<html><body>Hello, browser!</body></html>";
   struct MHD_Response *response;
   int ret;
-  
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)method;            /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
+  (void)con_cls;           /* Unused. Silent compiler warning. */
+
   response =
     MHD_create_response_from_buffer (strlen (page), (void *) page, 
                                     MHD_RESPMEM_PERSISTENT);
@@ -35,7 +42,7 @@ answer_to_connection (void *cls, struct MHD_Connection 
*connection,
 
 
 int
-main ()
+main (void)
 {
   struct MHD_Daemon *daemon;
 
diff --git a/doc/examples/largepost.c b/doc/examples/largepost.c
index 1edf4d50..af6a48dd 100644
--- a/doc/examples/largepost.c
+++ b/doc/examples/largepost.c
@@ -128,6 +128,10 @@ iterate_post (void *coninfo_cls,
 {
   struct connection_info_struct *con_info = coninfo_cls;
   FILE *fp;
+  (void)kind;               /* Unused. Silent compiler warning. */
+  (void)content_type;       /* Unused. Silent compiler warning. */
+  (void)transfer_encoding;  /* Unused. Silent compiler warning. */
+  (void)off;                /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (key, "file"))
     {
@@ -178,6 +182,9 @@ request_completed (void *cls,
                    enum MHD_RequestTerminationCode toe)
 {
   struct connection_info_struct *con_info = *con_cls;
+  (void)cls;         /* Unused. Silent compiler warning. */
+  (void)connection;  /* Unused. Silent compiler warning. */
+  (void)toe;         /* Unused. Silent compiler warning. */
 
   if (NULL == con_info)
     return;
@@ -209,6 +216,10 @@ answer_to_connection (void *cls,
                       size_t *upload_data_size,
                       void **con_cls)
 {
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+
   if (NULL == *con_cls)
     {
       /* First call, setup data structures */
diff --git a/doc/examples/logging.c b/doc/examples/logging.c
index aff21426..239fbe7d 100644
--- a/doc/examples/logging.c
+++ b/doc/examples/logging.c
@@ -18,6 +18,8 @@ static int
 print_out_key (void *cls, enum MHD_ValueKind kind, const char *key,
                const char *value)
 {
+  (void)cls;    /* Unused. Silent compiler warning. */
+  (void)kind;   /* Unused. Silent compiler warning. */
   printf ("%s: %s\n", key, value);
   return MHD_YES;
 }
@@ -29,6 +31,11 @@ answer_to_connection (void *cls, struct MHD_Connection 
*connection,
                       const char *version, const char *upload_data,
                       size_t *upload_data_size, void **con_cls)
 {
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
+  (void)con_cls;           /* Unused. Silent compiler warning. */
   printf ("New %s request for %s using version %s\n", method, url, version);
 
   MHD_get_connection_values (connection, MHD_HEADER_KIND, print_out_key,
diff --git a/doc/examples/responseheaders.c b/doc/examples/responseheaders.c
index aa5cd7e2..0f459c2e 100644
--- a/doc/examples/responseheaders.c
+++ b/doc/examples/responseheaders.c
@@ -29,6 +29,12 @@ answer_to_connection (void *cls, struct MHD_Connection 
*connection,
   int fd;
   int ret;
   struct stat sbuf;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
+  (void)con_cls;           /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, "GET"))
     return MHD_NO;
diff --git a/doc/examples/sessions.c b/doc/examples/sessions.c
index be4cf467..b5b25440 100644
--- a/doc/examples/sessions.c
+++ b/doc/examples/sessions.c
@@ -419,6 +419,8 @@ not_found_page (const void *cls,
 {
   int ret;
   struct MHD_Response *response;
+  (void)cls;     /* Unused. Silent compiler warning. */
+  (void)session; /* Unused. Silent compiler warning. */
 
   /* unsupported HTTP method */
   response = MHD_create_response_from_buffer (strlen (NOT_FOUND_ERROR),
@@ -479,6 +481,10 @@ post_iterator (void *cls,
 {
   struct Request *request = cls;
   struct Session *session = request->session;
+  (void)kind;               /* Unused. Silent compiler warning. */
+  (void)filename;           /* Unused. Silent compiler warning. */
+  (void)content_type;       /* Unused. Silent compiler warning. */
+  (void)transfer_encoding;  /* Unused. Silent compiler warning. */
 
   if (0 == strcmp ("DONE", key))
     {
@@ -565,6 +571,8 @@ create_response (void *cls,
   struct Session *session;
   int ret;
   unsigned int i;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
 
   request = *ptr;
   if (NULL == request)
@@ -664,6 +672,9 @@ request_completed_callback (void *cls,
                            enum MHD_RequestTerminationCode toe)
 {
   struct Request *request = *con_cls;
+  (void)cls;         /* Unused. Silent compiler warning. */
+  (void)connection;  /* Unused. Silent compiler warning. */
+  (void)toe;         /* Unused. Silent compiler warning. */
 
   if (NULL == request)
     return;
diff --git a/doc/examples/simplepost.c b/doc/examples/simplepost.c
index a6c3a69d..a3bba94a 100644
--- a/doc/examples/simplepost.c
+++ b/doc/examples/simplepost.c
@@ -74,6 +74,11 @@ iterate_post (void *coninfo_cls, enum MHD_ValueKind kind, 
const char *key,
               size_t size)
 {
   struct connection_info_struct *con_info = coninfo_cls;
+  (void)kind;               /* Unused. Silent compiler warning. */
+  (void)filename;           /* Unused. Silent compiler warning. */
+  (void)content_type;       /* Unused. Silent compiler warning. */
+  (void)transfer_encoding;  /* Unused. Silent compiler warning. */
+  (void)off;                /* Unused. Silent compiler warning. */
 
   if (0 == strcmp (key, "name"))
     {
@@ -101,6 +106,9 @@ request_completed (void *cls, struct MHD_Connection 
*connection,
                    void **con_cls, enum MHD_RequestTerminationCode toe)
 {
   struct connection_info_struct *con_info = *con_cls;
+  (void)cls;         /* Unused. Silent compiler warning. */
+  (void)connection;  /* Unused. Silent compiler warning. */
+  (void)toe;         /* Unused. Silent compiler warning. */
 
   if (NULL == con_info)
     return;
@@ -123,6 +131,10 @@ answer_to_connection (void *cls, struct MHD_Connection 
*connection,
                       const char *version, const char *upload_data,
                       size_t *upload_data_size, void **con_cls)
 {
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+
   if (NULL == *con_cls)
     {
       struct connection_info_struct *con_info;
diff --git a/doc/examples/tlsauthentication.c b/doc/examples/tlsauthentication.c
index 742837e9..293e5e65 100644
--- a/doc/examples/tlsauthentication.c
+++ b/doc/examples/tlsauthentication.c
@@ -29,7 +29,7 @@ string_to_base64 (const char *message)
   const char *lookup =
     "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
   unsigned long l;
-  int i;
+  size_t i;
   char *tmp;
   size_t length = strlen (message);
 
@@ -107,7 +107,7 @@ load_file (const char *filename)
     }
   buffer[size] = '\0';
 
-  if (size != fread (buffer, 1, size, fp))
+  if (size != (long)fread (buffer, 1, size, fp))
     {
       free (buffer);
       buffer = NULL;
@@ -218,6 +218,12 @@ answer_to_connection (void *cls, struct MHD_Connection 
*connection,
                       const char *version, const char *upload_data,
                       size_t *upload_data_size, void **con_cls)
 {
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
+
   if (0 != strcmp (method, "GET"))
     return MHD_NO;
   if (NULL == *con_cls)
diff --git a/src/examples/authorization_example.c 
b/src/examples/authorization_example.c
index d7931471..d62973a2 100644
--- a/src/examples/authorization_example.c
+++ b/src/examples/authorization_example.c
@@ -53,6 +53,10 @@ ahc_echo (void *cls,
   char *user;
   char *pass;
   int fail;
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, "GET"))
     return MHD_NO;              /* unexpected method */
diff --git a/src/examples/benchmark.c b/src/examples/benchmark.c
index f9b8b5fd..9512b9bf 100644
--- a/src/examples/benchmark.c
+++ b/src/examples/benchmark.c
@@ -69,6 +69,9 @@ completed_callback (void *cls,
   struct timeval *tv = *con_cls;
   struct timeval tve;
   uint64_t delta;
+  (void)cls;         /* Unused. Silent compiler warning. */
+  (void)connection;  /* Unused. Silent compiler warning. */
+  (void)toe;         /* Unused. Silent compiler warning. */
 
   if (NULL == tv)
     return;
@@ -94,6 +97,8 @@ uri_logger_cb (void *cls,
               const char *uri)
 {
   struct timeval *tv = malloc (sizeof (struct timeval));
+  (void)cls; /* Unused. Silent compiler warning. */
+  (void)uri; /* Unused. Silent compiler warning. */
 
   if (NULL != tv)
     gettimeofday (tv, NULL);
@@ -109,6 +114,13 @@ ahc_echo (void *cls,
           const char *version,
           const char *upload_data, size_t *upload_data_size, void **ptr)
 {
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
+  (void)ptr;               /* Unused. Silent compiler warning. */
+
   if (0 != strcmp (method, "GET"))
     return MHD_NO;              /* unexpected method */
   return MHD_queue_response (connection, MHD_HTTP_OK, response);
diff --git a/src/examples/benchmark_https.c b/src/examples/benchmark_https.c
index b7327afc..87a79717 100644
--- a/src/examples/benchmark_https.c
+++ b/src/examples/benchmark_https.c
@@ -69,6 +69,9 @@ completed_callback (void *cls,
   struct timeval *tv = *con_cls;
   struct timeval tve;
   uint64_t delta;
+  (void)cls;         /* Unused. Silent compiler warning. */
+  (void)connection;  /* Unused. Silent compiler warning. */
+  (void)toe;         /* Unused. Silent compiler warning. */
 
   if (NULL == tv)
     return;
@@ -94,6 +97,8 @@ uri_logger_cb (void *cls,
               const char *uri)
 {
   struct timeval *tv = malloc (sizeof (struct timeval));
+  (void)cls; /* Unused. Silent compiler warning. */
+  (void)uri; /* Unused. Silent compiler warning. */
 
   if (NULL != tv)
     gettimeofday (tv, NULL);
@@ -109,6 +114,13 @@ ahc_echo (void *cls,
           const char *version,
           const char *upload_data, size_t *upload_data_size, void **ptr)
 {
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
+  (void)ptr;               /* Unused. Silent compiler warning. */
+
   if (0 != strcmp (method, "GET"))
     return MHD_NO;              /* unexpected method */
   return MHD_queue_response (connection, MHD_HTTP_OK, response);
diff --git a/src/examples/chunked_example.c b/src/examples/chunked_example.c
index 96ae148a..a661216c 100644
--- a/src/examples/chunked_example.c
+++ b/src/examples/chunked_example.c
@@ -99,6 +99,11 @@ ahc_echo (void *cls,
   struct ResponseContentCallbackParam * callback_param;
   struct MHD_Response *response;
   int ret;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, "GET"))
     return MHD_NO;              /* unexpected method */
diff --git a/src/examples/demo.c b/src/examples/demo.c
index 68b18ce2..edf38e98 100644
--- a/src/examples/demo.c
+++ b/src/examples/demo.c
@@ -492,6 +492,10 @@ process_upload_data (void *cls,
 {
   struct UploadContext *uc = cls;
   int i;
+  (void)kind;              /* Unused. Silent compiler warning. */
+  (void)content_type;      /* Unused. Silent compiler warning. */
+  (void)transfer_encoding; /* Unused. Silent compiler warning. */
+  (void)off;               /* Unused. Silent compiler warning. */
 
   if (0 == strcmp (key, "category"))
     return do_append (&uc->category, data, size);
@@ -612,6 +616,9 @@ response_completed_callback (void *cls,
                             enum MHD_RequestTerminationCode toe)
 {
   struct UploadContext *uc = *con_cls;
+  (void)cls;         /* Unused. Silent compiler warning. */
+  (void)connection;  /* Unused. Silent compiler warning. */
+  (void)toe;         /* Unused. Silent compiler warning. */
 
   if (NULL == uc)
     return; /* this request wasn't an upload request */
@@ -688,6 +695,8 @@ generate_page (void *cls,
   int ret;
   int fd;
   struct stat buf;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (url, "/"))
     {
@@ -814,6 +823,7 @@ generate_page (void *cls,
 }
 
 
+#ifndef MINGW
 /**
  * Function called if we get a SIGPIPE. Does nothing.
  *
@@ -829,7 +839,6 @@ catcher (int sig)
 /**
  * setup handlers to ignore SIGPIPE.
  */
-#ifndef MINGW
 static void
 ignore_sigpipe ()
 {
diff --git a/src/examples/demo_https.c b/src/examples/demo_https.c
index f9376de9..85c369b6 100644
--- a/src/examples/demo_https.c
+++ b/src/examples/demo_https.c
@@ -493,6 +493,10 @@ process_upload_data (void *cls,
 {
   struct UploadContext *uc = cls;
   int i;
+  (void)kind;              /* Unused. Silent compiler warning. */
+  (void)content_type;      /* Unused. Silent compiler warning. */
+  (void)transfer_encoding; /* Unused. Silent compiler warning. */
+  (void)off;               /* Unused. Silent compiler warning. */
 
   if (0 == strcmp (key, "category"))
     return do_append (&uc->category, data, size);
@@ -613,6 +617,9 @@ response_completed_callback (void *cls,
                             enum MHD_RequestTerminationCode toe)
 {
   struct UploadContext *uc = *con_cls;
+  (void)cls;         /* Unused. Silent compiler warning. */
+  (void)connection;  /* Unused. Silent compiler warning. */
+  (void)toe;         /* Unused. Silent compiler warning. */
 
   if (NULL == uc)
     return; /* this request wasn't an upload request */
@@ -689,6 +696,8 @@ generate_page (void *cls,
   int ret;
   int fd;
   struct stat buf;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (url, "/"))
     {
@@ -813,6 +822,7 @@ generate_page (void *cls,
 }
 
 
+#ifndef MINGW
 /**
  * Function called if we get a SIGPIPE. Does nothing.
  *
@@ -828,7 +838,6 @@ catcher (int sig)
 /**
  * setup handlers to ignore SIGPIPE.
  */
-#ifndef MINGW
 static void
 ignore_sigpipe ()
 {
diff --git a/src/examples/digest_auth_example.c 
b/src/examples/digest_auth_example.c
index 548d0d96..4b00669f 100644
--- a/src/examples/digest_auth_example.c
+++ b/src/examples/digest_auth_example.c
@@ -45,6 +45,13 @@ ahc_echo (void *cls,
   const char *password = "testpass";
   const char *realm = "address@hidden";
   int ret;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)method;            /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
+  (void)ptr;               /* Unused. Silent compiler warning. */
 
   username = MHD_digest_auth_get_username(connection);
   if (username == NULL)
diff --git a/src/examples/dual_stack_example.c 
b/src/examples/dual_stack_example.c
index 6b3cef83..31b25438 100644
--- a/src/examples/dual_stack_example.c
+++ b/src/examples/dual_stack_example.c
@@ -39,6 +39,10 @@ ahc_echo (void *cls,
   const char *me = cls;
   struct MHD_Response *response;
   int ret;
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, "GET"))
     return MHD_NO;              /* unexpected method */
diff --git a/src/examples/fileserver_example.c 
b/src/examples/fileserver_example.c
index 692e1f34..b8935fa1 100644
--- a/src/examples/fileserver_example.c
+++ b/src/examples/fileserver_example.c
@@ -54,6 +54,10 @@ ahc_echo (void *cls,
   int ret;
   int fd;
   struct stat buf;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
 
   if ( (0 != strcmp (method, MHD_HTTP_METHOD_GET)) &&
        (0 != strcmp (method, MHD_HTTP_METHOD_HEAD)) )
diff --git a/src/examples/fileserver_example_dirs.c 
b/src/examples/fileserver_example_dirs.c
index 32110aa3..8c37f219 100644
--- a/src/examples/fileserver_example_dirs.c
+++ b/src/examples/fileserver_example_dirs.c
@@ -66,6 +66,7 @@ dir_reader (void *cls, uint64_t pos, char *buf, size_t max)
 
   if (max < 512)
     return 0;
+  (void)pos; /* 'pos' is ignored as function return next one single entry per 
call. */
   do
     {
       e = readdir (dir);
@@ -96,6 +97,10 @@ ahc_echo (void *cls,
   DIR *dir;
   struct stat buf;
   char emsg[1024];
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, MHD_HTTP_METHOD_GET))
     return MHD_NO;              /* unexpected method */
diff --git a/src/examples/fileserver_example_external_select.c 
b/src/examples/fileserver_example_external_select.c
index 1ae79e16..6aea6dbf 100644
--- a/src/examples/fileserver_example_external_select.c
+++ b/src/examples/fileserver_example_external_select.c
@@ -62,6 +62,10 @@ ahc_echo (void *cls,
   FILE *file;
   int fd;
   struct stat buf;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, MHD_HTTP_METHOD_GET))
     return MHD_NO;              /* unexpected method */
diff --git a/src/examples/https_fileserver_example.c 
b/src/examples/https_fileserver_example.c
index b22b37d8..453ca2ff 100644
--- a/src/examples/https_fileserver_example.c
+++ b/src/examples/https_fileserver_example.c
@@ -129,6 +129,10 @@ http_ahc (void *cls,
   FILE *file;
   int fd;
   struct stat buf;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, MHD_HTTP_METHOD_GET))
     return MHD_NO;              /* unexpected method */
diff --git a/src/examples/minimal_example.c b/src/examples/minimal_example.c
index 98e7e192..4cf6401a 100644
--- a/src/examples/minimal_example.c
+++ b/src/examples/minimal_example.c
@@ -39,6 +39,10 @@ ahc_echo (void *cls,
   const char *me = cls;
   struct MHD_Response *response;
   int ret;
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, "GET"))
     return MHD_NO;              /* unexpected method */
@@ -67,11 +71,11 @@ main (int argc, char *const *argv)
       printf ("%s PORT\n", argv[0]);
       return 1;
     }
-  d = MHD_start_daemon (// MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
+  d = MHD_start_daemon (/* MHD_USE_INTERNAL_POLLING_THREAD | 
MHD_USE_ERROR_LOG, */
                         MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD | 
MHD_USE_ERROR_LOG,
-                        // MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG 
| MHD_USE_POLL,
-                       // MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | MHD_USE_POLL,
-                       // MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
+                        /* MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG 
| MHD_USE_POLL, */
+                       /* MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | MHD_USE_POLL, */
+                       /* MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, */
                         atoi (argv[1]),
                         NULL, NULL, &ahc_echo, PAGE,
                        MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 120,
diff --git a/src/examples/minimal_example_comet.c 
b/src/examples/minimal_example_comet.c
index d689212c..c4a3395d 100644
--- a/src/examples/minimal_example_comet.c
+++ b/src/examples/minimal_example_comet.c
@@ -28,6 +28,8 @@
 static ssize_t
 data_generator (void *cls, uint64_t pos, char *buf, size_t max)
 {
+  (void)cls; /* Unused. Silent compiler warning. */
+  (void)pos; /* Unused. Silent compiler warning. */
   if (max < 80)
     return 0;
   memset (buf, 'A', max - 1);
@@ -46,6 +48,11 @@ ahc_echo (void *cls,
   static int aptr;
   struct MHD_Response *response;
   int ret;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, "GET"))
     return MHD_NO;              /* unexpected method */
diff --git a/src/examples/post_example.c b/src/examples/post_example.c
index 2d83e0a4..8b92956d 100644
--- a/src/examples/post_example.c
+++ b/src/examples/post_example.c
@@ -315,6 +315,7 @@ fill_v1_form (const void *cls,
   int ret;
   char *reply;
   struct MHD_Response *response;
+  (void)cls; /* Unused. Silent compiler warning. */
 
   reply = malloc (strlen (MAIN_PAGE) + strlen (session->value_1) + 1);
   if (NULL == reply)
@@ -358,6 +359,7 @@ fill_v1_v2_form (const void *cls,
   int ret;
   char *reply;
   struct MHD_Response *response;
+  (void)cls; /* Unused. Silent compiler warning. */
 
   reply = malloc (strlen (SECOND_PAGE) + strlen (session->value_1) + strlen 
(session->value_2) + 1);
   if (NULL == reply)
@@ -401,6 +403,8 @@ not_found_page (const void *cls,
 {
   int ret;
   struct MHD_Response *response;
+  (void)cls;     /* Unused. Silent compiler warning. */
+  (void)session; /* Unused. Silent compiler warning. */
 
   /* unsupported HTTP method */
   response = MHD_create_response_from_buffer (strlen (NOT_FOUND_ERROR),
@@ -463,6 +467,10 @@ post_iterator (void *cls,
 {
   struct Request *request = cls;
   struct Session *session = request->session;
+  (void)kind;              /* Unused. Silent compiler warning. */
+  (void)filename;          /* Unused. Silent compiler warning. */
+  (void)content_type;      /* Unused. Silent compiler warning. */
+  (void)transfer_encoding; /* Unused. Silent compiler warning. */
 
   if (0 == strcmp ("DONE", key))
     {
@@ -548,6 +556,8 @@ create_response (void *cls,
   struct Session *session;
   int ret;
   unsigned int i;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
 
   request = *ptr;
   if (NULL == request)
@@ -647,6 +657,9 @@ request_completed_callback (void *cls,
                            enum MHD_RequestTerminationCode toe)
 {
   struct Request *request = *con_cls;
+  (void)cls;         /* Unused. Silent compiler warning. */
+  (void)connection;  /* Unused. Silent compiler warning. */
+  (void)toe;         /* Unused. Silent compiler warning. */
 
   if (NULL == request)
     return;
diff --git a/src/examples/querystring_example.c 
b/src/examples/querystring_example.c
index 6f95b44e..3d91bcea 100644
--- a/src/examples/querystring_example.c
+++ b/src/examples/querystring_example.c
@@ -42,6 +42,10 @@ ahc_echo (void *cls,
   char *me;
   struct MHD_Response *response;
   int ret;
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, "GET"))
     return MHD_NO;              /* unexpected method */
diff --git a/src/examples/refuse_post_example.c 
b/src/examples/refuse_post_example.c
index 8079f467..dad3beb1 100644
--- a/src/examples/refuse_post_example.c
+++ b/src/examples/refuse_post_example.c
@@ -45,6 +45,11 @@ ahc_echo (void *cls,
   const char *me = cls;
   struct MHD_Response *response;
   int ret;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
 
   if ((0 != strcmp (method, "GET")) && (0 != strcmp (method, "POST")))
     return MHD_NO;              /* unexpected method */
diff --git a/src/examples/timeout.c b/src/examples/timeout.c
index e0e33560..b9569547 100644
--- a/src/examples/timeout.c
+++ b/src/examples/timeout.c
@@ -42,6 +42,13 @@ answer_to_connection(void *cls,
   const char *page = "<html><body>Hello timeout!</body></html>";
   struct MHD_Response *response;
   int ret;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)method;            /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
+  (void)con_cls;           /* Unused. Silent compiler warning. */
 
   response = MHD_create_response_from_buffer (strlen(page),
                                               (void *) page,
@@ -58,8 +65,7 @@ answer_to_connection(void *cls,
 
 
 int
-main (int argc,
-      char **argv)
+main (void)
 {
   struct MHD_Daemon *daemon;
 
diff --git a/src/examples/upgrade_example.c b/src/examples/upgrade_example.c
index af081408..73cfafb2 100644
--- a/src/examples/upgrade_example.c
+++ b/src/examples/upgrade_example.c
@@ -202,6 +202,9 @@ uh_cb (void *cls,
 {
   struct MyData *md;
   pthread_t pt;
+  (void)cls;         /* Unused. Silent compiler warning. */
+  (void)connection;  /* Unused. Silent compiler warning. */
+  (void)con_cls;     /* Unused. Silent compiler warning. */
 
   md = malloc (sizeof (struct MyData));
   if (NULL == md)
@@ -249,6 +252,11 @@ ahc_echo (void *cls,
   static int aptr;
   struct MHD_Response *response;
   int ret;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, "GET"))
     return MHD_NO;              /* unexpected method */

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]