From: Alexander Turenko via Tarantool-patches <tarantool-patches@dev.tarantool.org> To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>, Cyrill Gorcunov <gorcunov@tarantool.org>, Roman Khabibov <roman.habibov@tarantool.org> Cc: Alexander Turenko <alexander.turenko@tarantool.org>, tarantool-patches@dev.tarantool.org Subject: [Tarantool-patches] [PATCH 2/4] lua: move luaL_newserializer() comment into header Date: Wed, 23 Jun 2021 22:12:40 +0300 [thread overview] Message-ID: <9368ce7b0ff95216ee99bacd75b9edd29f4573a6.1624474915.git.alexander.turenko@tarantool.org> (raw) In-Reply-To: <cover.1624474915.git.alexander.turenko@tarantool.org> It is non-static function, so it looks logical to have the API comment in the header. Made a few code style fixes, while I'm here. Part of #3228 --- src/lua/serializer.c | 10 ++-------- src/lua/serializer.h | 13 +++++++++++-- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/lua/serializer.c b/src/lua/serializer.c index 6c3dd73af..38b7dd8b9 100644 --- a/src/lua/serializer.c +++ b/src/lua/serializer.c @@ -169,15 +169,9 @@ luaL_serializer_cfg(struct lua_State *L) return 0; } -/** - * @brief serializer.new() Lua binding. - * @param L stack - * @param reg methods to register - * @param parent parent serializer to inherit configuration - * @return new serializer - */ struct luaL_serializer * -luaL_newserializer(struct lua_State *L, const char *modname, const luaL_Reg *reg) +luaL_newserializer(struct lua_State *L, const char *modname, + const luaL_Reg *reg) { luaL_checkstack(L, 1, "too many upvalues"); diff --git a/src/lua/serializer.h b/src/lua/serializer.h index 54b0bc11a..e29d802bb 100644 --- a/src/lua/serializer.h +++ b/src/lua/serializer.h @@ -150,8 +150,16 @@ struct luaL_serializer { struct rlist on_update; }; +/** + * @brief serializer.new() Lua binding. + * @param L stack + * @param reg methods to register + * @param parent parent serializer to inherit configuration + * @return new serializer + */ struct luaL_serializer * -luaL_newserializer(struct lua_State *L, const char *modname, const luaL_Reg *reg); +luaL_newserializer(struct lua_State *L, const char *modname, + const luaL_Reg *reg); /** * Copy all option fields of @a src into @a dst. Other fields, @@ -162,7 +170,8 @@ luaL_serializer_copy_options(struct luaL_serializer *dst, const struct luaL_serializer *src); static inline struct luaL_serializer * -luaL_checkserializer(struct lua_State *L) { +luaL_checkserializer(struct lua_State *L) +{ return (struct luaL_serializer *) luaL_checkudata(L, lua_upvalueindex(1), LUAL_SERIALIZER); } -- 2.31.1
next prev parent reply other threads:[~2021-06-23 19:14 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-06-23 19:12 [Tarantool-patches] [PATCH 0/4] RFC: Isolate serializer helpers Alexander Turenko via Tarantool-patches 2021-06-23 19:12 ` [Tarantool-patches] [PATCH 1/4] lua: move serializer helpers into its own file Alexander Turenko via Tarantool-patches 2021-07-04 13:10 ` Vladislav Shpilevoy via Tarantool-patches 2021-07-05 6:30 ` Alexander Turenko via Tarantool-patches 2021-07-05 20:59 ` Vladislav Shpilevoy via Tarantool-patches 2021-06-23 19:12 ` Alexander Turenko via Tarantool-patches [this message] 2021-06-23 19:12 ` [Tarantool-patches] [PATCH 3/4] lua: split serializer functions into sections Alexander Turenko via Tarantool-patches 2021-06-23 19:12 ` [Tarantool-patches] [PATCH 4/4] test: add a basic unit test for serializer helpers Alexander Turenko via Tarantool-patches 2021-06-24 6:17 ` [Tarantool-patches] [PATCH 0/4] RFC: Isolate " Cyrill Gorcunov via Tarantool-patches 2021-06-28 6:31 ` Cyrill Gorcunov via Tarantool-patches 2021-07-04 13:09 ` Vladislav Shpilevoy via Tarantool-patches 2021-07-05 6:30 ` Alexander Turenko via Tarantool-patches 2021-07-07 10:08 ` Alexander Turenko via Tarantool-patches 2021-07-07 19:09 ` Alexander Turenko via Tarantool-patches 2021-07-07 22:16 ` Vladislav Shpilevoy via Tarantool-patches 2021-07-12 7:51 ` Alexander Turenko via Tarantool-patches
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=9368ce7b0ff95216ee99bacd75b9edd29f4573a6.1624474915.git.alexander.turenko@tarantool.org \ --to=tarantool-patches@dev.tarantool.org \ --cc=alexander.turenko@tarantool.org \ --cc=gorcunov@tarantool.org \ --cc=roman.habibov@tarantool.org \ --cc=v.shpilevoy@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH 2/4] lua: move luaL_newserializer() comment into header' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox