httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fua...@apache.org
Subject svn commit: r1082026 - /httpd/httpd/trunk/modules/lua/lua_vmprep.c
Date Wed, 16 Mar 2011 01:34:45 GMT
Author: fuankg
Date: Wed Mar 16 01:34:45 2011
New Revision: 1082026

URL: http://svn.apache.org/viewvc?rev=1082026&view=rev
Log:
Fixed mod_lua.

Added some casts to make picky compilers happy;
changed vm_release() proto and call.

Modified:
    httpd/httpd/trunk/modules/lua/lua_vmprep.c

Modified: httpd/httpd/trunk/modules/lua/lua_vmprep.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/lua/lua_vmprep.c?rev=1082026&r1=1082025&r2=1082026&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/lua/lua_vmprep.c (original)
+++ httpd/httpd/trunk/modules/lua/lua_vmprep.c Wed Mar 16 01:34:45 2011
@@ -368,7 +368,7 @@ static apr_status_t vm_destruct(void *vm
     return APR_SUCCESS;
 }
 
-static apr_status_t vm_release(lua_State* vm)
+static apr_status_t vm_release(void *vm)
 {
     apr_reslist_t* reslist;
     lua_pushlightuserdata(vm,vm);
@@ -391,7 +391,8 @@ AP_LUA_DECLARE(lua_State*)ap_lua_get_lua
     if (spec->scope == APL_SCOPE_SERVER) {
         apr_reslist_t *reslist;
 
-        if (apr_pool_userdata_get(&reslist,"mod_lua",spec->pool)==APR_SUCCESS) {
+        if (apr_pool_userdata_get((void **)&reslist,
+                                  "mod_lua", spec->pool) == APR_SUCCESS) {
             if(reslist==NULL) {
                 if(apr_reslist_create(&reslist, 
                     spec->vm_server_pool_min, 
@@ -404,23 +405,25 @@ AP_LUA_DECLARE(lua_State*)ap_lua_get_lua
                     spec->pool)!=APR_SUCCESS)
                     return NULL;
 
-                apr_pool_userdata_set(reslist, "mod_lua", vm_reslist_destroy, spec->pool);
+                apr_pool_userdata_set(reslist, "mod_lua",
+                                      vm_reslist_destroy, spec->pool);
             }
-            apr_reslist_acquire(reslist, &L);
+            apr_reslist_acquire(reslist, (void **)&L);
             lua_pushlightuserdata(L, L);
             lua_pushlightuserdata(L, reslist);
             lua_rawset(L,LUA_REGISTRYINDEX);
-            apr_pool_userdata_set(L, spec->file, vm_release, lifecycle_pool);
+            apr_pool_userdata_set(L, spec->file, &vm_release, lifecycle_pool);
         }
     } else {
-        if (apr_pool_userdata_get((void **) &L, spec->file, lifecycle_pool)==APR_SUCCESS)
{
+        if (apr_pool_userdata_get((void **)&L, spec->file,
+                                  lifecycle_pool) == APR_SUCCESS) {
 
             if(L==NULL) {
                 ap_log_perror(APLOG_MARK, APLOG_DEBUG, 0, lifecycle_pool,
                     "creating lua_State with file %s", spec->file);
                 /* not available, so create */
 
-                if(!vm_construct(&L, spec, lifecycle_pool))
+                if(!vm_construct((void **)&L, spec, lifecycle_pool))
                     apr_pool_userdata_set(L, spec->file, &cleanup_lua, lifecycle_pool);
             }
         }



Mime
View raw message