Return-Path: X-Original-To: apmail-httpd-cvs-archive@www.apache.org Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F168C108C5 for ; Sat, 27 Apr 2013 03:24:17 +0000 (UTC) Received: (qmail 31424 invoked by uid 500); 27 Apr 2013 03:24:17 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 31334 invoked by uid 500); 27 Apr 2013 03:24:17 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 31307 invoked by uid 99); 27 Apr 2013 03:24:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 27 Apr 2013 03:24:17 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 27 Apr 2013 03:24:15 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id D06AD2388847; Sat, 27 Apr 2013 03:23:55 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1476482 - /httpd/httpd/trunk/modules/lua/lua_request.c Date: Sat, 27 Apr 2013 03:23:55 -0000 To: cvs@httpd.apache.org From: fuankg@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130427032355.D06AD2388847@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: fuankg Date: Sat Apr 27 03:23:55 2013 New Revision: 1476482 URL: http://svn.apache.org/r1476482 Log: Reduce compiler warnings. Fixed some types, added casts, or changed to proper function. Modified: httpd/httpd/trunk/modules/lua/lua_request.c Modified: httpd/httpd/trunk/modules/lua/lua_request.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/lua/lua_request.c?rev=1476482&r1=1476481&r2=1476482&view=diff ============================================================================== --- httpd/httpd/trunk/modules/lua/lua_request.c (original) +++ httpd/httpd/trunk/modules/lua/lua_request.c Sat Apr 27 03:23:55 2013 @@ -692,7 +692,7 @@ static int lua_ap_sendfile(lua_State *L) rc = apr_file_open(&file, filename, APR_READ, APR_OS_DEFAULT, r->pool); if (rc == APR_SUCCESS) { - ap_send_fd(file, r, 0, file_info.size, &sent); + ap_send_fd(file, r, 0, (apr_size_t)file_info.size, &sent); apr_file_close(file); lua_pushinteger(L, sent); } @@ -841,9 +841,9 @@ static int lua_ap_mpm_query(lua_State *L int x, y; - x = lua_tonumber(L, 1); + x = lua_tointeger(L, 1); ap_mpm_query(x, &y); - lua_pushnumber(L, y); + lua_pushinteger(L, y); return 1; } @@ -965,7 +965,7 @@ static int lua_ap_scoreboard_process(lua luaL_checktype(L, 1, LUA_TUSERDATA); luaL_checktype(L, 2, LUA_TNUMBER); - i = lua_tonumber(L, 2); + i = lua_tointeger(L, 2); ps_record = ap_get_scoreboard_process(i); if (ps_record) { lua_newtable(L); @@ -1020,8 +1020,8 @@ static int lua_ap_scoreboard_worker(lua_ luaL_checktype(L, 1, LUA_TUSERDATA); luaL_checktype(L, 2, LUA_TNUMBER); luaL_checktype(L, 3, LUA_TNUMBER); - i = lua_tonumber(L, 2); - j = lua_tonumber(L, 3); + i = lua_tointeger(L, 2); + j = lua_tointeger(L, 3); ws_record = ap_get_scoreboard_worker_from_indexes(i, j); if (ws_record) { lua_newtable(L); @@ -1031,7 +1031,7 @@ static int lua_ap_scoreboard_worker(lua_ lua_settable(L, -3); lua_pushstring(L, "bytes_served"); - lua_pushnumber(L, ws_record->bytes_served); + lua_pushnumber(L, (lua_Number) ws_record->bytes_served); lua_settable(L, -3); lua_pushstring(L, "client"); @@ -1039,7 +1039,7 @@ static int lua_ap_scoreboard_worker(lua_ lua_settable(L, -3); lua_pushstring(L, "conn_bytes"); - lua_pushnumber(L, ws_record->conn_bytes); + lua_pushnumber(L, (lua_Number) ws_record->conn_bytes); lua_settable(L, -3); lua_pushstring(L, "conn_count"); @@ -1051,7 +1051,7 @@ static int lua_ap_scoreboard_worker(lua_ lua_settable(L, -3); lua_pushstring(L, "last_used"); - lua_pushnumber(L, ws_record->last_used); + lua_pushnumber(L, (lua_Number) ws_record->last_used); lua_settable(L, -3); lua_pushstring(L, "pid"); @@ -1063,7 +1063,7 @@ static int lua_ap_scoreboard_worker(lua_ lua_settable(L, -3); lua_pushstring(L, "start_time"); - lua_pushnumber(L, ws_record->start_time); + lua_pushnumber(L, (lua_Number) ws_record->start_time); lua_settable(L, -3); lua_pushstring(L, "status"); @@ -1071,7 +1071,7 @@ static int lua_ap_scoreboard_worker(lua_ lua_settable(L, -3); lua_pushstring(L, "stop_time"); - lua_pushnumber(L, ws_record->stop_time); + lua_pushnumber(L, (lua_Number) ws_record->stop_time); lua_settable(L, -3); lua_pushstring(L, "tid"); @@ -1103,7 +1103,7 @@ static int lua_ap_clock(lua_State *L) { apr_time_t now; now = apr_time_now(); - lua_pushnumber(L, now); + lua_pushnumber(L, (lua_Number) now); return 1; } @@ -1210,19 +1210,19 @@ static int lua_ap_stat(lua_State *L) lua_newtable(L); lua_pushstring(L, "mtime"); - lua_pushnumber(L, file_info.mtime); + lua_pushnumber(L, (lua_Number) file_info.mtime); lua_settable(L, -3); lua_pushstring(L, "atime"); - lua_pushnumber(L, file_info.atime); + lua_pushnumber(L, (lua_Number) file_info.atime); lua_settable(L, -3); lua_pushstring(L, "ctime"); - lua_pushnumber(L, file_info.ctime); + lua_pushnumber(L, (lua_Number) file_info.ctime); lua_settable(L, -3); lua_pushstring(L, "size"); - lua_pushnumber(L, file_info.size); + lua_pushnumber(L, (lua_Number) file_info.size); lua_settable(L, -3); lua_pushstring(L, "filetype"); @@ -1528,9 +1528,9 @@ static int lua_ap_state_query(lua_State static int lua_ap_sleep(lua_State *L) { - int msec; + apr_interval_time_t msec; luaL_checktype(L, 1, LUA_TNUMBER); - msec = (lua_tonumber(L, 1) * 1000000); + msec = (lua_tointeger(L, 1) * 1000000); apr_sleep(msec); return 0; } @@ -1665,7 +1665,7 @@ static int lua_ivm_get(lua_State *L) apr_thread_mutex_lock(lua_ivm_mutex); apr_pool_userdata_get((void **)&object, raw_key, r->server->process->pool); if (object) { - if (object->type == LUA_TBOOLEAN) lua_pushboolean(L, object->number); + if (object->type == LUA_TBOOLEAN) lua_pushboolean(L, (int) object->number); else if (object->type == LUA_TNUMBER) lua_pushnumber(L, object->number); else if (object->type == LUA_TSTRING) lua_pushlstring(L, object->vb.buf, object->size); apr_thread_mutex_unlock(lua_ivm_mutex);