refactor(typval): change FC_CFUNC abstraction into FC_LUAREF

"cfuncs" was only ever used to wrap luarefs. As vim8script is
finished and will not be developed further, support for "cfuncs"
for other usecases are not planned. This abstraction was immediately
broken anyway in order to get luarefs out of userfuncs again.

Even if a new kind of userfunc needs to be invented in the future,
likely just extending the FC_... flag union directy, instead of
invoking unnecessary heap object and c function pointer indirection,
will be a more straightforward design pattern.
This commit is contained in:
bfredl
2022-09-06 22:23:54 +02:00
parent 74a8b5982a
commit db9b8b08e7
7 changed files with 36 additions and 85 deletions

View File

@@ -9,14 +9,6 @@
#include "nvim/eval/typval.h"
#include "nvim/func_attr.h"
typedef struct {
LuaRef func_ref;
} LuaCallable;
typedef struct {
LuaCallable lua_callable;
} LuaCFunctionState;
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "lua/converter.h.generated.h"
#endif