From 9b05d1d26d358bf836a7ad0b23c244836cb30a06 Mon Sep 17 00:00:00 2001 From: Benoit Germain <benoit.germain@ubisoft.com> Date: Wed, 20 Mar 2024 17:34:49 +0100 Subject: C++ migration: removed most typedef, removed uint_t --- src/deep.h | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src/deep.h') diff --git a/src/deep.h b/src/deep.h index d8a1772..5322525 100644 --- a/src/deep.h +++ b/src/deep.h @@ -17,27 +17,24 @@ extern "C" { #include "uniquekey.h" // forwards -struct s_Universe; -typedef struct s_Universe Universe; +struct Universe; -enum eLookupMode +enum LookupMode { eLM_LaneBody, // send the lane body directly from the source to the destination lane eLM_ToKeeper, // send a function from a lane to a keeper state eLM_FromKeeper // send a function from a keeper state to a lane }; -typedef enum eLookupMode LookupMode; -enum eDeepOp +enum DeepOp { eDO_new, eDO_delete, eDO_metatable, eDO_module, }; -typedef enum eDeepOp DeepOp; -typedef void* (*luaG_IdFunction)( lua_State* L, DeepOp op_); +using luaG_IdFunction = void*( lua_State* L, DeepOp op_); // ################################################################################################ @@ -49,7 +46,7 @@ struct DeepPrelude { UniqueKey const magic{ DEEP_VERSION }; // when stored in a keeper state, the full userdata doesn't have a metatable, so we need direct access to the idfunc - luaG_IdFunction idfunc { nullptr }; + luaG_IdFunction* idfunc { nullptr }; // data is destroyed when refcount is 0 volatile int refcount{ 0 }; }; @@ -57,5 +54,5 @@ struct DeepPrelude char const* push_deep_proxy( Universe* U, lua_State* L, DeepPrelude* prelude, int nuv_, LookupMode mode_); void free_deep_prelude( lua_State* L, DeepPrelude* prelude_); -LANES_API int luaG_newdeepuserdata( lua_State* L, luaG_IdFunction idfunc, int nuv_); -LANES_API void* luaG_todeep( lua_State* L, luaG_IdFunction idfunc, int index); +LANES_API int luaG_newdeepuserdata( lua_State* L, luaG_IdFunction* idfunc, int nuv_); +LANES_API void* luaG_todeep( lua_State* L, luaG_IdFunction* idfunc, int index); -- cgit v1.2.3-55-g6feb