From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp53.i.mail.ru (smtp53.i.mail.ru [94.100.177.113]) (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 3F880469710 for ; Mon, 18 May 2020 15:11:06 +0300 (MSK) References: <20200512135052.221379-1-gorcunov@gmail.com> <20200512135052.221379-5-gorcunov@gmail.com> From: Oleg Babin Message-ID: <6c634b97-e9bd-c2eb-0916-c303cd2ccadf@tarantool.org> Date: Mon, 18 May 2020 15:11:04 +0300 MIME-Version: 1.0 In-Reply-To: <20200512135052.221379-5-gorcunov@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH 4/7] box/console: rename luaL_yaml_default to serializer_yaml List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cyrill Gorcunov , tml Hi! I'm not sure that we really should do that. Functions with LuaL prefix is a part of Lua code convention AFAIK. (https://www.lua.org/manual/5.1/manual.html#4) But LGTM if nobody doesn't have objections. On 12/05/2020 16:50, Cyrill Gorcunov wrote: > As we gonna implement lua output serializer lets > rename luaL_yaml_default to serializer_yaml which > will be more general name, for other serializers > we will use same serializer_ prefix. > > Part-of #4682 > > Signed-off-by: Cyrill Gorcunov > --- > src/box/lua/console.c | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/src/box/lua/console.c b/src/box/lua/console.c > index 734c0ee47..c8e0dea58 100644 > --- a/src/box/lua/console.c > +++ b/src/box/lua/console.c > @@ -49,7 +49,7 @@ > > extern char serpent_lua[]; > > -static struct luaL_serializer *luaL_yaml_default = NULL; > +static struct luaL_serializer *serializer_yaml; > > /* > * Completion engine (Mike Paul's). > @@ -369,7 +369,7 @@ lbox_console_format_yaml(struct lua_State *L) > } > lua_replace(L, 1); > lua_settop(L, 1); > - return lua_yaml_encode(L, luaL_yaml_default, NULL, NULL); > + return lua_yaml_encode(L, serializer_yaml, NULL, NULL); > } > > int > @@ -404,7 +404,7 @@ console_dump_plain(struct lua_State *L, uint32_t *size) > { > enum output_format fmt = console_get_output_format(); > if (fmt == OUTPUT_FORMAT_YAML) { > - int rc = lua_yaml_encode(L, luaL_yaml_default, "!push!", > + int rc = lua_yaml_encode(L, serializer_yaml, "!push!", > "tag:tarantool.io/push,2018"); > if (rc == 2) { > /* > @@ -566,11 +566,11 @@ tarantool_lua_console_init(struct lua_State *L) > lua_pushcclosure(L, lbox_console_readline, 1); > lua_setfield(L, -2, "readline"); > > - luaL_yaml_default = lua_yaml_new_serializer(L); > - luaL_yaml_default->encode_invalid_numbers = 1; > - luaL_yaml_default->encode_load_metatables = 1; > - luaL_yaml_default->encode_use_tostring = 1; > - luaL_yaml_default->encode_invalid_as_nil = 1; > + serializer_yaml = lua_yaml_new_serializer(L); > + serializer_yaml->encode_invalid_numbers = 1; > + serializer_yaml->encode_load_metatables = 1; > + serializer_yaml->encode_use_tostring = 1; > + serializer_yaml->encode_invalid_as_nil = 1; > /* > * Hold reference to the formatter in module local > * variable. >