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 /src/examples | |
parent | 527700a01e67e35781a4ba789a43e4d982dd5b25 (diff) | |
download | libmicrohttpd-a5b63e992bb1d45982269cd4be4d8990414acc17.tar.gz libmicrohttpd-a5b63e992bb1d45982269cd4be4d8990414acc17.zip |
Muted compiler warnings in examples.
Diffstat (limited to 'src/examples')
-rw-r--r-- | src/examples/authorization_example.c | 4 | ||||
-rw-r--r-- | src/examples/benchmark.c | 12 | ||||
-rw-r--r-- | src/examples/benchmark_https.c | 12 | ||||
-rw-r--r-- | src/examples/chunked_example.c | 5 | ||||
-rw-r--r-- | src/examples/demo.c | 11 | ||||
-rw-r--r-- | src/examples/demo_https.c | 11 | ||||
-rw-r--r-- | src/examples/digest_auth_example.c | 7 | ||||
-rw-r--r-- | src/examples/dual_stack_example.c | 4 | ||||
-rw-r--r-- | src/examples/fileserver_example.c | 4 | ||||
-rw-r--r-- | src/examples/fileserver_example_dirs.c | 5 | ||||
-rw-r--r-- | src/examples/fileserver_example_external_select.c | 4 | ||||
-rw-r--r-- | src/examples/https_fileserver_example.c | 4 | ||||
-rw-r--r-- | src/examples/minimal_example.c | 12 | ||||
-rw-r--r-- | src/examples/minimal_example_comet.c | 7 | ||||
-rw-r--r-- | src/examples/post_example.c | 13 | ||||
-rw-r--r-- | src/examples/querystring_example.c | 4 | ||||
-rw-r--r-- | src/examples/refuse_post_example.c | 5 | ||||
-rw-r--r-- | src/examples/timeout.c | 10 | ||||
-rw-r--r-- | src/examples/upgrade_example.c | 8 |
19 files changed, 134 insertions, 8 deletions
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 */ |