From 23051e830a8b212f831443eb888e93e30fa8bb19 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 4 Dec 2020 11:08:42 -0300 Subject: Changes in the API of 'luaH_set' and related functions Functions to set values in a table (luaH_set, luaH_newkey, etc.) receive the new value, instead of returning a slot where to put the value. --- ltable.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ltable.h') diff --git a/ltable.h b/ltable.h index c0060f4b..7bbbcb21 100644 --- a/ltable.h +++ b/ltable.h @@ -41,8 +41,12 @@ LUAI_FUNC void luaH_setint (lua_State *L, Table *t, lua_Integer key, LUAI_FUNC const TValue *luaH_getshortstr (Table *t, TString *key); LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key); LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key); -LUAI_FUNC TValue *luaH_newkey (lua_State *L, Table *t, const TValue *key); -LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key); +LUAI_FUNC void luaH_newkey (lua_State *L, Table *t, const TValue *key, + TValue *value); +LUAI_FUNC void luaH_set (lua_State *L, Table *t, const TValue *key, + TValue *value); +LUAI_FUNC void luaH_finishset (lua_State *L, Table *t, const TValue *key, + const TValue *slot, TValue *value); LUAI_FUNC Table *luaH_new (lua_State *L); LUAI_FUNC void luaH_resize (lua_State *L, Table *t, unsigned int nasize, unsigned int nhsize); -- cgit v1.2.3-55-g6feb