From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 39F3A469711 for ; Mon, 18 May 2020 13:15:38 +0300 (MSK) Received: by mail-lf1-f68.google.com with SMTP id w15so179482lfe.11 for ; Mon, 18 May 2020 03:15:38 -0700 (PDT) From: Cyrill Gorcunov Date: Mon, 18 May 2020 13:14:59 +0300 Message-Id: <20200518101502.117121-3-gorcunov@gmail.com> In-Reply-To: <20200518101502.117121-1-gorcunov@gmail.com> References: <20200518101502.117121-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 2/5] box/sql: func -- fix compilation warning List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml Cc: Alexander Turenko The @r is "double" value thus use explicit conversion to placate clang compiler. Signed-off-by: Cyrill Gorcunov --- src/box/sql/func.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/box/sql/func.c b/src/box/sql/func.c index 2c510940b..d5463facd 100644 --- a/src/box/sql/func.c +++ b/src/box/sql/func.c @@ -845,9 +845,9 @@ roundFunc(sql_context * context, int argc, sql_value ** argv) * handle the rounding directly, * otherwise use printf. */ - if (n == 0 && r >= 0 && r < LARGEST_INT64 - 1) { + if (n == 0 && r >= 0 && r < (double)(LARGEST_INT64 - 1)) { r = (double)((sql_int64) (r + 0.5)); - } else if (n == 0 && r < 0 && (-r) < LARGEST_INT64 - 1) { + } else if (n == 0 && r < 0 && (-r) < (double)(LARGEST_INT64 - 1)) { r = -(double)((sql_int64) ((-r) + 0.5)); } else { const char *rounded_value = tt_sprintf("%.*f", n, r); -- 2.26.2