From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 72F8F253F9 for ; Tue, 13 Aug 2019 18:19:58 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id quZSutQDFVbx for ; Tue, 13 Aug 2019 18:19:58 -0400 (EDT) Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 3140C253D2 for ; Tue, 13 Aug 2019 18:19:58 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: [tarantool-patches] Re: [PATCH v2 3/8] sql: wrap all trim functions in dispatcher From: "n.pettik" In-Reply-To: <1343677b-60e2-475d-7e08-e8f90898917e@tarantool.org> Date: Wed, 14 Aug 2019 01:19:55 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: <74a116ac889583f76d8617d644f6277073f9fbdd.1565275469.git.kshcherbatov@tarantool.org> <1343677b-60e2-475d-7e08-e8f90898917e@tarantool.org> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org Cc: Kirill Shcherbatov > On 13 Aug 2019, at 11:28, Kirill Shcherbatov = wrote: >=20 >>> A new dispatcher function trim_func calls corresponding trim_ >>> function implementation in relation with number of argc - a count >>> of arguments. >>>=20 >>> This is an important stem to get rid of function's name >>=20 >> Nit: stem -> step >=20 >>> + >>> +/** >>> + * Normalize args from @a argv input array when it has one, >>> + * two or three args. >>> + * >>> + * This is a dispatcher function that call corresponding >>=20 >> Nit: call -> calls > Fixed. >=20 >>> + switch (argc) { >>> + case 1: >>> + trim_func_one_arg(context, argc, argv); >>=20 >> Why not unpack arguments right here? >> IMHO it would look much better. > Can't understand, what do you mean? Those functions are static and = would be > inlined. They handle own corner case. Moreover, if I would unpack = values externally, > I need to pass three values (type, size, value) for each argument. Already replied in PM, but anyway copy answer here: I want you to get rid of argc and explicitly pass one, two or three args of struct Mem/strcut sql_value type to corresponding functions.