aboutsummaryrefslogtreecommitdiff
path: root/src/deep.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/deep.cpp')
-rw-r--r--src/deep.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/deep.cpp b/src/deep.cpp
index ee08cdd..c9e3655 100644
--- a/src/deep.cpp
+++ b/src/deep.cpp
@@ -108,7 +108,7 @@ static void get_deep_lookup( lua_State* L)
108* Return the registered ID function for 'index' (deep userdata proxy), 108* Return the registered ID function for 'index' (deep userdata proxy),
109* or nullptr if 'index' is not a deep userdata proxy. 109* or nullptr if 'index' is not a deep userdata proxy.
110*/ 110*/
111static inline luaG_IdFunction get_idfunc( lua_State* L, int index, LookupMode mode_) 111static inline luaG_IdFunction* get_idfunc( lua_State* L, int index, LookupMode mode_)
112{ 112{
113 // when looking inside a keeper, we are 100% sure the object is a deep userdata 113 // when looking inside a keeper, we are 100% sure the object is a deep userdata
114 if( mode_ == eLM_FromKeeper) 114 if( mode_ == eLM_FromKeeper)
@@ -122,7 +122,7 @@ static inline luaG_IdFunction get_idfunc( lua_State* L, int index, LookupMode mo
122 // essentially we are making sure that the metatable of the object we want to copy is stored in our metatable/idfunc database 122 // essentially we are making sure that the metatable of the object we want to copy is stored in our metatable/idfunc database
123 // it is the only way to ensure that the userdata is indeed a deep userdata! 123 // it is the only way to ensure that the userdata is indeed a deep userdata!
124 // of course, we could just trust the caller, but we won't 124 // of course, we could just trust the caller, but we won't
125 luaG_IdFunction ret; 125 luaG_IdFunction* ret;
126 STACK_GROW( L, 1); 126 STACK_GROW( L, 1);
127 STACK_CHECK( L, 0); 127 STACK_CHECK( L, 0);
128 128
@@ -134,7 +134,7 @@ static inline luaG_IdFunction get_idfunc( lua_State* L, int index, LookupMode mo
134 // replace metatable with the idfunc pointer, if it is actually a deep userdata 134 // replace metatable with the idfunc pointer, if it is actually a deep userdata
135 get_deep_lookup( L); // deep ... idfunc|nil 135 get_deep_lookup( L); // deep ... idfunc|nil
136 136
137 ret = (luaG_IdFunction) lua_touserdata( L, -1); // nullptr if not a userdata 137 ret = (luaG_IdFunction*) lua_touserdata( L, -1); // nullptr if not a userdata
138 lua_pop( L, 1); 138 lua_pop( L, 1);
139 STACK_END( L, 0); 139 STACK_END( L, 0);
140 return ret; 140 return ret;
@@ -377,7 +377,7 @@ char const* push_deep_proxy( Universe* U, lua_State* L, DeepPrelude* prelude, in
377* 377*
378* Returns: 'proxy' userdata for accessing the deep data via 'luaG_todeep()' 378* Returns: 'proxy' userdata for accessing the deep data via 'luaG_todeep()'
379*/ 379*/
380int luaG_newdeepuserdata( lua_State* L, luaG_IdFunction idfunc, int nuv_) 380int luaG_newdeepuserdata( lua_State* L, luaG_IdFunction* idfunc, int nuv_)
381{ 381{
382 char const* errmsg; 382 char const* errmsg;
383 383
@@ -424,7 +424,7 @@ int luaG_newdeepuserdata( lua_State* L, luaG_IdFunction idfunc, int nuv_)
424* Reference count is not changed, and access to the deep userdata is not 424* Reference count is not changed, and access to the deep userdata is not
425* serialized. It is the module's responsibility to prevent conflicting usage. 425* serialized. It is the module's responsibility to prevent conflicting usage.
426*/ 426*/
427void* luaG_todeep( lua_State* L, luaG_IdFunction idfunc, int index) 427void* luaG_todeep( lua_State* L, luaG_IdFunction* idfunc, int index)
428{ 428{
429 DeepPrelude** proxy; 429 DeepPrelude** proxy;
430 430
@@ -449,10 +449,10 @@ void* luaG_todeep( lua_State* L, luaG_IdFunction idfunc, int index)
449 * the id function of the copied value, or nullptr for non-deep userdata 449 * the id function of the copied value, or nullptr for non-deep userdata
450 * (not copied) 450 * (not copied)
451 */ 451 */
452bool copydeep( Universe* U, lua_State* L2, uint_t L2_cache_i, lua_State* L, uint_t i, LookupMode mode_, char const* upName_) 452bool copydeep(Universe* U, lua_State* L2, int L2_cache_i, lua_State* L, int i, LookupMode mode_, char const* upName_)
453{ 453{
454 char const* errmsg; 454 char const* errmsg;
455 luaG_IdFunction idfunc = get_idfunc( L, i, mode_); 455 luaG_IdFunction* idfunc = get_idfunc( L, i, mode_);
456 int nuv = 0; 456 int nuv = 0;
457 457
458 if (idfunc == nullptr) 458 if (idfunc == nullptr)