[Tarantool-patches] [PATCH 2/4] lua: move luaL_newserializer() comment into header

Alexander Turenko alexander.turenko at tarantool.org
Wed Jun 23 22:12:40 MSK 2021


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



More information about the Tarantool-patches mailing list