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 A1E262531E for ; Wed, 10 Jul 2019 18:47:46 -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 wnnmxvKsy9ld for ; Wed, 10 Jul 2019 18:47:46 -0400 (EDT) Received: from smtp17.mail.ru (smtp17.mail.ru [94.100.176.154]) (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 113272531C for ; Wed, 10 Jul 2019 18:47:45 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH 4/6] sql: make built-in functions operate on unsigned values References: <4acf9fab112e7ca119f1b2bf5efea53b3831ea4f.1559919361.git.korablev@tarantool.org> <4cbc3612-b655-8b2b-d879-6b1445c9535b@tarantool.org> <947FF2ED-8FBF-4796-8CFB-C12BE610A90A@tarantool.org> <6ECEFD7B-62E4-45AF-A6AE-030B714DD0C0@tarantool.org> From: Vladislav Shpilevoy Message-ID: Date: Thu, 11 Jul 2019 00:49:04 +0200 MIME-Version: 1.0 In-Reply-To: <6ECEFD7B-62E4-45AF-A6AE-030B714DD0C0@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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: "n.pettik" , tarantool-patches@freelists.org Thanks for the fixes! See 2 comments below. > diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h > index 2e8ac55e9..976b4486a 100644 > --- a/src/box/sql/sqlInt.h > +++ b/src/box/sql/sqlInt.h > @@ -395,13 +398,13 @@ void > sql_result_double(sql_context *, double); > > void > -sql_result_int(sql_context *, int); > +sql_result_uint(sql_context *ctx, uint64_t u_val); > > void > -sql_result_bool(struct sql_context *ctx, bool value); > +sql_result_int(sql_context *, int64_t); 1. Please, do not omit parameter names. > diff --git a/src/box/sql/vdbeapi.c b/src/box/sql/vdbeapi.c > index 705e869bc..ff7ce658b 100644 > --- a/src/box/sql/vdbeapi.c > +++ b/src/box/sql/vdbeapi.c > @@ -320,21 +330,21 @@ sql_result_double(sql_context * pCtx, double rVal) > } > > void > -sql_result_int(sql_context * pCtx, int iVal) > +sql_result_uint(sql_context *ctx, uint64_t u_val) > { > - mem_set_i64(pCtx->pOut, iVal); > + mem_set_u64(ctx->pOut, u_val); > } > > void > -sql_result_bool(struct sql_context *ctx, bool value) > +sql_result_int(sql_context * pCtx, int64_t iVal) 2. In new code we usually use Tarantool code style - no spaces after '*', and no camel case. > { > - mem_set_bool(ctx->pOut, value); > + mem_set_i64(pCtx->pOut, iVal); > } >