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 E08422A5D5 for ; Tue, 2 Apr 2019 03:27:12 -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 KY-6k7oqhBHo for ; Tue, 2 Apr 2019 03:27:12 -0400 (EDT) Received: from smtp32.i.mail.ru (smtp32.i.mail.ru [94.100.177.92]) (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 9710C2A5BB for ; Tue, 2 Apr 2019 03:27:12 -0400 (EDT) Date: Tue, 2 Apr 2019 10:27:09 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH 01/13] sql: Convert big integers from string Message-ID: <20190402072709.GB25072@chai> References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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: szudin@tarantool.org * n.pettik [19/03/25 18:13]: > I suggest to make all atoi return -1 in case of errors (including overflow), > and 0 in case of successful conversion. Error itself you can set via diag_set(). > Sign of the result you can pass via output param. > This way would be more Tarantool-like. I agree. > Moreover, instead of storing UINT in INT, I suggest to use fair enum and > output param is_uint/is_negative/is_whatever/… Perhaps return MP_INT/MP_UINT? > It’s not fair to return OVERFLOW result in case of “invalid format”. > See my comment concerning return values above. I agree, usign diag_set and distinct errors is a) ANSI req b) user-friendly -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov