]> granicus.if.org Git - apache/commitdiff
Fixed mod_lua.
authorGuenter Knauf <fuankg@apache.org>
Wed, 16 Mar 2011 01:34:45 +0000 (01:34 +0000)
committerGuenter Knauf <fuankg@apache.org>
Wed, 16 Mar 2011 01:34:45 +0000 (01:34 +0000)
Added some casts to make picky compilers happy;
changed vm_release() proto and call.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1082026 13f79535-47bb-0310-9956-ffa450edef68

modules/lua/lua_vmprep.c

index 7373e0f91f9995a88684022dc3fad71bad210e8f..44b9cd7a0f04846c7f1b2c27a0d630e82a9fe585 100644 (file)
@@ -368,7 +368,7 @@ static apr_status_t vm_destruct(void *vm, void *params, apr_pool_t *pool)
     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_state(apr_pool_t *lifecycle_pool,
     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_state(apr_pool_t *lifecycle_pool,
                     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);
             }
         }