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 E73B322D77 for ; Tue, 16 Jul 2019 20:53:09 -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 43hyTs8nY6i8 for ; Tue, 16 Jul 2019 20:53:09 -0400 (EDT) Received: from smtp49.i.mail.ru (smtp49.i.mail.ru [94.100.177.109]) (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 4A6E5229E8 for ; Tue, 16 Jul 2019 20:53:07 -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 4/6] sql: make built-in functions operate on unsigned values From: "n.pettik" In-Reply-To: Date: Wed, 17 Jul 2019 03:53:04 +0300 Content-Transfer-Encoding: 7bit Message-Id: <9D090063-9A38-4222-B7EE-559189F2A100@tarantool.org> 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> 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: Vladislav Shpilevoy >> 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. Fixes for both comments: diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h index 976b4486a..3a1a63b22 100644 --- a/src/box/sql/sqlInt.h +++ b/src/box/sql/sqlInt.h @@ -401,7 +401,7 @@ void sql_result_uint(sql_context *ctx, uint64_t u_val); void -sql_result_int(sql_context *, int64_t); +sql_result_int(sql_context *ctx, int64_t val); void sql_result_bool(struct sql_context *ctx, bool value); diff --git a/src/box/sql/vdbeapi.c b/src/box/sql/vdbeapi.c index ff7ce658b..44f01fb87 100644 --- a/src/box/sql/vdbeapi.c +++ b/src/box/sql/vdbeapi.c @@ -336,9 +336,9 @@ sql_result_uint(sql_context *ctx, uint64_t u_val) } void -sql_result_int(sql_context * pCtx, int64_t iVal) +sql_result_int(sql_context *ctx, int64_t val) { - mem_set_i64(pCtx->pOut, iVal); + mem_set_i64(ctx->pOut, val); } void