From ef694d32a688840f26dedb34808222f696fd21bf Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sat, 14 Sep 2013 14:44:23 +0000 Subject: [PATCH] modules: Fix some compiler warnings. trunk patch: http://svn.apache.org/r1500345 http://svn.apache.org/r1500362 http://svn.apache.org/r1500423 http://svn.apache.org/r1500483 http://svn.apache.org/r1500519 Submitted by: fuankg Reviewed by: jim, minfrin git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1523259 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ STATUS | 15 --------------- include/util_ldap.h | 4 ++++ modules/cache/mod_socache_memcache.c | 2 +- modules/filters/mod_charset_lite.c | 2 +- modules/filters/mod_data.c | 3 ++- modules/generators/mod_info.c | 2 +- modules/lua/lua_request.c | 2 +- modules/proxy/mod_proxy_connect.c | 2 +- modules/proxy/mod_proxy_fcgi.c | 11 ++++++----- 10 files changed, 19 insertions(+), 26 deletions(-) diff --git a/CHANGES b/CHANGES index 31d11b29f3..4695a6710b 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,8 @@ Changes with Apache 2.4.7 + *) modules: Fix some compiler warnings. [Guenter Knauf] + * skiplist: Add skiplist capability to httpd [Jim Jagielski] * Sync 2.4 and trunk diff --git a/STATUS b/STATUS index df2a59d830..92557cfdbf 100644 --- a/STATUS +++ b/STATUS @@ -164,21 +164,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK: 2.4.x patch: trunk patch works +1: trawick, covener, humbedooh - * modules: Fix some compiler warnings. - trunk patch: http://svn.apache.org/r1500345 - http://svn.apache.org/r1500362 - http://svn.apache.org/r1500423 - http://svn.apache.org/r1500483 - http://svn.apache.org/r1500519 - 2.4.x patch: trunk patches work - +1: fuankg, jim, minfrin - comments: - jim: In general, casts are sometimes used to "hide" problems - that exist, esp when using the incorrect data types... - Are these casts safe? - fuankg: replied to list with further details about patches. - humbedooh: in r1500362, the lua changes can just be backported now :) - PATCHES PROPOSED TO BACKPORT FROM TRUNK: [ New proposals should be added at the end of the list ] diff --git a/include/util_ldap.h b/include/util_ldap.h index c31539817e..2db507f5b6 100644 --- a/include/util_ldap.h +++ b/include/util_ldap.h @@ -83,6 +83,10 @@ #define LDAP_DECLARE_DATA __declspec(dllimport) #endif +#ifdef WIN32 +#define timeval l_timeval +#endif + #ifdef __cplusplus extern "C" { #endif diff --git a/modules/cache/mod_socache_memcache.c b/modules/cache/mod_socache_memcache.c index beeeec2c98..8cabd8a50b 100644 --- a/modules/cache/mod_socache_memcache.c +++ b/modules/cache/mod_socache_memcache.c @@ -85,7 +85,7 @@ static apr_status_t socache_mc_init(ap_socache_instance_t *ctx, { apr_status_t rv; int thread_limit = 0; - int nservers = 0; + apr_uint16_t nservers = 0; char *cache_config; char *split; char *tok; diff --git a/modules/filters/mod_charset_lite.c b/modules/filters/mod_charset_lite.c index 2d3d143996..934f04774d 100644 --- a/modules/filters/mod_charset_lite.c +++ b/modules/filters/mod_charset_lite.c @@ -474,7 +474,7 @@ static void log_xlate_error(ap_filter_t *f, apr_status_t rv) charset_filter_ctx_t *ctx = f->ctx; const char *msg; char msgbuf[100]; - int len; + apr_size_t len; switch(ctx->ees) { case EES_LIMIT: diff --git a/modules/filters/mod_data.c b/modules/filters/mod_data.c index 83284dd2d8..d083d32204 100644 --- a/modules/filters/mod_data.c +++ b/modules/filters/mod_data.c @@ -109,7 +109,8 @@ static apr_status_t data_out_filter(ap_filter_t *f, apr_bucket_brigade *bb) apr_brigade_length(ctx->bb, 1, &len); clen = apr_atoi64(content_length); if (clen >= 0 && clen < APR_INT32_MAX) { - ap_set_content_length(r, len + apr_base64_encode_len(clen) - 1); + ap_set_content_length(r, len + + apr_base64_encode_len((int)clen) - 1); } else { apr_table_unset(r->headers_out, "Content-Length"); diff --git a/modules/generators/mod_info.c b/modules/generators/mod_info.c index 2f2db9fa61..e5e63de137 100644 --- a/modules/generators/mod_info.c +++ b/modules/generators/mod_info.c @@ -113,7 +113,7 @@ static void put_int_flush_right(request_rec * r, int i, int field) if (r) ap_rputc('0' + i % 10, r); else - apr_file_putc('0' + i % 10, out); + apr_file_putc((char)('0' + i % 10), out); } else { if (r) diff --git a/modules/lua/lua_request.c b/modules/lua/lua_request.c index c2cfb53548..eb6aef1d16 100644 --- a/modules/lua/lua_request.c +++ b/modules/lua/lua_request.c @@ -884,7 +884,7 @@ static int lua_apr_touch(lua_State *L) r = ap_lua_check_request_rec(L, 1); luaL_checktype(L, 2, LUA_TSTRING); path = lua_tostring(L, 2); - mtime = luaL_optnumber(L, 3, apr_time_now()); + mtime = (apr_time_t)luaL_optnumber(L, 3, (lua_Number)apr_time_now()); status = apr_file_mtime_set(path, mtime, r->pool); lua_pushboolean(L, (status == 0)); return 1; diff --git a/modules/proxy/mod_proxy_connect.c b/modules/proxy/mod_proxy_connect.c index b38edc91f4..9a1bfefb7f 100644 --- a/modules/proxy/mod_proxy_connect.c +++ b/modules/proxy/mod_proxy_connect.c @@ -220,7 +220,7 @@ static int proxy_connect_handler(request_rec *r, proxy_worker *worker, apr_uri_t uri; const char *connectname; - int connectport = 0; + apr_port_t connectport = 0; /* is this for us? */ if (r->method_number != M_CONNECT) { diff --git a/modules/proxy/mod_proxy_fcgi.c b/modules/proxy/mod_proxy_fcgi.c index 0f844163dc..875153fe35 100644 --- a/modules/proxy/mod_proxy_fcgi.c +++ b/modules/proxy/mod_proxy_fcgi.c @@ -234,7 +234,8 @@ static apr_status_t get_data(proxy_conn_rec *conn, return rv; } -static apr_status_t send_begin_request(proxy_conn_rec *conn, int request_id) +static apr_status_t send_begin_request(proxy_conn_rec *conn, + apr_uint16_t request_id) { struct iovec vec[2]; fcgi_header header; @@ -266,7 +267,7 @@ static apr_status_t send_begin_request(proxy_conn_rec *conn, int request_id) } static apr_status_t send_environment(proxy_conn_rec *conn, request_rec *r, - int request_id) + apr_uint16_t request_id) { const apr_array_header_t *envarr; const apr_table_entry_t *elts; @@ -390,7 +391,7 @@ static apr_status_t send_environment(proxy_conn_rec *conn, request_rec *r, itr += vallen; } - fill_in_header(&header, FCGI_PARAMS, request_id, bodylen, 0); + fill_in_header(&header, FCGI_PARAMS, request_id, (apr_uint16_t)bodylen, 0); fcgi_header_to_array(&header, farray); vec[0].iov_base = (void *)farray; @@ -543,7 +544,7 @@ static void dump_header_to_log(request_rec *r, unsigned char fheader[], } static apr_status_t dispatch(proxy_conn_rec *conn, proxy_dir_conf *conf, - request_rec *r, int request_id) + request_rec *r, apr_uint16_t request_id) { apr_bucket_brigade *ib, *ob; int seen_end_of_headers = 0, done = 0; @@ -884,7 +885,7 @@ static int fcgi_do_request(apr_pool_t *p, request_rec *r, * multiple requests to the same FastCGI connection, but * we don't support that, and always use a value of '1' to * keep things simple. */ - int request_id = 1; + apr_uint16_t request_id = 1; apr_status_t rv; /* Step 1: Send FCGI_BEGIN_REQUEST */ -- 2.50.1