From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 306456EC58; Wed, 23 Jun 2021 22:14:17 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 306456EC58 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1624475657; bh=uofDUS/ghBrvXZwWri50AnvccmXDS5JSjZVaowLwfb8=; h=To:Cc:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=mF0Hm3unmlZs1DTAO4H7tExQQ6DVkasc0Oi40zIUbH9xvJLftLez41KTKeJW6TvWX t5rlZIO+Pn8g7ROX8Ajzv4h6A+HA4ny+4c7OrOuX0Cz+dPGVnvK3cDN5lVpAeTzbZn 8BlEUz5eTDNPA9i4AhfD8lAfJZgFTka9rwGqe+Ec= Received: from smtp35.i.mail.ru (smtp35.i.mail.ru [94.100.177.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id AA2716EC5F for ; Wed, 23 Jun 2021 22:13:13 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org AA2716EC5F Received: by smtp35.i.mail.ru with esmtpa (envelope-from ) id 1lw8JE-00086m-NW; Wed, 23 Jun 2021 22:13:13 +0300 To: Vladislav Shpilevoy , Cyrill Gorcunov , Roman Khabibov Cc: Alexander Turenko , tarantool-patches@dev.tarantool.org Date: Wed, 23 Jun 2021 22:12:40 +0300 Message-Id: <9368ce7b0ff95216ee99bacd75b9edd29f4573a6.1624474915.git.alexander.turenko@tarantool.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD954DFF1DC42D673FB517E8D1A7E34673E94B235AA752823A6182A05F538085040FC948831C502E38BE89476C9E752FCFEB09C9E3EB098C79F701F0EF8CB33EB85 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7BB17EE3498E810FEEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063739E242D0556ED1DD8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D868263D9F4E56677AED6F321B85626FD2117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCF1175FABE1C0F9B6A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD182CC0D3CB04F14752D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EED76C6ED7039589DE3DBBCB839D0549ACD8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE36A1CB4668A9CA5FABA3038C0950A5D36B5C8C57E37DE458B0BC6067A898B09E46D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE7B2B7C64F398C7410731C566533BA786AA5CC5B56E945C8DA X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2368A440D3B0F6089093C9A16E5BC824A2A04A2ABAA09D25379311020FFC8D4ADDF4B2DD3D9F7C08B0C64226D7BB6D574 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975CDFD85F345618D5684F1CB34ED44BB226F4E67A1B9F9914F79C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EFF532FBFD8162E58C699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D342833AC5E8E9ACF1CE59CC77AD7DC7C18CB62E322CABD3A98C3BF8728B53E48D881FEEEED967E70321D7E09C32AA3244C84F00F19D0D07176D483617E0AF49F90E646F07CC2D4F3D883B48618A63566E0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojbL9S8ysBdXgCFZEybMaxpNA1mp9sTSkI X-Mailru-Sender: FFAA8E4AEE17E37C3731A083A1A85ADEA1C0F6ECADBAAE5E45F0DECFD76B6287B7EA9FE7735C3DBFC664A44C781FCEA7C77752E0C033A69EDF9F2CE1E9CF805D8CD356D4F938FF726C18EFA0BB12DBB0 X-Mras: Ok Subject: [Tarantool-patches] [PATCH 2/4] lua: move luaL_newserializer() comment into header X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Alexander Turenko via Tarantool-patches Reply-To: Alexander Turenko Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 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