libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit a754b1b3cffd1bbeb8629d060f6466f358cad8c1
parent 22e0954068ff70395f77c00e36635efcd35e2e31
Author: Andrey Uzunov <andrey.uzunov@gmail.com>
Date:   Sat, 20 Jul 2013 18:35:59 +0000

mhd2spdy: -Wextra warnings fixed

Diffstat:
Msrc/examples/mhd2spdy_http.c | 11+++++++++++
Msrc/examples/mhd2spdy_http.h | 1+
Msrc/examples/mhd2spdy_spdy.c | 31++++++++++++++++++++++++++++---
Msrc/examples/mhd2spdy_spdy.h | 4++--
4 files changed, 42 insertions(+), 5 deletions(-)

diff --git a/src/examples/mhd2spdy_http.c b/src/examples/mhd2spdy_http.c @@ -27,6 +27,8 @@ void * http_log_cb(void * cls, const char * uri) { + (void)cls; + struct HTTP_URI * http_uri; PRINT_INFO2("log uri '%s'\n", uri); @@ -55,6 +57,8 @@ http_iterate_cb(void *cls, enum MHD_ValueKind kind, const char *name, const char *value) { + (void)kind; + static char * const forbidden[] = {"Transfer-Encoding", "Proxy-Connection", "Keep-Alive", @@ -84,6 +88,8 @@ http_response_callback (void *cls, char *buffer, size_t max) { + (void)pos; + int ret; struct Proxy *proxy = (struct Proxy *)cls; void *newbody; @@ -207,6 +213,11 @@ http_cb_request (void *cls, size_t *upload_data_size, void **ptr) { + (void)cls; + (void)url; + (void)upload_data; + (void)upload_data_size; + //struct MHD_Response *response; int ret; struct Proxy *proxy; diff --git a/src/examples/mhd2spdy_http.h b/src/examples/mhd2spdy_http.h @@ -25,6 +25,7 @@ #include "mhd2spdy_structures.h" + int http_cb_request (void *cls, struct MHD_Connection *connection, diff --git a/src/examples/mhd2spdy_spdy.c b/src/examples/mhd2spdy_spdy.c @@ -70,9 +70,14 @@ void spdy_diec(const char *func, int error_code) * spdylay_send_callback for the details. */ static ssize_t spdy_cb_send(spdylay_session *session, - const uint8_t *data, size_t length, int flags, + const uint8_t *data, + size_t length, + int flags, void *user_data) { + (void)session; + (void)flags; + //PRINT_INFO("spdy_cb_send called"); struct SPDY_Connection *connection; ssize_t rv; @@ -129,6 +134,9 @@ static ssize_t spdy_cb_recv(spdylay_session *session, uint8_t *buf, size_t length, int flags, void *user_data) { + (void)session; + (void)flags; + struct SPDY_Connection *connection; ssize_t rv; @@ -199,6 +207,8 @@ static void spdy_cb_on_ctrl_send(spdylay_session *session, spdylay_frame_type type, spdylay_frame *frame, void *user_data) { + (void)user_data; + //char **nv; //const char *name = NULL; int32_t stream_id; @@ -224,6 +234,8 @@ void spdy_cb_on_ctrl_recv(spdylay_session *session, spdylay_frame_type type, spdylay_frame *frame, void *user_data) { + (void)user_data; + //struct SPDY_Request *req; char **nv; //const char *name = NULL; @@ -284,6 +296,9 @@ static void spdy_cb_on_stream_close(spdylay_session *session, spdylay_status_code status_code, void *user_data) { + (void)status_code; + (void)user_data; + struct Proxy * proxy = spdylay_session_get_stream_user_data(session, stream_id); assert(NULL != proxy); @@ -312,6 +327,9 @@ static void spdy_cb_on_data_chunk_recv(spdylay_session *session, uint8_t flags, const uint8_t *data, size_t len, void *user_data) { + (void)flags; + (void)user_data; + //struct SPDY_Request *req; struct Proxy *proxy; proxy = spdylay_session_get_stream_user_data(session, stream_id); @@ -335,6 +353,9 @@ static void spdy_cb_on_data_chunk_recv(spdylay_session *session, uint8_t flags, static void spdy_cb_on_data_recv(spdylay_session *session, uint8_t flags, int32_t stream_id, int32_t length, void *user_data) { + (void)length; + (void)user_data; + if(flags & SPDYLAY_DATA_FLAG_FIN) { struct Proxy *proxy; @@ -373,6 +394,8 @@ static int spdy_cb_ssl_select_next_proto(SSL* ssl, const unsigned char *in, unsigned int inlen, void *arg) { + (void)ssl; + //PRINT_INFO("spdy_cb_ssl_select_next_proto"); int rv; uint16_t *spdy_proto_version; @@ -505,6 +528,8 @@ bool spdy_ctl_select(fd_set * read_fd_set, fd_set * except_fd_set, struct SPDY_Connection *connection) { + (void)except_fd_set; + bool ret = false; if(spdylay_session_want_read(connection->session) || @@ -687,7 +712,7 @@ spdy_request(const char **nv, struct Proxy *proxy) void -spdy_get_pollfdset(struct pollfd fds[], struct SPDY_Connection *connections[], int max_size, nfds_t *real_size) +spdy_get_pollfdset(struct pollfd fds[], struct SPDY_Connection *connections[], unsigned int max_size, nfds_t *real_size) { struct SPDY_Connection *connection; struct Proxy *proxy; @@ -756,7 +781,7 @@ int spdy_get_selectfdset(fd_set * read_fd_set, fd_set * write_fd_set, fd_set * except_fd_set, - struct SPDY_Connection *connections[], int max_size, nfds_t *real_size) + struct SPDY_Connection *connections[], unsigned int max_size, nfds_t *real_size) { struct SPDY_Connection *connection; struct Proxy *proxy; diff --git a/src/examples/mhd2spdy_spdy.h b/src/examples/mhd2spdy_spdy.h @@ -47,14 +47,14 @@ void spdy_free_connection(struct SPDY_Connection * connection); void -spdy_get_pollfdset(struct pollfd fds[], struct SPDY_Connection *connections[], int max_size, nfds_t *real_size); +spdy_get_pollfdset(struct pollfd fds[], struct SPDY_Connection *connections[], unsigned int max_size, nfds_t *real_size); int spdy_get_selectfdset(fd_set * read_fd_set, fd_set * write_fd_set, fd_set * except_fd_set, - struct SPDY_Connection *connections[], int max_size, nfds_t *real_size); + struct SPDY_Connection *connections[], unsigned int max_size, nfds_t *real_size); void spdy_run(struct pollfd fds[], struct SPDY_Connection *connections[], int size);