diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2017-09-29 13:29:23 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2017-09-29 22:07:49 +0300 |
commit | a5b63e992bb1d45982269cd4be4d8990414acc17 (patch) | |
tree | b2ecaa5b0342c4745b3a91e2211f3b06dc0b82d0 | |
parent | 527700a01e67e35781a4ba789a43e4d982dd5b25 (diff) | |
download | libmicrohttpd-a5b63e992bb1d45982269cd4be4d8990414acc17.tar.gz libmicrohttpd-a5b63e992bb1d45982269cd4be4d8990414acc17.zip |
Muted compiler warnings in examples.
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, | |||
28 | int fail; | 28 | int fail; |
29 | int ret; | 29 | int ret; |
30 | struct MHD_Response *response; | 30 | struct MHD_Response *response; |
31 | (void)cls; /* Unused. Silent compiler warning. */ | ||
32 | (void)url; /* Unused. Silent compiler warning. */ | ||
33 | (void)version; /* Unused. Silent compiler warning. */ | ||
34 | (void)upload_data; /* Unused. Silent compiler warning. */ | ||
35 | (void)upload_data_size; /* Unused. Silent compiler warning. */ | ||
31 | 36 | ||
32 | if (0 != strcmp (method, "GET")) | 37 | if (0 != strcmp (method, "GET")) |
33 | return MHD_NO; | 38 | return MHD_NO; |
@@ -67,7 +72,7 @@ answer_to_connection (void *cls, struct MHD_Connection *connection, | |||
67 | 72 | ||
68 | 73 | ||
69 | int | 74 | int |
70 | main () | 75 | main (void) |
71 | { | 76 | { |
72 | struct MHD_Daemon *daemon; | 77 | struct MHD_Daemon *daemon; |
73 | 78 | ||
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, | |||
23 | const char *page = "<html><body>Hello, browser!</body></html>"; | 23 | const char *page = "<html><body>Hello, browser!</body></html>"; |
24 | struct MHD_Response *response; | 24 | struct MHD_Response *response; |
25 | int ret; | 25 | int ret; |
26 | 26 | (void)cls; /* Unused. Silent compiler warning. */ | |
27 | (void)url; /* Unused. Silent compiler warning. */ | ||
28 | (void)method; /* Unused. Silent compiler warning. */ | ||
29 | (void)version; /* Unused. Silent compiler warning. */ | ||
30 | (void)upload_data; /* Unused. Silent compiler warning. */ | ||
31 | (void)upload_data_size; /* Unused. Silent compiler warning. */ | ||
32 | (void)con_cls; /* Unused. Silent compiler warning. */ | ||
33 | |||
27 | response = | 34 | response = |
28 | MHD_create_response_from_buffer (strlen (page), (void *) page, | 35 | MHD_create_response_from_buffer (strlen (page), (void *) page, |
29 | MHD_RESPMEM_PERSISTENT); | 36 | MHD_RESPMEM_PERSISTENT); |
@@ -35,7 +42,7 @@ answer_to_connection (void *cls, struct MHD_Connection *connection, | |||
35 | 42 | ||
36 | 43 | ||
37 | int | 44 | int |
38 | main () | 45 | main (void) |
39 | { | 46 | { |
40 | struct MHD_Daemon *daemon; | 47 | struct MHD_Daemon *daemon; |
41 | 48 | ||
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, | |||
128 | { | 128 | { |
129 | struct connection_info_struct *con_info = coninfo_cls; | 129 | struct connection_info_struct *con_info = coninfo_cls; |
130 | FILE *fp; | 130 | FILE *fp; |
131 | (void)kind; /* Unused. Silent compiler warning. */ | ||
132 | (void)content_type; /* Unused. Silent compiler warning. */ | ||
133 | (void)transfer_encoding; /* Unused. Silent compiler warning. */ | ||
134 | (void)off; /* Unused. Silent compiler warning. */ | ||
131 | 135 | ||
132 | if (0 != strcmp (key, "file")) | 136 | if (0 != strcmp (key, "file")) |
133 | { | 137 | { |
@@ -178,6 +182,9 @@ request_completed (void *cls, | |||
178 | enum MHD_RequestTerminationCode toe) | 182 | enum MHD_RequestTerminationCode toe) |
179 | { | 183 | { |
180 | struct connection_info_struct *con_info = *con_cls; | 184 | struct connection_info_struct *con_info = *con_cls; |
185 | (void)cls; /* Unused. Silent compiler warning. */ | ||
186 | (void)connection; /* Unused. Silent compiler warning. */ | ||
187 | (void)toe; /* Unused. Silent compiler warning. */ | ||
181 | 188 | ||
182 | if (NULL == con_info) | 189 | if (NULL == con_info) |
183 | return; | 190 | return; |
@@ -209,6 +216,10 @@ answer_to_connection (void *cls, | |||
209 | size_t *upload_data_size, | 216 | size_t *upload_data_size, |
210 | void **con_cls) | 217 | void **con_cls) |
211 | { | 218 | { |
219 | (void)cls; /* Unused. Silent compiler warning. */ | ||
220 | (void)url; /* Unused. Silent compiler warning. */ | ||
221 | (void)version; /* Unused. Silent compiler warning. */ | ||
222 | |||
212 | if (NULL == *con_cls) | 223 | if (NULL == *con_cls) |
213 | { | 224 | { |
214 | /* First call, setup data structures */ | 225 | /* 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 | |||
18 | print_out_key (void *cls, enum MHD_ValueKind kind, const char *key, | 18 | print_out_key (void *cls, enum MHD_ValueKind kind, const char *key, |
19 | const char *value) | 19 | const char *value) |
20 | { | 20 | { |
21 | (void)cls; /* Unused. Silent compiler warning. */ | ||
22 | (void)kind; /* Unused. Silent compiler warning. */ | ||
21 | printf ("%s: %s\n", key, value); | 23 | printf ("%s: %s\n", key, value); |
22 | return MHD_YES; | 24 | return MHD_YES; |
23 | } | 25 | } |
@@ -29,6 +31,11 @@ answer_to_connection (void *cls, struct MHD_Connection *connection, | |||
29 | const char *version, const char *upload_data, | 31 | const char *version, const char *upload_data, |
30 | size_t *upload_data_size, void **con_cls) | 32 | size_t *upload_data_size, void **con_cls) |
31 | { | 33 | { |
34 | (void)cls; /* Unused. Silent compiler warning. */ | ||
35 | (void)version; /* Unused. Silent compiler warning. */ | ||
36 | (void)upload_data; /* Unused. Silent compiler warning. */ | ||
37 | (void)upload_data_size; /* Unused. Silent compiler warning. */ | ||
38 | (void)con_cls; /* Unused. Silent compiler warning. */ | ||
32 | printf ("New %s request for %s using version %s\n", method, url, version); | 39 | printf ("New %s request for %s using version %s\n", method, url, version); |
33 | 40 | ||
34 | MHD_get_connection_values (connection, MHD_HEADER_KIND, print_out_key, | 41 | 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, | |||
29 | int fd; | 29 | int fd; |
30 | int ret; | 30 | int ret; |
31 | struct stat sbuf; | 31 | struct stat sbuf; |
32 | (void)cls; /* Unused. Silent compiler warning. */ | ||
33 | (void)url; /* Unused. Silent compiler warning. */ | ||
34 | (void)version; /* Unused. Silent compiler warning. */ | ||
35 | (void)upload_data; /* Unused. Silent compiler warning. */ | ||
36 | (void)upload_data_size; /* Unused. Silent compiler warning. */ | ||
37 | (void)con_cls; /* Unused. Silent compiler warning. */ | ||
32 | 38 | ||
33 | if (0 != strcmp (method, "GET")) | 39 | if (0 != strcmp (method, "GET")) |
34 | return MHD_NO; | 40 | 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, | |||
419 | { | 419 | { |
420 | int ret; | 420 | int ret; |
421 | struct MHD_Response *response; | 421 | struct MHD_Response *response; |
422 | (void)cls; /* Unused. Silent compiler warning. */ | ||
423 | (void)session; /* Unused. Silent compiler warning. */ | ||
422 | 424 | ||
423 | /* unsupported HTTP method */ | 425 | /* unsupported HTTP method */ |
424 | response = MHD_create_response_from_buffer (strlen (NOT_FOUND_ERROR), | 426 | response = MHD_create_response_from_buffer (strlen (NOT_FOUND_ERROR), |
@@ -479,6 +481,10 @@ post_iterator (void *cls, | |||
479 | { | 481 | { |
480 | struct Request *request = cls; | 482 | struct Request *request = cls; |
481 | struct Session *session = request->session; | 483 | struct Session *session = request->session; |
484 | (void)kind; /* Unused. Silent compiler warning. */ | ||
485 | (void)filename; /* Unused. Silent compiler warning. */ | ||
486 | (void)content_type; /* Unused. Silent compiler warning. */ | ||
487 | (void)transfer_encoding; /* Unused. Silent compiler warning. */ | ||
482 | 488 | ||
483 | if (0 == strcmp ("DONE", key)) | 489 | if (0 == strcmp ("DONE", key)) |
484 | { | 490 | { |
@@ -565,6 +571,8 @@ create_response (void *cls, | |||
565 | struct Session *session; | 571 | struct Session *session; |
566 | int ret; | 572 | int ret; |
567 | unsigned int i; | 573 | unsigned int i; |
574 | (void)cls; /* Unused. Silent compiler warning. */ | ||
575 | (void)version; /* Unused. Silent compiler warning. */ | ||
568 | 576 | ||
569 | request = *ptr; | 577 | request = *ptr; |
570 | if (NULL == request) | 578 | if (NULL == request) |
@@ -664,6 +672,9 @@ request_completed_callback (void *cls, | |||
664 | enum MHD_RequestTerminationCode toe) | 672 | enum MHD_RequestTerminationCode toe) |
665 | { | 673 | { |
666 | struct Request *request = *con_cls; | 674 | struct Request *request = *con_cls; |
675 | (void)cls; /* Unused. Silent compiler warning. */ | ||
676 | (void)connection; /* Unused. Silent compiler warning. */ | ||
677 | (void)toe; /* Unused. Silent compiler warning. */ | ||
667 | 678 | ||
668 | if (NULL == request) | 679 | if (NULL == request) |
669 | return; | 680 | 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, | |||
74 | size_t size) | 74 | size_t size) |
75 | { | 75 | { |
76 | struct connection_info_struct *con_info = coninfo_cls; | 76 | struct connection_info_struct *con_info = coninfo_cls; |
77 | (void)kind; /* Unused. Silent compiler warning. */ | ||
78 | (void)filename; /* Unused. Silent compiler warning. */ | ||
79 | (void)content_type; /* Unused. Silent compiler warning. */ | ||
80 | (void)transfer_encoding; /* Unused. Silent compiler warning. */ | ||
81 | (void)off; /* Unused. Silent compiler warning. */ | ||
77 | 82 | ||
78 | if (0 == strcmp (key, "name")) | 83 | if (0 == strcmp (key, "name")) |
79 | { | 84 | { |
@@ -101,6 +106,9 @@ request_completed (void *cls, struct MHD_Connection *connection, | |||
101 | void **con_cls, enum MHD_RequestTerminationCode toe) | 106 | void **con_cls, enum MHD_RequestTerminationCode toe) |
102 | { | 107 | { |
103 | struct connection_info_struct *con_info = *con_cls; | 108 | struct connection_info_struct *con_info = *con_cls; |
109 | (void)cls; /* Unused. Silent compiler warning. */ | ||
110 | (void)connection; /* Unused. Silent compiler warning. */ | ||
111 | (void)toe; /* Unused. Silent compiler warning. */ | ||
104 | 112 | ||
105 | if (NULL == con_info) | 113 | if (NULL == con_info) |
106 | return; | 114 | return; |
@@ -123,6 +131,10 @@ answer_to_connection (void *cls, struct MHD_Connection *connection, | |||
123 | const char *version, const char *upload_data, | 131 | const char *version, const char *upload_data, |
124 | size_t *upload_data_size, void **con_cls) | 132 | size_t *upload_data_size, void **con_cls) |
125 | { | 133 | { |
134 | (void)cls; /* Unused. Silent compiler warning. */ | ||
135 | (void)url; /* Unused. Silent compiler warning. */ | ||
136 | (void)version; /* Unused. Silent compiler warning. */ | ||
137 | |||
126 | if (NULL == *con_cls) | 138 | if (NULL == *con_cls) |
127 | { | 139 | { |
128 | struct connection_info_struct *con_info; | 140 | 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) | |||
29 | const char *lookup = | 29 | const char *lookup = |
30 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; | 30 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; |
31 | unsigned long l; | 31 | unsigned long l; |
32 | int i; | 32 | size_t i; |
33 | char *tmp; | 33 | char *tmp; |
34 | size_t length = strlen (message); | 34 | size_t length = strlen (message); |
35 | 35 | ||
@@ -107,7 +107,7 @@ load_file (const char *filename) | |||
107 | } | 107 | } |
108 | buffer[size] = '\0'; | 108 | buffer[size] = '\0'; |
109 | 109 | ||
110 | if (size != fread (buffer, 1, size, fp)) | 110 | if (size != (long)fread (buffer, 1, size, fp)) |
111 | { | 111 | { |
112 | free (buffer); | 112 | free (buffer); |
113 | buffer = NULL; | 113 | buffer = NULL; |
@@ -218,6 +218,12 @@ answer_to_connection (void *cls, struct MHD_Connection *connection, | |||
218 | const char *version, const char *upload_data, | 218 | const char *version, const char *upload_data, |
219 | size_t *upload_data_size, void **con_cls) | 219 | size_t *upload_data_size, void **con_cls) |
220 | { | 220 | { |
221 | (void)cls; /* Unused. Silent compiler warning. */ | ||
222 | (void)url; /* Unused. Silent compiler warning. */ | ||
223 | (void)version; /* Unused. Silent compiler warning. */ | ||
224 | (void)upload_data; /* Unused. Silent compiler warning. */ | ||
225 | (void)upload_data_size; /* Unused. Silent compiler warning. */ | ||
226 | |||
221 | if (0 != strcmp (method, "GET")) | 227 | if (0 != strcmp (method, "GET")) |
222 | return MHD_NO; | 228 | return MHD_NO; |
223 | if (NULL == *con_cls) | 229 | 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, | |||
53 | char *user; | 53 | char *user; |
54 | char *pass; | 54 | char *pass; |
55 | int fail; | 55 | int fail; |
56 | (void)url; /* Unused. Silent compiler warning. */ | ||
57 | (void)version; /* Unused. Silent compiler warning. */ | ||
58 | (void)upload_data; /* Unused. Silent compiler warning. */ | ||
59 | (void)upload_data_size; /* Unused. Silent compiler warning. */ | ||
56 | 60 | ||
57 | if (0 != strcmp (method, "GET")) | 61 | if (0 != strcmp (method, "GET")) |
58 | return MHD_NO; /* unexpected method */ | 62 | 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, | |||
69 | struct timeval *tv = *con_cls; | 69 | struct timeval *tv = *con_cls; |
70 | struct timeval tve; | 70 | struct timeval tve; |
71 | uint64_t delta; | 71 | uint64_t delta; |
72 | (void)cls; /* Unused. Silent compiler warning. */ | ||
73 | (void)connection; /* Unused. Silent compiler warning. */ | ||
74 | (void)toe; /* Unused. Silent compiler warning. */ | ||
72 | 75 | ||
73 | if (NULL == tv) | 76 | if (NULL == tv) |
74 | return; | 77 | return; |
@@ -94,6 +97,8 @@ uri_logger_cb (void *cls, | |||
94 | const char *uri) | 97 | const char *uri) |
95 | { | 98 | { |
96 | struct timeval *tv = malloc (sizeof (struct timeval)); | 99 | struct timeval *tv = malloc (sizeof (struct timeval)); |
100 | (void)cls; /* Unused. Silent compiler warning. */ | ||
101 | (void)uri; /* Unused. Silent compiler warning. */ | ||
97 | 102 | ||
98 | if (NULL != tv) | 103 | if (NULL != tv) |
99 | gettimeofday (tv, NULL); | 104 | gettimeofday (tv, NULL); |
@@ -109,6 +114,13 @@ ahc_echo (void *cls, | |||
109 | const char *version, | 114 | const char *version, |
110 | const char *upload_data, size_t *upload_data_size, void **ptr) | 115 | const char *upload_data, size_t *upload_data_size, void **ptr) |
111 | { | 116 | { |
117 | (void)cls; /* Unused. Silent compiler warning. */ | ||
118 | (void)url; /* Unused. Silent compiler warning. */ | ||
119 | (void)version; /* Unused. Silent compiler warning. */ | ||
120 | (void)upload_data; /* Unused. Silent compiler warning. */ | ||
121 | (void)upload_data_size; /* Unused. Silent compiler warning. */ | ||
122 | (void)ptr; /* Unused. Silent compiler warning. */ | ||
123 | |||
112 | if (0 != strcmp (method, "GET")) | 124 | if (0 != strcmp (method, "GET")) |
113 | return MHD_NO; /* unexpected method */ | 125 | return MHD_NO; /* unexpected method */ |
114 | return MHD_queue_response (connection, MHD_HTTP_OK, response); | 126 | 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, | |||
69 | struct timeval *tv = *con_cls; | 69 | struct timeval *tv = *con_cls; |
70 | struct timeval tve; | 70 | struct timeval tve; |
71 | uint64_t delta; | 71 | uint64_t delta; |
72 | (void)cls; /* Unused. Silent compiler warning. */ | ||
73 | (void)connection; /* Unused. Silent compiler warning. */ | ||
74 | (void)toe; /* Unused. Silent compiler warning. */ | ||
72 | 75 | ||
73 | if (NULL == tv) | 76 | if (NULL == tv) |
74 | return; | 77 | return; |
@@ -94,6 +97,8 @@ uri_logger_cb (void *cls, | |||
94 | const char *uri) | 97 | const char *uri) |
95 | { | 98 | { |
96 | struct timeval *tv = malloc (sizeof (struct timeval)); | 99 | struct timeval *tv = malloc (sizeof (struct timeval)); |
100 | (void)cls; /* Unused. Silent compiler warning. */ | ||
101 | (void)uri; /* Unused. Silent compiler warning. */ | ||
97 | 102 | ||
98 | if (NULL != tv) | 103 | if (NULL != tv) |
99 | gettimeofday (tv, NULL); | 104 | gettimeofday (tv, NULL); |
@@ -109,6 +114,13 @@ ahc_echo (void *cls, | |||
109 | const char *version, | 114 | const char *version, |
110 | const char *upload_data, size_t *upload_data_size, void **ptr) | 115 | const char *upload_data, size_t *upload_data_size, void **ptr) |
111 | { | 116 | { |
117 | (void)cls; /* Unused. Silent compiler warning. */ | ||
118 | (void)url; /* Unused. Silent compiler warning. */ | ||
119 | (void)version; /* Unused. Silent compiler warning. */ | ||
120 | (void)upload_data; /* Unused. Silent compiler warning. */ | ||
121 | (void)upload_data_size; /* Unused. Silent compiler warning. */ | ||
122 | (void)ptr; /* Unused. Silent compiler warning. */ | ||
123 | |||
112 | if (0 != strcmp (method, "GET")) | 124 | if (0 != strcmp (method, "GET")) |
113 | return MHD_NO; /* unexpected method */ | 125 | return MHD_NO; /* unexpected method */ |
114 | return MHD_queue_response (connection, MHD_HTTP_OK, response); | 126 | 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, | |||
99 | struct ResponseContentCallbackParam * callback_param; | 99 | struct ResponseContentCallbackParam * callback_param; |
100 | struct MHD_Response *response; | 100 | struct MHD_Response *response; |
101 | int ret; | 101 | int ret; |
102 | (void)cls; /* Unused. Silent compiler warning. */ | ||
103 | (void)url; /* Unused. Silent compiler warning. */ | ||
104 | (void)version; /* Unused. Silent compiler warning. */ | ||
105 | (void)upload_data; /* Unused. Silent compiler warning. */ | ||
106 | (void)upload_data_size; /* Unused. Silent compiler warning. */ | ||
102 | 107 | ||
103 | if (0 != strcmp (method, "GET")) | 108 | if (0 != strcmp (method, "GET")) |
104 | return MHD_NO; /* unexpected method */ | 109 | 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, | |||
492 | { | 492 | { |
493 | struct UploadContext *uc = cls; | 493 | struct UploadContext *uc = cls; |
494 | int i; | 494 | int i; |
495 | (void)kind; /* Unused. Silent compiler warning. */ | ||
496 | (void)content_type; /* Unused. Silent compiler warning. */ | ||
497 | (void)transfer_encoding; /* Unused. Silent compiler warning. */ | ||
498 | (void)off; /* Unused. Silent compiler warning. */ | ||
495 | 499 | ||
496 | if (0 == strcmp (key, "category")) | 500 | if (0 == strcmp (key, "category")) |
497 | return do_append (&uc->category, data, size); | 501 | return do_append (&uc->category, data, size); |
@@ -612,6 +616,9 @@ response_completed_callback (void *cls, | |||
612 | enum MHD_RequestTerminationCode toe) | 616 | enum MHD_RequestTerminationCode toe) |
613 | { | 617 | { |
614 | struct UploadContext *uc = *con_cls; | 618 | struct UploadContext *uc = *con_cls; |
619 | (void)cls; /* Unused. Silent compiler warning. */ | ||
620 | (void)connection; /* Unused. Silent compiler warning. */ | ||
621 | (void)toe; /* Unused. Silent compiler warning. */ | ||
615 | 622 | ||
616 | if (NULL == uc) | 623 | if (NULL == uc) |
617 | return; /* this request wasn't an upload request */ | 624 | return; /* this request wasn't an upload request */ |
@@ -688,6 +695,8 @@ generate_page (void *cls, | |||
688 | int ret; | 695 | int ret; |
689 | int fd; | 696 | int fd; |
690 | struct stat buf; | 697 | struct stat buf; |
698 | (void)cls; /* Unused. Silent compiler warning. */ | ||
699 | (void)version; /* Unused. Silent compiler warning. */ | ||
691 | 700 | ||
692 | if (0 != strcmp (url, "/")) | 701 | if (0 != strcmp (url, "/")) |
693 | { | 702 | { |
@@ -814,6 +823,7 @@ generate_page (void *cls, | |||
814 | } | 823 | } |
815 | 824 | ||
816 | 825 | ||
826 | #ifndef MINGW | ||
817 | /** | 827 | /** |
818 | * Function called if we get a SIGPIPE. Does nothing. | 828 | * Function called if we get a SIGPIPE. Does nothing. |
819 | * | 829 | * |
@@ -829,7 +839,6 @@ catcher (int sig) | |||
829 | /** | 839 | /** |
830 | * setup handlers to ignore SIGPIPE. | 840 | * setup handlers to ignore SIGPIPE. |
831 | */ | 841 | */ |
832 | #ifndef MINGW | ||
833 | static void | 842 | static void |
834 | ignore_sigpipe () | 843 | ignore_sigpipe () |
835 | { | 844 | { |
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, | |||
493 | { | 493 | { |
494 | struct UploadContext *uc = cls; | 494 | struct UploadContext *uc = cls; |
495 | int i; | 495 | int i; |
496 | (void)kind; /* Unused. Silent compiler warning. */ | ||
497 | (void)content_type; /* Unused. Silent compiler warning. */ | ||
498 | (void)transfer_encoding; /* Unused. Silent compiler warning. */ | ||
499 | (void)off; /* Unused. Silent compiler warning. */ | ||
496 | 500 | ||
497 | if (0 == strcmp (key, "category")) | 501 | if (0 == strcmp (key, "category")) |
498 | return do_append (&uc->category, data, size); | 502 | return do_append (&uc->category, data, size); |
@@ -613,6 +617,9 @@ response_completed_callback (void *cls, | |||
613 | enum MHD_RequestTerminationCode toe) | 617 | enum MHD_RequestTerminationCode toe) |
614 | { | 618 | { |
615 | struct UploadContext *uc = *con_cls; | 619 | struct UploadContext *uc = *con_cls; |
620 | (void)cls; /* Unused. Silent compiler warning. */ | ||
621 | (void)connection; /* Unused. Silent compiler warning. */ | ||
622 | (void)toe; /* Unused. Silent compiler warning. */ | ||
616 | 623 | ||
617 | if (NULL == uc) | 624 | if (NULL == uc) |
618 | return; /* this request wasn't an upload request */ | 625 | return; /* this request wasn't an upload request */ |
@@ -689,6 +696,8 @@ generate_page (void *cls, | |||
689 | int ret; | 696 | int ret; |
690 | int fd; | 697 | int fd; |
691 | struct stat buf; | 698 | struct stat buf; |
699 | (void)cls; /* Unused. Silent compiler warning. */ | ||
700 | (void)version; /* Unused. Silent compiler warning. */ | ||
692 | 701 | ||
693 | if (0 != strcmp (url, "/")) | 702 | if (0 != strcmp (url, "/")) |
694 | { | 703 | { |
@@ -813,6 +822,7 @@ generate_page (void *cls, | |||
813 | } | 822 | } |
814 | 823 | ||
815 | 824 | ||
825 | #ifndef MINGW | ||
816 | /** | 826 | /** |
817 | * Function called if we get a SIGPIPE. Does nothing. | 827 | * Function called if we get a SIGPIPE. Does nothing. |
818 | * | 828 | * |
@@ -828,7 +838,6 @@ catcher (int sig) | |||
828 | /** | 838 | /** |
829 | * setup handlers to ignore SIGPIPE. | 839 | * setup handlers to ignore SIGPIPE. |
830 | */ | 840 | */ |
831 | #ifndef MINGW | ||
832 | static void | 841 | static void |
833 | ignore_sigpipe () | 842 | ignore_sigpipe () |
834 | { | 843 | { |
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, | |||
45 | const char *password = "testpass"; | 45 | const char *password = "testpass"; |
46 | const char *realm = "test@example.com"; | 46 | const char *realm = "test@example.com"; |
47 | int ret; | 47 | int ret; |
48 | (void)cls; /* Unused. Silent compiler warning. */ | ||
49 | (void)url; /* Unused. Silent compiler warning. */ | ||
50 | (void)method; /* Unused. Silent compiler warning. */ | ||
51 | (void)version; /* Unused. Silent compiler warning. */ | ||
52 | (void)upload_data; /* Unused. Silent compiler warning. */ | ||
53 | (void)upload_data_size; /* Unused. Silent compiler warning. */ | ||
54 | (void)ptr; /* Unused. Silent compiler warning. */ | ||
48 | 55 | ||
49 | username = MHD_digest_auth_get_username(connection); | 56 | username = MHD_digest_auth_get_username(connection); |
50 | if (username == NULL) | 57 | 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, | |||
39 | const char *me = cls; | 39 | const char *me = cls; |
40 | struct MHD_Response *response; | 40 | struct MHD_Response *response; |
41 | int ret; | 41 | int ret; |
42 | (void)url; /* Unused. Silent compiler warning. */ | ||
43 | (void)version; /* Unused. Silent compiler warning. */ | ||
44 | (void)upload_data; /* Unused. Silent compiler warning. */ | ||
45 | (void)upload_data_size; /* Unused. Silent compiler warning. */ | ||
42 | 46 | ||
43 | if (0 != strcmp (method, "GET")) | 47 | if (0 != strcmp (method, "GET")) |
44 | return MHD_NO; /* unexpected method */ | 48 | 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, | |||
54 | int ret; | 54 | int ret; |
55 | int fd; | 55 | int fd; |
56 | struct stat buf; | 56 | struct stat buf; |
57 | (void)cls; /* Unused. Silent compiler warning. */ | ||
58 | (void)version; /* Unused. Silent compiler warning. */ | ||
59 | (void)upload_data; /* Unused. Silent compiler warning. */ | ||
60 | (void)upload_data_size; /* Unused. Silent compiler warning. */ | ||
57 | 61 | ||
58 | if ( (0 != strcmp (method, MHD_HTTP_METHOD_GET)) && | 62 | if ( (0 != strcmp (method, MHD_HTTP_METHOD_GET)) && |
59 | (0 != strcmp (method, MHD_HTTP_METHOD_HEAD)) ) | 63 | (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) | |||
66 | 66 | ||
67 | if (max < 512) | 67 | if (max < 512) |
68 | return 0; | 68 | return 0; |
69 | (void)pos; /* 'pos' is ignored as function return next one single entry per call. */ | ||
69 | do | 70 | do |
70 | { | 71 | { |
71 | e = readdir (dir); | 72 | e = readdir (dir); |
@@ -96,6 +97,10 @@ ahc_echo (void *cls, | |||
96 | DIR *dir; | 97 | DIR *dir; |
97 | struct stat buf; | 98 | struct stat buf; |
98 | char emsg[1024]; | 99 | char emsg[1024]; |
100 | (void)cls; /* Unused. Silent compiler warning. */ | ||
101 | (void)version; /* Unused. Silent compiler warning. */ | ||
102 | (void)upload_data; /* Unused. Silent compiler warning. */ | ||
103 | (void)upload_data_size; /* Unused. Silent compiler warning. */ | ||
99 | 104 | ||
100 | if (0 != strcmp (method, MHD_HTTP_METHOD_GET)) | 105 | if (0 != strcmp (method, MHD_HTTP_METHOD_GET)) |
101 | return MHD_NO; /* unexpected method */ | 106 | 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, | |||
62 | FILE *file; | 62 | FILE *file; |
63 | int fd; | 63 | int fd; |
64 | struct stat buf; | 64 | struct stat buf; |
65 | (void)cls; /* Unused. Silent compiler warning. */ | ||
66 | (void)version; /* Unused. Silent compiler warning. */ | ||
67 | (void)upload_data; /* Unused. Silent compiler warning. */ | ||
68 | (void)upload_data_size; /* Unused. Silent compiler warning. */ | ||
65 | 69 | ||
66 | if (0 != strcmp (method, MHD_HTTP_METHOD_GET)) | 70 | if (0 != strcmp (method, MHD_HTTP_METHOD_GET)) |
67 | return MHD_NO; /* unexpected method */ | 71 | 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, | |||
129 | FILE *file; | 129 | FILE *file; |
130 | int fd; | 130 | int fd; |
131 | struct stat buf; | 131 | struct stat buf; |
132 | (void)cls; /* Unused. Silent compiler warning. */ | ||
133 | (void)version; /* Unused. Silent compiler warning. */ | ||
134 | (void)upload_data; /* Unused. Silent compiler warning. */ | ||
135 | (void)upload_data_size; /* Unused. Silent compiler warning. */ | ||
132 | 136 | ||
133 | if (0 != strcmp (method, MHD_HTTP_METHOD_GET)) | 137 | if (0 != strcmp (method, MHD_HTTP_METHOD_GET)) |
134 | return MHD_NO; /* unexpected method */ | 138 | 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, | |||
39 | const char *me = cls; | 39 | const char *me = cls; |
40 | struct MHD_Response *response; | 40 | struct MHD_Response *response; |
41 | int ret; | 41 | int ret; |
42 | (void)url; /* Unused. Silent compiler warning. */ | ||
43 | (void)version; /* Unused. Silent compiler warning. */ | ||
44 | (void)upload_data; /* Unused. Silent compiler warning. */ | ||
45 | (void)upload_data_size; /* Unused. Silent compiler warning. */ | ||
42 | 46 | ||
43 | if (0 != strcmp (method, "GET")) | 47 | if (0 != strcmp (method, "GET")) |
44 | return MHD_NO; /* unexpected method */ | 48 | return MHD_NO; /* unexpected method */ |
@@ -67,11 +71,11 @@ main (int argc, char *const *argv) | |||
67 | printf ("%s PORT\n", argv[0]); | 71 | printf ("%s PORT\n", argv[0]); |
68 | return 1; | 72 | return 1; |
69 | } | 73 | } |
70 | d = MHD_start_daemon (// MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, | 74 | d = MHD_start_daemon (/* MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, */ |
71 | MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, | 75 | MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, |
72 | // MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | MHD_USE_POLL, | 76 | /* MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | MHD_USE_POLL, */ |
73 | // MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | MHD_USE_POLL, | 77 | /* MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | MHD_USE_POLL, */ |
74 | // MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, | 78 | /* MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, */ |
75 | atoi (argv[1]), | 79 | atoi (argv[1]), |
76 | NULL, NULL, &ahc_echo, PAGE, | 80 | NULL, NULL, &ahc_echo, PAGE, |
77 | MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 120, | 81 | 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 @@ | |||
28 | static ssize_t | 28 | static ssize_t |
29 | data_generator (void *cls, uint64_t pos, char *buf, size_t max) | 29 | data_generator (void *cls, uint64_t pos, char *buf, size_t max) |
30 | { | 30 | { |
31 | (void)cls; /* Unused. Silent compiler warning. */ | ||
32 | (void)pos; /* Unused. Silent compiler warning. */ | ||
31 | if (max < 80) | 33 | if (max < 80) |
32 | return 0; | 34 | return 0; |
33 | memset (buf, 'A', max - 1); | 35 | memset (buf, 'A', max - 1); |
@@ -46,6 +48,11 @@ ahc_echo (void *cls, | |||
46 | static int aptr; | 48 | static int aptr; |
47 | struct MHD_Response *response; | 49 | struct MHD_Response *response; |
48 | int ret; | 50 | int ret; |
51 | (void)cls; /* Unused. Silent compiler warning. */ | ||
52 | (void)url; /* Unused. Silent compiler warning. */ | ||
53 | (void)version; /* Unused. Silent compiler warning. */ | ||
54 | (void)upload_data; /* Unused. Silent compiler warning. */ | ||
55 | (void)upload_data_size; /* Unused. Silent compiler warning. */ | ||
49 | 56 | ||
50 | if (0 != strcmp (method, "GET")) | 57 | if (0 != strcmp (method, "GET")) |
51 | return MHD_NO; /* unexpected method */ | 58 | 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, | |||
315 | int ret; | 315 | int ret; |
316 | char *reply; | 316 | char *reply; |
317 | struct MHD_Response *response; | 317 | struct MHD_Response *response; |
318 | (void)cls; /* Unused. Silent compiler warning. */ | ||
318 | 319 | ||
319 | reply = malloc (strlen (MAIN_PAGE) + strlen (session->value_1) + 1); | 320 | reply = malloc (strlen (MAIN_PAGE) + strlen (session->value_1) + 1); |
320 | if (NULL == reply) | 321 | if (NULL == reply) |
@@ -358,6 +359,7 @@ fill_v1_v2_form (const void *cls, | |||
358 | int ret; | 359 | int ret; |
359 | char *reply; | 360 | char *reply; |
360 | struct MHD_Response *response; | 361 | struct MHD_Response *response; |
362 | (void)cls; /* Unused. Silent compiler warning. */ | ||
361 | 363 | ||
362 | reply = malloc (strlen (SECOND_PAGE) + strlen (session->value_1) + strlen (session->value_2) + 1); | 364 | reply = malloc (strlen (SECOND_PAGE) + strlen (session->value_1) + strlen (session->value_2) + 1); |
363 | if (NULL == reply) | 365 | if (NULL == reply) |
@@ -401,6 +403,8 @@ not_found_page (const void *cls, | |||
401 | { | 403 | { |
402 | int ret; | 404 | int ret; |
403 | struct MHD_Response *response; | 405 | struct MHD_Response *response; |
406 | (void)cls; /* Unused. Silent compiler warning. */ | ||
407 | (void)session; /* Unused. Silent compiler warning. */ | ||
404 | 408 | ||
405 | /* unsupported HTTP method */ | 409 | /* unsupported HTTP method */ |
406 | response = MHD_create_response_from_buffer (strlen (NOT_FOUND_ERROR), | 410 | response = MHD_create_response_from_buffer (strlen (NOT_FOUND_ERROR), |
@@ -463,6 +467,10 @@ post_iterator (void *cls, | |||
463 | { | 467 | { |
464 | struct Request *request = cls; | 468 | struct Request *request = cls; |
465 | struct Session *session = request->session; | 469 | struct Session *session = request->session; |
470 | (void)kind; /* Unused. Silent compiler warning. */ | ||
471 | (void)filename; /* Unused. Silent compiler warning. */ | ||
472 | (void)content_type; /* Unused. Silent compiler warning. */ | ||
473 | (void)transfer_encoding; /* Unused. Silent compiler warning. */ | ||
466 | 474 | ||
467 | if (0 == strcmp ("DONE", key)) | 475 | if (0 == strcmp ("DONE", key)) |
468 | { | 476 | { |
@@ -548,6 +556,8 @@ create_response (void *cls, | |||
548 | struct Session *session; | 556 | struct Session *session; |
549 | int ret; | 557 | int ret; |
550 | unsigned int i; | 558 | unsigned int i; |
559 | (void)cls; /* Unused. Silent compiler warning. */ | ||
560 | (void)version; /* Unused. Silent compiler warning. */ | ||
551 | 561 | ||
552 | request = *ptr; | 562 | request = *ptr; |
553 | if (NULL == request) | 563 | if (NULL == request) |
@@ -647,6 +657,9 @@ request_completed_callback (void *cls, | |||
647 | enum MHD_RequestTerminationCode toe) | 657 | enum MHD_RequestTerminationCode toe) |
648 | { | 658 | { |
649 | struct Request *request = *con_cls; | 659 | struct Request *request = *con_cls; |
660 | (void)cls; /* Unused. Silent compiler warning. */ | ||
661 | (void)connection; /* Unused. Silent compiler warning. */ | ||
662 | (void)toe; /* Unused. Silent compiler warning. */ | ||
650 | 663 | ||
651 | if (NULL == request) | 664 | if (NULL == request) |
652 | return; | 665 | 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, | |||
42 | char *me; | 42 | char *me; |
43 | struct MHD_Response *response; | 43 | struct MHD_Response *response; |
44 | int ret; | 44 | int ret; |
45 | (void)url; /* Unused. Silent compiler warning. */ | ||
46 | (void)version; /* Unused. Silent compiler warning. */ | ||
47 | (void)upload_data; /* Unused. Silent compiler warning. */ | ||
48 | (void)upload_data_size; /* Unused. Silent compiler warning. */ | ||
45 | 49 | ||
46 | if (0 != strcmp (method, "GET")) | 50 | if (0 != strcmp (method, "GET")) |
47 | return MHD_NO; /* unexpected method */ | 51 | 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, | |||
45 | const char *me = cls; | 45 | const char *me = cls; |
46 | struct MHD_Response *response; | 46 | struct MHD_Response *response; |
47 | int ret; | 47 | int ret; |
48 | (void)cls; /* Unused. Silent compiler warning. */ | ||
49 | (void)url; /* Unused. Silent compiler warning. */ | ||
50 | (void)version; /* Unused. Silent compiler warning. */ | ||
51 | (void)upload_data; /* Unused. Silent compiler warning. */ | ||
52 | (void)upload_data_size; /* Unused. Silent compiler warning. */ | ||
48 | 53 | ||
49 | if ((0 != strcmp (method, "GET")) && (0 != strcmp (method, "POST"))) | 54 | if ((0 != strcmp (method, "GET")) && (0 != strcmp (method, "POST"))) |
50 | return MHD_NO; /* unexpected method */ | 55 | 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, | |||
42 | const char *page = "<html><body>Hello timeout!</body></html>"; | 42 | const char *page = "<html><body>Hello timeout!</body></html>"; |
43 | struct MHD_Response *response; | 43 | struct MHD_Response *response; |
44 | int ret; | 44 | int ret; |
45 | (void)cls; /* Unused. Silent compiler warning. */ | ||
46 | (void)url; /* Unused. Silent compiler warning. */ | ||
47 | (void)version; /* Unused. Silent compiler warning. */ | ||
48 | (void)method; /* Unused. Silent compiler warning. */ | ||
49 | (void)upload_data; /* Unused. Silent compiler warning. */ | ||
50 | (void)upload_data_size; /* Unused. Silent compiler warning. */ | ||
51 | (void)con_cls; /* Unused. Silent compiler warning. */ | ||
45 | 52 | ||
46 | response = MHD_create_response_from_buffer (strlen(page), | 53 | response = MHD_create_response_from_buffer (strlen(page), |
47 | (void *) page, | 54 | (void *) page, |
@@ -58,8 +65,7 @@ answer_to_connection(void *cls, | |||
58 | 65 | ||
59 | 66 | ||
60 | int | 67 | int |
61 | main (int argc, | 68 | main (void) |
62 | char **argv) | ||
63 | { | 69 | { |
64 | struct MHD_Daemon *daemon; | 70 | struct MHD_Daemon *daemon; |
65 | 71 | ||
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, | |||
202 | { | 202 | { |
203 | struct MyData *md; | 203 | struct MyData *md; |
204 | pthread_t pt; | 204 | pthread_t pt; |
205 | (void)cls; /* Unused. Silent compiler warning. */ | ||
206 | (void)connection; /* Unused. Silent compiler warning. */ | ||
207 | (void)con_cls; /* Unused. Silent compiler warning. */ | ||
205 | 208 | ||
206 | md = malloc (sizeof (struct MyData)); | 209 | md = malloc (sizeof (struct MyData)); |
207 | if (NULL == md) | 210 | if (NULL == md) |
@@ -249,6 +252,11 @@ ahc_echo (void *cls, | |||
249 | static int aptr; | 252 | static int aptr; |
250 | struct MHD_Response *response; | 253 | struct MHD_Response *response; |
251 | int ret; | 254 | int ret; |
255 | (void)cls; /* Unused. Silent compiler warning. */ | ||
256 | (void)url; /* Unused. Silent compiler warning. */ | ||
257 | (void)version; /* Unused. Silent compiler warning. */ | ||
258 | (void)upload_data; /* Unused. Silent compiler warning. */ | ||
259 | (void)upload_data_size; /* Unused. Silent compiler warning. */ | ||
252 | 260 | ||
253 | if (0 != strcmp (method, "GET")) | 261 | if (0 != strcmp (method, "GET")) |
254 | return MHD_NO; /* unexpected method */ | 262 | return MHD_NO; /* unexpected method */ |