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 /doc | |
parent | 527700a01e67e35781a4ba789a43e4d982dd5b25 (diff) | |
download | libmicrohttpd-a5b63e992bb1d45982269cd4be4d8990414acc17.tar.gz libmicrohttpd-a5b63e992bb1d45982269cd4be4d8990414acc17.zip |
Muted compiler warnings in examples.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/examples/basicauthentication.c | 7 | ||||
-rw-r--r-- | doc/examples/hellobrowser.c | 11 | ||||
-rw-r--r-- | doc/examples/largepost.c | 11 | ||||
-rw-r--r-- | doc/examples/logging.c | 7 | ||||
-rw-r--r-- | doc/examples/responseheaders.c | 6 | ||||
-rw-r--r-- | doc/examples/sessions.c | 11 | ||||
-rw-r--r-- | doc/examples/simplepost.c | 12 | ||||
-rw-r--r-- | doc/examples/tlsauthentication.c | 10 |
8 files changed, 70 insertions, 5 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) |