[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libmicrohttpd] 04/04: Fixed compiler warnings for tests in
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libmicrohttpd] 04/04: Fixed compiler warnings for tests in src/microhttpd |
Date: |
Fri, 29 Sep 2017 22:06:06 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 3f5fe81d43728e9d7eecad00234ce244fa8211be
Author: Evgeny Grin (Karlson2k) <address@hidden>
AuthorDate: Fri Sep 29 18:52:34 2017 +0300
Fixed compiler warnings for tests in src/microhttpd
---
src/microhttpd/test_daemon.c | 9 +++++++++
src/microhttpd/test_http_reasons.c | 2 ++
src/microhttpd/test_postprocessor.c | 31 +++++++++++++++++--------------
src/microhttpd/test_postprocessor_amp.c | 3 +++
src/microhttpd/test_postprocessor_large.c | 7 +++++--
src/microhttpd/test_shutdown_select.c | 1 +
src/microhttpd/test_str_token.c | 1 +
src/microhttpd/test_upgrade.c | 8 ++++++++
8 files changed, 46 insertions(+), 16 deletions(-)
diff --git a/src/microhttpd/test_daemon.c b/src/microhttpd/test_daemon.c
index f22ca138..e3b72bcd 100644
--- a/src/microhttpd/test_daemon.c
+++ b/src/microhttpd/test_daemon.c
@@ -57,6 +57,8 @@ apc_nothing (void *cls,
const struct sockaddr *addr,
socklen_t addrlen)
{
+ (void)cls; (void)addr; (void)addrlen; /* Unused. Silent compiler warning. */
+
return MHD_NO;
}
@@ -66,6 +68,8 @@ apc_all (void *cls,
const struct sockaddr *addr,
socklen_t addrlen)
{
+ (void)cls; (void)addr; (void)addrlen; /* Unused. Silent compiler warning. */
+
return MHD_YES;
}
@@ -79,6 +83,10 @@ ahc_nothing (void *cls,
const char *upload_data, size_t *upload_data_size,
void **unused)
{
+ (void)cls;(void)connection;(void)url; /* Unused. Silent compiler
warning. */
+ (void)method;(void)version;(void)upload_data; /* Unused. Silent compiler
warning. */
+ (void)upload_data_size;(void)unused; /* Unused. Silent compiler
warning. */
+
return MHD_NO;
}
@@ -215,6 +223,7 @@ main (int argc,
char *const *argv)
{
int errorCount = 0;
+ (void)argc; (void)argv; /* Unused. Silent compiler warning. */
errorCount += testStartError ();
errorCount += testStartStop ();
diff --git a/src/microhttpd/test_http_reasons.c
b/src/microhttpd/test_http_reasons.c
index 1a78e2c6..a4dab63a 100644
--- a/src/microhttpd/test_http_reasons.c
+++ b/src/microhttpd/test_http_reasons.c
@@ -121,6 +121,8 @@ static int test_5xx(void)
int main(int argc, char * argv[])
{
int errcount = 0;
+ (void)argc; (void)argv; /* Unused. Silent compiler warning. */
+
errcount += test_absent_codes();
errcount += test_1xx();
errcount += test_2xx();
diff --git a/src/microhttpd/test_postprocessor.c
b/src/microhttpd/test_postprocessor.c
index 029600a2..8edc5b22 100644
--- a/src/microhttpd/test_postprocessor.c
+++ b/src/microhttpd/test_postprocessor.c
@@ -91,6 +91,8 @@ value_checker (void *cls,
{
int *want_off = cls;
int idx = *want_off;
+ (void)kind; /* Unused. Silent compiler warning. */
+
#if 0
fprintf (stderr,
@@ -120,14 +122,14 @@ value_checker (void *cls,
static int
-test_urlencoding ()
+test_urlencoding (void)
{
struct MHD_Connection connection;
struct MHD_HTTP_Header header;
struct MHD_PostProcessor *pp;
unsigned int want_off = URL_START;
- int i;
- int delta;
+ size_t i;
+ size_t delta;
size_t size;
memset (&connection, 0, sizeof (struct MHD_Connection));
@@ -154,7 +156,7 @@ test_urlencoding ()
static int
-test_multipart_garbage ()
+test_multipart_garbage (void)
{
struct MHD_Connection connection;
struct MHD_HTTP_Header header;
@@ -195,7 +197,7 @@ test_multipart_garbage ()
static int
-test_multipart_splits ()
+test_multipart_splits (void)
{
struct MHD_Connection connection;
struct MHD_HTTP_Header header;
@@ -228,14 +230,14 @@ test_multipart_splits ()
static int
-test_multipart ()
+test_multipart (void)
{
struct MHD_Connection connection;
struct MHD_HTTP_Header header;
struct MHD_PostProcessor *pp;
unsigned int want_off = FORM_START;
- int i;
- int delta;
+ size_t i;
+ size_t delta;
size_t size;
memset (&connection, 0, sizeof (struct MHD_Connection));
@@ -263,14 +265,14 @@ test_multipart ()
static int
-test_nested_multipart ()
+test_nested_multipart (void)
{
struct MHD_Connection connection;
struct MHD_HTTP_Header header;
struct MHD_PostProcessor *pp;
unsigned int want_off = FORM_NESTED_START;
- int i;
- int delta;
+ size_t i;
+ size_t delta;
size_t size;
memset (&connection, 0, sizeof (struct MHD_Connection));
@@ -298,14 +300,14 @@ test_nested_multipart ()
static int
-test_empty_value ()
+test_empty_value (void)
{
struct MHD_Connection connection;
struct MHD_HTTP_Header header;
struct MHD_PostProcessor *pp;
unsigned int want_off = URL_EMPTY_VALUE_START;
- int i;
- int delta;
+ size_t i;
+ size_t delta;
size_t size;
memset (&connection, 0, sizeof (struct MHD_Connection));
@@ -337,6 +339,7 @@ int
main (int argc, char *const *argv)
{
unsigned int errorCount = 0;
+ (void)argc; (void)argv; /* Unused. Silent compiler warning. */
errorCount += test_multipart_splits ();
errorCount += test_multipart_garbage ();
diff --git a/src/microhttpd/test_postprocessor_amp.c
b/src/microhttpd/test_postprocessor_amp.c
index 73f72f92..ef271810 100644
--- a/src/microhttpd/test_postprocessor_amp.c
+++ b/src/microhttpd/test_postprocessor_amp.c
@@ -11,6 +11,8 @@ int check_post(void *cls, enum MHD_ValueKind kind, const
char* key,
const char* content_encoding, const char* data,
uint64_t off, size_t size)
{
+ (void)cls; (void)kind; (void)filename; (void)content_type; /* Unused.
Silent compiler warning. */
+ (void)content_encoding; (void)data; (void)off; (void)size; /* Unused.
Silent compiler warning. */
if ((0 != strcmp(key, "a")) && (0 != strcmp(key, "b")))
{
printf("ERROR: got unexpected '%s'\n", key);
@@ -26,6 +28,7 @@ main (int argc, char *const *argv)
struct MHD_Connection connection;
struct MHD_HTTP_Header header;
struct MHD_PostProcessor *pp;
+ (void)argc; (void)argv; /* Unused. Silent compiler warning. */
memset (&connection, 0, sizeof (struct MHD_Connection));
memset (&header, 0, sizeof (struct MHD_HTTP_Header));
diff --git a/src/microhttpd/test_postprocessor_large.c
b/src/microhttpd/test_postprocessor_large.c
index a509a7ba..13e8c78f 100644
--- a/src/microhttpd/test_postprocessor_large.c
+++ b/src/microhttpd/test_postprocessor_large.c
@@ -43,6 +43,8 @@ value_checker (void *cls,
const char *data, uint64_t off, size_t size)
{
unsigned int *pos = cls;
+ (void)kind; (void)key; (void)filename; (void)content_type; /* Unused.
Silent compiler warning. */
+ (void)transfer_encoding; (void)data; (void)off; /* Unused.
Silent compiler warning. */
#if 0
fprintf (stderr,
"VC: %llu %u `%s' `%s' `%s' `%s' `%.*s'\n",
@@ -63,8 +65,8 @@ test_simple_large ()
struct MHD_Connection connection;
struct MHD_HTTP_Header header;
struct MHD_PostProcessor *pp;
- int i;
- int delta;
+ size_t i;
+ size_t delta;
size_t size;
char data[102400];
unsigned int pos;
@@ -98,6 +100,7 @@ int
main (int argc, char *const *argv)
{
unsigned int errorCount = 0;
+ (void)argc; (void)argv; /* Unused. Silent compiler warning. */
errorCount += test_simple_large ();
if (errorCount != 0)
diff --git a/src/microhttpd/test_shutdown_select.c
b/src/microhttpd/test_shutdown_select.c
index e3cd0249..e8942c0b 100644
--- a/src/microhttpd/test_shutdown_select.c
+++ b/src/microhttpd/test_shutdown_select.c
@@ -286,6 +286,7 @@ main (int argc, char *const *argv)
#endif /* MHD_WINSOCK_SOCKETS */
bool test_poll;
bool must_ignore;
+ (void)argc; /* Unused. Silent compiler warning. */
test_poll = has_in_name(argv[0], "_poll");
must_ignore = has_in_name(argv[0], "_ignore");
diff --git a/src/microhttpd/test_str_token.c b/src/microhttpd/test_str_token.c
index 464cc7a5..15f3f406 100644
--- a/src/microhttpd/test_str_token.c
+++ b/src/microhttpd/test_str_token.c
@@ -111,6 +111,7 @@ int check_not_match(void)
int main(int argc, char * argv[])
{
int errcount = 0;
+ (void)argc; (void)argv; /* Unused. Silent compiler warning. */
errcount += check_match();
errcount += check_not_match();
return errcount == 0 ? 0 : 1;
diff --git a/src/microhttpd/test_upgrade.c b/src/microhttpd/test_upgrade.c
index b1a234cb..377e712d 100644
--- a/src/microhttpd/test_upgrade.c
+++ b/src/microhttpd/test_upgrade.c
@@ -443,6 +443,7 @@ notify_completed_cb (void *cls,
void **con_cls,
enum MHD_RequestTerminationCode toe)
{
+ (void)cls; (void)connection; /* Unused. Silent compiler warning. */
if ( (toe != MHD_REQUEST_TERMINATED_COMPLETED_OK) &&
(toe != MHD_REQUEST_TERMINATED_CLIENT_ABORT) &&
(toe != MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN) )
@@ -468,6 +469,8 @@ log_cb (void *cls,
struct MHD_Connection *connection)
{
pthread_t* ppth;
+ (void)cls; (void)connection; /* Unused. Silent compiler warning. */
+
if (0 != strcmp (uri,
"/"))
abort ();
@@ -505,6 +508,7 @@ notify_connection_cb (void *cls,
enum MHD_ConnectionNotificationCode toe)
{
static int started;
+ (void)cls; (void)connection; /* Unused. Silent compiler warning. */
switch (toe)
{
@@ -759,6 +763,7 @@ upgrade_cb (void *cls,
MHD_socket sock,
struct MHD_UpgradeResponseHandle *urh)
{
+ (void)cls; (void)connection; (void)con_cls; (void)extra_in; /* Unused.
Silent compiler warning. */
usock = wr_create_from_plain_sckt (sock);
if (0 != extra_in_size)
abort ();
@@ -821,6 +826,8 @@ ahc_upgrade (void *cls,
{
struct MHD_Response *resp;
int ret;
+ (void)cls;(void)url;(void)method; /* Unused. Silent
compiler warning. */
+ (void)version;(void)upload_data;(void)upload_data_size; /* Unused. Silent
compiler warning. */
if (NULL == *con_cls)
abort ();
@@ -898,6 +905,7 @@ run_mhd_select_loop (struct MHD_Daemon *daemon)
static void
run_mhd_poll_loop (struct MHD_Daemon *daemon)
{
+ (void)daemon; /* Unused. Silent compiler warning. */
abort (); /* currently not implementable with existing MHD API */
}
#endif /* HAVE_POLL */
--
To stop receiving notification emails like this one, please contact
address@hidden